MBO-Tech-IT-Webseite/components/Hero.tsx

90 lines
2.9 KiB
TypeScript

import type { CSSProperties } from "react";
import NetField from "./NetField";
interface HeroProps {
eyebrowText?: string;
headline1?: string;
subtext1?: string;
subtext2?: string;
cta1Text?: string;
cta1Href?: string;
cta2Text?: string;
cta2Href?: string;
bgImagePath?: string | null;
badges?: string[];
}
// Knoten im Netz: was wir tun, in Worten für Nicht-Techniker. x/y in Prozent des Hero.
const netLabels = [
{ text: "WLAN", x: 58, y: 22 },
{ text: "Netzwerk", x: 75, y: 15 },
{ text: "PC & Notebook", x: 84, y: 32 },
{ text: "Eigene Cloud", x: 64, y: 42 },
{ text: "Webseiten", x: 80, y: 52 },
{ text: "Datensicherung", x: 58, y: 63 },
{ text: "Fernzugriff", x: 86, y: 68 },
{ text: "IT-Sicherheit", x: 71, y: 78 },
];
export default function Hero({
headline1 = "Ihr IT-Service in Crailsheim.",
subtext1 = "Ihr IT-Dienstleister in Crailsheim, egal ob zu Hause oder im Büro. Von Hard- & Software über Netzwerk & WLAN bis hin zu Webseiten & Webanwendungen: Wir lösen Ihre IT-Probleme persönlich und zum fairen Preis.",
subtext2 = "",
cta1Text = "Jetzt anfragen",
cta1Href = "#contact",
cta2Text = "Unsere Leistungen",
cta2Href = "/services",
bgImagePath = null,
}: HeroProps = {}) {
return (
<section className="hero" aria-labelledby="hero-title">
{bgImagePath && (
<div className="hero__photo" data-slot="hero" data-alt="Hintergrundbild aus der Verwaltung (hero-bilder)">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
src={`${process.env.NEXT_PUBLIC_SUPABASE_URL}/storage/v1/object/public/hero-bilder/${bgImagePath}`}
alt=""
fetchPriority="high"
/>
</div>
)}
<NetField />
<div className="wrap grid12 hero__content">
<div className="hero__text">
<h1 id="hero-title">
<span className="hero__brand">
MBO-<span className="hero__brand-blue">Tech-IT</span>
</span>{" "}
<span className="hero__claim">{headline1}</span>
</h1>
{subtext1 && <p className="hero__sub">{subtext1}</p>}
{subtext2 && <p className="hero__sub">{subtext2}</p>}
<div className="hero__actions">
<a href={cta1Href} className="btn-primary btn-lg">
{cta1Text}
</a>
<a href={cta2Href === "#services" ? "/services" : cta2Href} className="btn-secondary btn-lg">
{cta2Text}
</a>
</div>
<ul className="hero__net" aria-label="Wobei wir helfen">
{netLabels.map((l, i) => (
<li
key={l.text}
className={i % 2 === 0 ? "is-warm" : undefined}
style={{ "--x": `${l.x}%`, "--y": `${l.y}%` } as CSSProperties}
>
{l.text}
</li>
))}
</ul>
</div>
</div>
</section>
);
}