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

/**
 * Menu Médailles
 */
export default class MedalsMenuBuilder extends AbstractMenuBuilder {
  static readonly menuName = "Medals"

  /**
   * Construit le menu Médailles et Dons, ou null si aucune page accessible
   */
  build (): MenuItem | null {
    if (this.ability.can('display', 'medals_page')) {
      return this.createItem('medals', {name: 'fas fa-trophy'}, '/medals/list/', MENU_LINK_TYPE.V1)
    }
    return null
  }
}
