import { Link } from 'react-router-dom'; import { formatDate } from '../lib/utils'; import { ArrowLeftPH, ArrowLeftD, FilesServicePhone, FilesServiceCalendar, FilesServiceNotification, FilesServiceMessage, } from './icons/FilesServiceIcons'; interface Tag { uuid: string; name: string; color: string } /** پرونده > {name} breadcrumb, ported from tauri BreadcrumbHeader. */ export function Breadcrumb({ name, backTo }: { name: string; backTo: string }) { return (
بازگشت پرونده {name}
); } function TagDots({ tags }: { tags?: Tag[] }) { if (!tags || tags.length === 0) return ; return ( {tags.slice(0, 4).map((t, i) => ( ))} ); } const InfoLine = ({ icon, label, value }: { icon: React.ReactNode; label: string; value: string }) => (
{icon} {label} {value}
); /** * The patient case-file banner — ported pixel-for-pixel from tauri * FileServicesHeader (name + status chip, file number, tags, contact/date, * next appointment, یادداشت button). */ export default function PatientCaseBanner({ name, recordNumber, mobile, createdAt, tags, nextAppointment, hasDebt, onAddNote }: { name: string; recordNumber?: string | null; mobile?: string | null; createdAt?: number; tags?: Tag[]; nextAppointment?: number | null; hasDebt?: boolean; onAddNote: () => void; }) { const complete = !hasDebt; return (
{/* right — name + tags */}
{name} {complete ? 'تکمیل شده' : 'تکمیل نشده'}
شماره پرونده: {recordNumber || '—'}
برچسب ها:
{/* middle — contact + file date */}
} label="شماره تماس:" value={mobile || '—'} /> } label="تاریخ تشکیل پرونده:" value={createdAt ? formatDate(createdAt) : '—'} />
{/* left — next appointment + note */}
} label="نوبت بعدی:" value={nextAppointment ? formatDate(nextAppointment) : '—'} />
); }