diff --git a/src/components/notes/note-form.tsx b/src/components/notes/note-form.tsx index ec5783e..e77337d 100644 --- a/src/components/notes/note-form.tsx +++ b/src/components/notes/note-form.tsx @@ -1,16 +1,20 @@ -import { For, Show, createResource, createSignal } from "solid-js"; +import { For, Show, Suspense, createResource, createSignal, lazy } from "solid-js"; import { formatApiError } from "@/api/client"; import { getSettings } from "@/api/settings"; import type { Note } from "@/api/client"; import { Button } from "@/components/ui/button"; import { ConfirmDialog } from "@/components/ui/confirm-dialog"; -import { IconPlus, IconTrash } from "@/components/ui/icons"; +import { FormDialog } from "@/components/ui/form-dialog"; +import { IconEdit, IconPlus, IconTrash } from "@/components/ui/icons"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; +import { PageSpinner } from "@/components/ui/page-spinner"; import { Textarea } from "@/components/ui/textarea"; import { formatBytes, maxUploadBytes } from "@/lib/upload-limits"; import { useT } from "@/stores/preferences-context"; +const DrawCanvas = lazy(() => import("@/components/ui/draw-canvas").then((m) => ({ default: m.DrawCanvas }))); + export type NoteFormValues = { title: string; content: string; @@ -36,6 +40,7 @@ export function NoteForm(props: { const [error, setError] = createSignal(""); const [pending, setPending] = createSignal(false); const [confirmOpen, setConfirmOpen] = createSignal(false); + const [drawOpen, setDrawOpen] = createSignal(false); const [pendingValues, setPendingValues] = createSignal(null); const [settings] = createResource(async () => { try { @@ -147,17 +152,29 @@ export function NoteForm(props: { disabled={pending() || files().length >= MAX_NOTE_FILES} onChange={(event) => addFile(event.currentTarget.files?.[0])} /> - +
+ + +
0} @@ -207,6 +224,23 @@ export function NoteForm(props: { + + }> + { + addFile(file); + setDrawOpen(false); + }} + /> + + +
-