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

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}
    >
      {simulationStatusLabel(status)}
    </span>
  );
}
