Skip to content

[CRM][Frontend] - Update Chip Spans to use Chip component #192

@bderbs30

Description

@bderbs30

[CRM][Frontend] - Update chip spans to use Chip component

Description

Right now we have a shared Chip component in src/lib/components/ui/Chip.tsx with variants (neutral, success, error, warning, primary) and a single source of styling. We also have helpers in src/lib/utils/status.utils.ts that map statuses to chip variants: getAssessmentStatusVariant, getDecisionStatusVariant, getSubmissionVariant, and to labels (getAssessmentStatusLabel, getDecisionStatusLabel). Some parts of the app already use <Chip> and these helpers (e.g. PositionCard, TaskCard, TaskTemplatePreviewPanel), but in other places we're still rendering chip-like UI with <span> plus manual Tailwind and getStatusBadgeColor. That duplication means if we change chip styling or someone adds a new "chip" with different classes, we get inconsistent look and feel across the app.

Your ask is to find every place where we're using a span (or similar) to show a chip-style badge and replace those with the Chip component, using the existing variant/label helpers where they fit so styling stays consistent.

One example: In src/lib/components/core/CandidateTable.tsx, the ASSESSMENT and DECISION columns both render status as a span with chipPaddingClass, getStatusBadgeColor, and manual classes:

cell: ({ row }) => {
    const decision = row.original.decisionStatus ?? 'Pending';
    const decisionLabel = formatDecisionLabel(decision);
    return (
        <span
            className={cn(
                `inline-flex items-center gap-1 rounded-md ${chipPaddingClass} text-xs font-medium`,
                getStatusBadgeColor(decision)
            )}
        >
            {decisionLabel}
        </span>
    );
},

These should instead use <Chip variant={getDecisionStatusVariant(decision)}>{getDecisionStatusLabel(decision)}</Chip> (and the assessment column should use getAssessmentStatusVariant / getAssessmentStatusLabel). The same idea applies anywhere else that uses getStatusBadgeColor or ad-hoc chip-like classes on a span: swap to Chip + the appropriate variant/label helper.

If a given spot uses a label function that doesn't exist in status utils (e.g. a different casing or wording), either reuse an existing helper or add a small helper that stays consistent with the rest of the file; the important part is that the rendered element is <Chip> with a variant from our helpers so styling stays centralized. If you're unsure whether something should be a chip or a different component, check with the team.

Acceptance Criteria

  • All chip-style badges in the app are rendered with the Chip component from @/lib/components/ui/Chip.
  • Status-based chips use the variant/label helpers from @/lib/utils/status.utils.ts (e.g. getAssessmentStatusVariant, getDecisionStatusVariant, getAssessmentStatusLabel, getDecisionStatusLabel) instead of getStatusBadgeColor and manual classes.
  • No remaining use of getStatusBadgeColor (or equivalent ad-hoc chip classes) on spans for chip-like UI; any still needed for non-chip usage is documented or removed.
  • Visual check: chip appearance is consistent across the app (e.g. CandidateTable, position cards, task UI) and matches the design system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BacklogNot urgentFrontendRequires frontend code changes/updates

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions