import React from "react";
import { Dashboard, Dns, DeviceHub, Build, Settings, Info } from "../../icons";

type MenuItem = {
  code: string;
  name: string;
  route: string;
  icon: React.ReactElement;
  order: number;
  subMenus?: MenuItem[];
};

type MenuSection = {
  order: number;
  items: MenuItem[];
};

type Menu = MenuSection[];

const menu: Menu = [
  {
    order: 0,
    items: [
      {
        code: "dashboard",
        name: "Menu.Dashboard",
        route: "/dashboard",
        icon: <Dashboard />,
        order: 0
      },
      {
        code: "machines",
        name: "Menu.Machines",
        route: "/machines",
        icon: <Dns />,
        order: 1
      },
      {
        code: "system",
        name: "Menu.System",
        route: "/system",
        icon: <DeviceHub />,
        order: 2
      }
    ]
  },
  {
    order: 1,
    items: [
      {
        code: "administration",
        name: "Menu.Administration",
        route: "/administration",
        icon: <Build />,
        order: 0,
        subMenus: [
          {
            code: "machines",
            name: "Menu.Machines",
            route: "/administration/machines",
            icon: <Build />,
            order: 0
          },
          {
            code: "agents",
            name: "Menu.Agents",
            route: "/administration/agents",
            icon: <Build />,
            order: 1
          }
        ]
      },
      {
        code: "settings",
        name: "Menu.Settings",
        route: "/settings",
        icon: <Settings />,
        order: 1
      }
    ]
  },
  {
    order: 2,
    items: [
      {
        code: "about",
        name: "Menu.About",
        route: "/about",
        icon: <Info />,
        order: 0
      }
    ]
  }
];

export type { MenuItem, MenuSection, Menu };
export { menu };
export default menu;
