Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(web): add public collection error boundary

Richie McIlroy3a8ec4cb4eeb
diff --git a/apps/web/app/c/error.tsx b/apps/web/app/c/error.tsx
new file mode 100644
index 000000000..e762d83b3
--- /dev/null
+++ b/apps/web/app/c/error.tsx
@@ -0,0 +1,28 @@
+"use client";
+
+import { Button } from "@cap/ui";
+import { useEffect } from "react";
+
+export default function CollectionError({
+ error,
+ reset,
+}: {
+ error: Error & { digest?: string };
+ reset: () => void;
+}) {
+ useEffect(() => {
+ console.error("Public collection page error:", error);
+ }, [error]);
+
+ return (
+ <div className="wrapper flex flex-col items-center justify-center h-screen text-center">
+ <h1 className="text-5xl md:text-6xl font-medium">Something went wrong</h1>
+ <p className="text-xl md:text-2xl mt-2 mb-6 text-gray-400">
+ This collection could not be loaded right now.
+ </p>
+ <Button type="button" variant="gray" size="sm" onClick={reset}>
+ Try again
+ </Button>
+ </div>
+ );
+}