import React from "react";
import Icon from "@ant-design/icons";
import { DageRouteItem } from "./types";
import { ReactComponent as SettingIcon } from "@/assets/icons/systems.svg";
import { ReactComponent as AssessmentIcon } from "@/assets/icons/icon_check.svg";
import { ReactComponent as managementIcon } from "@/assets/icons/icon_management.svg";

export const DEFAULT_MENU: DageRouteItem[] = [
  {
    path: "/assessment",
    title: "考核设置",
    icon: <Icon component={AssessmentIcon} />,
    redirect: "/assessment/index",
    children: [
      {
        path: "/assessment/index",
        title: "指标设置",
        Component: React.lazy(() => import("../pages/Assessment/Index")),
        children: [
          {
            hide: true,
            path: "/assessment/index/create",
            title: "新增指标",
            Component: React.lazy(
              () => import("../pages/Assessment/Index/CreateOrEdit")
            ),
          },
        ],
      },
      {
        path: "/assessment/template",
        title: "考核模板",
        Component: React.lazy(() => import("../pages/Assessment/Template")),
        children: [
          {
            hide: true,
            path: "/assessment/template/create",
            title: "新增模板",
            Component: React.lazy(
              () => import("../pages/Assessment/Template/CreateOrEdit")
            ),
          },
        ],
      },
    ],
  },
  {
    path: "/management",
    title: "考核管理",
    icon: <Icon component={managementIcon} />,
    redirect: "/management/index",
    children: [
      {
        path: "/management/index",
        title: "考核管理",
        Component: React.lazy(() => import("../pages/Management/Index")),
        children: [
          {
            hide: true,
            path: "/management/index/create",
            title: "新增考核",
            Component: React.lazy(
              () => import("../pages/Management/Index/CreateOrEdit")
            ),
          },
          {
            hide: true,
            path: "/management/index/setting-index",
            title: "设置指标",
            Component: React.lazy(
              () => import("../pages/Management/Index/SettingIndex")
            ),
          },
          {
            hide: true,
            path: "/management/index/setting-role",
            title: "设置角色",
            Component: React.lazy(
              () => import("../pages/Management/Index/SettingRole")
            ),
          },
          {
            hide: true,
            meta: {
              custom: true,
            },
            path: "/management/index/detail",
            title: "考核详情",
            Component: React.lazy(() => import("../pages/AssessmentDetail")),
          },
        ],
      },
    ],
  },
];

export const DEFAULT_ADMIN_MENU: DageRouteItem[] = [
  {
    path: "/setting",
    title: "系统设置",
    icon: <Icon component={SettingIcon} />,
    children: [
      {
        path: "/setting/user",
        title: "用户管理",
        Component: React.lazy(() => import("../pages/User")),
      },
      {
        path: "/setting/log",
        title: "操作日志",
        Component: React.lazy(() => import("../pages/Log")),
      },
    ],
  },
];

export * from "./types";
