// Basic toast hook for notifications import { useState } from "react"; type ToastVariant = "default" | "destructive"; interface ToastOptions { title?: string; description?: string; variant?: ToastVariant; duration?: number; id?: number; className?: string; } export function useToast() { const [toasts, setToasts] = useState([]); // Create a function that matches the expected signature in BlogManagement const toast = (options: ToastOptions) => { const id = Date.now(); const newToast = { ...options, id, duration: options.duration || 3000, }; setToasts((prev) => [...prev, newToast]); // Auto dismiss setTimeout(() => { dismiss(id); }, newToast.duration); return id; }; const dismiss = (id?: number) => { if (id) { setToasts((prev) => prev.filter((toast) => toast.id !== id)); } else { setToasts([]); } }; return { toast, dismiss, toasts }; }