260506_01_fst: First Commit
This commit is contained in:
28
src/config/menu.data.ts
Normal file
28
src/config/menu.data.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import {SideMenuItem, TopMenuItem} from "@/config/menu.type";
|
||||
import {CATEGORY_KEY_MAP, CATEGORY_PATH_MAP, DIV_KEY_MAP} from "./kfpaConfig";
|
||||
import { Building } from 'lucide-react';
|
||||
|
||||
export const TOP_MENUS: TopMenuItem[] = Object.entries(CATEGORY_KEY_MAP).map(
|
||||
([key, value]) => {
|
||||
const path = `/${CATEGORY_PATH_MAP[key].replace(/^\/+/, "")}`;
|
||||
|
||||
return {
|
||||
id: key,
|
||||
label: value,
|
||||
path,
|
||||
match: (pathname: string) => pathname === path,
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
export const SIDE_MENUS :SideMenuItem[] = Object.entries(DIV_KEY_MAP)
|
||||
.sort(([a], [b]) => {
|
||||
if (a === "-1") return -1;
|
||||
if (b === "-1") return 1;
|
||||
return Number(a) - Number(b);
|
||||
})
|
||||
.map(([key, value]) => ({
|
||||
id: key,
|
||||
label: value,
|
||||
icon: Building,
|
||||
}));
|
||||
Reference in New Issue
Block a user