- ZIP download from the Merkzettel: every photo is a new usage by default; only already downloaded photos offer "Neu / Bereits genutzt" (SegmentedControl), with thumbnails and a cost summary. "Bild auslassen" is gone. - Toasts (Sakani Toaster) for admin saves, deletes and errors; billing errors are readable and use router.refresh instead of reloads. Errors inside modal dialogs stay inline (a toast would sit behind the backdrop). - Album overview in blog-listing style, Sakani Pagination for albums, search and usage history, skeleton loading states. - Registration stepper; verification mail lands on step 3. - Editorials as a searchable, filterable table; audit log with event picker, German labels and collapsible details. - Release notes 2.4.0 seeded (migration 0009). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
863 B
TypeScript
29 lines
863 B
TypeScript
"use client";
|
|
|
|
import { useActionState } from "react";
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
import type { ReleaseNoteActionResult } from "./actions";
|
|
import { useResultToast } from "@/components/ui/feedback";
|
|
|
|
export function DeleteReleaseNoteButton({
|
|
action,
|
|
noteId,
|
|
}: Readonly<{
|
|
action: (state: ReleaseNoteActionResult, formData: FormData) => Promise<ReleaseNoteActionResult>;
|
|
noteId: string;
|
|
}>) {
|
|
const [state, formAction, pending] = useActionState(action, { ok: true, message: "" });
|
|
useResultToast(state, "Versionshinweis gelöscht.");
|
|
|
|
return (
|
|
<form action={formAction} className="flex flex-col items-end gap-1">
|
|
<input type="hidden" name="noteId" value={noteId} />
|
|
<Button type="submit" variant="outline" size="sm" disabled={pending}>
|
|
{pending ? "…" : "Löschen"}
|
|
</Button>
|
|
</form>
|
|
);
|
|
}
|