Improve error display

This commit is contained in:
april
2024-01-04 15:28:34 -06:00
parent 8c0a0955b3
commit c72523b664
3 changed files with 33 additions and 9 deletions

View File

@@ -1,3 +1,4 @@
import ErrorDisplay from "@/ui/error-display";
import { client } from "@/util/api";
import { Center, Container, List, Loader, Stack, Text } from "@mantine/core";
import { useParams } from "@remix-run/react";
@@ -17,12 +18,7 @@ export default function Flight() {
<Container>
<Stack h="calc(100vh - 95px)">
{flight.isError ? (
<Stack align="center" justify="center" h="100%" m="0" p="0">
<Text c="red">
<IconAlertTriangle size="3rem" />
</Text>
<Text c="red">Error fetching flight</Text>
</Stack>
<ErrorDisplay error="Error Fetching Flight" />
) : flight.isPending ? (
<Center h="100%">
<Loader />