import { lazy } from 'react'
import { Navigate, type RouteObject } from 'react-router'

export const routes: RouteObject[] = [
  {
    path: '/',
    Component: lazy(() => import('@/components/layout/AppLayout')),
    children: [
      {
        path: 'data',
        Component: lazy(() => import('@/components/layout/DataLayout')),
        children: [
          { index: true, element: <Navigate to="dashboard" /> },
          { path: 'dashboard', Component: lazy(() => import('./dashboard/views/Index')) },
          // 数据采集
          { path: 'write', element: <Navigate to="my" /> },
          { path: 'write/my', Component: lazy(() => import('./write/my/views/Index')) },
          { path: 'write/copy', Component: lazy(() => import('./write/copy/views/Index')) },
          { path: 'write/upload', Component: lazy(() => import('./write/upload/views/Index')) },
          { path: 'write/copy', Component: lazy(() => import('./write/copy/views/Index')) },
          { path: 'write/built', Component: lazy(() => import('./write/built/views/Index')) },
          // 数据理解与探索
          { path: 'read', element: <Navigate to="understanding" /> },
          { path: 'read/understanding', Component: lazy(() => import('./read/understanding/views/Index')) },
          { path: 'read/exploration', Component: lazy(() => import('./read/exploration/views/Index')) },
          // 数据预处理
          { path: 'preprocess', element: <Navigate to="null" /> },
          { path: 'preprocess/null', Component: lazy(() => import('./preprocess/null/views/Index')) },
          { path: 'preprocess/repeat', Component: lazy(() => import('./preprocess/repeat/views/Index')) },
          { path: 'preprocess/max', Component: lazy(() => import('./preprocess/max/views/Index')) },
          { path: 'preprocess/min', Component: lazy(() => import('./preprocess/min/views/Index')) },
          { path: 'preprocess/error', Component: lazy(() => import('./preprocess/error/views/Index')) },
          { path: 'preprocess/split', Component: lazy(() => import('./preprocess/split/views/Index')) },
          { path: 'preprocess/space', Component: lazy(() => import('./preprocess/space/views/Index')) },
          { path: 'preprocess/symbol', Component: lazy(() => import('./preprocess/symbol/views/Index')) },
          { path: 'preprocess/type', Component: lazy(() => import('./preprocess/type/views/Index')) },
          { path: 'preprocess/sort', Component: lazy(() => import('./preprocess/sort/views/Index')) },
          { path: 'preprocess/splice', Component: lazy(() => import('./preprocess/splice/views/Index')) },
          // 数据预处理
          { path: 'process', element: <Navigate to="mapping" /> },
          { path: 'process/mapping', Component: lazy(() => import('./process/mapping/views/Index')) },
          { path: 'process/binning', Component: lazy(() => import('./process/binning/views/Index')) },
          { path: 'process/group', Component: lazy(() => import('./process/group/views/Index')) },
          { path: 'process/desensitization', Component: lazy(() => import('./process/desensitization/views/Index')) },
          { path: 'process/date', Component: lazy(() => import('./process/date/views/Index')) },
          { path: 'process/string', Component: lazy(() => import('./process/string/views/Index')) },
          { path: 'process/number', Component: lazy(() => import('./process/number/views/Index')) },
          { path: 'process/logic', Component: lazy(() => import('./process/logic/views/Index')) },
          { path: 'process/perspective', Component: lazy(() => import('./process/perspective/views/Index')) },
          // 数据挖掘
          { path: 'digging', element: <Navigate to="linear" /> },
          { path: 'digging/linear', Component: lazy(() => import('./digging/linear/views/Index')) },
          { path: 'digging/logistic', Component: lazy(() => import('./digging/logistic/views/Index')) },
          { path: 'digging/tree', Component: lazy(() => import('./digging/tree/views/Index')) },
          { path: 'digging/forest', Component: lazy(() => import('./digging/forest/views/Index')) },
          { path: 'digging/svm', Component: lazy(() => import('./digging/svm/views/Index')) },
          { path: 'digging/kmeans', Component: lazy(() => import('./digging/kmeans/views/Index')) },
          { path: 'digging/hierarchical', Component: lazy(() => import('./digging/hierarchical/views/Index')) },
          { path: 'digging/apriori', Component: lazy(() => import('./digging/apriori/views/Index')) },
          { path: 'digging/fpgrowth', Component: lazy(() => import('./digging/fpgrowth/views/Index')) },
          { path: 'digging/holtwinters', Component: lazy(() => import('./digging/holtwinters/views/Index')) },
          // 数据可视化组件
          { path: 'chart', element: <Navigate to="bar" /> },
          { path: 'chart/bar', Component: lazy(() => import('./chart/bar/views/Index')) },
          { path: 'chart/line', Component: lazy(() => import('./chart/line/views/Index')) },
          { path: 'chart/pie', Component: lazy(() => import('./chart/pie/views/Index')) },
          { path: 'chart/radar', Component: lazy(() => import('./chart/radar/views/Index')) },
          { path: 'chart/point', Component: lazy(() => import('./chart/point/views/Index')) },
          { path: 'chart/bubble', Component: lazy(() => import('./chart/bubble/views/Index')) },
          { path: 'chart/wordCloud', Component: lazy(() => import('./chart/wordCloud/views/Index')) },
          { path: 'chart/map', Component: lazy(() => import('./chart/bar/views/Index')) },
          { path: 'chart/indicator', Component: lazy(() => import('./chart/indicator/views/Index')) },
          { path: 'chart/funnel', Component: lazy(() => import('./chart/funnel/views/Index')) },
          { path: 'chart/histogram', Component: lazy(() => import('./chart/histogram/views/Index')) },
          { path: 'chart/table', Component: lazy(() => import('./chart/table/views/Index')) },
          { path: 'chart/pareto', Component: lazy(() => import('./chart/pareto/views/Index')) },
          { path: 'chart/treeMap', Component: lazy(() => import('./chart/treeMap/views/Index')) },
          { path: 'screen', Component: lazy(() => import('./screen/views/Index')) },
        ],
      },
    ],
  },
]
