2021-06-19 18:46:05 +01:00
|
|
|
import { Text } from "preact-i18n";
|
2021-07-05 11:23:23 +01:00
|
|
|
|
2021-06-19 18:46:05 +01:00
|
|
|
import Modal from "../../../components/ui/Modal";
|
|
|
|
|
|
|
|
interface Props {
|
2021-07-05 11:25:20 +01:00
|
|
|
onClose: () => void;
|
|
|
|
error: string;
|
2021-06-19 18:46:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export function ErrorModal({ onClose, error }: Props) {
|
2021-07-05 11:25:20 +01:00
|
|
|
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>
|
|
|
|
);
|
2021-06-19 18:46:05 +01:00
|
|
|
}
|