import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faUser, faCalendarCheck, faPhone } from '@fortawesome/pro-duotone-svg-icons'; import { Badge } from '@/components/base/badges/badges'; export type CallerSummary = { name: string; phone: string; isNew: boolean; aiSummary?: string | null; leadSource?: string | null; utmCampaign?: string | null; nextAppointment?: { scheduledAt: string; doctorName: string; department: string } | null; lastAppointment?: { scheduledAt: string; status: string; department: string } | null; }; interface AiSummaryCardProps { caller: CallerSummary | null; } const formatDate = (dateStr: string): string => { const d = new Date(dateStr); return d.toLocaleDateString('en-IN', { day: 'numeric', month: 'short' }); }; export const AiSummaryCard = ({ caller }: AiSummaryCardProps) => { if (!caller) { return (

Select a patient or receive a call

); } return (
{caller.name || caller.phone} {caller.isNew ? 'New' : 'Returning'}
{caller.name && ( {caller.phone} )}
{caller.aiSummary && (

{caller.aiSummary}

)} {(caller.leadSource || caller.utmCampaign) && (
{caller.leadSource && ( {caller.leadSource} )} {caller.utmCampaign && ( {caller.utmCampaign} )}
)}
{caller.nextAppointment && (
{formatDate(caller.nextAppointment.scheduledAt)} · {caller.nextAppointment.doctorName}
)} {caller.lastAppointment && (
Last: {formatDate(caller.lastAppointment.scheduledAt)} · {caller.lastAppointment.status}
)}
); };