2026-06-22 00:18:05 +02:00
|
|
|
import { useTranslation } from 'react-i18next';
|
2026-05-26 11:13:14 +02:00
|
|
|
import type { SimulationStatus } from '@/api/types';
|
|
|
|
|
|
|
|
|
|
const STYLES: Record<SimulationStatus, string> = {
|
2026-06-09 18:42:26 +02:00
|
|
|
pending: 'bg-cloud text-graphite border border-hairline',
|
2026-05-26 11:13:14 +02:00
|
|
|
in_progress: 'bg-primary-soft text-primary-deep',
|
2026-06-09 18:42:26 +02:00
|
|
|
review_required: 'bg-warn-soft text-warn',
|
|
|
|
|
done: 'bg-success-soft text-success',
|
2026-05-26 11:13:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export function SimulationStatusBadge({ status }: { status: SimulationStatus }): JSX.Element {
|
2026-06-22 00:18:05 +02:00
|
|
|
const { t } = useTranslation();
|
2026-05-26 11:13:14 +02:00
|
|
|
return (
|
|
|
|
|
<span
|
2026-06-09 18:42:26 +02:00
|
|
|
className={`inline-flex items-center rounded-pill px-3 py-[6px] text-[14px] leading-[1.3] font-medium ${STYLES[status]}`}
|
2026-05-26 11:13:14 +02:00
|
|
|
data-testid="simulation-status-badge"
|
|
|
|
|
data-status={status}
|
|
|
|
|
>
|
2026-06-22 00:18:05 +02:00
|
|
|
{t(`status.simulation.${status}`)}
|
2026-05-26 11:13:14 +02:00
|
|
|
</span>
|
|
|
|
|
);
|
|
|
|
|
}
|