Merge branch 'fix/not-found-page-permission' into 'development'

[FIX/FE] Not Found Page

See merge request mbugroup/lti-web-client!301
This commit is contained in:
Rivaldi A N S
2026-02-03 05:06:11 +00:00
7 changed files with 33 additions and 30 deletions
+7 -1
View File
@@ -74,6 +74,8 @@ const MainDrawer = ({
const formattedPathname = pathname.endsWith('/') ? pathname : `${pathname}/`;
const isPathnameNotFoundPage = formattedPathname === '/404/';
const isPermitted = ROUTE_PERMISSIONS[formattedPathname]?.some((permission) =>
permissionCheck(permission)
);
@@ -82,10 +84,14 @@ const MainDrawer = ({
setMainDrawerOpen(!mainDrawerOpen);
};
if (!isPermitted) {
if (!isPermitted && !isPathnameNotFoundPage) {
return <PermissionNotFound />;
}
if (isPathnameNotFoundPage) {
return children;
}
return (
<Drawer
open={mainDrawerOpen}
+17
View File
@@ -0,0 +1,17 @@
import Button from '@/components/Button';
const PageNotFound = () => {
return (
<div className='w-full h-full flex-1 flex flex-col justify-center items-center gap-4'>
<h2 className='text-2xl font-bold text-error'>Halaman Tidak Ditemukan</h2>
<p className='text-gray-600 text-center'>
Halaman atau data yang anda cari tidak ditemukan.
</p>
<Button href='/dashboard' className='text-base-100'>
Kembali ke Dashboard
</Button>
</div>
);
};
export default PageNotFound;
@@ -190,8 +190,6 @@ const DailyMarketingsTable = ({
];
useEffect(() => {
// console.log({ sorting });
if (sorting.length === 1) {
onFilterByChange(sorting[0].id);
onSortByChange(sorting[0].desc ? 'desc' : 'asc');