The desktop sidebar kept its own copy of the item list, so the entries added to the mobile settings menu — Resources, Categories, Branches, Holidays, Price lists — never appeared in it. Adding a settings page meant editing two files, and forgetting one was silent. settingsMenu.ts is now the single source; the sidebar derives from it with its two deliberate differences stated in code: no "manage doctor" entry, and a disabled "security" row at the end. Labels follow the mobile list, which uses the correct zero-width joiner spelling. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
27 lines
1.3 KiB
TypeScript
27 lines
1.3 KiB
TypeScript
import React from 'react';
|
|
import PurchaseSubscriptionSidebar from './PurchaseSubscriptionSidebar';
|
|
|
|
// فهرست منو به `settingsMenu.ts` منتقل شد تا سایدبار دسکتاپ و فهرست موبایل یک منبع
|
|
// داشته باشند. این re-export برای مصرفکنندههای موجود میماند.
|
|
export { SETTINGS_MENU, menuForRole, type SettingsMenuItem } from './settingsMenu';
|
|
|
|
/**
|
|
* SettingsLayout — presentational shell for the doctor/clinic settings area.
|
|
* Renders the shared settings sidebar (PurchaseSubscriptionSidebar) beside the
|
|
* page content, so every settings page shows the exact same menu as the
|
|
* subscription page. Full-width so the sidebar sits flush against the main nav.
|
|
*
|
|
* @param active key of the currently-open settings section (highlighted)
|
|
* @param children the section content (e.g. subscription plans)
|
|
*/
|
|
export default function SettingsLayout({ active, children }: { active: string; children: React.ReactNode }) {
|
|
return (
|
|
<div className="fade-in settings-shell" dir="rtl" style={{ width: '100%' }}>
|
|
<div className="grid grid-cols-1 lg:grid-cols-[248px_minmax(0,1fr)] gap-5">
|
|
<PurchaseSubscriptionSidebar active={active} />
|
|
<div style={{ minWidth: 0 }}>{children}</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|