Files
medusa-store/packages/admin-ui/ui/src/hooks/use-notification.tsx
2023-03-13 14:02:20 +01:00

21 lines
467 B
TypeScript

import { toast } from "react-hot-toast"
import Notification, {
NotificationTypes,
} from "../components/atoms/notification"
const useNotification = () => {
return (title: string, message: string, type: NotificationTypes) => {
toast.custom(
(t) => (
<Notification toast={t} type={type} title={title} message={message} />
),
{
position: "top-right",
duration: 3000,
}
)
}
}
export default useNotification