import * as ToastPrimitive from "@radix-ui/react-toast"; import clsx from "clsx"; import { useTranslation } from "next-i18next"; import type { Dispatch, SetStateAction } from "react"; import React from "react"; type Props = { model: [boolean, Dispatch>]; onAction?: () => void; title: string; description?: string; className?: string; }; const Toast = (props: Props) => { const [t] = useTranslation(); const [open, setOpen] = props.model; return (
{props.title} {props.description && (
{props.description}
)}
{props.onAction && ( { e.preventDefault(); if (props.onAction) props.onAction(); setOpen(false); }} > {t("COPY", { ns: "common" })} )} {t("CLOSE", { ns: "common" })}
); }; export default Toast;