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

const LABELS: Record<SimulationStatus, string> = {
  pending: 'Pending',
  in_progress: 'In progress',
  review_required: 'Review required',
  done: 'Done',
};

const STYLES: Record<SimulationStatus, string> = {
  pending: 'bg-cloud text-graphite border border-hairline',
  in_progress: 'bg-primary-soft text-primary-deep',
  review_required: 'bg-warn-soft text-warn',
  done: 'bg-success-soft text-success',
};

export function SimulationStatusBadge({ status }: { status: SimulationStatus }): 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="simulation-status-badge"
      data-status={status}
    >
      {LABELS[status]}
    </span>
  );
}
