- 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>
22 lines
713 B
TypeScript
22 lines
713 B
TypeScript
import { useTranslation } from 'react-i18next';
|
|
import type { EngagementStatus } from '@/api/types';
|
|
|
|
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 {
|
|
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="status-badge"
|
|
data-status={status}
|
|
>
|
|
{t(`status.engagement.${status}`)}
|
|
</span>
|
|
);
|
|
}
|