- StatusBadge/SimulationStatusBadge: swap bare i18n.t() helper for
useTranslation() hook so badges re-render reactively on i18n init
- EngagementDetailPage: formatDate() on start_date/end_date/created_at
(was: raw ISO string, formatDateTime with noisy 00:00:00)
- UsersAdminPage: formatDate() on created_at column (was: raw ISO string)
- Layout footer: t('nav.footer') with FR string in fr.json
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
23 lines
769 B
TypeScript
23 lines
769 B
TypeScript
import { useTranslation } from 'react-i18next';
|
|
import type { SimulationStatus } from '@/api/types';
|
|
|
|
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 {
|
|
const { t } = useTranslation();
|
|
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}
|
|
>
|
|
{t(`status.simulation.${status}`)}
|
|
</span>
|
|
);
|
|
}
|