import { lazy } from "react";

// Dashboard route
const dashboardRoute = {
  path: "dashboard",
  component: lazy(() => import("@/pages/Dashboard")),
  name: "仪表盘",
  icon: "dashboard",
};

// Resource Management routes
const resourceRoutes = [
  {
    path: "team",
    component: lazy(() => import("@/pages/resource/team")),
    name: "团队管理",
    icon: "team",
  },
  {
    path: "bucket",
    component: lazy(() => import("@/pages/resource/bucket")),
    name: "对象存储",
    icon: "shop",
  },
  {
    path: "task",
    component: lazy(() => import("@/pages/resource/resourceTask")),
    name: "任务管理",
    icon: "appstore",
  },
  {
    path: "task/edit/:id?",
    component: lazy(() => import("@/pages/resource/resourceTask/edit")),
    hidden: true,
    name: "新增/编辑任务",
  },
];

// Company routes
const companyRoutes = [
  {
    path: "quotation",
    component: lazy(() => import("@/pages/company/quotation")),
    name: "报价单",
    icon: "file",
  },
  {
    path: "quotaInfo/:id?", // 添加可选的 id 参数
    hidden: true,
    component: lazy(() => import("@/pages/company/quotation/detail")),
    name: "报价单详情",
    icon: "file",
  },
  {
    path: "serviceTeamplate",
    component: lazy(() => import("@/pages/company/service")),
    name: "服务管理",
    icon: "container",
  },
  {
    path: "serviceType",
    hidden: true,
    component: lazy(() => import("@/pages/company/service/serviceType")),
    name: "类型管理",
    icon: "container",
  },
  {
    path: "serviceTemplateInfo/:id?",
    hidden: true,
    component: lazy(() => import("@/pages/company/service/detail")),
    name: "服务模版详情",
    icon: "container",
  },
  {
    path: "quotaInfo/preview/:id?", // 添加可选的 id 参数
    hidden: true,
    component: lazy(() => import("@/pages/company/quotation/view")),
    name: "报价单预览",
    icon: "file",
  },
  {
    path: "customer",
    component: lazy(() => import("@/pages/company/customer")),
    name: "客户管理",
    icon: "user",
  },
  {
    path: "customerInfo/:id?",
    hidden: true,
    component: lazy(() => import("@/pages/company/customer/detail")),
    name: "客户详情",
    icon: "user",
  },
  {
    path: "supplier",
    component: lazy(() => import("@/pages/company/supplier")),
    name: "供应商管理",
    icon: "branches",
  },
  {
    path: "supplierInfo/:id?",
    hidden: true,
    component: lazy(() => import("@/pages/company/supplier/detail")),
    name: "供应商详情",
    icon: "branches",
  },
];

const marketingRoutes = [];

export const routes = [
  dashboardRoute,
  {
    path: "resource",
    component: lazy(() => import("@/pages/resource")),
    name: "资源管理",
    icon: "appstore",
    children: resourceRoutes,
  },
  {
    path: "company",
    component: lazy(() => import("@/pages/company")),
    name: "公司管理",
    icon: "bank",
    children: companyRoutes,
  },
  {
    path: "marketing",
    component: lazy(() => import("@/pages/marketing")),
    name: "行销中心",
    icon: "shopping",
    children: marketingRoutes,
  },
];
