aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/pages/errors/CriticalError.tsx
blob: 22070c2a7b15dc9d16f2da2515c68778e2187c9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { FunctionComponent } from "react";
import { Alert, Container, Text } from "@mantine/core";
import { faExclamationTriangle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Reload } from "@/utilities";

interface Props {
  message: string;
}

const CriticalError: FunctionComponent<Props> = ({ message }) => (
  <Container my="xl">
    <Alert
      title="Something is wrong!"
      color="red"
      icon={<FontAwesomeIcon icon={faExclamationTriangle} />}
      withCloseButton
      closeButtonLabel="Reload"
      onClose={Reload}
    >
      <Text color="red">{message}</Text>
    </Alert>
  </Container>
);

export default CriticalError;