refactor: consolidate individual system pages into a single reusable StatusPage component
This commit is contained in:
@@ -19,7 +19,7 @@ import {
|
||||
EnterpriseModalContext,
|
||||
EnterpriseTranslationContext,
|
||||
} from '../hooks/use-module.context';
|
||||
import { Forbidden } from '../../../components';
|
||||
import { StatusPage } from '../../../components';
|
||||
import { useEnterpriseStorage } from '../hooks/enterprise-storage.context';
|
||||
import { defaultPrivileges, noPrivileges } from '../constant';
|
||||
|
||||
@@ -176,7 +176,19 @@ export function EnterpriseModuleProvider<
|
||||
|
||||
const { ALLOW_VIEW } = configSlice.privileges ?? {};
|
||||
|
||||
if (!ALLOW_VIEW) return <Forbidden homeUrl="/app" height={500} />;
|
||||
if (!ALLOW_VIEW) {
|
||||
return (
|
||||
<StatusPage
|
||||
title={t('common:systemPages.forbidden.title')}
|
||||
heading={t('common:systemPages.forbidden.heading')}
|
||||
description={t('common:systemPages.forbidden.description')}
|
||||
showActionsHome
|
||||
homeUrl="/app"
|
||||
homeButtonLabel={t('common:systemPages.actions.backToHome')}
|
||||
height={500}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<EnterpriseConfigContext.Provider value={configSlice}>
|
||||
|
||||
Reference in New Issue
Block a user