forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErrorFallbackMessage.js
More file actions
33 lines (31 loc) · 1.03 KB
/
ErrorFallbackMessage.js
File metadata and controls
33 lines (31 loc) · 1.03 KB
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
27
28
29
30
31
32
33
import React from 'react'
import { Box, Divider, SimpleGrid, Stack, Text } from '@chakra-ui/react'
import { object } from 'prop-types'
import { Trans } from '@lingui/macro'
export function ErrorFallbackMessage({ error }) {
return (
<Box bg="gray.50" my="10" display="flex" alignItems="center">
<SimpleGrid columns={{ base: 1, md: 2 }} bg="primary" color="gray.50">
<Stack role="alert" my="5" mx="10">
<Text fontSize="2xl" fontWeight="bold">
<Trans>An error has occurred.</Trans>
</Text>
<Divider borderColor="accent" borderWidth="1" w="20%" />
<Text fontFamily="courier" fontSize="xl">
{error.message}
</Text>
</Stack>
<Stack my="5" mx="10">
<Text fontWeight="bold" fontSize="2xl">
<Trans>
This component is currently unavailable. Try reloading the page.
</Trans>
</Text>
</Stack>
</SimpleGrid>
</Box>
)
}
ErrorFallbackMessage.propTypes = {
error: object,
}