mirror of
https://github.com/revoltchat/revite.git
synced 2025-02-24 09:10:57 -05:00
31 lines
834 B
TypeScript
31 lines
834 B
TypeScript
|
import { Text } from "preact-i18n";
|
||
|
import Modal from "../../../components/ui/Modal";
|
||
|
|
||
|
interface Props {
|
||
|
onClose: () => void;
|
||
|
error: string;
|
||
|
}
|
||
|
|
||
|
export function ErrorModal({ onClose, error }: Props) {
|
||
|
return (
|
||
|
<Modal
|
||
|
visible={true}
|
||
|
onClose={() => false}
|
||
|
title={<Text id="app.special.modals.error" />}
|
||
|
actions={[
|
||
|
{
|
||
|
onClick: onClose,
|
||
|
confirmation: true,
|
||
|
text: <Text id="app.special.modals.actions.ok" />
|
||
|
},
|
||
|
{
|
||
|
onClick: () => location.reload(),
|
||
|
text: <Text id="app.special.modals.actions.reload" />
|
||
|
}
|
||
|
]}
|
||
|
>
|
||
|
<Text id={`error.${error}`}>{error}</Text>
|
||
|
</Modal>
|
||
|
);
|
||
|
}
|