<script lang="ts" setup>
import type { SidebarNavGroup } from '~/components/app/sidebar/index.vue'

const route = useRoute()
const { breadcrumbs } = toRefs(useBreadcrumbs())

const sidebarNav: SidebarNavGroup[] = [
  {
    items: [
      {
        title: '课程管理',
        url: `/course`,
        icon: 'tabler:book-2',
      },
      {
        title: '课程资源',
        url: `/course/resources`,
        icon: 'tabler:books',
      },
      {
        title: 'AI 备课',
        icon: 'tabler:clipboard-list',
        items: [
          {
            title: 'AI 教学设计',
            url: `/course/prep/teach`,
          },
          {
            title: 'AI 课件设计',
            url: `/course/prep/deck`,
          },
          {
            title: 'AI 出题',
            url: `/course/prep/quiz`,
          },
        ]
      },
      {
        title: 'AI 教科研',
        url: `/course/research`,
        icon: 'tabler:report-search',
      },
    ],
  },
]
</script>

<template>
  <div class="w-full min-h-screen flex font-sans">
    <SidebarProvider style="--sidebar-width: 200px">
      <AppSidebar
        v-if="!route.meta.hideSidebar"
        :nav="sidebarNav"
      />
      <SidebarInset>
        <AppTopbar
          :hide-trigger="route.meta.hideSidebar"
          :breadcrumbs
        />
        <div class="flex flex-1 flex-col gap-4">
          <slot />
        </div>
      </SidebarInset>
    </SidebarProvider>
  </div>
</template>

<style scoped></style>
