/**
 * 统一导航配置
 * Header.tsx 和 Sidebar.tsx 共享此数据源，避免路由配置重复
 */
import React from "react";
import {
  DashboardOutlined,
  FileOutlined,
  FileTextOutlined,
  AudioOutlined,
  AppstoreOutlined,
  EditOutlined,
  FolderOutlined,
  VideoCameraOutlined,
  HistoryOutlined,
  TrophyOutlined,
  ScanOutlined,
  ControlOutlined,
  CrownOutlined,
} from "@ant-design/icons";

/** 导航项类型 */
export interface NavItem {
  key: string;
  label: string;
  path: string;
  icon: React.ReactNode;
}

/** 导航分组类型 */
export interface NavGroup {
  title: string;
  items: NavItem[];
}

/**
 * 全量导航项（Header 扁平列表使用）
 * 所有路径统一使用 /app 前缀，与路由配置保持一致
 */
export const NAV_ITEMS: NavItem[] = [
  {
    key: "dashboard",
    label: "概览",
    path: "/app/dashboard",
    icon: React.createElement(DashboardOutlined),
  },
  {
    key: "assets",
    label: "素材库",
    path: "/app/assets",
    icon: React.createElement(FileOutlined),
  },
  {
    key: "titles",
    label: "标题库",
    path: "/app/titles",
    icon: React.createElement(FileTextOutlined),
  },
  {
    key: "voices",
    label: "配音库",
    path: "/app/voices",
    icon: React.createElement(AudioOutlined),
  },
  {
    key: "templates",
    label: "模板库",
    path: "/app/templates",
    icon: React.createElement(AppstoreOutlined),
  },
  {
    key: "editing-planner",
    label: "剪辑编辑器",
    path: "/app/editing-planner",
    icon: React.createElement(EditOutlined),
  },
  {
    key: "my-templates",
    label: "我的模板",
    path: "/app/my-templates",
    icon: React.createElement(FolderOutlined),
  },
  {
    key: "generate",
    label: "一键生成",
    path: "/app/generate",
    icon: React.createElement(VideoCameraOutlined),
  },
  {
    key: "history",
    label: "任务历史",
    path: "/app/history",
    icon: React.createElement(HistoryOutlined),
  },
  {
    key: "products",
    label: "成品库",
    path: "/app/products",
    icon: React.createElement(TrophyOutlined),
  },
  {
    key: "duplication",
    label: "查重",
    path: "/app/duplication",
    icon: React.createElement(ScanOutlined),
  },
];

/** 侧边栏导航分组（Sidebar 分组列表使用） */
export const NAV_GROUPS: NavGroup[] = [
  {
    title: "创作工具",
    items: [
      {
        key: "dashboard",
        label: "概览",
        path: "/app/dashboard",
        icon: React.createElement(DashboardOutlined),
      },
      {
        key: "generate",
        label: "一键生成",
        path: "/app/generate",
        icon: React.createElement(VideoCameraOutlined),
      },
      {
        key: "editing-planner",
        label: "剪辑编辑器",
        path: "/app/editing-planner",
        icon: React.createElement(EditOutlined),
      },
    ],
  },
  {
    title: "资源管理",
    items: [
      {
        key: "assets",
        label: "素材库",
        path: "/app/assets",
        icon: React.createElement(FileOutlined),
      },
      {
        key: "voices",
        label: "配音库",
        path: "/app/voices",
        icon: React.createElement(AudioOutlined),
      },
      {
        key: "titles",
        label: "标题库",
        path: "/app/titles",
        icon: React.createElement(FileTextOutlined),
      },
      {
        key: "products",
        label: "成品库",
        path: "/app/products",
        icon: React.createElement(TrophyOutlined),
      },
      {
        key: "templates",
        label: "模板库",
        path: "/app/templates",
        icon: React.createElement(AppstoreOutlined),
      },
      {
        key: "my-templates",
        label: "我的模板",
        path: "/app/my-templates",
        icon: React.createElement(FolderOutlined),
      },
    ],
  },
  {
    title: "系统",
    items: [
      {
        key: "history",
        label: "任务历史",
        path: "/app/history",
        icon: React.createElement(HistoryOutlined),
      },
      {
        key: "duplication",
        label: "查重",
        path: "/app/duplication",
        icon: React.createElement(ScanOutlined),
      },
      {
        key: "admin",
        label: "控制台",
        path: "/app/admin",
        icon: React.createElement(ControlOutlined),
      },
      {
        key: "subscription",
        label: "订阅管理",
        path: "/app/subscription",
        icon: React.createElement(CrownOutlined),
      },
    ],
  },
];
