feat(админка): оболочка v2 с пятью разделами

This commit is contained in:
anor
2026-11-06 20:52:27 +10:00
parent a3e7badc68
commit 9e76e8ce57
11 changed files with 403 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
export const BASE = "/admin/v2";
export const SECTIONS = [
["today", "Мой день", BASE],
["customers", "Клиенты", `${BASE}/customers`],
["money", "Деньги", `${BASE}/money`],
["work", "Работа", `${BASE}/work`],
["system", "Система", `${BASE}/system`],
];
export function sectionFromPath(pathname) {
const clean = (pathname || "").replace(/\/+$/, "");
if (clean === BASE || clean === `${BASE}/today`) return "today";
const found = SECTIONS.find(([, , href]) => clean === href);
return found ? found[0] : "today";
}
export function hrefFor(section) {
const found = SECTIONS.find(([key]) => key === section);
return found ? found[2] : BASE;
}