Files
clinicpro/assets/admin/components/appointments/DoctorTabs.tsx
T
hamedandClaude Opus 4.8 48c70e89f2 fix(appointments): center timeline card and match tauri turns layout
- Center the whole page in a max-width container; move the toolbar above the
  card and make the doctor tabs the card header (as in the tauri turns design).
- Rebuild the timeline card to match the reference: inner start/end ring-dot
  time markers, patient name / phone / «سرویس» lines, and status pill + عملیات
  on the card's left; outer marker rail with time on the right.
- Timeline rows are width-capped and centered on the page.
- Empty slots render the light-blue «افزودن نوبت +» card with a «نوبت جدید» pill.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 15:45:51 +03:30

51 lines
1.6 KiB
TypeScript

/**
* تب دکترها با نشانگر underline — بازسازی تب‌های بالای صفحهٔ نوبت‌های طرح tauri
* (`index.jsx`): فعال #5559ce با خط زیرین، بقیه خاکستری.
*/
export interface DoctorTab {
uuid: string;
name: string;
}
export default function DoctorTabs({
doctors, selected, onSelect, showAll = true,
}: {
doctors: DoctorTab[];
/** '' یعنی «همه». */
selected: string;
onSelect: (uuid: string) => void;
showAll?: boolean;
}) {
const tabs: DoctorTab[] = showAll ? [{ uuid: '', name: 'همه' }, ...doctors] : doctors;
return (
<div style={{
display: 'flex', alignItems: 'center', gap: 24, padding: '8px 16px 0',
borderBottom: '1px solid var(--border)', overflowX: 'auto',
}}>
{tabs.map((d) => {
const active = selected === d.uuid;
return (
<button
key={d.uuid || 'all'}
type="button"
onClick={() => onSelect(d.uuid)}
style={{
position: 'relative', background: 'none', border: 'none', cursor: 'pointer',
fontFamily: 'inherit', fontSize: 15, fontWeight: 500, padding: '8px 2px 12px',
color: active ? 'var(--primary)' : 'var(--text-2)', whiteSpace: 'nowrap',
}}
>
{d.name}
{active && (
<span style={{
position: 'absolute', bottom: -1, left: 0, right: 0, height: 3,
background: 'var(--primary)', borderRadius: '3px 3px 0 0',
}} />
)}
</button>
);
})}
</div>
);
}