feat(ui): AppSwitcherMenu parity + hub-only warehouse headers + calendar badge removal

- shared AppSwitcherMenu ('پنل‌ها' title, active filled item with ✓ فعلی,
  «مدیریت انبار»/«مدیریت تدارکات» switcher, divider + خروج از حساب) used by
  both the procurement dashboard and the warehouse hub (PM variant keeps
  logout-only); replaced the old raw «بازگشت به دفتر» link
- warehouse header mirrors the procurement pattern: icon + hamburger only
  on the hub dashboard; sub-views (تغییر موجودی، کنترل روزانه، انبارها،
  کالاهای در راه، سازمان‌دهی) render a minimal header with just the title
  and «بازگشت به داشبورد»
- removed the self-referencing «داشبورد انبار» tab from the hub strip
- removed the red per-day transaction-count badges from the daily-control
  calendar (backend untouched — purely visual)
- removed the test subtitle «داده‌ها در پایگاه داده ذخیره می‌شوند» from the
  procurement dashboard header
This commit is contained in:
ali_mohaghegh
2026-09-03 15:01:07 +03:30
parent e4ae34ddbc
commit 0cd4f8f361
7 changed files with 53 additions and 61 deletions
@@ -0,0 +1,29 @@
import { PanelMenu } from "./PanelMenu";
import { useLogout } from "../pages/Inventory/panelMenu";
// منوی همبرگری مشترک بین دو ماژول (پنل انبار / دفتر تدارکات) —
// دقیقاً مثل منوی دفتر: عنوان «پنل‌ها»، ماژول فعلی با استایل فعال (پر)
// + «✓ فعلی»، ماژول دیگر به‌عنوان سوییچر، و در پایان جداکننده + خروج.
export function AppSwitcherMenu({
activeModule,
canSwitchToProcurement = true,
}: {
activeModule: "warehouse" | "procurement";
canSwitchToProcurement?: boolean; // مدیر پروژه به دفتر تدارکات دسترسی ندارد
}) {
const logout = useLogout();
const items = [];
if (activeModule === "procurement") {
items.push({ label: "مدیریت انبار", to: "/inventory" });
items.push({ label: "مدیریت تدارکات", to: "/", active: true });
} else {
items.push({ label: "مدیریت انبار", to: "/inventory", active: true });
if (canSwitchToProcurement) {
items.push({ label: "مدیریت تدارکات", to: "/" });
}
}
items.push({ divider: true });
items.push({ label: "خروج از حساب", onClick: logout });
return <PanelMenu title="پنل‌ها" items={items} />;
}