// Copyright: © 2026 TWWIM UG. All rights reserved. (www.twwim.com) import { Clock, AlertTriangle } from 'lucide-react'; import { useTranslation } from '@/i18n/TranslationProvider'; import { type WaitUrgency, formatWait } from '../lib/waitTime'; interface WaitTimeBadgeProps { waitMs: number; urgency: WaitUrgency; size?: 'sm' | 'md'; } const STYLES: Record = { none: 'bg-emerald-50 text-emerald-700 ring-emerald-200', warn: 'bg-amber-50 text-amber-700 ring-amber-200', breach: 'bg-red-100 text-red-700 ring-red-300 animate-pulse', }; export function WaitTimeBadge({ waitMs, urgency, size = 'sm' }: WaitTimeBadgeProps) { const { locale } = useTranslation(); if (waitMs === 0) return null; const Icon = urgency === 'breach' ? AlertTriangle : Clock; const px = size === 'sm' ? 'px-1.5 py-0.5 text-[10px]' : 'px-2 py-1 text-xs'; return ( {formatWait(waitMs, locale)} ); }