import { useCallback } from 'react'; export type ToastType = 'success' | 'error' | 'warning' | 'info'; interface ToastOptions { title?: string; description?: string; duration?: number; action?: { label: string; onClick: () => void; }; } /** * Hook for showing toast notifications (placeholder implementation) * In a real app, this would integrate with a toast library like react-hot-toast */ export function useToast() { const toast = useCallback((type: ToastType, message: string, options: ToastOptions = {}) => { // Placeholder implementation - in real app, integrate with toast library console.log(`${type.toUpperCase()}: ${message}`, options); // Could dispatch to a global toast context here // Example: toastContext.add({ type, message, ...options }); }, []); const success = useCallback((message: string, options?: ToastOptions) => toast('success', message, options), [toast]); const error = useCallback((message: string, options?: ToastOptions) => toast('error', message, options), [toast]); const warning = useCallback((message: string, options?: ToastOptions) => toast('warning', message, options), [toast]); const info = useCallback((message: string, options?: ToastOptions) => toast('info', message, options), [toast]); return { toast, success, error, warning, info, }; }