refactor(notes): add shared types and component interfaces folders

This commit is contained in:
devcodetools committed 2026-09-13 16:49:13 +02:00
1 parent 10a888a089
commit 2975b80a94
5 files changed
+52

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
export interface DeleteModalProps {
open: boolean
title: string
onConfirm: () => void
onCancel: () => void
}
+4
View File
@@ -0,0 +1,4 @@
export interface FloatingButtonProps {
onClick: () => void
label?: string
}
+29
View File
@@ -0,0 +1,29 @@
import type { Note, NotePatch } from '../types/note'
export type EditorMode = 'create' | 'edit'
export interface EditNoteEditorProps {
mode: 'edit'
note: Note
onUpdate: (id: number, patch: NotePatch) => void
onDelete: (id: number) => void
}
export interface CreateNoteEditorProps {
mode: 'create'
onCreate: (title: string, content: string) => void
onCancelCreate: () => void
}
export type NoteEditorProps = EditNoteEditorProps | CreateNoteEditorProps
export interface NoteFormProps {
title: string
content: string
titleMissing: boolean
cancelLabel: string
onTitleChange: (value: string) => void
onContentChange: (value: string) => void
onCancel: () => void
onSubmit: () => void
}
+6
View File
@@ -0,0 +1,6 @@
import type { Note } from '../types/note'
export interface NoteListProps {
notes: Note[]
onSelect: (id: number) => void
}
+7
View File
@@ -0,0 +1,7 @@
export interface Note {
id: number
title: string
content: string
}
export type NotePatch = Partial<Pick<Note, 'title' | 'content'>>