import { FC, useState } from 'react'; import { Toast } from 'react-hot-toast'; import { HiCheckCircle, HiExclamationCircle, HiInformationCircle, HiXCircle } from 'react-icons/hi'; interface ToastBodyProps { t: Toast; type: 'success' | 'error' | 'warning' | 'info'; title?: string; showCloseButton?: boolean; subtitle?: string; } const colorClasses = { success: 'text-green-600', error: 'text-red-600', warning: 'text-amber-600', info: 'text-blue-600', }; const ToastBody: FC = (props) => { const [showToast, setShowToast] = useState(true); return ( <> {showToast && (
{props.type == 'success' && } {props.type == 'error' && } {props.type == 'warning' && } {props.type == 'info' && }

{props.type == 'success' && (props.title || 'Success')} {props.type == 'error' && (props.title || 'Error')} {props.type == 'warning' && (props.title || 'Warning')} {props.type == 'info' && (props.title || 'Info')}

{props.subtitle}

{props.showCloseButton && (
)}
)} ); }; export default ToastBody;