import { Chip } from '@mui/material'; import type { StatusMeta } from '@/components/meta/types'; import { useUi } from '@/i18n/useUi'; export interface StatusChipProps { value: string | number | null | undefined; statuses: StatusMeta[]; size?: 'small' | 'medium'; } /** Chip for a status value, label/colour from a StatusMeta table; unknown values render as plain text chip. */ export function StatusChip({ value, statuses, size = 'small' }: StatusChipProps) { const { tr } = useUi(); if (value === null || value === undefined || value === '') return null; const s = statuses.find((x) => String(x.value) === String(value)); return ; }