import {
  ClipboardList,
  Cable,
  Home,
  LayoutGrid,
  PackageSearch,
  ReceiptText,
  ScrollText,
  Settings,
  ShieldCheck,
  TicketCheck,
  Users,
} from 'lucide-react'
import { type SidebarData } from '../types'

export const sidebarData: SidebarData = {
  user: {
    name: '管理员',
    email: 'root@local.dev',
    avatar: '',
  },
  teams: [
    {
      name: 'Work Admin',
      logo: LayoutGrid,
      plan: '商城后台',
    },
  ],
  navGroups: [
    {
      title: '工作台',
      items: [
        {
          title: '后台首页',
          url: '/',
          icon: Home,
        },
      ],
    },
    {
      title: '商城业务',
      items: [
        {
          title: '商品管理',
          icon: PackageSearch,
          items: [
            {
              title: '分类管理',
              url: '/catalog/categories',
              permission: {
                resource: 'catalog/categories',
                action: 'read',
              },
            },
            {
              title: '商品列表',
              url: '/catalog/products',
              permission: {
                resource: 'catalog/products',
                action: 'read',
              },
            },
          ],
        },
        {
          title: '订单管理',
          icon: ReceiptText,
          items: [
            {
              title: '订单列表',
              url: '/orders',
              permission: {
                resource: 'orders',
                action: 'read',
              },
            },
            {
              title: '查课下单',
              url: '/course-query',
              permission: {
                resource: 'orders',
                action: 'write',
              },
            },
            {
              title: '自营下单',
              url: '/self-owned-order',
              permission: {
                resource: 'orders',
                action: 'write',
              },
            },
          ],
        },
        {
          title: '工单管理',
          url: '/tickets',
          icon: TicketCheck,
        },
        {
          title: '日志查询',
          url: '/order-logs',
          icon: ClipboardList,
          permission: {
            resource: 'order-logs',
            action: 'read',
          },
        },
      ],
    },
    {
      title: '系统管理',
      items: [
        {
          title: '用户与权限',
          icon: ShieldCheck,
          items: [
            {
              title: '用户管理',
              url: '/system/users',
              icon: Users,
              permission: {
                resource: 'admin/users',
                action: 'read',
              },
            },
          ],
        },
        {
          title: '安全审计',
          icon: ScrollText,
          items: [
            {
              title: '第三方接口',
              url: '/system/third-party',
              icon: Cable,
              permission: {
                resource: 'admin/third-party',
                action: 'read',
              },
            },
            {
              title: '操作日志',
              url: '/system/audit-logs',
              icon: ScrollText,
              permission: {
                resource: 'admin/audit-logs',
                action: 'read',
              },
            },
          ],
        },
        {
          title: '账号安全',
          url: '/settings/account',
          icon: Settings,
        },
      ],
    },
  ],
}
