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

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

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

export default useCoursesTitle;
