import { UserCircleIcon, PhoneIcon } from '@heroicons/react/24/outline'; import type { Appointment } from '../../types'; import AppointmentStatusDropdown, { STATUS_META } from '../ui/AppointmentStatusDropdown'; import AppointmentActionsMenu from '../AppointmentActions'; /** * نمای جدولی (نمایش جدولی) — بازسازیِ جدول نوبتهای طرح tauri (`List.jsx`): * ستونهای ردیف/نام بیمار/شماره تماس/[پزشک]/شروع/پایان/سرویس/پرسنل/وضعیت/عملیات. */ const th: React.CSSProperties = { padding: '10px 14px', textAlign: 'right', fontWeight: 600, color: 'var(--text-2)', whiteSpace: 'nowrap', fontSize: 12.5 }; const td: React.CSSProperties = { padding: '10px 14px', textAlign: 'right', color: 'var(--text)', verticalAlign: 'middle', fontSize: 13 }; export default function TurnsTable({ items, loading, queryKey, showDoctor, canManage = true, canCancel = true, }: { items: Appointment[]; loading: boolean; queryKey: unknown[]; showDoctor: boolean; /** مجوز تغییر وضعیت (منشی)؛ پیشفرض true برای owner/پزشک. */ canManage?: boolean; /** مجوز لغو نوبت (منشی)؛ پیشفرض true. */ canCancel?: boolean; }) { if (loading) return
| ردیف | نام بیمار | شماره تماس | {showDoctor &&پزشک | }شروع | پایان | سرویس | پرسنل | وضعیت | عملیات |
|---|---|---|---|---|---|---|---|---|---|
| {(i + 1).toLocaleString('fa-IR')} |
|
|
{showDoctor && {a.doctor_name} | }{a.appointment_time} | {a.end_time} | {a.service_item?.name || '—'} | {a.staff?.full_name || '—'} |
{canManage ? (
|
{(canManage || canCancel)
? |