forked from RiseUP/riseup-squad23
66 lines
2.3 KiB
JavaScript
66 lines
2.3 KiB
JavaScript
import React, { useState } from 'react';
|
|
import Sidebar from './components/Sidebar';
|
|
//import Header from './components/Header';
|
|
import Table from "./pages/Table";
|
|
|
|
import Inicio from './pages/Inicio';
|
|
import PatientCadastroManager from './pages/PatientCadastroManager';
|
|
import EditPage from './pages/EditPage';
|
|
import DoctorEditPage from './pages/DoctorEditPage';
|
|
|
|
import Details from './pages/Details';
|
|
import DoctorDetails from './pages/DoctorDetails';
|
|
|
|
import DoctorTable from './pages/DoctorTable';
|
|
import DoctorCadastroManager from './pages/DoctorCadastroManager';
|
|
import Agendamento from './pages/Agendamento'
|
|
|
|
import LaudoManager from "./pages/LaudoManager";
|
|
|
|
function App() {
|
|
const [isSidebarActive] = useState(true);
|
|
const [currentPage, setCurrentPage] = useState('Inicio');
|
|
const [patientID, setPatientID] = useState(null);
|
|
|
|
|
|
const renderPageContent = () => {
|
|
switch (currentPage) {
|
|
case 'Inicio':
|
|
return <Inicio setCurrentPage={setCurrentPage} />;
|
|
case 'agendamento':
|
|
return <Agendamento/>;
|
|
case 'form-layout':
|
|
return <PatientCadastroManager setCurrentPage={setCurrentPage}/>;
|
|
case 'doctor-form-layout':
|
|
return <DoctorCadastroManager />;
|
|
case 'table':
|
|
return <Table setCurrentPage={setCurrentPage} setPatientID={setPatientID} />;
|
|
case 'doctor-table':
|
|
return <DoctorTable setCurrentPage={setCurrentPage} setPatientID={setPatientID} />;
|
|
case 'details-page-paciente':
|
|
return <Details patientID={patientID} setCurrentPage={setCurrentPage} />;
|
|
case 'details-page-doctor':
|
|
return <DoctorDetails patientID={patientID} setCurrentPage={setCurrentPage} />;
|
|
case 'edit-page-paciente':
|
|
return <EditPage id={patientID} />;
|
|
case 'edit-page-doctor':
|
|
return <DoctorEditPage id={patientID} />;
|
|
case 'laudo-manager':
|
|
return <LaudoManager />;
|
|
default:
|
|
return <Inicio setCurrentPage={setCurrentPage} />;
|
|
}
|
|
};
|
|
|
|
return (
|
|
<div id="app" className={isSidebarActive ? 'active' : ''}>
|
|
<Sidebar isSidebarActive={isSidebarActive} setCurrentPage={setCurrentPage} />
|
|
<div id="main">
|
|
|
|
{renderPageContent()}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default App; |