display add table data #4

Merged
vipeesh.p merged 1 commits from feature/view-patient-data into develop 2023-09-07 07:06:46 +00:00
3 changed files with 34 additions and 7 deletions
Showing only changes of commit dfff86c491 - Show all commits

View File

@ -13,7 +13,27 @@ interface DataTableProps {
onAddRow: () => void;
}
const DataTable: React.FC= () => {
type Props={
handleFormSection5Data:(
generalHealth: string|undefined,
presentProblemBefore: string|undefined,
ifYespresentProblemBefore:string|undefined,
ifYestreatmentProvided: string|undefined,
ifYesOutcome: string|undefined,
strokeBloodclotting: string|undefined,
ifYesstrokeBloodclotting: string|undefined,
dizzinessFetigue: string|undefined,
ifyesdizzinessFetigue: string|undefined,
antiColligent: string|undefined,
injuriesHospitalization: string|undefined,
supplementsOrDrugs: string|undefined,
)=> void
patientDataDiplay:any;
type:string;
}
function DataTable({handleFormSection5Data,patientDataDiplay,type}:Props) {
const [illnessFromData, setIllnessFromData] = React.useState<any>({
id:0,date:'',illness:'',treatment:'',results:''
@ -48,14 +68,12 @@ const DataTable: React.FC= () => {
results: ''
});
}
};
console.log("sdfsdfdsf",illnessData, illnessFromData)
};
return (
<>
<FormLabel>If yes, Please enter the details below:</FormLabel><br></br>
{type!=="display"?
<FormControl>
<Grid container spacing={1.5} sx={{width:750, marginTop:1}}>
<Grid item xs={2} className='addNew-form-table-style'>
@ -120,6 +138,7 @@ const DataTable: React.FC= () => {
</Grid>
</FormControl>
:""}
<TableContainer sx={{width:800}} className='illness-table-style'>
@ -149,9 +168,12 @@ const DataTable: React.FC= () => {
{row.results}
</TableCell>
<TableCell align='left'>
<Button sx={{height:'30x',width:20, bgcolor:'skyblue'}} onClick={(e)=>{deleteIllnessData(row.id)}}>
{type!=="display"?
<Button sx={{height:'30x',width:20, bgcolor:'skyblue'}}
onClick={(e)=>{deleteIllnessData(row.id)}}>
Delete
</Button>
:""}
</TableCell>
</TableRow>
))}

View File

@ -281,7 +281,10 @@ export default function PastTreatment5({handleFormSection5Data,patientDataDiplay
</Grid>
<Grid item xs={12} sx={{marginLeft:2, marginBottom:3}} >
<Table />
<Table
handleFormSection5Data={handleFormSection5Data}
patientDataDiplay={patientDataDiplay}
type={type}/>
</Grid>
<Grid item xs={6} className='collapsable-form-style-multiline'>

View File

@ -388,6 +388,8 @@ export default function PatientForm({type}:Props){
//@ts-ignore
const patientData = localStorage.getItem('patientData') ? JSON.parse(localStorage.getItem('patientData')) : [];
console.log("dfsdfdsf",patientData)
return(
<>