feat: add toast notification system with success, error, and info variants
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user