import { Fragment, useEffect, useState } from "react"; import { Dialog, Transition } from "@headlessui/react"; import clsx from "clsx"; import { useApp } from "../../../hooks"; interface Props { title: string; description: string; closeText?: string; open: boolean; onClose: () => void; className?: string; } export default function OpenSuccessModal({ title, description, closeText, open, onClose, className }: Props) { const { t } = useApp(); const [data, setData] = useState<{ title: string; description: string; closeText?: string }>(); useEffect(() => { if (title && description) { setData({ title, description, closeText }); } }, [title, description, closeText]); return (
{/* This element is to trick the browser into centering the modal contents. */}
{data?.title}

{data?.description}

); }