Skip to content

armgit / ARTEX

Public Imported from GitHub
0

ARTEX - AI autonomous penetration testing system (English translation; upstream: Autumn-27/ARTEX, AGPL-3.0)

web: render the 404 text on the client

Merve DALĞINe59d396f200c
diff --git a/web/src/app/not-found.tsx b/web/src/app/not-found.tsx
index 7280378..28536b0 100644
--- a/web/src/app/not-found.tsx
+++ b/web/src/app/not-found.tsx
@@ -1,11 +1,18 @@
"use client";
+import { useEffect, useState } from "react";
+
import Link from "next/link";
import { Button } from "@/components/ui/button";
import { t } from "@/i18n";
export default function NotFound() {
+ // This page is prerendered in the build-time locale; render the text only on the
+ // client so a reader in another locale gets no hydration mismatch.
+ const [mounted, setMounted] = useState(false);
+ useEffect(() => setMounted(true), []);
+ if (!mounted) return <div className="h-dvh" />;
return (
<div className="flex h-dvh flex-col items-center justify-center space-y-2 text-center">
<h1 className="font-semibold text-2xl">{t("Page not found.")}</h1>