frontend.zweitmeinu.ng/src/app/layout.tsx
CCS Admin 0e5c9808a8 fix: replace hardcoded content with CMS data
- Phone number: 10 locations now use CMS site-settings contact.phone
- ContactForm: service dropdown options from CMS services
- FAQ categories: display names derived from CMS services
- Footer: Top Fachbereiche column dynamic from CMS services
- SEO metadata: fachbereiche, faq, kontakt use generateMetadata()
- HomeCTA: converted to async server component, fetches settings
- Added phoneToHref() helper to payload-helpers.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:31:27 +00:00

71 lines
2.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { Metadata } from "next"
import { TopBar, Header, Footer, EmergencyBanner } from "@/components/layout"
import { getNavigation, getSiteSettings, getSocialLinks, getServices } from "@/lib/api"
import { phoneToHref } from "@/lib/payload-helpers"
import "./globals.css"
export const metadata: Metadata = {
title: {
default: "zweitmeinu.ng Medizinische Zweitmeinung",
template: "%s | zweitmeinu.ng",
},
description:
"Ihr zentrales Portal für qualifizierte medizinische Zweitmeinungen. Zugang zu erfahrenen Fachärzt:innen aus über 50 Fachbereichen.",
metadataBase: new URL(
process.env.NEXT_PUBLIC_SITE_URL || "https://zweitmeinu.ng",
),
openGraph: {
type: "website",
locale: "de_DE",
siteName: "zweitmeinu.ng",
},
}
export default async function RootLayout({
children,
}: {
children: React.ReactNode
}) {
const [navigation, settings, socialLinks, services] = await Promise.all([
getNavigation(),
getSiteSettings(),
getSocialLinks(),
getServices(),
])
const phone = settings?.contact?.phone || "0800 80 44 100"
const email = settings?.contact?.email || "kontakt@zweitmeinu.ng"
const headerServices = services.map((s) => ({
title: s.title,
slug: s.slug,
icon: s.icon ?? null,
}))
const footerServices = services.map((s) => ({
title: s.title.replace(/^Zweitmeinung\s+/, ""),
slug: s.slug,
}))
return (
<html lang="de">
<body className="font-body antialiased">
<a
href="#main-content"
className="sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-[200] focus:bg-white focus:px-4 focus:py-2 focus:rounded-lg focus:shadow-lg"
>
Zum Hauptinhalt springen
</a>
<div className="flex min-h-screen flex-col">
<TopBar settings={settings} />
<Header mainMenu={navigation?.mainMenu ?? null} services={headerServices} phone={phone} email={email} />
<main id="main-content" className="flex-1">
{children}
</main>
<EmergencyBanner settings={settings} />
<Footer socialLinks={socialLinks} settings={settings} services={footerServices} />
</div>
</body>
</html>
)
}