feat: add multilingual about page with imprint and privacy info

This commit is contained in:
Hördle Bot
2025-12-01 14:08:31 +01:00
parent ff6aff25e8
commit 20910e5cbf
4 changed files with 577 additions and 337 deletions

View File

@@ -1,36 +1,47 @@
'use client';
"use client";
import { config } from '@/lib/config';
import { useEffect, useState } from 'react';
import { config } from "@/lib/config";
import { Link } from "@/lib/navigation";
import { useTranslations } from "next-intl";
import { useEffect, useState } from "react";
export default function AppFooter() {
const [version, setVersion] = useState<string>('');
const [version, setVersion] = useState<string>("");
const t = useTranslations("About");
useEffect(() => {
fetch('/api/version')
.then(res => res.json())
.then(data => setVersion(data.version))
.catch(() => setVersion(''));
}, []);
useEffect(() => {
fetch("/api/version")
.then((res) => res.json())
.then((data) => setVersion(data.version))
.catch(() => setVersion(""));
}, []);
if (!config.credits.enabled) return null;
if (!config.credits.enabled) return null;
return (
<footer className="app-footer">
<p>
{config.credits.text}{' '}
<a href={config.credits.linkUrl} target="_blank" rel="noopener noreferrer">
{config.credits.linkText}
</a>
{version && (
<>
{' '}·{' '}
<span style={{ fontSize: '0.85em', opacity: 0.7 }}>
{version}
</span>
</>
)}
</p>
</footer>
);
return (
<footer className="app-footer">
<p>
{config.credits.text}{" "}
<a
href={config.credits.linkUrl}
target="_blank"
rel="noopener noreferrer"
>
{config.credits.linkText}
</a>
{version && (
<>
{" "}
·{" "}
<span style={{ fontSize: "0.85em", opacity: 0.7 }}>{version}</span>
</>
)}
</p>
<p style={{ marginTop: "0.5rem", fontSize: "0.85rem" }}>
<Link href="/about" style={{ textDecoration: "underline" }}>
{t("footerLinkLabel")}
</Link>
</p>
</footer>
);
}