refactor: consolidate individual system pages into a single reusable StatusPage component

This commit is contained in:
Firman Ramdhani
2026-08-03 11:20:45 +07:00
parent bfea7e7773
commit 9e30c8a5e5
9 changed files with 174 additions and 172 deletions
@@ -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}>