filter dokter only yang bisa merespkan
This commit is contained in:
@@ -19,6 +19,8 @@ export const accessGroup = {
|
|||||||
admin: ["/report/logs"]
|
admin: ["/report/logs"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const navConfig = [
|
const navConfig = [
|
||||||
// GENERAL
|
// GENERAL
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
@@ -124,7 +126,7 @@ const navConfig = [
|
|||||||
path: '/linking',
|
path: '/linking',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'E - PRESCRIPTION',
|
title: 'E-PRESCRIPTION',
|
||||||
path: '/e-prescription/live-chat',
|
path: '/e-prescription/live-chat',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import navConfig from './NavConfig';
|
|||||||
import NavbarDocs from './NavbarDocs';
|
import NavbarDocs from './NavbarDocs';
|
||||||
import NavbarAccount from './NavbarAccount';
|
import NavbarAccount from './NavbarAccount';
|
||||||
import CollapseButton from './CollapseButton';
|
import CollapseButton from './CollapseButton';
|
||||||
|
import useAuth from '@/hooks/useAuth';
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -42,6 +43,7 @@ export default function NavbarVertical({ isOpenSidebar, onCloseSidebar }: Props)
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
|
const {user} = useAuth()
|
||||||
|
|
||||||
const isDesktop = useResponsive('up', 'lg');
|
const isDesktop = useResponsive('up', 'lg');
|
||||||
|
|
||||||
@@ -55,6 +57,16 @@ export default function NavbarVertical({ isOpenSidebar, onCloseSidebar }: Props)
|
|||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [pathname]);
|
}, [pathname]);
|
||||||
|
|
||||||
|
const filteredItems = navConfig.filter(section => {
|
||||||
|
return section.items.some(item => {
|
||||||
|
return item.title === 'E-PRESCRIPTION';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const filteredData = filteredItems.map(section => ({
|
||||||
|
items: section.items.filter(item => item.title === "E-PRESCRIPTION")
|
||||||
|
}));
|
||||||
|
|
||||||
const renderContent = (
|
const renderContent = (
|
||||||
<Scrollbar
|
<Scrollbar
|
||||||
sx={{
|
sx={{
|
||||||
@@ -89,7 +101,7 @@ export default function NavbarVertical({ isOpenSidebar, onCloseSidebar }: Props)
|
|||||||
<NavbarAccount isCollapse={isCollapse} />
|
<NavbarAccount isCollapse={isCollapse} />
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<NavSectionVertical navConfig={navConfig} isCollapse={isCollapse} />
|
<NavSectionVertical navConfig={user.role_id == 5 ? filteredData : navConfig} isCollapse={isCollapse} />
|
||||||
|
|
||||||
<Box sx={{ flexGrow: 1 }} />
|
<Box sx={{ flexGrow: 1 }} />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user