import { Box, Group, Text } from '@pikku/mantine/core' import { mKey } from '@/i18n/messages' import { useLocale } from '@/i18n/config' import { asI18n } from '@pikku/react' import { BOOKING_STATUS, INVOICE_STATUS, type BookingStatus, type InvoiceStatus, } from '../lib/status' type Variant = | { kind: 'booking'; status: BookingStatus } | { kind: 'invoice'; status: InvoiceStatus } export function StatusPill(props: Variant & { size?: 'sm' | 'xs' }) { useLocale() const size = props.size ?? 'xs' const palette = props.kind === 'booking' ? BOOKING_STATUS[props.status] : INVOICE_STATUS[props.status] const labelKey = props.kind === 'booking' ? `common.pages.bookingStatus.label.${props.status}` : `common.pages.adminBooking.invoices.status.${props.status}` return ( {asI18n(`${mKey(labelKey as any)}`)} ) }