import React from 'react'; import {ToastComponent as Toast} from '../../components/common/molecules/toast/toast.component'; import {ThemeProviderComponent} from '../../components/providers'; import toast from 'react-hot-toast'; import {INotify, IUseToast} from './use-toast.type'; export const useToast = ({}: IUseToast) => { const notify = ({title, description, variant, children, id}: INotify) => toast.custom( (t) => ( {children && children} {!children && ( toast.dismiss(id)} isOpen={t.visible} > {title && {title}} {description && ( {description} )} )} ), {id}, ); return notify; };