+
+ {statusCode ? `Error ${statusCode}` : "An Error Occurred"}
+
+
+ {statusCode === 404
+ ? "The page you are looking for could not be found."
+ : "A server-side error occurred while rendering this page."}
+
+
+ Return to Home
+
+
+ );
+}
+
+ErrorPage.getInitialProps = ({ res, err }: NextPageContext) => {
+ const statusCode = res ? res.statusCode : err ? err.statusCode : 404;
+ return { statusCode };
+};
+
+export default ErrorPage;
\ No newline at end of file
diff --git a/frontend/pages/donors/[publicKey].tsx b/frontend/pages/donors/[publicKey].tsx
index 80b09b6f..f4ff1ebc 100644
--- a/frontend/pages/donors/[publicKey].tsx
+++ b/frontend/pages/donors/[publicKey].tsx
@@ -71,6 +71,7 @@ function formatDate(iso: string): string {
function BadgePill({ tier, earnedAt }: { tier: BadgeTier; earnedAt: string }) {
const meta = BADGE_META[tier];
+ if (!meta) return null; // or use optional chaining below
return (