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

/**
 * Menu Donneurs
 */
export default class DonorsMenuBuilder extends AbstractMenuBuilder {
  static readonly menuName = "Donors"

  /**
   * Construit le menu Partenariat et Dons, ou null si aucune page accessible
   */
  build (): MenuItem | null {
    if (this.ability.can('display', 'donors_page')) {
      return this.createItem('donors', {name: 'fas fa-handshake'}, '/donors/list/', MENU_LINK_TYPE.V1)
    }

    return null
  }
}
