import type { Component } from 'vue'
import {
  AppstoreOutlined,
  AuditOutlined,
  DashboardOutlined,
  TeamOutlined,
  SettingOutlined,
  FileTextOutlined,
  CustomerServiceOutlined,
  ShopOutlined,
  GitlabOutlined,
} from '@ant-design/icons-vue'

export type AdminNavItem = {
  key: string
  label: string
  icon?: Component
  to: string
}

export type AdminNavGroup = {
  key: string
  label: string
  icon?: Component
  iconColor?: string
  badge?: string
  disabled?: boolean
  children: AdminNavItem[]
}

export type AdminNavLink = Omit<AdminNavGroup, 'children'> & {
  to: string
}

export type AdminNavEntry = AdminNavGroup | AdminNavLink

export const adminNav: AdminNavEntry[] = [
  {
    key: 'admin-home',
    label: '管理首页',
    icon: DashboardOutlined,
    to: '/admin',
  },
  {
    key: 'admin-app-review',
    label: '应用审核',
    icon: AuditOutlined,
    badge: 'NEW',
    to: '/admin/app-review',
  },
  {
    key: 'admin-git-review',
    label: 'Git 审核',
    icon: GitlabOutlined,
    to: '/admin/git-review',
  },
  {
    key: 'admin-apps',
    label: '应用管理',
    icon: AppstoreOutlined,
    to: '/admin/apps',
  },
  {
    key: 'admin-market',
    label: '应用市场',
    icon: ShopOutlined,
    to: '/admin/market',
  },
  {
    key: 'admin-users',
    label: '用户管理',
    icon: TeamOutlined,
    children: [
      { key: 'admin-users-list', label: '所有用户', icon: TeamOutlined, to: '/admin/users' },
      { key: 'admin-developers', label: '开发者', icon: TeamOutlined, to: '/admin/developers' },
    ],
  },
  {
    key: 'admin-tickets',
    label: '工单处理',
    icon: CustomerServiceOutlined,
    to: '/admin/tickets',
  },
  {
    key: 'admin-content',
    label: '内容管理',
    icon: FileTextOutlined,
    children: [
      { key: 'admin-articles', label: '文章管理', icon: FileTextOutlined, to: '/admin/articles' },
      { key: 'admin-article-categories', label: '文章分类', icon: FileTextOutlined, to: '/admin/article-categories' },
      { key: 'admin-announcements', label: '公告管理', icon: FileTextOutlined, to: '/admin/announcements' },
    ],
  },
  {
    key: 'admin-settings',
    label: '平台设置',
    icon: SettingOutlined,
    to: '/admin/settings',
  },
]
