feat: add toast notification system with success, error, and info variants

This commit is contained in:
Your Name
2026-02-15 20:30:17 +02:00
parent 61a5f11f25
commit 6341897487
5 changed files with 76 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ import { Button } from "@/components/ui/button";
import type { BoardMeta } from "@/types/board";
import { useAppStore } from "@/stores/app-store";
import { useBoardStore } from "@/stores/board-store";
import { useToastStore } from "@/stores/toast-store";
import { deleteBoard, loadBoard, saveBoard } from "@/lib/storage";
interface BoardCardProps {
@@ -31,6 +32,7 @@ interface BoardCardProps {
export function BoardCard({ board, index = 0 }: BoardCardProps) {
const [confirmDelete, setConfirmDelete] = useState(false);
const prefersReducedMotion = useReducedMotion();
const addToast = useToastStore((s) => s.addToast);
const setView = useAppStore((s) => s.setView);
const addRecentBoard = useAppStore((s) => s.addRecentBoard);
@@ -51,6 +53,7 @@ export function BoardCard({ board, index = 0 }: BoardCardProps) {
await deleteBoard(board.id);
await refreshBoards();
setConfirmDelete(false);
addToast(`"${board.title}" deleted`, "info");
}
async function handleDuplicate() {
@@ -66,6 +69,7 @@ export function BoardCard({ board, index = 0 }: BoardCardProps) {
};
await saveBoard(duplicated);
await refreshBoards();
addToast(`"${board.title}" duplicated`, "success");
}
return (