import AbstractMenuBuilder from '~/services/layout/menuBuilder/abstractMenuBuilder'
import type { MenuGroup, MenuItems } from '~/types/layout'

/**
 * Menu Paramètres
 */
export default class ParametersMenuBuilder extends AbstractMenuBuilder {
  static readonly menuName = 'Parameters'

  /**
   * Construit le menu Header Configuration, ou null si aucune page accessible
   */
  build(): MenuGroup | null {
    // prettier-ignore
    const children: MenuItems = this.makeChildren([
      { pageName: 'parameters_general_page', icon: 'fas fa-gears' },
      { pageName: 'parameters_website_page', icon: 'fas fa-globe-americas' },
      { pageName: 'parameters_teaching_page', icon: 'fas fa-school' },
      { pageName: 'parameters_intranet_page', icon: 'fas fa-arrows-down-to-people' },
      { pageName: 'parameters_education_notation_page', icon: 'fas fa-graduation-cap' },
      { pageName: 'parameters_bulletin_page', icon: 'fas fa-file-lines' },
      { pageName: 'parameters_education_timings_page', icon: 'fas fa-clock' },
      { pageName: 'parameters_residence_areas_page', icon: 'fas fa-location-dot' },
      { pageName: 'parameters_attendances_page', icon: 'fas fa-user-times' },
      { pageName: 'parameters_sms_page', icon: 'fas fa-mobile' },
      { pageName: 'parameters_super_admin_page', icon: 'fas fa-user-gear' },
    ])

    if (children.length > 0) {
      return this.createGroup('parameters', undefined, children)
    }

    return null
  }
}
