import { Outlet, createFileRoute } from '@tanstack/react-router'
import { Separator } from '@radix-ui/react-select'
import { AppSidebar } from '@/components/app-sidebar'
import {
  SidebarInset,
  SidebarProvider,
  SidebarTrigger,
} from '@/components/ui/sidebar'
import Breadcrumbs from '@/components/applicationBreadcrumbs'

export const Route = createFileRoute('/_sidebar')({
  component: RouteComponent,
})

function RouteComponent() {
  return (
    <SidebarProvider>
      <AppSidebar />
      <SidebarInset>
        <header className="flex h-16 shrink-0 items-center gap-2">
          <div className="flex items-center gap-2 px-4">
            <SidebarTrigger className="-ml-1" />
            <Separator
              // orientation="vertical"
              className="mr-2 data-[orientation=vertical]:h-4"
            />
            <Breadcrumbs />
          </div>
        </header>
        <div className="p-4 pt-0 h-full w-full flex-grow">
          <Outlet />
        </div>
      </SidebarInset>
    </SidebarProvider>
  )
}
