import { Star } from 'lucide-react'; import { Badge } from '@/components/ui/badge'; import { useI18n } from '@/lib/i18n'; import type { WorkedBeforeView } from '@/types'; type WorkedBefore = WorkedBeforeView; interface Props { wb: WorkedBefore | null; busy: boolean; currentCall: string; } function fmtDate(s: any): string { if (!s) return ''; const d = new Date(s); if (isNaN(d.getTime())) return ''; const p = (n: number) => String(n).padStart(2, '0'); return `${d.getUTCFullYear()}-${p(d.getUTCMonth() + 1)}-${p(d.getUTCDate())}`; } function fmtDateTime(s: any): string { if (!s) return ''; const d = new Date(s); if (isNaN(d.getTime())) return ''; const p = (n: number) => String(n).padStart(2, '0'); return `${d.getUTCFullYear()}-${p(d.getUTCMonth() + 1)}-${p(d.getUTCDate())} ${p(d.getUTCHours())}:${p(d.getUTCMinutes())}`; } export function CallHistoryPanel({ wb, busy, currentCall }: Props) { const { t } = useI18n(); const hasCall = currentCall.trim() !== ''; const count = wb?.count ?? 0; const entries = wb?.entries ?? []; return ( ); }