import { h } from '@stencil/core';
import * as O from 'fp-ts/Option';
export const ManagePageRouteName = 'manage';
export const AddBenefitPageRouteName = 'manage/add';
export const EditBenefitPageRouteName = 'manage/edit';
export const AdminPageRouteName = 'admin';
export const renderManagePageRoutes = (signedInUserRole, baseUrl) => {
  const editorRoutes = [
    h("stencil-route", { url: `${baseUrl}/${AddBenefitPageRouteName}`, routeRender: (_props) => h("ap-ben-edit-benefit-page", null), exact: true }),
    h("stencil-route", { url: `${baseUrl}/${EditBenefitPageRouteName}/:benefitId`, routeRender: (props) => (h("ap-ben-edit-benefit-page", { benefitId: O.fromNullable(props.match.params['benefitId']) })), exact: true }),
    h("stencil-route", { url: `${baseUrl}/${ManagePageRouteName}/:match?`, routeRender: (props) => h("ap-ben-manage-page", Object.assign({}, props)) })
  ];
  const adminRoutes = [
    h("stencil-route", { url: `${baseUrl}/${AdminPageRouteName}`, routeRender: (_props) => h("ap-ben-role-management-page", null), exact: true })
  ];
  switch (signedInUserRole) {
    case 'accountAdmin':
      return editorRoutes.concat(adminRoutes);
    case 'accountEditor':
      return editorRoutes;
    default:
      return [];
  }
};
