display add table data
This commit is contained in:
parent
d8a25984fc
commit
dfff86c491
@ -13,7 +13,27 @@ interface DataTableProps {
|
|||||||
onAddRow: () => void;
|
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>({
|
const [illnessFromData, setIllnessFromData] = React.useState<any>({
|
||||||
id:0,date:'',illness:'',treatment:'',results:''
|
id:0,date:'',illness:'',treatment:'',results:''
|
||||||
@ -50,12 +70,10 @@ const DataTable: React.FC= () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("sdfsdfdsf",illnessData, illnessFromData)
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<FormLabel>If yes, Please enter the details below:</FormLabel><br></br>
|
<FormLabel>If yes, Please enter the details below:</FormLabel><br></br>
|
||||||
|
{type!=="display"?
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Grid container spacing={1.5} sx={{width:750, marginTop:1}}>
|
<Grid container spacing={1.5} sx={{width:750, marginTop:1}}>
|
||||||
<Grid item xs={2} className='addNew-form-table-style'>
|
<Grid item xs={2} className='addNew-form-table-style'>
|
||||||
@ -120,6 +138,7 @@ const DataTable: React.FC= () => {
|
|||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
:""}
|
||||||
|
|
||||||
|
|
||||||
<TableContainer sx={{width:800}} className='illness-table-style'>
|
<TableContainer sx={{width:800}} className='illness-table-style'>
|
||||||
@ -149,9 +168,12 @@ const DataTable: React.FC= () => {
|
|||||||
{row.results}
|
{row.results}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align='left'>
|
<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
|
Delete
|
||||||
</Button>
|
</Button>
|
||||||
|
:""}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -281,7 +281,10 @@ export default function PastTreatment5({handleFormSection5Data,patientDataDiplay
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid item xs={12} sx={{marginLeft:2, marginBottom:3}} >
|
<Grid item xs={12} sx={{marginLeft:2, marginBottom:3}} >
|
||||||
<Table />
|
<Table
|
||||||
|
handleFormSection5Data={handleFormSection5Data}
|
||||||
|
patientDataDiplay={patientDataDiplay}
|
||||||
|
type={type}/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid item xs={6} className='collapsable-form-style-multiline'>
|
<Grid item xs={6} className='collapsable-form-style-multiline'>
|
||||||
|
|||||||
@ -389,6 +389,8 @@ export default function PatientForm({type}:Props){
|
|||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
const patientData = localStorage.getItem('patientData') ? JSON.parse(localStorage.getItem('patientData')) : [];
|
const patientData = localStorage.getItem('patientData') ? JSON.parse(localStorage.getItem('patientData')) : [];
|
||||||
|
|
||||||
|
console.log("dfsdfdsf",patientData)
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<>
|
<>
|
||||||
{alertProps && alertProps.open && (
|
{alertProps && alertProps.open && (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user