Files
WhiteNightsAdminPanel/src/shared/config/constants.tsx

150 lines
2.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { authStore } from "@shared";
import {
Power,
LucideIcon,
Building2,
Map,
Users,
Earth,
Landmark,
GitBranch,
// Car,
Table,
Notebook,
Split,
Newspaper,
PersonStanding,
Cpu,
BookImage,
} from "lucide-react";
import { CarrierSvg } from "./CarrierSvg";
export const DRAWER_WIDTH = 300;
interface NavigationItem {
id: string;
label: string;
icon?: LucideIcon | React.ReactNode;
path?: string;
onClick?: () => void;
nestedItems?: NavigationItem[];
isActive?: boolean;
}
export const NAVIGATION_ITEMS: {
primary: NavigationItem[];
secondary: NavigationItem[];
} = {
primary: [
{
id: "all",
label: "Все сущности",
icon: Table,
nestedItems: [
{
id: "media",
label: "Медиа",
icon: BookImage,
path: "/media",
},
{
id: "articles",
label: "Статьи",
icon: Newspaper,
path: "/article",
},
{
id: "attractions",
label: "Достопримечательности",
icon: Landmark,
path: "/sight",
},
{
id: "stations",
label: "Остановки",
icon: PersonStanding,
path: "/station",
},
{
id: "routes",
label: "Маршруты",
icon: Split,
path: "/route",
},
{
id: "reference",
label: "Справочник",
icon: Notebook,
nestedItems: [
{
id: "countries",
label: "Страны",
icon: Earth,
path: "/country",
},
{
id: "cities",
label: "Города",
icon: Building2,
path: "/city",
},
{
id: "carriers",
label: "Перевозчики",
// @ts-ignore
icon: CarrierSvg,
path: "/carrier",
},
],
},
],
},
{
id: "snapshots",
label: "Снапшоты",
icon: GitBranch,
path: "/snapshot",
},
{
id: "map",
label: "Карта",
icon: Map,
path: "/map",
},
{
id: "devices",
label: "Устройства",
icon: Cpu,
path: "/devices",
},
// {
// id: "vehicles",
// label: "Транспорт",
// icon: Car,
// path: "/vehicle",
// },
{
id: "users",
label: "Пользователи",
icon: Users,
path: "/user",
},
],
secondary: [
{
id: "logout",
label: "Выйти",
icon: Power,
onClick: () => {
authStore.logout();
window.location.href = "/login";
},
},
],
};
export const VEHICLE_TYPES = [
{ label: "Трамвай", value: 1 },
{ label: "Троллейбус", value: 2 },
];