import toast from 'react-hot-toast' import { ToastProps } from '@/app/types' const toastStyles = { success: { background: 'bg-green-50', text: 'text-green-800', border: 'border-green-200', }, error: { background: 'bg-red-50', text: 'text-red-800', border: 'border-red-200', }, loading: { background: 'bg-blue-50', text: 'text-blue-800', border: 'border-blue-200', }, } const showToast = ({ type, message, action, duration }: ToastProps) => { const styles = toastStyles[type] toast.custom( (t) => (

{message}

{action && (
)}
), { duration: duration || 4000 } ) } export default showToast //пример использования: showToast({ type: 'error', message: 'Неверный email или пароль' })