Files
Epicnabbo-Catalogus-Updated…/src/app/admin/error.tsx
T
openhands 17847545dd Improvements: remove dead config, fix ESM, add URL validation, unify types, add missing logging
- Remove .prettierrc (dead config, Biome replaces Prettier)
- Rename lighthouserc.json to lighthouserc.cjs with module.exports for ESM compat
- Add logger.warn to empty catch blocks in auth, register, site-settings, prisma-cache, redis, security, rate-limit
- Unify ActionResult type: action-helper.ts uses 'ok' consistent with safe-action-shared.ts
- Add noUnusedLocals + noUnusedParameters to tsconfig + fix 25 pre-existing unused vars
- Replace barrel export src/types/index.ts with direct @/types/common imports
- Make trustHost conditional (development only) in auth.ts
- Add pre-flight URL validation to update-Nitrov3.sh to catch image.library.url misconfigurations
- Improve NITRO_IMAGE_LIBRARY_URL content validation in pre-flight & post-compute checks
2026-07-26 20:28:11 +02:00

79 lines
1.9 KiB
TypeScript

"use client";
import * as Sentry from "@sentry/nextjs";
import { LayoutDashboard, RefreshCw } from "lucide-react";
import Link from "next/link";
import { useTranslations } from "next-intl";
import { useEffect } from "react";
import { Button } from "@/components/ui/button";
/**
* Admin route-segment error boundary. Renders inside the admin layout shell.
*/
export default function AdminErrorPage({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
const t = useTranslations("pages.error");
const tNav = useTranslations("admin.nav");
useEffect(() => {
console.error(error);
Sentry.captureException(error);
}, [error]);
return (
<div
className="rounded-xl border p-8 max-w-lg mx-auto mt-8 text-center"
style={{
borderColor: "var(--admin-border, rgba(0,0,0,0.08))",
background: "var(--admin-surface, #fff)",
}}
role="alert"
>
<p
className="text-sm font-bold uppercase tracking-wider mb-2"
style={{ color: "var(--admin-muted, #6b7280)" }}
>
{t("code")}
</p>
<h1 className="text-xl font-extrabold mb-2">{t("title")}</h1>
<p
className="text-sm mb-1"
style={{ color: "var(--admin-muted, #6b7280)" }}
>
{t("subtitle")}
</p>
<p
className="text-sm mb-6"
style={{ color: "var(--admin-muted, #6b7280)" }}
>
{t("body")}
</p>
<div className="flex flex-wrap gap-3 justify-center">
<Button type="button" variant="default" onClick={() => reset()}>
<RefreshCw className="size-4" aria-hidden />
{t("tryAgain")}
</Button>
<Button variant="outline" asChild>
<Link href="/admin">
<LayoutDashboard className="size-4" aria-hidden />
{tNav("dashboard")}
</Link>
</Button>
</div>
{error.digest ? (
<p
className="mt-6 text-xs font-mono"
style={{ color: "var(--admin-muted, #9ca3af)" }}
>
{t("reference", { digest: error.digest })}
</p>
) : null}
</div>
);
}