import type { Component } from 'vue'
import {
  DashboardOutlined,
  FileTextOutlined,
  TeamOutlined,
  SettingOutlined,
  AuditOutlined,
  MessageOutlined,
  UserOutlined,
  SolutionOutlined,
  BankOutlined,
  NotificationOutlined,
  FolderOutlined,
  BookOutlined,
  StarOutlined,
  FormOutlined,
} 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-content',
    label: '内容管理',
    icon: FileTextOutlined,
    children: [
      { key: 'admin-articles', label: '文章管理', icon: FileTextOutlined, to: '/admin/articles' },
      { key: 'admin-categories', label: '栏目管理', icon: FolderOutlined, to: '/admin/categories' },
      { key: 'admin-announcements', label: '公告管理', icon: NotificationOutlined, to: '/admin/announcements' },
    ],
  },
  // ── 专家管理 ──
  {
    key: 'admin-experts',
    label: '专家管理',
    icon: StarOutlined,
    children: [
      { key: 'admin-experts-list', label: '专家列表', icon: SolutionOutlined, to: '/admin/experts' },
      { key: 'admin-experts-review', label: '专家审核', icon: AuditOutlined, to: '/admin/experts/review', },
    ],
  },
  // ── 会员管理 ──
  {
    key: 'admin-members',
    label: '会员管理',
    icon: BankOutlined,
    children: [
      { key: 'admin-members-list', label: '会员列表', icon: TeamOutlined, to: '/admin/members' },
      { key: 'admin-members-review', label: '会员审核', icon: AuditOutlined, to: '/admin/members/review' },
    ],
  },
  // ── 建言献策 ──
  {
    key: 'admin-suggestions',
    label: '建言献策',
    icon: MessageOutlined,
    to: '/admin/suggestions',
    badge: 'NEW',
  },
  // ── 用户管理 ──
  {
    key: 'admin-users',
    label: '用户管理',
    icon: UserOutlined,
    to: '/admin/users',
  },
  // ── 资料下载 ──
  {
    key: 'admin-downloads',
    label: '资料下载管理',
    icon: BookOutlined,
    to: '/admin/downloads',
  },
  // ── 申请管理 ──
  {
    key: 'admin-applications',
    label: '申请管理',
    icon: FormOutlined,
    children: [
      { key: 'admin-expert-applications', label: '专家申请', icon: SolutionOutlined, to: '/admin/applications/expert' },
      { key: 'admin-member-applications', label: '会员申请', icon: TeamOutlined, to: '/admin/applications/member' },
    ],
  },
  // ── 系统设置 ──
  {
    key: 'admin-settings',
    label: '系统设置',
    icon: SettingOutlined,
    to: '/admin/settings',
  },
]
