menambahkan halaman awal untuk setiap menu sidebar
This commit is contained in:
31
src/pages/shiftManagement/schedule/IndexSchedule.jsx
Normal file
31
src/pages/shiftManagement/schedule/IndexSchedule.jsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import React, { memo, useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useBreadcrumb } from '../../../layout/LayoutBreadcrumb';
|
||||
import { Typography } from 'antd';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
const IndexSchedule = memo(function IndexSchedule() {
|
||||
const navigate = useNavigate();
|
||||
const { setBreadcrumbItems } = useBreadcrumb();
|
||||
|
||||
useEffect(() => {
|
||||
const token = localStorage.getItem('token');
|
||||
if (token) {
|
||||
setBreadcrumbItems([
|
||||
{ title: <Text strong style={{ fontSize: '14px' }}>• Manajemen Shift</Text> },
|
||||
{ title: <Text strong style={{ fontSize: '14px' }}>Jadwal Shift</Text> }
|
||||
]);
|
||||
} else {
|
||||
navigate('/signin');
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1>Jadwal Shift Page</h1>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
export default IndexSchedule;
|
||||
Reference in New Issue
Block a user