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>
  );
}
