/** * Impressum (Legal Notice) page. * Required for German law compliance. Displays information from settings.yaml. */ import { Metadata } from 'next'; import { notFound } from 'next/navigation'; import { getConfig } from '@/lib/config'; import { BackLink } from '@/components/BackLink'; import EmailLink from '@/components/EmailLink'; import { encodeEmail, spelledOutEmail } from '@/lib/emailObfuscation'; import { getServerDictionary } from '@/lib/i18n/server'; import './impressum.css'; export function generateMetadata(): Metadata { // No title for a page that is switched off: it renders the 404 page. if (!getConfig().legal.enabled) return {}; return { title: getServerDictionary().legal.title, robots: { index: false, follow: true }, // Usually no need to index legal pages }; } export const dynamic = 'force-dynamic'; /** `tel:` takes digits and a leading +; the displayed number keeps its spacing. */ function telHref(phone: string): string { return `tel:${phone.replace(/[^\d+]/g, '')}`; } export default function ImpressumPage() { const { legal, contact } = getConfig(); const t = getServerDictionary(); // The built-in form stands in as the second contact channel unless an // external one is configured. const contactUrl = legal.contactUrl ?? (contact.enabled ? '/contact' : undefined); if (!legal.enabled) { notFound(); } return (

{t.legal.title}

{legal.heading ?? t.legal.subtitle}

{t.legal.address}

{legal.name}
{legal.address}
{legal.zipCity}
{legal.country}

{(legal.email || legal.phone || contactUrl) && (

{t.legal.contact}

{legal.email && ( <> {t.legal.email}: {/* ยง 5 DDG wants the address reachable without JavaScript too. */}
)} {legal.phone && ( <> {t.legal.phone}: {legal.phone}
)} {contactUrl && ( {legal.contactLabel ?? t.legal.contactForm} )}

)} {(legal.taxId || legal.vatId) && (

{t.legal.taxSection}

{legal.taxId && ( <> {t.legal.taxId}: {legal.taxId}
)} {legal.vatId && ( <> {t.legal.vatId}: {legal.vatId} )}

)} {legal.extraInfo && (

{t.legal.extraInfo}

{legal.extraInfo}

)}
); }