Files
artcraft/app/components/ErrorDialog.tsx
T
2024-04-27 23:21:56 +07:00

35 lines
948 B
TypeScript

import { Button, TransitionDialogue } from "~/components";
import {
showErrorDialog,
errorDialogMessage,
errorDialogTitle,
} from "~/pages/PageEnigma/store";
import { useSignals } from "@preact/signals-react/runtime";
import { faTriangleExclamation } from "@fortawesome/pro-solid-svg-icons";
export function ErrorDialog() {
useSignals();
return (
<TransitionDialogue
title={errorDialogTitle.value}
titleIcon={faTriangleExclamation}
titleIconClassName="text-brand-primary"
isOpen={showErrorDialog.value}
onClose={() => (showErrorDialog.value = false)}
showClose={false}>
<div>
{errorDialogMessage.value}
<div className="flex justify-end">
<Button
type="button"
onClick={() => (showErrorDialog.value = false)}
variant="secondary">
Close
</Button>
</div>
</div>
</TransitionDialogue>
);
}