'use client'; import { FileText } from 'lucide-react'; import type { PastTreatment } from '@/types/treatment'; interface PastTreatmentsPanelProps { items: PastTreatment[]; loading?: boolean; } export function PastTreatmentsPanel({ items, loading }: PastTreatmentsPanelProps) { return (

Previous treatments

Document preview is not implemented yet; file names are listed for context.

{loading &&

Loading history...

} {!loading && items.length === 0 && (

No prior treatments for this patient.

)}
{items.map((t) => (

{t.title}

Status: {t.status}

{t.records.length > 0 && (
    {t.records.map((r) => (
  • Record: {r.teeth.length > 0 ? `Teeth ${[...r.teeth].sort().join(', ')}` : 'No teeth tagged'} {r.notes ? ` — ${r.notes}` : ''}
  • ))}
)} {t.documents.length > 0 && (

Attachments

    {t.documents.map((doc) => (
  • {doc.fileName} {(doc.sizeBytes / 1024).toFixed(1)} KB
  • ))}
)}
))}
); }