const updateNote = (id: string, newText: any) => {
const notesList = notes()
const index = notesList.findIndex(note => note.id === id)
if (index !== -1) {
const oldNote = notesList[index]
console.log(newText)
oldNote.text = newText
console.log(oldNote)
const updatedNotes = [...notesList]
updatedNotes.splice(index, 1, oldNote)
setNotes(updatedNotes)
}
}
const updateNote = (id: string, newText: any) => {
const notesList = notes()
const index = notesList.findIndex(note => note.id === id)
if (index !== -1) {
const oldNote = notesList[index]
console.log(newText)
oldNote.text = newText
console.log(oldNote)
const updatedNotes = [...notesList]
updatedNotes.splice(index, 1, oldNote)
setNotes(updatedNotes)
}
}