import * as icon from '@mdi/js';
import { MenuAsideItem } from './interfaces';

const menuAside: MenuAsideItem[] = [
  {
    href: '/command-center',
    // eslint-disable-next-line @typescript-eslint/ban-ts-comment
    // @ts-ignore
    icon: 'mdiShieldHomeOutline' in icon ? icon['mdiShieldHomeOutline' as keyof typeof icon] : icon.mdiViewDashboardOutline,
    label: 'Command Center',
  },
  {
    label: 'Operations',
    icon: icon.mdiClipboardTextOutline,
    permissions: [
      'READ_BOOKING_REQUESTS',
      'READ_APPROVAL_STEPS',
      'READ_RESERVATIONS',
      'READ_SERVICE_REQUESTS',
      'READ_INVOICES',
      'READ_DOCUMENTS',
    ],
    menu: [
      {
        href: '/booking_requests/booking_requests-list',
        label: 'Booking Requests',
        icon: icon.mdiClipboardTextOutline,
        permissions: 'READ_BOOKING_REQUESTS',
      },
      {
        href: '/approval_steps/approval_steps-list',
        label: 'Approvals',
        icon: icon.mdiCheckDecagram,
        permissions: 'READ_APPROVAL_STEPS',
      },
      {
        href: '/reservations/reservations-list',
        label: 'Reservations',
        icon: icon.mdiCalendarCheck,
        permissions: 'READ_RESERVATIONS',
      },
      {
        href: '/service_requests/service_requests-list',
        label: 'Service Requests',
        icon: icon.mdiRoomService,
        permissions: 'READ_SERVICE_REQUESTS',
      },
      {
        href: '/invoices/invoices-list',
        label: 'Invoices',
        icon: icon.mdiFileDocument,
        permissions: 'READ_INVOICES',
      },
      {
        href: '/documents/documents-list',
        label: 'Documents',
        // eslint-disable-next-line @typescript-eslint/ban-ts-comment
        // @ts-ignore
        icon: 'mdiPaperclip' in icon ? icon['mdiPaperclip' as keyof typeof icon] : icon.mdiFileDocument,
        permissions: 'READ_DOCUMENTS',
      },
    ],
  },
  {
    label: 'Portfolio',
    icon: icon.mdiHomeCity,
    permissions: [
      'READ_ORGANIZATIONS',
      'READ_PROPERTIES',
      'READ_UNITS',
      'READ_NEGOTIATED_RATES',
      'READ_UNIT_TYPES',
      'READ_AMENITIES',
    ],
    menu: [
      {
        href: '/organizations/organizations-list',
        label: 'Organizations',
        icon: icon.mdiOfficeBuildingOutline,
        permissions: 'READ_ORGANIZATIONS',
      },
      {
        href: '/properties/properties-list',
        label: 'Properties',
        icon: icon.mdiHomeCity,
        permissions: 'READ_PROPERTIES',
      },
      {
        href: '/units/units-list',
        label: 'Units',
        // eslint-disable-next-line @typescript-eslint/ban-ts-comment
        // @ts-ignore
        icon: 'mdiDoor' in icon ? icon['mdiDoor' as keyof typeof icon] : icon.mdiHomeCity,
        permissions: 'READ_UNITS',
      },
      {
        href: '/negotiated_rates/negotiated_rates-list',
        label: 'Negotiated Rates',
        // eslint-disable-next-line @typescript-eslint/ban-ts-comment
        // @ts-ignore
        icon: 'mdiTag' in icon ? icon['mdiTag' as keyof typeof icon] : icon.mdiFileDocument,
        permissions: 'READ_NEGOTIATED_RATES',
      },
    ],
  },
  {
    label: 'Administration',
    icon: icon.mdiAccountGroup,
    permissions: [
      'READ_USERS',
      'READ_ROLES',
      'READ_PERMISSIONS',
      'READ_NOTIFICATIONS',
      'READ_AUDIT_LOGS',
      'READ_JOB_RUNS',
    ],
    menu: [
      {
        href: '/users/users-list',
        label: 'Users',
        icon: icon.mdiAccountGroup,
        permissions: 'READ_USERS',
      },
      {
        href: '/roles/roles-list',
        label: 'Roles',
        // eslint-disable-next-line @typescript-eslint/ban-ts-comment
        // @ts-ignore
        icon: icon.mdiShieldAccountVariantOutline ?? icon.mdiAccountGroup,
        permissions: 'READ_ROLES',
      },
      {
        href: '/permissions/permissions-list',
        label: 'Permissions',
        // eslint-disable-next-line @typescript-eslint/ban-ts-comment
        // @ts-ignore
        icon: icon.mdiShieldAccountOutline ?? icon.mdiAccountGroup,
        permissions: 'READ_PERMISSIONS',
      },
      {
        href: '/notifications/notifications-list',
        label: 'Notifications',
        // eslint-disable-next-line @typescript-eslint/ban-ts-comment
        // @ts-ignore
        icon: 'mdiBell' in icon ? icon['mdiBell' as keyof typeof icon] : icon.mdiFileDocument,
        permissions: 'READ_NOTIFICATIONS',
      },
      {
        href: '/audit_logs/audit_logs-list',
        label: 'Audit Logs',
        // eslint-disable-next-line @typescript-eslint/ban-ts-comment
        // @ts-ignore
        icon: 'mdiClipboardPulse' in icon ? icon['mdiClipboardPulse' as keyof typeof icon] : icon.mdiClipboardTextOutline,
        permissions: 'READ_AUDIT_LOGS',
      },
      {
        href: '/job_runs/job_runs-list',
        label: 'Job Runs',
        icon: icon.mdiClockOutline,
        permissions: 'READ_JOB_RUNS',
      },
    ],
  },
  {
    href: '/profile',
    label: 'Profile',
    icon: icon.mdiAccountCircle,
    withDevider: true,
  },
  {
    href: '/api-docs',
    target: '_blank',
    label: 'Swagger API',
    icon: icon.mdiFileCode,
    permissions: 'READ_API_DOCS',
  },
];

export default menuAside;
