// Toast.tsx
import { Toaster, toast } from 'react-hot-toast'
import { CheckCircle, AlertTriangle, XCircle } from 'lucide-react'

export const ToastProvider = () => (
    <Toaster
        position="top-right"
        toastOptions={{
            duration: 4000,
            style: {
                borderRadius: '8px',
                padding: '12px 16px',
                fontSize: '14px',
            },
        }}
    />
)


export const showSuccess = (message: string) =>
    toast.success(message, {
        icon: <CheckCircle className="w-5 h-5 text-green-600" />,
        style: { background: '#ecfdf5', color: '#065f46' },
    })

export const showError = (message: string) =>
    toast.error(message, {
        icon: <XCircle className="w-5 h-5 text-red-600" />,
        style: { background: '#fee2e2', color: '#991b1b' },
    })

export const showWarning = (message: string) =>
    toast(message, {
        icon: <AlertTriangle className="w-5 h-5 text-yellow-600" />,
        style: { background: '#fef9c3', color: '#92400e' },
    })
