feature/view-patient-data #7

Merged
vipeesh.p merged 14 commits from feature/view-patient-data into develop 2023-09-14 11:01:38 +00:00
Showing only changes of commit 18a31e4c2a - Show all commits

View File

@ -41,9 +41,11 @@ const PatientImageMarker = (props: Props) => {
};
useEffect(() => {
if (action.type === 'add')
setEntries([...entries, { index: entries.length + 1, severity: 5 }]);
else
if (action.type === 'add') {
const ind =
entries.length != 0 ? entries[entries.length - 1].index + 1 : 1;
setEntries([...entries, { index: ind, severity: 5 }]);
} else
setEntries(
entries.filter((entry: any, ind: number) => ind != action.index)
);