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

+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
}