import { ButtonLink, ButtonRow } from "@/components/Button";
import { Container } from "@/components/Container";
import { getT } from "@/lib/content";
import type { Locale } from "@/lib/locales";
import { href } from "@/lib/routes";

import styles from "./Page.module.css";

/**
 * The localised not-found page (Blueprint 04). Legacy Joomla URLs never reach
 * it — the proxy and the redirect map in next.config.ts send them to a real
 * page first — so anything that lands here is a genuine mistyped address.
 */
export function NotFoundView({ locale }: { locale: Locale }) {
  const t = getT(locale);

  return (
    <div className={styles.notFound}>
      <Container>
        <p className={styles.notFoundCode}>{t("notFound.code")}</p>
        <h1 className={styles.h1}>{t("notFound.title")}</h1>
        <p className={styles.oneLiner}>{t("notFound.body")}</p>
        <div style={{ marginTop: "var(--s6)" }}>
          <ButtonRow>
            <ButtonLink href={href({ key: "nexys" }, locale)}>{t("cta.nexysOverview")}</ButtonLink>
            <ButtonLink href={href({ key: "support" }, locale)} variant="secondary">
              {t("nav.support")}
            </ButtonLink>
            <ButtonLink href={href({ key: "contact" }, locale)} variant="secondary">
              {t("cta.contact")}
            </ButtonLink>
          </ButtonRow>
        </div>
      </Container>
    </div>
  );
}
