import { ArrowLeftStartOnRectangleIcon, CheckIcon, ExclamationTriangleIcon, InformationCircleIcon, XMarkIcon } from "@heroicons/react/24/outline";
import React from "react";
import { toast, ToastContainer } from "react-toastify";
import BadgeIcon, { EBadgeColor } from "../BadgeIcon";
import IconButton from "../IconButton";
import Loader from "../Loader";
import classes from "./classes.module.scss";
import ToastContent from "./ToastContent";
import "react-toastify/dist/ReactToastify.css";
export default function Toaster() {
return (
} />}
/>
);
}
export class ToasterService {
private static instance: ToasterService;
private constructor() {}
public static getInstance() {
return (this.instance ??= new this());
}
public text({ title, description }: { title: string; description?: string }) {
toast.info(, {
icon: false,
progressStyle: { backgroundColor: "var(--primary-default-base)" },
});
}
public info({ title, description }: { title: string; description?: string }) {
toast.info(
} color={EBadgeColor.INFO} />}
/>,
{
icon: false,
progressStyle: { backgroundColor: "var(--info-default-base)" },
},
);
}
public success({ title, description }: { title: string; description?: string }) {
toast.info(
} color={EBadgeColor.SUCCESS} />} />,
{
icon: false,
progressStyle: { backgroundColor: "var(--success-default-base)" },
},
);
}
public error({ title, description }: { title: string; description?: string }) {
toast.info(
} color={EBadgeColor.ERROR} />} />,
{
icon: false,
progressStyle: { backgroundColor: "var(--error-default-base)" },
},
);
}
public warning({ title, description }: { title: string; description?: string }) {
toast.info(
} color={EBadgeColor.WARNING} />}
/>,
{
icon: false,
progressStyle: { backgroundColor: "var(--warning-default-base)" },
},
);
}
public loading({ title, description }: { title: string; description?: string }) {
toast.info(
} color={EBadgeColor.INFO} />} />,
{
icon: false,
autoClose: false,
},
);
}
public loggedOut({ title, description }: { title: string; description?: string }) {
toast.info(
} color={EBadgeColor.NEUTRAL} />}
/>,
{
icon: false,
autoClose: false,
},
);
}
}