import { Button } from '@/components/base/buttons/button'; import { cx } from '@/utils/cx'; import { formatShortDate } from '@/lib/format'; import type { FollowUp } from '@/types/entities'; interface FollowupWidgetProps { overdue: FollowUp[]; upcoming: FollowUp[]; } export const FollowupWidget = ({ overdue, upcoming }: FollowupWidgetProps) => { const items = [...overdue, ...upcoming].slice(0, 4); if (items.length === 0) { return null; } return (

Upcoming Follow-ups

{items.map((item) => { const isOverdue = overdue.some((o) => o.id === item.id); return (

{item.scheduledAt ? formatShortDate(item.scheduledAt) : 'No date'} {isOverdue && ' — Overdue'}

{item.description ?? item.followUpType ?? 'Follow-up'}

{(item.patientName || item.patientPhone) && (

{item.patientName} {item.patientPhone && ` · ${item.patientPhone}`}

)}
); })}
); };