47 lines
1.6 KiB
TypeScript
47 lines
1.6 KiB
TypeScript
import { Button } from "~/components/ui/button";
|
|
import {
|
|
Card,
|
|
CardContent,
|
|
CardDescription,
|
|
CardFooter,
|
|
CardHeader,
|
|
CardTitle,
|
|
} from "~/components/ui/card";
|
|
import { ChevronLeft, FileQuestion, RotateCw } from "lucide-react";
|
|
import { Link } from "react-router";
|
|
import { forceReload } from "~/lib/utils";
|
|
|
|
export default function Error({
|
|
title = "Page introuvable",
|
|
message = "Nous n'avons pas pu trouver la page que vous recherchiez.",
|
|
code = 404,
|
|
description = "La page que vous recherchez a peut-être été supprimée, son nom a été modifié ou est temporairement indisponible.",
|
|
}) {
|
|
return (
|
|
<div className="container flex items-center justify-center min-h-[80vh]">
|
|
<Card className="max-w-md w-full">
|
|
<CardHeader className="text-center">
|
|
<div className="flex justify-center mb-4">
|
|
<FileQuestion className="h-12 w-12 text-primary" />
|
|
</div>
|
|
<CardTitle className="text-2xl">{title}</CardTitle>
|
|
<CardDescription>{message}</CardDescription>
|
|
</CardHeader>
|
|
<CardContent className="text-center">
|
|
<p className="text-4xl font-bold mb-2">{code}</p>
|
|
<p className="text-muted-foreground">{description}</p>
|
|
</CardContent>
|
|
<CardFooter className="flex justify-center gap-2">
|
|
<Button>
|
|
<ChevronLeft />
|
|
<Link to="/">Retour</Link>
|
|
</Button>
|
|
<Button variant="destructive" onClick={forceReload}>
|
|
<RotateCw />
|
|
Réessayer
|
|
</Button>
|
|
</CardFooter>
|
|
</Card>
|
|
</div>
|
|
);
|
|
}
|