feat(appointments): toolbar personnel filter (پرسنل را انتخاب کنید...)
Adds staffUuid to AppointmentFilters and a toolbar staff select that filters the loaded day's rows client-side, matching appointments-table.pdf. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -712,6 +712,9 @@ export default function AppointmentsPage() {
|
||||
</button>
|
||||
)}
|
||||
|
||||
{/* Personnel filter (Figma «پرسنل را انتخاب کنید...») */}
|
||||
<StaffFilterSelect value={filters.staffUuid} onChange={(v) => setFilters(f => ({ ...f, staffUuid: v }))} />
|
||||
|
||||
{/* Filters (Figma فیلترها) */}
|
||||
<button
|
||||
aria-label="فیلترها"
|
||||
@@ -846,6 +849,20 @@ export default function AppointmentsPage() {
|
||||
);
|
||||
}
|
||||
|
||||
/** Toolbar staff filter — filters the loaded day's table rows by پرسنل. */
|
||||
function StaffFilterSelect({ value, onChange }: { value: string; onChange: (v: string) => void }) {
|
||||
const staffQ = useQuery<ApiResponse<{ uuid: string; full_name: string }[]>>({
|
||||
queryKey: ['staff-list'], queryFn: () => api.get('/api/v1/staff'),
|
||||
});
|
||||
return (
|
||||
<select aria-label="پرسنل" value={value} onChange={e => onChange(e.target.value)}
|
||||
style={{ height: 32, borderRadius: 'var(--r-sm)', border: '1px solid var(--border)', background: 'var(--surface)', fontSize: 12.5, fontFamily: 'inherit', padding: '0 10px', minWidth: 170 }}>
|
||||
<option value="">پرسنل را انتخاب کنید...</option>
|
||||
{(staffQ.data?.data ?? []).map(s => <option key={s.uuid} value={s.uuid}>{s.full_name}</option>)}
|
||||
</select>
|
||||
);
|
||||
}
|
||||
|
||||
function tabStyle(active: boolean): React.CSSProperties {
|
||||
return {
|
||||
padding: '6px 14px', borderRadius: 'var(--r-sm)', fontSize: 13, fontWeight: 600,
|
||||
|
||||
Reference in New Issue
Block a user