import { Button } from '@fluid-design/fluid-ui'; import { CursorArrowRaysIcon, XMarkIcon } from '@heroicons/react/24/solid'; import { AnimatePresence, motion } from 'framer-motion'; import { useId } from 'react'; import toast, { Toast } from 'react-hot-toast'; export interface ToastProps { icon?: (props: React.ComponentProps<'svg'>) => React.ReactElement; image?: string; title?: string; message?: string; onDismiss?: () => void; } const ToastBody = ( props: ToastProps & { t: Toast; } ) => { const { icon, image, title, message, onDismiss, t } = props; const Icon = icon || CursorArrowRaysIcon; const id = useId(); return ( {t.visible && (
{image ? (
notification
) : ( )}

{title ? title : `Clicked`}

{message}

)}
); }; const presentToast = (props: ToastProps | string) => { if (typeof props === 'string') { toast.custom((t) => ); } else { toast.custom((t) => ); } }; export const useToast = () => [presentToast];