'use client'; import { useTranslations } from 'next-intl'; import { Button } from '@/components/ui/shared/Button'; import type { PastTreatment } from '@/types/treatment'; const TREATMENT_TYPE_KEYS = { consultation: 'typeConsultation', filling: 'typeFilling', endo: 'typeEndo', visit: 'typeVisit', hygiene: 'typeHygiene', } as const; interface TreatmentPreviewCardProps { draft: PastTreatment | null; disabled?: boolean; onPreview: () => void; } export function TreatmentPreviewCard({ draft, disabled, onPreview }: TreatmentPreviewCardProps) { const t = useTranslations('treatment'); const attachmentCount = draft ? draft.details.reduce((n, c) => n + (c.attachmentMetas?.length ?? 0), 0) : 0; return (
{t('selectAppointment')}
) : ({draft.title}
{draft.status}{t('caseCount', { n: draft.details.length })} ยท{' '} {t('attachmentCount', { n: attachmentCount })}
{t('moreCases', { n: draft.details.length - 2 })}
)}