import {
  capabilityToi18nKey,
  useCustomServerTranslation,
} from 'src/hooks/useCustomServerTranslation';
import { UserPermissions } from 'src/utils/permissions';

const useSessionsTitle = (
  defaultTranslationKey = `title_${UserPermissions.VIEW_LEARNING_SESSIONS}`,
) => {
  const getCustomTitle = useCustomServerTranslation();

  return getCustomTitle(
    capabilityToi18nKey(UserPermissions.VIEW_LEARNING_SESSIONS),
    defaultTranslationKey,
  );
};

export default useSessionsTitle;
