Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/app/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"use client";

import { useEffect } from "react";

export default function Error({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {


useEffect(() => {
// Log the error to an error reporting service or console to satisfy lint rules
console.error("Application error captured:", error);
}, [error]);

return (
<div className="flex flex-col items-center justify-center min-h-screen gap-4">
<h2 className="text-2xl font-bold">Something went wrong</h2>
<p className="text-sm text-gray-500">
{error.message || "An unexpected error occurred."}
</p>
<button
onClick={() => reset()}
className="px-4 py-2 text-white transition-colors bg-black rounded hover:bg-gray-800"
>
Try Again
</button>
</div>
);
}
13 changes: 13 additions & 0 deletions src/app/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default function Loading() {
return (
<div
className="flex items-center justify-center min-h-screen bg-transparent"
role="status"
aria-label="Loading page content"
>
<div className="w-12 h-12 border-2 border-gray-200 rounded-full animate-spin border-b-black" />

<span className="sr-only">Loading...</span>
</div>
);
}
14 changes: 14 additions & 0 deletions src/components/loader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default function Loader() {
return (
<div
className="flex items-center justify-center p-6"
role="status"
aria-label="Loading"


>
<div className="w-10 h-10 border-2 border-gray-200 rounded-full animate-spin border-b-black" />
<span className="sr-only">Loading...</span>
</div>
);
}
Loading