error page added (#185)

This commit is contained in:
Jahid Khan
2025-02-15 21:25:11 +05:30
committed by GitHub
parent e4b6fd9bad
commit 6912cbd3cb

29
app/error.tsx Normal file
View File

@@ -0,0 +1,29 @@
"use client";
import { Button } from "@/components/ui/button";
import React, { useEffect } from "react";
export default function error({ error, reset }: { error: Error; reset: () => void }) {
useEffect(() => {
console.error(error);
}, [error]);
return (
<div className="flex w-full items-center justify-center bg-white text-center dark:bg-background">
<div className="flex-col items-center justify-center dark:text-gray-100 md:flex">
{/* Message */}
<div className="space-y-2">
<h2 className="text-2xl font-semibold tracking-tight">Something went wrong!</h2>
<p className="text-muted-foreground">See the console for more information.</p>
</div>
{/* Buttons */}
<div className="mt-2">
<Button variant="outline" onClick={() => reset()} className="gap-2 text-muted-foreground">
Try Again
</Button>
</div>
</div>
</div>
);
}