diff --git a/src/App.tsx b/src/App.tsx index 2d04ad2..e77d318 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -135,6 +135,61 @@ export default function App(): JSX.Element { setEditedTasks(items); } + const EditableList = ( + + + {(provided) => ( +
+ {editedTasks.map((item, index) => ( + + {(provided) => ( + + ) => { + handleTaskEdit(event.target.value, item.key) + }} + defaultValue={item.description} + fullWidth + sx={{ marginBottom: "0.5rem" }} + inputProps={{ + 'aria-label': 'Task description', + maxLength: task_input_limit + }} + /> + { + handleDeleteTask(item.key) + }} + > + + + + + + + )} + + ))} + {provided.placeholder} +
+ )} +
+
+ ); + return ( <> - - - - {(provided) => ( -
- {editedTasks.map((item, index) => ( - - {(provided) => ( -
- - ) => { - handleTaskEdit(event.target.value, item.key) - }} - defaultValue={item.description} - fullWidth - sx={{ marginBottom: "0.5rem" }} - inputProps={{ - 'aria-label': 'Task description', - maxLength: task_input_limit - }} - /> - { - handleDeleteTask(item.key) - }} - > - - - - - - -
- )} -
- ))} - {provided.placeholder} -
- )} -
-
+ { EditableList }