fix(admin): give the service catalog a real page header

The visual pass over the older screens found one inconsistency worth fixing:
the service catalog opened with a hand-rolled bold line and a button. No back
button, no description — the one page in the panel that does not say what it is
or how to leave it. It uses PageHeader now, like every other page.

Everything else on the task 01-04 screens held up under dark mode and compact
density: branches, resource types, skills, pools and the catalog all read from
tokens and none of them broke. The only remaining mobile findings are the
shared shell's Latin phone number and one small tap target, both of which
predate this work and appear on the dashboard too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
hamed
2026-08-01 15:23:23 +03:30
co-authored by Claude Opus 5
parent beaa11334c
commit f8d4e97e35
+15 -8
View File
@@ -16,6 +16,7 @@ import type { ApiResponse } from '../lib/api';
import type { ServiceSection, ServiceItem } from '../types'; import type { ServiceSection, ServiceItem } from '../types';
import { formatRial, formatNumber } from '../lib/utils'; import { formatRial, formatNumber } from '../lib/utils';
import { usePermissions } from '../hooks/usePermissions'; import { usePermissions } from '../hooks/usePermissions';
import PageHeader from '../components/ui/PageHeader';
import Modal from '../components/ui/Modal'; import Modal from '../components/ui/Modal';
import ConfirmDialog from '../components/ui/ConfirmDialog'; import ConfirmDialog from '../components/ui/ConfirmDialog';
import ServiceTariffModal from '../components/ServiceTariffModal'; import ServiceTariffModal from '../components/ServiceTariffModal';
@@ -129,14 +130,20 @@ function ClinicServicesPageInner() {
{!selectedSection ? ( {!selectedSection ? (
/* ═════════ نمای بخش‌ها ═════════ */ /* ═════════ نمای بخش‌ها ═════════ */
<> <>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 16, flexWrap: 'wrap', gap: 12 }}> {/* تیتر دست‌ساز جای `PageHeader` بود: بدون آن این صفحه تنها فهرستِ پنل است
<b style={{ fontSize: 16 }}>بخشها</b> که نه دکمهٔ بازگشت دارد و نه می‌گوید چیست. */}
{canCreate && ( <PageHeader
<button className="cp-btn-primary" onClick={() => { sectionForm.reset({ name: '' }); setSectionModal('create'); }}> title="سرویس‌ها"
<PlusIcon style={{ width: 16 }} /> بخش جدید description="بخش‌ها و سرویس‌های قابل رزرو. مدت و قیمت هر سرویس از همین‌جا می‌آید."
</button> backTo="/admin/settings-menu"
)} action={
</div> canCreate ? (
<button className="cp-btn-primary" onClick={() => { sectionForm.reset({ name: '' }); setSectionModal('create'); }}>
<PlusIcon style={{ width: 16 }} /> بخش جدید
</button>
) : undefined
}
/>
{sectionsLoading ? ( {sectionsLoading ? (
<div style={{ color: 'var(--text-3)', fontSize: 13, padding: 16 }}>در حال بارگذاری...</div> <div style={{ color: 'var(--text-3)', fontSize: 13, padding: 16 }}>در حال بارگذاری...</div>