repo_description: A stunning, functional and responsive retractable sidebar for Next.js built on top of shadcn/ui.
repo_topics: admin-panel dashboard nextjs shadcn-ui sidebar tailwind
code: import {
    Tag,
    Users,
    Settings,
    Bookmark,
    SquarePen,
    LayoutGrid,
    LucideIcon
  } from "lucide-react";
  
  type Submenu = {
    href: string;
    label: string;
    active?: boolean;
  };
  
  type Menu = {
    href: string;
    label: string;
    active?: boolean;
    icon: LucideIcon;
    submenus?: Submenu[];
  };
  
  type Group = {
    groupLabel: string;
    menus: Menu[];
  };
  
  export function getMenuList(pathname: string): Group[] {
    return [
      {
        groupLabel: "",
        menus: [
          {
            href: "/dashboard",
            label: "Dashboard",
            icon: LayoutGrid,
            submenus: []
          }
        ]
      },
      {
        groupLabel: "Contents",
        menus: [
          {
            href: "",
            label: "Posts",
            icon: SquarePen,
            submenus: [
              {
                href: "/posts",
                label: "All Posts"
              },
              {
                href: "/posts/new",
                label: "New Post"
              }
            ]
          },
          {
            href: "/categories",
            label: "Categories",
            icon: Bookmark
          },
          {
            href: "/tags",
            label: "Tags",
            icon: Tag
          }
        ]
      },
      {
        groupLabel: "Settings",
        menus: [
          {
            href: "/users",
            label: "Users",
            icon: Users
          },
          {
            href: "/account",
            label: "Account",
            icon: Settings
          }
        ]
      }
    ];
  }
  