"use client";

import * as React from "react";

import { NavMain } from "@/app/protected/(admin-pages)/_components/navigations/nav-main";
import { NavReports } from "@/app/protected/(admin-pages)/_components/navigations/nav-report";
import { NavUser } from "@/app/protected/(admin-pages)/_components/navigations/nav-user";
import { TeamSwitcher } from "@/app/_components/team-switcher";

import {
  Sidebar,
  SidebarContent,
  SidebarFooter,
  SidebarHeader,
  SidebarRail,
} from "@/app/_components/ui/sidebar";
import { NavPreMain } from "./navigations/nav-pre-main";
import { navData } from "@/prisma/data/nav";

export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
  return (
    <Sidebar collapsible="icon" {...props}>
      <SidebarHeader>
        <TeamSwitcher teams={navData.teams} />
      </SidebarHeader>
      <SidebarContent>
        <NavPreMain items={navData.NavPreMain} />
        <NavMain items={navData.navMain} />
        <NavReports reports={navData.reports} />
      </SidebarContent>
      <SidebarFooter>
        <NavUser user={navData.user} />
      </SidebarFooter>
      <SidebarRail />
    </Sidebar>
  );
}
