import {MenuItem} from "~/types/layout";
import {MENU_LINK_TYPE} from "~/types/enum/layout";
import AbstractMenuBuilder from "~/services/layout/menuBuilder/abstractMenuBuilder";

/**
 * Menu Matériel
 */
export default class EquipmentMenuBuilder extends AbstractMenuBuilder {
  static readonly menuName = "Equipment"

  /**
   * Construit le menu Equipement ou null si aucune page accessible
   */
  build (): MenuItem | null  {
    if (this.ability.can('display', 'equipment_page')) {
      return this.createItem('equipment', {name: 'fas fa-cube'}, '/equipment/list/', MENU_LINK_TYPE.V1)
    }
    return null
  }
}
