'use client'

import {
  BookCopyIcon,
  CalendarClockIcon,
  DollarSignIcon,
  FileBadgeIcon,
  GraduationCap,
  LayoutDashboardIcon,
  ShieldUserIcon,
  UploadIcon,
  UsersIcon
} from 'lucide-react'

import { NavMain } from '@/components/nav-main'
import { WorkspaceSwitcher } from '@/components/workspace-switcher'
import {
  Sidebar,
  SidebarContent,
  SidebarHeader,
  SidebarRail
} from '@repo/ui/components/ui/sidebar'

const data = {
  navMain: [
    {
      title: 'Visão geral',
      url: '/main',
      icon: LayoutDashboardIcon
    },
    {
      title: 'Histórico de compras',
      url: '/orders',
      icon: DollarSignIcon
    }
  ],
  navUser: [
    {
      title: 'Colaboradores',
      url: '/users',
      icon: UsersIcon
    },
    {
      title: 'Gestores',
      url: '/admins',
      icon: ShieldUserIcon
    },
    {
      title: 'Importações',
      url: '/batch',
      icon: UploadIcon
    }
  ],
  navEnrollment: [
    {
      title: 'Matrículas',
      url: '/enrollments',
      icon: GraduationCap
    },
    {
      title: 'Certificações',
      url: '/certs',
      icon: FileBadgeIcon
    },
    {
      title: 'Agendamentos',
      url: '/scheduled',
      icon: CalendarClockIcon
    },
    {
      title: 'Catálogo de cursos',
      url: '/courses',
      icon: BookCopyIcon
    }
  ]
}

export function AppSidebar() {
  return (
    <Sidebar collapsible="icon">
      <SidebarRail title="Mostrar/ocultar barra lateral" />
      <SidebarHeader>
        <WorkspaceSwitcher />
      </SidebarHeader>
      <SidebarContent className="group-data-[state=expanded]:p-2">
        <NavMain data={data} />
      </SidebarContent>
    </Sidebar>
  )
}
