✨ empty-state CTAs and save flash banners
Browse files at this commitf1d34524f55ae2241aade905eadb3bf40a7d5ba5Parent: d6c0195- feat
- ✨ empty-state CTAs and save flash banners
9 changed files +155 -21
- src/components/notes/note-list.tsx +10 -5
- src/components/ui/alert.tsx +6 -4
- src/components/ui/empty-state.tsx +28 -0
- src/i18n/messages.ts +9 -0
- src/lib/flash.ts +13 -0
- src/pages/courses-page.tsx +24 -2
- src/pages/events-page.tsx +18 -3
- src/pages/exams-page.tsx +25 -2
- src/pages/notes-page.tsx +22 -5
src/components/notes/note-list.tsxmodified+10 -5
| @@ -1,11 +1,14 @@ | ||
| 1 | -import { For, Show, createSignal } from "solid-js"; | |
| 1 | +import { For, Show, createSignal, type JSX } from "solid-js"; | |
| 2 | 2 | import type { Note } from "@/api/types"; |
| 3 | 3 | import { NoteCard } from "@/components/notes/note-card"; |
| 4 | 4 | import { NoteReaderPanel } from "@/components/notes/note-reader-panel"; |
| 5 | +import { EmptyState } from "@/components/ui/empty-state"; | |
| 5 | 6 | |
| 6 | 7 | export function NoteList(props: { |
| 7 | 8 | notes: Note[]; |
| 8 | - emptyLabel?: string; | |
| 9 | + emptyTitle: string; | |
| 10 | + emptyDescription?: string; | |
| 11 | + emptyAction?: JSX.Element; | |
| 9 | 12 | onUpdate: (id: string, values: { title: string; content: string }) => Promise<void>; |
| 10 | 13 | onDelete: (id: string) => Promise<void>; |
| 11 | 14 | }) { |
| @@ -16,9 +19,11 @@ export function NoteList(props: { | ||
| 16 | 19 | <Show |
| 17 | 20 | when={props.notes.length > 0} |
| 18 | 21 | fallback={ |
| 19 | - <div class="flex min-h-[12rem] items-center justify-center rounded-lg border border-dashed border-border/80 bg-muted/20 px-6 text-center text-sm text-muted-foreground"> | |
| 20 | - {props.emptyLabel ?? ""} | |
| 21 | - </div> | |
| 22 | + <EmptyState | |
| 23 | + title={props.emptyTitle} | |
| 24 | + description={props.emptyDescription} | |
| 25 | + action={props.emptyAction} | |
| 26 | + /> | |
| 22 | 27 | } |
| 23 | 28 | > |
| 24 | 29 | <ul class="grid grid-cols-2 gap-3 xl:grid-cols-3"> |
src/components/ui/alert.tsxmodified+6 -4
| @@ -2,16 +2,18 @@ import type { ComponentProps, ParentProps } from "solid-js"; | ||
| 2 | 2 | import { splitProps } from "solid-js"; |
| 3 | 3 | import { cn } from "@/lib/cn"; |
| 4 | 4 | |
| 5 | -export function Alert(props: ParentProps<ComponentProps<"div"> & { variant?: "default" | "destructive" }>) { | |
| 5 | +export function Alert( | |
| 6 | + props: ParentProps<ComponentProps<"div"> & { variant?: "default" | "destructive" | "success" }>, | |
| 7 | +) { | |
| 6 | 8 | const [local, rest] = splitProps(props, ["class", "children", "variant"]); |
| 7 | 9 | return ( |
| 8 | 10 | <div |
| 9 | 11 | role="alert" |
| 10 | 12 | class={cn( |
| 11 | 13 | "relative w-full rounded-md border px-4 py-3 text-sm shadow-sm", |
| 12 | - local.variant === "destructive" | |
| 13 | - ? "border-destructive/30 bg-destructive/10 text-destructive" | |
| 14 | - : "bg-background text-foreground", | |
| 14 | + local.variant === "destructive" && "border-destructive/30 bg-destructive/10 text-destructive", | |
| 15 | + local.variant === "success" && "border-emerald-600/30 bg-emerald-600/10 text-emerald-800 dark:text-emerald-300", | |
| 16 | + (!local.variant || local.variant === "default") && "bg-background text-foreground", | |
| 15 | 17 | local.class, |
| 16 | 18 | )} |
| 17 | 19 | {...rest} |
src/components/ui/empty-state.tsxadded+28 -0
| @@ -0,0 +1,28 @@ | ||
| 1 | +import type { JSX } from "solid-js"; | |
| 2 | +import { Show } from "solid-js"; | |
| 3 | +import { cn } from "@/lib/cn"; | |
| 4 | + | |
| 5 | +/** Dashed empty panel with optional primary action. */ | |
| 6 | +export function EmptyState(props: { | |
| 7 | + title: string; | |
| 8 | + description?: string; | |
| 9 | + action?: JSX.Element; | |
| 10 | + class?: string; | |
| 11 | +}) { | |
| 12 | + return ( | |
| 13 | + <div | |
| 14 | + class={cn( | |
| 15 | + "flex min-h-[12rem] flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border/80 bg-muted/20 px-6 py-10 text-center", | |
| 16 | + props.class, | |
| 17 | + )} | |
| 18 | + > | |
| 19 | + <p class="text-sm font-medium text-foreground">{props.title}</p> | |
| 20 | + <Show when={props.description}> | |
| 21 | + <p class="max-w-sm text-sm leading-6 text-muted-foreground">{props.description}</p> | |
| 22 | + </Show> | |
| 23 | + <Show when={props.action}> | |
| 24 | + <div class="pt-1">{props.action}</div> | |
| 25 | + </Show> | |
| 26 | + </div> | |
| 27 | + ); | |
| 28 | +} |
src/i18n/messages.tsmodified+9 -0
| @@ -77,6 +77,9 @@ export type MessageKey = | ||
| 77 | 77 | | "common.searchPlaceholder" |
| 78 | 78 | | "common.all" |
| 79 | 79 | | "common.saveAttendance" |
| 80 | + | "common.created" | |
| 81 | + | "common.deleted" | |
| 82 | + | "common.saved" | |
| 80 | 83 | | "theme.light" |
| 81 | 84 | | "theme.dark" |
| 82 | 85 | | "theme.toggle" |
| @@ -618,6 +621,9 @@ const en: Dict = { | ||
| 618 | 621 | "common.searchPlaceholder": "Search…", |
| 619 | 622 | "common.all": "All", |
| 620 | 623 | "common.saveAttendance": "Save my attendance", |
| 624 | + "common.created": "Created.", | |
| 625 | + "common.deleted": "Deleted.", | |
| 626 | + "common.saved": "Saved.", | |
| 621 | 627 | "theme.light": "Light", |
| 622 | 628 | "theme.dark": "Dark", |
| 623 | 629 | "theme.toggle": "Toggle theme", |
| @@ -1171,6 +1177,9 @@ const tr: Dict = { | ||
| 1171 | 1177 | "common.searchPlaceholder": "Ara…", |
| 1172 | 1178 | "common.all": "Tümü", |
| 1173 | 1179 | "common.saveAttendance": "Yoklamamı kaydet", |
| 1180 | + "common.created": "Oluşturuldu.", | |
| 1181 | + "common.deleted": "Silindi.", | |
| 1182 | + "common.saved": "Kaydedildi.", | |
| 1174 | 1183 | "theme.light": "Açık", |
| 1175 | 1184 | "theme.dark": "Koyu", |
| 1176 | 1185 | "theme.toggle": "Tema", |
src/lib/flash.tsadded+13 -0
| @@ -0,0 +1,13 @@ | ||
| 1 | +import { createEffect, createSignal, onCleanup, type Accessor, type Setter } from "solid-js"; | |
| 2 | + | |
| 3 | +/** Short-lived success banner; auto-clears after `ms` (default 3s). */ | |
| 4 | +export function createFlash(ms = 3000): [Accessor<string>, Setter<string>] { | |
| 5 | + const [message, setMessage] = createSignal(""); | |
| 6 | + createEffect(() => { | |
| 7 | + const text = message(); | |
| 8 | + if (!text) return; | |
| 9 | + const id = window.setTimeout(() => setMessage(""), ms); | |
| 10 | + onCleanup(() => window.clearTimeout(id)); | |
| 11 | + }); | |
| 12 | + return [message, setMessage]; | |
| 13 | +} |
src/pages/courses-page.tsxmodified+24 -2
| @@ -12,7 +12,8 @@ import { RouteGuard } from "@/components/layout/route-guard"; | ||
| 12 | 12 | import { PageHeader } from "@/components/layout/page-header"; |
| 13 | 13 | import { Badge } from "@/components/ui/badge"; |
| 14 | 14 | import { Button } from "@/components/ui/button"; |
| 15 | -import { DataTableEmpty, DataTableFrame, DataTableSkeleton } from "@/components/ui/data-table"; | |
| 15 | +import { DataTableFrame, DataTableSkeleton } from "@/components/ui/data-table"; | |
| 16 | +import { EmptyState } from "@/components/ui/empty-state"; | |
| 16 | 17 | import { DataToolbar } from "@/components/ui/data-toolbar"; |
| 17 | 18 | import { IconEye, IconPlus } from "@/components/ui/icons"; |
| 18 | 19 | import { Input } from "@/components/ui/input"; |
| @@ -23,6 +24,7 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@ | ||
| 23 | 24 | import { TableRowActions } from "@/components/ui/table-row-actions"; |
| 24 | 25 | import { Textarea } from "@/components/ui/textarea"; |
| 25 | 26 | import { PaginationControls } from "@/components/ui/pagination-controls"; |
| 27 | +import { createFlash } from "@/lib/flash"; | |
| 26 | 28 | import { loadListPage, totalPages as pagesOf } from "@/lib/list-page"; |
| 27 | 29 | import { useAuth } from "@/stores/auth-context"; |
| 28 | 30 | import { useT } from "@/stores/preferences-context"; |
| @@ -49,6 +51,7 @@ function CoursesContent() { | ||
| 49 | 51 | const [kind, setKind] = createSignal<CourseKind>("course"); |
| 50 | 52 | const [termId, setTermId] = createSignal(""); |
| 51 | 53 | const [error, setError] = createSignal(""); |
| 54 | + const [flash, setFlash] = createFlash(); | |
| 52 | 55 | const [pending, setPending] = createSignal(false); |
| 53 | 56 | const [query, setQuery] = createSignal(""); |
| 54 | 57 | const [termFilter, setTermFilter] = createSignal("all"); |
| @@ -128,6 +131,7 @@ function CoursesContent() { | ||
| 128 | 131 | setTermId(""); |
| 129 | 132 | setShowForm(false); |
| 130 | 133 | await refetch(); |
| 134 | + setFlash(t("common.created")); | |
| 131 | 135 | } catch (err) { |
| 132 | 136 | setError(formatApiError(err)); |
| 133 | 137 | } finally { |
| @@ -221,11 +225,29 @@ function CoursesContent() { | ||
| 221 | 225 | } |
| 222 | 226 | /> |
| 223 | 227 | |
| 228 | + <Show when={flash()}> | |
| 229 | + <Alert variant="success">{flash()}</Alert> | |
| 230 | + </Show> | |
| 224 | 231 | <Suspense fallback={<DataTableSkeleton columns={5} rows={8} />}> |
| 225 | 232 | <Show when={list.error}> |
| 226 | 233 | <Alert variant="destructive">{formatApiError(list.error)}</Alert> |
| 227 | 234 | </Show> |
| 228 | - <Show when={pageItems().length > 0} fallback={<DataTableEmpty>{t("courses.empty")}</DataTableEmpty>}> | |
| 235 | + <Show | |
| 236 | + when={pageItems().length > 0} | |
| 237 | + fallback={ | |
| 238 | + <EmptyState | |
| 239 | + title={t("courses.empty")} | |
| 240 | + action={ | |
| 241 | + canCreate() ? ( | |
| 242 | + <Button type="button" size="sm" class="rounded-lg" onClick={() => setShowForm(true)}> | |
| 243 | + <IconPlus class="h-4 w-4" /> | |
| 244 | + {t("courses.create")} | |
| 245 | + </Button> | |
| 246 | + ) : undefined | |
| 247 | + } | |
| 248 | + /> | |
| 249 | + } | |
| 250 | + > | |
| 229 | 251 | <div class="space-y-4"> |
| 230 | 252 | <div class="flex flex-wrap items-center justify-between gap-3"> |
| 231 | 253 | <div> |
src/pages/events-page.tsxmodified+18 -3
| @@ -10,11 +10,13 @@ import { EventForm } from "@/components/events/event-form"; | ||
| 10 | 10 | import { RouteGuard } from "@/components/layout/route-guard"; |
| 11 | 11 | import { PageHeader } from "@/components/layout/page-header"; |
| 12 | 12 | import { DataToolbar } from "@/components/ui/data-toolbar"; |
| 13 | +import { EmptyState } from "@/components/ui/empty-state"; | |
| 13 | 14 | import { IconPlus } from "@/components/ui/icons"; |
| 14 | 15 | import { PageSpinner } from "@/components/ui/page-spinner"; |
| 15 | 16 | import { PaginationControls } from "@/components/ui/pagination-controls"; |
| 16 | 17 | import { Select } from "@/components/ui/select"; |
| 17 | 18 | import { SidePanel } from "@/components/ui/side-panel"; |
| 19 | +import { createFlash } from "@/lib/flash"; | |
| 18 | 20 | import { formatDateTime } from "@/lib/format"; |
| 19 | 21 | import { loadListPage, totalPages as pagesOf } from "@/lib/list-page"; |
| 20 | 22 | import { hasMinRole } from "@/lib/roles"; |
| @@ -36,6 +38,7 @@ function EventsContent() { | ||
| 36 | 38 | const { locale } = usePreferences(); |
| 37 | 39 | const t = useT(); |
| 38 | 40 | const [error, setError] = createSignal(""); |
| 41 | + const [flash, setFlash] = createFlash(); | |
| 39 | 42 | const [showForm, setShowForm] = createSignal(false); |
| 40 | 43 | const [query, setQuery] = createSignal(""); |
| 41 | 44 | const [timeFilter, setTimeFilter] = createSignal("all"); |
| @@ -120,6 +123,7 @@ function EventsContent() { | ||
| 120 | 123 | await postEvent(body); |
| 121 | 124 | setShowForm(false); |
| 122 | 125 | await refetch(); |
| 126 | + setFlash(t("common.created")); | |
| 123 | 127 | } catch (err) { |
| 124 | 128 | setError(formatApiError(err)); |
| 125 | 129 | throw err; |
| @@ -128,6 +132,9 @@ function EventsContent() { | ||
| 128 | 132 | /> |
| 129 | 133 | </SidePanel> |
| 130 | 134 | |
| 135 | + <Show when={flash()}> | |
| 136 | + <Alert variant="success">{flash()}</Alert> | |
| 137 | + </Show> | |
| 131 | 138 | {error() && <p class="text-sm text-destructive">{error()}</p>} |
| 132 | 139 | |
| 133 | 140 | <section class="data-shell space-y-4 p-4"> |
| @@ -163,9 +170,17 @@ function EventsContent() { | ||
| 163 | 170 | <Show |
| 164 | 171 | when={pageItems().length > 0} |
| 165 | 172 | fallback={ |
| 166 | - <div class="rounded-sm border border-dashed border-border bg-muted/20 px-6 py-16 text-center text-sm text-muted-foreground"> | |
| 167 | - {t("events.empty")} | |
| 168 | - </div> | |
| 173 | + <EmptyState | |
| 174 | + title={t("events.empty")} | |
| 175 | + action={ | |
| 176 | + canCreate() ? ( | |
| 177 | + <Button type="button" size="sm" class="rounded-lg" onClick={() => setShowForm(true)}> | |
| 178 | + <IconPlus class="h-4 w-4" /> | |
| 179 | + {t("events.create")} | |
| 180 | + </Button> | |
| 181 | + ) : undefined | |
| 182 | + } | |
| 183 | + /> | |
| 169 | 184 | } |
| 170 | 185 | > |
| 171 | 186 | <div class="space-y-4"> |
src/pages/exams-page.tsxmodified+25 -2
| @@ -13,7 +13,8 @@ import { PageHeader } from "@/components/layout/page-header"; | ||
| 13 | 13 | import { Alert } from "@/components/ui/alert"; |
| 14 | 14 | import { Badge } from "@/components/ui/badge"; |
| 15 | 15 | import { Button } from "@/components/ui/button"; |
| 16 | -import { DataTableEmpty, DataTableFrame, DataTableSkeleton } from "@/components/ui/data-table"; | |
| 16 | +import { DataTableFrame, DataTableSkeleton } from "@/components/ui/data-table"; | |
| 17 | +import { EmptyState } from "@/components/ui/empty-state"; | |
| 17 | 18 | import { DataToolbar } from "@/components/ui/data-toolbar"; |
| 18 | 19 | import { IconEdit, IconEye, IconPlus } from "@/components/ui/icons"; |
| 19 | 20 | import { PaginationControls } from "@/components/ui/pagination-controls"; |
| @@ -23,6 +24,7 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@ | ||
| 23 | 24 | import { TableRowActions } from "@/components/ui/table-row-actions"; |
| 24 | 25 | import { createNow } from "@/lib/create-now"; |
| 25 | 26 | import { examKindLabel } from "@/lib/exam-labels"; |
| 27 | +import { createFlash } from "@/lib/flash"; | |
| 26 | 28 | import { formatDateTime } from "@/lib/format"; |
| 27 | 29 | import { loadListPage, totalPages as pagesOf } from "@/lib/list-page"; |
| 28 | 30 | import { hasMinRole } from "@/lib/roles"; |
| @@ -56,6 +58,7 @@ function ExamsContent() { | ||
| 56 | 58 | const [selectedCourseId, setSelectedCourseId] = createSignal(""); |
| 57 | 59 | const [editingExam, setEditingExam] = createSignal<Exam | null>(null); |
| 58 | 60 | const [page, setPage] = createSignal(0); |
| 61 | + const [flash, setFlash] = createFlash(); | |
| 59 | 62 | |
| 60 | 63 | const [courses] = createResource( |
| 61 | 64 | () => (auth.user()?.role && auth.user()?.role !== "student" ? true : null), |
| @@ -160,6 +163,7 @@ function ExamsContent() { | ||
| 160 | 163 | }); |
| 161 | 164 | setCreateOpen(false); |
| 162 | 165 | await refetchExams(); |
| 166 | + setFlash(t("common.created")); | |
| 163 | 167 | }; |
| 164 | 168 | |
| 165 | 169 | const updateExam = async (values: ExamFormValues) => { |
| @@ -168,6 +172,7 @@ function ExamsContent() { | ||
| 168 | 172 | await patchExamById(exam.id, values); |
| 169 | 173 | setEditingExam(null); |
| 170 | 174 | await refetchExams(); |
| 175 | + setFlash(t("common.saved")); | |
| 171 | 176 | }; |
| 172 | 177 | |
| 173 | 178 | return ( |
| @@ -238,11 +243,29 @@ function ExamsContent() { | ||
| 238 | 243 | } |
| 239 | 244 | /> |
| 240 | 245 | |
| 246 | + <Show when={flash()}> | |
| 247 | + <Alert variant="success">{flash()}</Alert> | |
| 248 | + </Show> | |
| 241 | 249 | <Suspense fallback={<DataTableSkeleton columns={6} rows={8} />}> |
| 242 | 250 | <Show when={list.error}> |
| 243 | 251 | <Alert variant="destructive">{formatApiError(list.error)}</Alert> |
| 244 | 252 | </Show> |
| 245 | - <Show when={pageItems().length > 0} fallback={<DataTableEmpty>{t("exams.empty")}</DataTableEmpty>}> | |
| 253 | + <Show | |
| 254 | + when={pageItems().length > 0} | |
| 255 | + fallback={ | |
| 256 | + <EmptyState | |
| 257 | + title={t("exams.empty")} | |
| 258 | + action={ | |
| 259 | + canCreate() ? ( | |
| 260 | + <Button type="button" size="sm" class="rounded-lg" onClick={() => setCreateOpen(true)}> | |
| 261 | + <IconPlus class="h-4 w-4" /> | |
| 262 | + {t("exams.create")} | |
| 263 | + </Button> | |
| 264 | + ) : undefined | |
| 265 | + } | |
| 266 | + /> | |
| 267 | + } | |
| 268 | + > | |
| 246 | 269 | <DataTableFrame> |
| 247 | 270 | <Table class="data-table table-fixed min-w-[64rem]"> |
| 248 | 271 | <colgroup> |
src/pages/notes-page.tsxmodified+22 -5
| @@ -15,6 +15,7 @@ import { IconPlus } from "@/components/ui/icons"; | ||
| 15 | 15 | import { PageSpinner } from "@/components/ui/page-spinner"; |
| 16 | 16 | import { PaginationControls } from "@/components/ui/pagination-controls"; |
| 17 | 17 | import { SidePanel } from "@/components/ui/side-panel"; |
| 18 | +import { createFlash } from "@/lib/flash"; | |
| 18 | 19 | import { loadListPage, totalPages as pagesOf } from "@/lib/list-page"; |
| 19 | 20 | import { useT } from "@/stores/preferences-context"; |
| 20 | 21 | |
| @@ -31,6 +32,7 @@ export default function NotesPage() { | ||
| 31 | 32 | function NotesContent() { |
| 32 | 33 | const t = useT(); |
| 33 | 34 | const [error, setError] = createSignal(""); |
| 35 | + const [flash, setFlash] = createFlash(); | |
| 34 | 36 | const [createOpen, setCreateOpen] = createSignal(false); |
| 35 | 37 | const [page, setPage] = createSignal(0); |
| 36 | 38 | |
| @@ -50,11 +52,12 @@ function NotesContent() { | ||
| 50 | 52 | const totalPages = createMemo(() => pagesOf(total(), NOTE_PAGE_SIZE)); |
| 51 | 53 | const safePage = createMemo(() => Math.min(page(), totalPages() - 1)); |
| 52 | 54 | |
| 53 | - const wrap = async (fn: () => Promise<void>) => { | |
| 55 | + const wrap = async (fn: () => Promise<void>, okMessage: string) => { | |
| 54 | 56 | setError(""); |
| 55 | 57 | try { |
| 56 | 58 | await fn(); |
| 57 | 59 | await refetch(); |
| 60 | + setFlash(okMessage); | |
| 58 | 61 | } catch (err) { |
| 59 | 62 | setError(formatApiError(err)); |
| 60 | 63 | } |
| @@ -101,13 +104,20 @@ function NotesContent() { | ||
| 101 | 104 | } |
| 102 | 105 | await refetch(); |
| 103 | 106 | setCreateOpen(false); |
| 104 | - if (failedUploads > 0) setError(t("notes.fileUploadPartial", { count: failedUploads })); | |
| 107 | + if (failedUploads > 0) { | |
| 108 | + setError(t("notes.fileUploadPartial", { count: failedUploads })); | |
| 109 | + return; | |
| 110 | + } | |
| 111 | + setFlash(t("common.created")); | |
| 105 | 112 | }} |
| 106 | 113 | /> |
| 107 | 114 | </SidePanel> |
| 108 | 115 | |
| 109 | 116 | <div class="space-y-5"> |
| 110 | 117 | <section class="min-w-0 space-y-4"> |
| 118 | + <Show when={flash()}> | |
| 119 | + <Alert variant="success">{flash()}</Alert> | |
| 120 | + </Show> | |
| 111 | 121 | {error() && <p class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive">{error()}</p>} |
| 112 | 122 | <Suspense fallback={<PageSpinner />}> |
| 113 | 123 | <Show when={list.error}> |
| @@ -116,16 +126,23 @@ function NotesContent() { | ||
| 116 | 126 | <Show when={list()}> |
| 117 | 127 | <NoteList |
| 118 | 128 | notes={pageItems()} |
| 119 | - emptyLabel={t("notes.empty")} | |
| 129 | + emptyTitle={t("dashboard.emptyNotesTitle")} | |
| 130 | + emptyDescription={t("notes.empty")} | |
| 131 | + emptyAction={ | |
| 132 | + <Button type="button" size="sm" class="rounded-lg" onClick={() => setCreateOpen(true)}> | |
| 133 | + <IconPlus class="h-4 w-4" /> | |
| 134 | + {t("notes.new")} | |
| 135 | + </Button> | |
| 136 | + } | |
| 120 | 137 | onUpdate={(id, values) => |
| 121 | 138 | wrap(async () => { |
| 122 | 139 | await patchNoteById(id, values); |
| 123 | - }) | |
| 140 | + }, t("common.saved")) | |
| 124 | 141 | } |
| 125 | 142 | onDelete={(id) => |
| 126 | 143 | wrap(async () => { |
| 127 | 144 | await deleteNoteById(id); |
| 128 | - }) | |
| 145 | + }, t("common.deleted")) | |
| 129 | 146 | } |
| 130 | 147 | /> |
| 131 | 148 | <Show when={total() > NOTE_PAGE_SIZE}> |