refactor(notes): use shared types and interfaces in components

This commit is contained in:
devcodetools committed 2026-09-13 16:49:14 +02:00
1 parent 2975b80a94
commit 557e48116a
12 files changed
+16 -57

No files matched your search

+2 -2
View File
@@ -1,5 +1,5 @@
import { useState } from 'react'
import type { Note } from './types'
import type { NotePatch } from './types/note'
import { useNotes } from './hooks/useNotes'
import NoteList from './components/NoteList'
import NoteEditor from './components/NoteEditor'
@@ -21,7 +21,7 @@ function App() {
setCreating(false)
}
const handleUpdate = (id: number, patch: Partial<Pick<Note, 'title' | 'content'>>) => {
const handleUpdate = (id: number, patch: NotePatch) => {
updateNote(id, patch)
setSelectedId(null)
}