import React from "react";
import {
  HomeOutlined,
  UserOutlined,
  BlockOutlined,
  SettingOutlined,
  CarryOutOutlined,
  BarChartOutlined,
  MergeCellsOutlined,
} from "@ant-design/icons";

import { Inicio } from "../views/inicio";
import { Perfil } from "../views/perfil";
import { Timeline } from "../views/administracion/timeline";
import { EventoResumenDependencia, EventoResumenYager, EventoYager } from "../views/evento-yager";
import { NoEncontrado, NoAutorizado } from "../views/error";

import {
  EventosListado, 
  EventosDetalle,
  EventoDetalleGrupo,
  ResultadoGrupoEvento, 
  ResultadoEventoAccion, 
} from "../views/administracion/eventos";
import { 
  GruposListado, 
  GruposDetalle 
} from "../views/administracion/grupos";
import {
  UsuariosRedes,
  UsuariosDetalle,
  UsuariosListado,
} from "../views/administracion/usuarios";
import {
  Reportes,
  Felicitacion,
  SinParticipar,
  Individual,
  Comparativa,
  Evento,
  Dependencia
} from "../views/administracion/reportes";
import {
  Notificaciones
} from "../views/administracion/notificaciones";
import { 
  DependenciaDetalle, 
  DependenciasListado 
} from "../views/administracion/dependencias";

const singOutRoute = () => {
  return "Cargando...";
};

const sharedRoutes = [
  {
    path: "/no-autorizado",
    component: NoAutorizado,
  },
  {
    path: "/salir",
    component: singOutRoute,
  },
  {
    path: "*",
    component: NoEncontrado,
  },
];

const dashboardRoutes = [
  {
    layout: "dashboard",
    path: "/",
    name: "Inicio",
    icon: <HomeOutlined />,
    sidebar: "single",
    component: Inicio,
  },
  {
    layout: "dashboard",
    path: "/administracion",
    name: "Administración",
    icon: <SettingOutlined />,
    sidebar: "collapse",
    routes: [
      {
        layout: "dashboard",
        path: "/eventos",
        name: "Eventos",
        icon: <CarryOutOutlined />,
        sidebar: "single",
        routes: [
          {
            path: "/",
            name: "Eventos",
            component: EventosListado,
          },
          {
            path: "/nuevo",
            name: "Nuevo",
            component: EventosDetalle,
          },
          {
            path: "/detalle",
            name: "Editar",
            component: EventosDetalle,
          },
          {
            path: "/detalleGrupo",
            name: "Eventos por grupo",
            component: EventoDetalleGrupo,
          },
          {
            path: "/resultado-acciones",
            name: "Resultado por acciones",
            component: ResultadoEventoAccion,
          },
          {
            path: "/resultado-grupo-evento",
            name: "Resultado por grupo",
            component: ResultadoGrupoEvento,
          },
        ],
      },
      {
        layout: "dashboard",
        path: "/usuarios",
        name: "Usuarios",
        icon: <UserOutlined />,
        sidebar: "single",
        routes: [
          {
            path: "/",
            name: "Usuarios",
            component: UsuariosListado,
          },
          {
            path: "/nuevo",
            name: "Nuevo",
            component: UsuariosDetalle,
          },
          {
            path: "/detalle",
            name: "Editar",
            component: UsuariosDetalle,
          },
          {
            path: "/redes",
            name: "Usuarios: Redes sociales",
            component: UsuariosRedes,
          },
        ],
      },
      {
        layout: "dashboard",
        path: "/grupos",
        name: "Grupos",
        icon: <BlockOutlined />,
        sidebar: "single",
        routes: [
          {
            path: "/",
            name: "Grupos",
            component: GruposListado,
          },
          {
            path: "/nuevo",
            name: "Nuevo",
            component: GruposDetalle,
          },
          {
            path: "/detalle",
            name: "Editar",
            component: GruposDetalle,
          },
        ],
      },
      {
        layout: "dashboard",
        path: "/dependencias",
        name: "Dependencias",
        icon: <MergeCellsOutlined />,
        sidebar: "single",
        routes: [
          {
            path: "/",
            name: "Dependencias",
            component: DependenciasListado,
          },
          {
            path: "/nueva",
            name: "Nueva",
            component: DependenciaDetalle,
          },
          {
            path: "/detalle",
            name: "Editar",
            component: DependenciaDetalle,
          },
        ],
      },
      {
        layout: "dashboard",
        path: "/reportes",
        name: "Reportes",
        icon: <BarChartOutlined />,
        sidebar: "single",
        routes: [
          {
            path: "/",
            name: "Reportes",
            component: Reportes,
          },
          {
            path: "/sin-participar",
            name: "Sin participar",
            component: SinParticipar,
          },
          {
            path: "/felicitacion",
            name: "Felicitación",
            component: Felicitacion,
          },
          {
            path: "/individual",
            name: "Participación Individual",
            component: Individual,
          },
          {
            path: "/dependencia",
            name: "Participación por Dependencia",
            component: Dependencia,
          },
          {
            path: "/comparativa",
            name: "Participación Comparativa",
            component: Comparativa,
          },
          {
            path: "/evento",
            name: "Participación por Evento",
            component: Evento,
          }
        ]
      },
      {
        layout: "dashboard",
        path: "/timeline",
        name: "Timeline procesos",
        icon: <BlockOutlined />,
        sidebar: false,
        component: Timeline,
      },
      {
        layout: "dashboard",
        path: "/notificaciones",
        name: "Notificaciones",
        icon: <BlockOutlined />,
        sidebar: false,
        component: Notificaciones,
      },
    ],
  },
  {
    layout: "dashboard",
    path: "/perfil",
    name: "Perfil",
    icon: <UserOutlined />,
    sidebar: "single",
    component: Perfil,
  },
  {
    layout: "dashboard",
    path: "/evento-laud",
    name: "Evento Laud",
    icon: <HomeOutlined />,
    sidebar: false,
    component: EventoYager,
  },
  {
    layout: "dashboard",
    path: "/resumen-evento",
    name: "Resumen Evento",
    icon: <HomeOutlined />,
    sidebar: false,
    component: EventoResumenYager,
  },
  {
    layout: "dashboard",
    path: "/resumen-lider-dependencia",
    name: "Resumen Lider Dependencia",
    icon: <HomeOutlined />,
    sidebar: false,
    component: EventoResumenDependencia,
  },

  ...sharedRoutes,
];

const publicRoutes = [...sharedRoutes];

export { dashboardRoutes, publicRoutes };
