refactor(notes): add shared types and component interfaces folders
This commit is contained in:
1 parent
10a888a089
commit
2975b80a94
5 files changed
+52
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user