feature/view-patient-data #7
@ -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)
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user