From fdb3e3eb8687969c5e512b0023e12d313be82926 Mon Sep 17 00:00:00 2001 From: MBO-Tech-IT Date: Wed, 30 Sep 2026 14:47:29 +0200 Subject: [PATCH] feat: Zielgruppen-Weiche im Hero, Kontaktformular je Zielgruppe, Schnellkontakt Co-Authored-By: Claude Sonnet 5.5 --- app/page.tsx | 4 +- components/Contact.tsx | 147 +++++++++++++++++++++++++++----- components/Header.tsx | 14 ++- components/Hero.tsx | 38 +++++++-- components/MobileContactBar.tsx | 21 +++++ 5 files changed, 195 insertions(+), 29 deletions(-) create mode 100644 components/MobileContactBar.tsx diff --git a/app/page.tsx b/app/page.tsx index 8ece008..01024b8 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -10,6 +10,7 @@ import PaperlessSection from "@/components/PaperlessSection"; import About from "@/components/About"; import Contact from "@/components/Contact"; import Footer from "@/components/Footer"; +import MobileContactBar from "@/components/MobileContactBar"; import { GalerieAnzeige } from "@/components/GalerieAnzeige"; export const dynamic = "force-dynamic"; @@ -63,7 +64,7 @@ export default async function Home() { })); return ( -
+
0 ? oeffnung : undefined} />
+
); } diff --git a/components/Contact.tsx b/components/Contact.tsx index 0efd5d8..5f14ecd 100644 --- a/components/Contact.tsx +++ b/components/Contact.tsx @@ -13,6 +13,34 @@ interface ContactProps { } type Status = "idle" | "loading" | "success" | "error"; +type Zielgruppe = "privat" | "geschaeftlich"; + +const themen: Record = { + privat: [ + "Mein WLAN ist langsam oder instabil", + "PC / Notebook läuft nicht richtig", + "Neuen Computer einrichten", + "Daten sichern / Fotos retten", + "Familienschutz (FamilyGuard)", + "Eigene Cloud (Nextcloud)", + "Sonstiges", + ], + geschaeftlich: [ + "IT-Betreuung & Support", + "Netzwerk & WLAN", + "Sicherer Fernzugriff (VPN)", + "Dokumentenarchiv (Nextcloud + Paperless)", + "Datensicherung & Backup", + "IT-Sicherheit & Datenschutz", + "Server, Cloud & Hosting", + "Webseite / Webanwendung", + "Sonstiges", + ], +}; + +const inputClass = + "w-full px-4 py-3 rounded-xl bg-slate-50 dark:bg-[#111925] border border-slate-300 dark:border-gray-700 text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-slate-600 focus:outline-none focus:border-orange-500/60 focus:ring-1 focus:ring-orange-500/20 transition-colors"; +const labelClass = "block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2"; export default function Contact({ telefon = "+49 171 9345193", @@ -57,6 +85,9 @@ export default function Contact({ const [name, setName] = useState(""); const [emailInput, setEmailInput] = useState(""); + const [zielgruppe, setZielgruppe] = useState("privat"); + const [firma, setFirma] = useState(""); + const [telefonInput, setTelefonInput] = useState(""); const [betreff, setBetreff] = useState(""); const [nachricht, setNachricht] = useState(""); const [status, setStatus] = useState("idle"); @@ -71,7 +102,18 @@ export default function Contact({ const res = await fetch("/api/contact", { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ name, email: emailInput, betreff, nachricht }), + body: JSON.stringify({ + name, + email: emailInput, + telefon: telefonInput.trim() || undefined, + betreff: `${zielgruppe === "privat" ? "Privat" : "Geschäftlich"}: ${betreff}`, + nachricht: + zielgruppe === "geschaeftlich" && firma.trim() + ? `Firma: ${firma.trim()}${nachricht ? ` + +${nachricht}` : ""}` + : nachricht, + }), }); const data = await res.json(); @@ -125,6 +167,8 @@ export default function Contact({ setStatus("idle"); setName(""); setEmailInput(""); + setTelefonInput(""); + setFirma(""); setBetreff(""); setNachricht(""); }} @@ -135,63 +179,122 @@ export default function Contact({ ) : (
+
+ Ich melde mich als +
+ {([ + ["privat", "Privatkunde"], + ["geschaeftlich", "Unternehmen"], + ] as const).map(([value, label]) => ( + + ))} +
+
+
- + setName(e.target.value)} placeholder="Max Mustermann" - className="w-full px-4 py-3 rounded-xl bg-slate-50 dark:bg-[#111925] border border-slate-300 dark:border-gray-700 text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-slate-600 focus:outline-none focus:border-orange-500/60 focus:ring-1 focus:ring-orange-500/20 transition-colors" + className={inputClass} />
+ {zielgruppe === "geschaeftlich" ? ( +
+ + setFirma(e.target.value)} + placeholder="Musterfirma GmbH" + className={inputClass} + /> +
+ ) : null}
- + setEmailInput(e.target.value)} placeholder="max@beispiel.de" - className="w-full px-4 py-3 rounded-xl bg-slate-50 dark:bg-[#111925] border border-slate-300 dark:border-gray-700 text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-slate-600 focus:outline-none focus:border-orange-500/60 focus:ring-1 focus:ring-orange-500/20 transition-colors" + className={inputClass} + /> +
+
+ + setTelefonInput(e.target.value)} + placeholder="0171 1234567" + className={inputClass} />
- +
- +