import { defineConfig } from '@umijs/max';
import {
  alarmsRoute,
  commonManagerRoutes,
  forgotPasswordRoute,
  loginRoute,
  managerRouteBase,
  notFoundRoute,
  profileRoute,
} from './config/routes';

export default defineConfig({
  favicons: ['/spole-logo.png'],
  layout: {
    title: 'Spole',
  },
  routes: [
    loginRoute,
    alarmsRoute,
    forgotPasswordRoute,
    profileRoute,
    {
      name: 'spole.monitoring',
      icon: 'icon-monitoring',
      path: '/home',
      component: './Slave/Spole/Monitor',
    },
    {
      name: 'spole.mira',
      icon: 'icon-speaker',
      path: '/mira',
      component: './Slave/Spole/Mira',
      routes: [
        // {
        //   path: '/manager/mira',
        //   component: './Slave/Spole/Manager/Mira',
        // },
      ],
    },
    {
      name: 'spole.miva',
      icon: 'icon-led',
      path: '/miva',
      component: './Slave/Spole/Miva',
      routes: [
        // {
        //   path: '/manager/miva',
        //   component: './Slave/Spole/Manager/Miva',
        // },
      ],
    },
    {
      name: 'spole.traffic-light',
      icon: 'icon-traffic-light',
      path: '/traffic-light',
      component: './Slave/Spole/TrafficLight',
      routes: [
        // {
        //   path: '/manager/miva',
        //   component: './Slave/Spole/Manager/Miva',
        // },
      ],
    },
    {
      name: 'spole.street-light',
      icon: 'icon-street-light',
      path: '/street-light',
      component: './Slave/Spole/StreetLight',
      routes: [
        // {
        //   path: '/manager/miva',
        //   component: './Slave/Spole/Manager/Miva',
        // },
      ],
    },
    {
      name: 'spole.media',
      icon: 'icon-media-upload',
      path: '/media',
      component: './Slave/Spole/Media',
      routes: [
        // {
        //   path: '/manager/miva',
        //   component: './Slave/Spole/Manager/Miva',
        // },
      ],
    },
    {
      ...managerRouteBase,
      routes: [
        ...commonManagerRoutes,
        // {
        //   name: 'light',
        //   icon: 'icon-light',
        //   path: '/manager/light',
        //   routes: [
        //     {
        //       path: '/manager/light',
        //       component: './Slave/Spole/Manager/Light',
        //     },
        //   ],
        // },
      ],
    },
    {
      path: '/',
      redirect: '/home',
    },
    notFoundRoute,
  ],
});
