diff --git a/src/app/fachbereiche/[slug]/page.tsx b/src/app/fachbereiche/[slug]/page.tsx index 10f00e0..e4f3cec 100644 --- a/src/app/fachbereiche/[slug]/page.tsx +++ b/src/app/fachbereiche/[slug]/page.tsx @@ -4,7 +4,8 @@ import { Container } from "@/components/ui/Container" import { Button } from "@/components/ui/Button" import { RichTextRenderer } from "@/components/ui/RichTextRenderer" import { getLucideIcon } from "@/lib/icon-map" -import { getServices, getServiceBySlug } from "@/lib/api" +import { getServices, getServiceBySlug, getSiteSettings } from "@/lib/api" +import { phoneToHref } from "@/lib/payload-helpers" import { Phone, Mail, ArrowRight, Check } from "lucide-react" export async function generateStaticParams() { @@ -32,14 +33,15 @@ export default async function ServiceDetailPage({ params: Promise<{ slug: string }> }) { const { slug } = await params - const service = await getServiceBySlug(slug) + const [service, settings] = await Promise.all([ + getServiceBySlug(slug), + getSiteSettings(), + ]) if (!service) notFound() const Icon = getLucideIcon(service.icon) const shortTitle = service.title.replace(/^Zweitmeinung\s+/, "") - const categoryName = typeof service.category === "object" && service.category - ? service.category.name - : null + const phone = settings?.contact?.phone || "0800 80 44 100" return ( <> @@ -60,7 +62,7 @@ export default async function ServiceDetailPage({ {service.shortDescription}

- @@ -197,9 +199,9 @@ export default async function ServiceDetailPage({ Einschätzung im Bereich {shortTitle}.

-
diff --git a/src/app/faq/page.tsx b/src/app/faq/page.tsx index 2440e7b..cef4491 100644 --- a/src/app/faq/page.tsx +++ b/src/app/faq/page.tsx @@ -3,32 +3,39 @@ import { Container } from "@/components/ui/Container" import { Button } from "@/components/ui/Button" import { FAQClient } from "@/components/faq/FAQClient" import { Phone, Mail, HelpCircle } from "lucide-react" -import { getFaqs } from "@/lib/api" +import { getFaqs, getServices, getSiteSettings } from "@/lib/api" import { richTextToPlainText } from "@/components/ui/RichTextRenderer" +import { phoneToHref } from "@/lib/payload-helpers" -export const metadata: Metadata = { - title: "FAQ - Häufige Fragen", - description: - "Antworten auf die wichtigsten Fragen zur medizinischen Zweitmeinung. Von Onkologie über Kardiologie bis Intensivmedizin.", -} - -const categoryNames: Record = { - allgemein: "Allgemeine Fragen", - intensivmedizin: "Intensivmedizin", - kardiologie: "Kardiologie", - onkologie: "Onkologie", - nephrologie: "Nephrologie", - gallenblase: "Gallenblase", - schilddruese: "Schilddrüse", +export async function generateMetadata(): Promise { + const services = await getServices() + const names = services.map((s) => s.title.replace(/^Zweitmeinung\s+/, "")).join(", ") + return { + title: "FAQ - Häufige Fragen", + description: `Antworten auf die wichtigsten Fragen zur medizinischen Zweitmeinung. ${names}.`, + } } export default async function FAQPage() { - const faqs = await getFaqs() + const [faqs, services, settings] = await Promise.all([ + getFaqs(), + getServices(), + getSiteSettings(), + ]) + + const phone = settings?.contact?.phone || "0800 80 44 100" + + // Build category names from services (slug suffix → title without "Zweitmeinung ") + const serviceCategoryNames: Record = { allgemein: "Allgemeine Fragen" } + for (const s of services) { + const suffix = s.slug.replace(/^zweitmeinung-/, "") + serviceCategoryNames[suffix] = s.title.replace(/^Zweitmeinung\s+/, "") + } // Derive categories from data const categorySlugs = [...new Set(faqs.map((f) => f.category).filter((c): c is string => !!c))] const categories = categorySlugs.map((slug: string) => ({ - name: categoryNames[slug] || slug, + name: serviceCategoryNames[slug] || slug, slug, })) @@ -75,7 +82,7 @@ export default async function FAQPage() { kostenlose Erstberatung.

- diff --git a/src/app/kontakt/page.tsx b/src/app/kontakt/page.tsx index 76c0f07..efd93e1 100644 --- a/src/app/kontakt/page.tsx +++ b/src/app/kontakt/page.tsx @@ -2,15 +2,22 @@ import type { Metadata } from "next" import { Container } from "@/components/ui/Container" import { ContactForm } from "@/components/contact/ContactForm" import { Phone, Mail, MapPin, Clock, Printer } from "lucide-react" -import { getSiteSettings } from "@/lib/api" +import { getSiteSettings, getServices } from "@/lib/api" -export const metadata: Metadata = { - title: "Kontakt", - description: "Kontaktieren Sie uns für eine kostenlose Erstberatung. Telefon: 0800 80 44 100.", +export async function generateMetadata(): Promise { + const settings = await getSiteSettings() + const phone = settings?.contact?.phone || "0800 80 44 100" + return { + title: "Kontakt", + description: `Kontaktieren Sie uns für eine kostenlose Erstberatung. Telefon: ${phone}.`, + } } export default async function KontaktPage() { - const settings = await getSiteSettings() + const [settings, services] = await Promise.all([ + getSiteSettings(), + getServices(), + ]) const phone = settings?.contact?.phone || "0800 80 44 100" const email = settings?.contact?.email || "kontakt@zweitmeinu.ng" @@ -18,7 +25,12 @@ export default async function KontaktPage() { const street = settings?.address?.street || "Hans-Böckler-Str. 19" const zip = settings?.address?.zip || "46236" const city = settings?.address?.city || "Bottrop" - const phoneHref = `tel:${phone.replace(/[\s/]/g, "")}` + const phoneHref = `tel:+49${phone.replace(/[\s/()-]/g, "").substring(1)}` + + const serviceOptions = services.map((s) => ({ + value: s.slug.replace(/^zweitmeinung-/, ""), + label: s.title.replace(/^Zweitmeinung\s+/, ""), + })) return ( <> @@ -109,7 +121,7 @@ export default async function KontaktPage() {

Nachricht senden

- +
diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 97f23ee..f21a287 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,6 +1,7 @@ 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 = { @@ -32,12 +33,20 @@ export default async function RootLayout({ 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 ( @@ -49,12 +58,12 @@ export default async function RootLayout({
-
+
{children}
-
diff --git a/src/app/so-funktionierts/page.tsx b/src/app/so-funktionierts/page.tsx index 8c92b1c..79a79b7 100644 --- a/src/app/so-funktionierts/page.tsx +++ b/src/app/so-funktionierts/page.tsx @@ -1,6 +1,8 @@ import type { Metadata } from "next" import { Container } from "@/components/ui/Container" import { Button } from "@/components/ui/Button" +import { getSiteSettings } from "@/lib/api" +import { phoneToHref } from "@/lib/payload-helpers" import { Phone, FileText, UserCheck, ClipboardCheck, MessageSquare, HeartHandshake, Shield, Clock, @@ -28,7 +30,10 @@ const whyCards = [ { title: "Persönlich", description: "Case Management und persönliche Betreuung von Anfang an.", icon: Users }, ] -export default function SoFunktionierts() { +export default async function SoFunktionierts() { + const settings = await getSiteSettings() + const phone = settings?.contact?.phone || "0800 80 44 100" + return ( <> {/* Hero */} @@ -104,9 +109,9 @@ export default function SoFunktionierts() { fundierte, unabhängige Einschätzung.

-
- Kostenlose Servicehotline: 0800 80 44 100 + Kostenlose Servicehotline: {phone}
@@ -117,9 +122,9 @@ export default function UeberUnsPage() {

Wir beraten Sie gerne unverbindlich und kostenfrei.

- diff --git a/src/components/contact/ContactForm.tsx b/src/components/contact/ContactForm.tsx index aedcda4..856acde 100644 --- a/src/components/contact/ContactForm.tsx +++ b/src/components/contact/ContactForm.tsx @@ -5,7 +5,11 @@ import { Send, Loader2, CheckCircle } from "lucide-react" const PAYLOAD_URL = process.env.NEXT_PUBLIC_PAYLOAD_URL || "https://cms.c2sgmbh.de" -export function ContactForm() { +interface ContactFormProps { + serviceOptions?: Array<{ value: string; label: string }> +} + +export function ContactForm({ serviceOptions = [] }: ContactFormProps) { const [form, setForm] = useState({ name: "", email: "", @@ -52,6 +56,17 @@ export function ContactForm() { } } + const options = serviceOptions.length > 0 + ? serviceOptions + : [ + { value: "intensivmedizin", label: "Intensivmedizin" }, + { value: "kardiologie", label: "Kardiologie" }, + { value: "onkologie", label: "Onkologie" }, + { value: "nephrologie", label: "Nephrologie" }, + { value: "gallenblase", label: "Gallenblase" }, + { value: "schilddruese", label: "Schilddrüse" }, + ] + if (status === "success") { return (
@@ -129,12 +144,9 @@ export function ContactForm() { className="w-full px-4 py-2.5 rounded-lg border border-border bg-bg focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary text-sm" > - - - - - - + {options.map((opt) => ( + + ))}
diff --git a/src/components/home/HomeCTA.tsx b/src/components/home/HomeCTA.tsx index 6c74d46..651655b 100644 --- a/src/components/home/HomeCTA.tsx +++ b/src/components/home/HomeCTA.tsx @@ -1,8 +1,13 @@ import { Phone, Mail } from "lucide-react" import { Container } from "@/components/ui/Container" import { Button } from "@/components/ui/Button" +import { getSiteSettings } from "@/lib/api" +import { phoneToHref } from "@/lib/payload-helpers" + +export async function HomeCTA() { + const settings = await getSiteSettings() + const phone = settings?.contact?.phone || "0800 80 44 100" -export function HomeCTA() { return (
@@ -15,7 +20,7 @@ export function HomeCTA() { Sicherheit, die Sie verdienen.
- diff --git a/src/components/layout/Footer.tsx b/src/components/layout/Footer.tsx index 358e3bc..624027c 100644 --- a/src/components/layout/Footer.tsx +++ b/src/components/layout/Footer.tsx @@ -6,51 +6,50 @@ import { socialLinksToMap } from "@/lib/payload-helpers" interface FooterProps { socialLinks?: SocialLink[] settings?: SiteSetting | null + services?: Array<{ title: string; slug: string }> } -const footerColumns = [ - { - title: "Top Fachbereiche", - links: [ - { label: "Kardiologie", href: "/fachbereiche/zweitmeinung-kardiologie" }, - { label: "Onkologie", href: "/fachbereiche/zweitmeinung-onkologie" }, - { label: "Intensivmedizin", href: "/fachbereiche/zweitmeinung-intensivmedizin" }, - { label: "Nephrologie", href: "/fachbereiche/zweitmeinung-nephrologie" }, - { label: "Gallenblase", href: "/fachbereiche/zweitmeinung-gallenblase" }, - { label: "Schilddrüse", href: "/fachbereiche/zweitmeinung-schilddruese" }, - ], - }, - { - title: "Services", - links: [ - { label: "So funktioniert's", href: "/so-funktionierts" }, - { label: "Häufige Fragen (FAQ)", href: "/faq" }, - { label: "Alle Fachbereiche", href: "/fachbereiche" }, - { label: "Kontakt", href: "/kontakt" }, - ], - }, - { - title: "Unternehmen", - links: [ - { label: "Über uns", href: "/ueber-uns" }, - { label: "Motivation", href: "/motivation" }, - { label: "complex care solutions GmbH", href: "https://complexcaresolutions.de" }, - ], - }, - { - title: "Rechtliches", - links: [ - { label: "Impressum", href: "/impressum" }, - { label: "Datenschutz", href: "/datenschutz" }, - ], - }, -] - -export function Footer({ socialLinks, settings }: FooterProps) { +export function Footer({ socialLinks, settings, services = [] }: FooterProps) { const socialMap = socialLinksToMap(socialLinks) const copyright = settings?.footer?.copyrightText || `\u00A9 ${new Date().getFullYear()} complex care solutions GmbH. Alle Rechte vorbehalten.` + const fachbereicheLinks = services.length > 0 + ? services.map((s) => ({ label: s.title, href: `/fachbereiche/${s.slug}` })) + : [ + { label: "Kardiologie", href: "/fachbereiche/zweitmeinung-kardiologie" }, + { label: "Onkologie", href: "/fachbereiche/zweitmeinung-onkologie" }, + { label: "Intensivmedizin", href: "/fachbereiche/zweitmeinung-intensivmedizin" }, + ] + + const footerColumns = [ + { title: "Top Fachbereiche", links: fachbereicheLinks }, + { + title: "Services", + links: [ + { label: "So funktioniert's", href: "/so-funktionierts" }, + { label: "Häufige Fragen (FAQ)", href: "/faq" }, + { label: "Alle Fachbereiche", href: "/fachbereiche" }, + { label: "Kontakt", href: "/kontakt" }, + ], + }, + { + title: "Unternehmen", + links: [ + { label: "Über uns", href: "/ueber-uns" }, + { label: "Motivation", href: "/motivation" }, + { label: "complex care solutions GmbH", href: "https://complexcaresolutions.de" }, + ], + }, + { + title: "Rechtliches", + links: [ + { label: "Impressum", href: "/impressum" }, + { label: "Datenschutz", href: "/datenschutz" }, + ], + }, + ] + return (