import type { EngagementStatus } from '@/api/types';

const LABELS: Record<EngagementStatus, string> = {
  planned: 'Planned',
  active: 'Active',
  closed: 'Closed',
};

const STYLES: Record<EngagementStatus, string> = {
  planned: 'bg-warn-soft text-warn border border-warn',
  active: 'bg-primary-soft text-primary-deep',
  closed: 'bg-cloud text-graphite border border-hairline',
};

export function StatusBadge({ status }: { status: EngagementStatus }): JSX.Element {
  return (
    <span
      className={`inline-flex items-center rounded-pill px-3 py-[6px] text-[14px] leading-[1.3] font-medium ${STYLES[status]}`}
      data-testid="status-badge"
      data-status={status}
    >
      {LABELS[status]}
    </span>
  );
}
