update
This commit is contained in:
53
frontend/dashboard/src/pages/Report/Log/Show.tsx
Normal file
53
frontend/dashboard/src/pages/Report/Log/Show.tsx
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import { paramCase } from 'change-case';
|
||||||
|
import { useParams, useLocation } from 'react-router-dom';
|
||||||
|
// @mui
|
||||||
|
import { Container, Stack } from '@mui/material';
|
||||||
|
import useSettings from '../../../hooks/useSettings';
|
||||||
|
import Page from '../../../components/Page';
|
||||||
|
import View from './View';
|
||||||
|
import HeaderBreadcrumbs from '../../../components/HeaderBreadcrumbs';
|
||||||
|
import axios from '../../../utils/axios';
|
||||||
|
import { Appointment } from '../../../@types/doctor';
|
||||||
|
|
||||||
|
export default function Create() {
|
||||||
|
const { themeStretch } = useSettings();
|
||||||
|
const { id } = useParams();
|
||||||
|
|
||||||
|
const isEdit = id ? true : false;
|
||||||
|
|
||||||
|
const [currentAppointment, setCurrentAppointment] = useState<Appointment>();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isEdit) {
|
||||||
|
axios.get('/appointments/' + id).then((res) => {
|
||||||
|
setCurrentAppointment(res.data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [id]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page title="Appointment">
|
||||||
|
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||||
|
<Stack direction="row" alignItems="center">
|
||||||
|
<HeaderBreadcrumbs
|
||||||
|
heading={!isEdit ? 'Appointment' : 'Appointment'}
|
||||||
|
links={[
|
||||||
|
{ name: 'Report', href: '/report' },
|
||||||
|
{
|
||||||
|
name: 'Appointments',
|
||||||
|
href: '/report/appointments',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
<View
|
||||||
|
// isSubmitting={isSubmitting}
|
||||||
|
isEdit={isEdit}
|
||||||
|
currentAppointment={currentAppointment}
|
||||||
|
/>
|
||||||
|
</Container>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user