in Output/GPT4o_1120/JS/contextual_experiment/translate_to_react/1732190567/src/store/todoSlice.ts [24:33]
id: nanoid(),
title: action.payload,
completed: false,
};
state.todos.push(newTodo);
localStorage.setItem('todos-react', JSON.stringify(state.todos));
},
toggleTodo: (state, action: PayloadAction<string>) => {
const todo = state.todos.find((todo) => todo.id === action.payload);
if (todo) {