import { useTranslation } from '../../../i18n' import { Tooltip } from '../../shared/Tooltip' import { DialogHeader, PILL, type DialogHeaderProps } from '../../shared/DialogShell' import { typeInfo } from './bookingsModel' import { TypeTile, toneColor, toneTint, type StatusTone } from './bookingParts' export interface BookingDialogHeaderProps extends Omit { tone: StatusTone /** The booking type, drawn as the raised tile on the left. */ type: string } /** The head band of a booking dialog, tinted by the status like the card the booking sits on. */ export function BookingDialogHeader({ tone, type, ...rest }: BookingDialogHeaderProps) { return } tint={toneTint(tone)} /> } /** Confirmed or pending with its dot. With onToggle it switches to the other. */ export function StatusPill({ status, onToggle }: { status: 'confirmed' | 'pending'; onToggle?: () => void }) { const { t } = useTranslation() const content = ( <> {status === 'confirmed' ? t('reservations.confirmed') : t('reservations.pending')} ) if (!onToggle) return {content} const label = t('reservations.status.switchTo', { status: status === 'confirmed' ? t('reservations.pending') : t('reservations.confirmed') }) return ( ) } export function TypePill({ type }: { type: string }) { const { t } = useTranslation() const info = typeInfo(type) return {t(info.chipKey)} }