import React from "react" import type { Toast } from "react-hot-toast" import { toast as globalToast } from "react-hot-toast" import AlertIcon from "../../fundamentals/icons/alert-icon" import CheckCircleIcon from "../../fundamentals/icons/check-circle-icon" import CrossIcon from "../../fundamentals/icons/cross-icon" import InfoIcon from "../../fundamentals/icons/info-icon" import XCircleIcon from "../../fundamentals/icons/x-circle-icon" import ToasterContainer from "../toaster-container" export type NotificationTypes = "success" | "warning" | "error" | "info" type NotificationProps = { toast: Toast type: NotificationTypes title: string message: string } const Notification: React.FC = ({ toast, type, title, message, }) => { const onDismiss = () => { globalToast.dismiss(toast.id) } return (
{getIcon(type)}
{title} {message}
Close
) } const ICON_SIZE = 20 function getIcon(type: NotificationTypes) { switch (type) { case "success": return case "warning": return case "error": return default: return } } export default Notification