api ulandi
This commit is contained in:
@@ -13,7 +13,6 @@ import LangToggle from "@/widgets/lang-toggle/ui/lang-toggle";
|
||||
import {
|
||||
Briefcase,
|
||||
Building2,
|
||||
CalendarCheck2,
|
||||
ChevronDown,
|
||||
ChevronRight,
|
||||
HelpCircle,
|
||||
@@ -29,44 +28,83 @@ import { useEffect, useMemo, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
|
||||
type Role = "admin" | "manager" | "user";
|
||||
type Role =
|
||||
| "superuser"
|
||||
| "admin"
|
||||
| "moderator"
|
||||
| "tour_admin"
|
||||
| "buxgalter"
|
||||
| "operator"
|
||||
| "user";
|
||||
|
||||
interface SidebarProps {
|
||||
role: Role;
|
||||
}
|
||||
|
||||
/** --- MENYU TUZILMASI --- **/
|
||||
const MENU_ITEMS = [
|
||||
{ label: "Foydalanuvchilar", icon: Users, path: "/user", roles: ["admin"] },
|
||||
{
|
||||
label: "Foydalanuvchilar",
|
||||
icon: Users,
|
||||
path: "/user",
|
||||
roles: ["moderator", "admin", "superuser", "moderator"],
|
||||
},
|
||||
{
|
||||
label: "Tur firmalar",
|
||||
icon: Building2,
|
||||
path: "/agencies",
|
||||
roles: ["admin", "manager"],
|
||||
roles: ["moderator", "admin", "superuser", "moderator"],
|
||||
},
|
||||
{
|
||||
label: "Xodimlar",
|
||||
icon: Briefcase,
|
||||
path: "/employees",
|
||||
roles: ["moderator", "admin", "superuser"],
|
||||
},
|
||||
{
|
||||
label: "Bronlar",
|
||||
icon: Wallet,
|
||||
path: "/finance",
|
||||
roles: ["moderator", "admin", "superuser", "buxgalter"],
|
||||
},
|
||||
{ label: "Xodimlar", icon: Briefcase, path: "/employees", roles: ["admin"] },
|
||||
{ label: "Byudjet", icon: Wallet, path: "/finance", roles: ["admin"] },
|
||||
{
|
||||
label: "Turlar",
|
||||
icon: Plane,
|
||||
path: "/tours",
|
||||
roles: ["admin", "manager"],
|
||||
roles: [
|
||||
"moderator",
|
||||
"admin",
|
||||
"superuser",
|
||||
"tour_admin",
|
||||
"operator",
|
||||
"buxgalter",
|
||||
],
|
||||
children: [
|
||||
{ label: "Turlar", path: "/tours" },
|
||||
{ label: "Tur sozlamalari", path: "/tours/setting" },
|
||||
{
|
||||
label: "Tur sozlamalari",
|
||||
path: "/tours/setting",
|
||||
roles: ["moderator", "admin", "superuser"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Bronlar",
|
||||
icon: CalendarCheck2,
|
||||
path: "/bookings",
|
||||
roles: ["admin", "manager", "user"],
|
||||
},
|
||||
// {
|
||||
// label: "Bronlar",
|
||||
// icon: CalendarCheck2,
|
||||
// path: "/bookings",
|
||||
// roles: [
|
||||
// "moderator",
|
||||
// "admin",
|
||||
// "superuser",
|
||||
// "tour_admin",
|
||||
// "operator",
|
||||
// "buxgalter",
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
label: "Yangiliklar",
|
||||
icon: Newspaper,
|
||||
path: "/news",
|
||||
roles: ["admin", "manager"],
|
||||
roles: ["moderator", "admin", "superuser"],
|
||||
children: [
|
||||
{ label: "Yangiliklar", path: "/news" },
|
||||
{ label: "Kategoriya", path: "/news/categories" },
|
||||
@@ -76,7 +114,7 @@ const MENU_ITEMS = [
|
||||
label: "FAQ",
|
||||
icon: MessageSquare,
|
||||
path: "/faq",
|
||||
roles: ["admin"],
|
||||
roles: ["moderator", "admin", "superuser"],
|
||||
children: [
|
||||
{ label: "Savollar ro‘yxati", path: "/faq" },
|
||||
{ label: "Savollar kategoriyasi", path: "/faq/categories" },
|
||||
@@ -86,17 +124,32 @@ const MENU_ITEMS = [
|
||||
label: "Arizalar",
|
||||
icon: HelpCircle,
|
||||
path: "/support",
|
||||
roles: ["admin", "manager"],
|
||||
roles: ["moderator", "admin", "superuser", "tour_admin", "operator"],
|
||||
children: [
|
||||
{ label: "Agentlik arizalari", path: "/support/tours", roles: ["admin"] },
|
||||
{ label: "Yordam arizalari", path: "/support/user", roles: ["admin"] },
|
||||
{
|
||||
label: "Agentlik arizalari",
|
||||
path: "/support/tours",
|
||||
roles: ["moderator", "admin", "superuser", "operator"],
|
||||
},
|
||||
{
|
||||
label: "Yordam arizalari",
|
||||
path: "/support/user",
|
||||
roles: [
|
||||
"moderator",
|
||||
"admin",
|
||||
"superuser",
|
||||
"tour_admin",
|
||||
"operator",
|
||||
"buxgalter",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Tur sozlamalari",
|
||||
label: "Sayt sozlamalari",
|
||||
icon: Settings,
|
||||
path: "/tour-settings",
|
||||
roles: ["admin"],
|
||||
roles: ["moderator", "admin", "superuser"],
|
||||
children: [
|
||||
{ label: "Sayt SEOsi", path: "/site-seo/" },
|
||||
{ label: "Offerta", path: "/site-pages/" },
|
||||
@@ -201,7 +254,7 @@ export function Sidebar({ role }: SidebarProps) {
|
||||
|
||||
return (
|
||||
<div className="lg:border">
|
||||
<div className="lg:hidden flex items-center justify-between bg-gray-900 p-4 sticky top-0 z-50">
|
||||
<div className="lg:hidden flex items-center justify-end bg-gray-900 p-4 sticky top-0 z-50">
|
||||
<Sheet open={isSheetOpen} onOpenChange={setIsSheetOpen}>
|
||||
<div className="flex gap-4">
|
||||
<LangToggle />
|
||||
|
||||
Reference in New Issue
Block a user