import { useSyncExternalStore } from "react"; import { useTranslation } from "react-i18next"; import { dismissError, getError, subscribeError } from "../lib/errorDialog"; import Modal, { ModalFooter } from "./ui/Modal"; import { Button } from "./ui/Button"; // Renders the current app error (if any) as a modal the user must acknowledge. export default function ErrorDialog() { const { t } = useTranslation(); const err = useSyncExternalStore(subscribeError, getError, getError); if (!err) return null; return (

{err.message}

); }