208 lines
7.7 KiB
TypeScript
208 lines
7.7 KiB
TypeScript
import type { Icon as PhosphorIcon } from "@phosphor-icons/react";
|
|
import type { ScreenshotAccordionItem } from "./ScreenshotAccordion";
|
|
import type { ReactNode } from "react";
|
|
import CtaBanner, { type CtaVariant } from "@/components/ui/CtaShowcase";
|
|
|
|
export interface ProductFeature {
|
|
icon: PhosphorIcon;
|
|
title: string;
|
|
desc: string;
|
|
}
|
|
|
|
export type AccordionItem = ScreenshotAccordionItem;
|
|
|
|
export interface ProductPageData {
|
|
badge: string;
|
|
headline: string;
|
|
subtext: string;
|
|
accordionBadge?: string;
|
|
accordionHeadline?: string;
|
|
accordionItems?: AccordionItem[];
|
|
featureHeading: string;
|
|
featureSubtext: string;
|
|
features: ProductFeature[];
|
|
ctaHeadline: string;
|
|
ctaSubtext: string;
|
|
/** Which shared CTA showcase variant to render (hex | portrait | kanban). */
|
|
ctaVariant?: CtaVariant;
|
|
/** @deprecated superseded by ctaVariant */
|
|
ctaStyle?: "light" | "dark";
|
|
ctaSecondaryLabel?: string;
|
|
ctaSecondaryHref?: string;
|
|
/** Optional extra sections inserted before/after feature grid */
|
|
extraSectionBefore?: ReactNode;
|
|
extraSectionAfter?: ReactNode;
|
|
/** Optional: custom visual for solution right side */
|
|
solutionVisual?: ReactNode;
|
|
}
|
|
|
|
// Feature icon inside a honeycomb cell (brand motif) — flat-top hexagon frame
|
|
// in the same yellow as the icon, with a subtle tint fill.
|
|
function HexIcon({ icon: Icon }: { icon: PhosphorIcon }) {
|
|
return (
|
|
<span className="relative inline-flex items-center justify-center shrink-0" style={{ width: 54, height: 54 }} aria-hidden>
|
|
<svg viewBox="0 0 56 56" className="absolute inset-0 w-full h-full" fill="none">
|
|
<path
|
|
d="M3 28 L15.5 6.4 L40.5 6.4 L53 28 L40.5 49.6 L15.5 49.6 Z"
|
|
fill="var(--accent-yellow-light)"
|
|
stroke="var(--text-primary)"
|
|
strokeWidth="2"
|
|
strokeLinejoin="round"
|
|
/>
|
|
</svg>
|
|
<Icon size={23} weight="duotone" style={{ color: "var(--accent-yellow-dark)" }} className="relative" />
|
|
</span>
|
|
);
|
|
}
|
|
|
|
export default function ProductPageTemplate({
|
|
data,
|
|
slug,
|
|
}: {
|
|
data: ProductPageData;
|
|
slug?: string;
|
|
}) {
|
|
const jsonLd = slug
|
|
? [
|
|
{
|
|
"@context": "https://schema.org",
|
|
"@type": "SoftwareApplication",
|
|
name: `HiveGrid ${data.badge ? "" : ""}${data.headline.split(":")[0]}`.trim(),
|
|
description: data.subtext || data.featureSubtext,
|
|
applicationCategory: "BusinessApplication",
|
|
operatingSystem: "Web, iOS, Android",
|
|
url: `https://hivegrid.de/produkt/${slug}`,
|
|
offers: {
|
|
"@type": "Offer",
|
|
price: "0",
|
|
priceCurrency: "EUR",
|
|
availability: "https://schema.org/InStock",
|
|
},
|
|
provider: { "@type": "Organization", name: "HiveGrid", url: "https://hivegrid.de" },
|
|
},
|
|
{
|
|
"@context": "https://schema.org",
|
|
"@type": "BreadcrumbList",
|
|
itemListElement: [
|
|
{ "@type": "ListItem", position: 1, name: "Home", item: "https://hivegrid.de" },
|
|
{ "@type": "ListItem", position: 2, name: "Lösungen", item: "https://hivegrid.de/#loesungen" },
|
|
{ "@type": "ListItem", position: 3, name: data.headline.split(":")[0].replace(/^HiveGrid\s*/, "").trim(), item: `https://hivegrid.de/produkt/${slug}` },
|
|
],
|
|
},
|
|
]
|
|
: null;
|
|
|
|
return (
|
|
<>
|
|
{jsonLd?.map((schema, i) => (
|
|
<script
|
|
key={i}
|
|
type="application/ld+json"
|
|
dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
|
|
/>
|
|
))}
|
|
{/* Hero */}
|
|
<section
|
|
className="section-full"
|
|
style={{ background: "var(--surface)", paddingTop: "var(--hero-top-padding)", paddingBottom: data.subtext ? 80 : 20 }}
|
|
>
|
|
<div className="flex flex-col items-center gap-8 mx-auto text-center" style={{ maxWidth: 800 }}>
|
|
<span
|
|
className="text-[12px] font-semibold tracking-widest chamfer-badge px-2 py-0.5"
|
|
style={{ background: "var(--accent-yellow-light)", color: "var(--accent-yellow-dark)" }}
|
|
>
|
|
{data.badge}
|
|
</span>
|
|
<h1
|
|
className="text-[28px] sm:text-[36px] md:text-[56px] font-bold leading-[1.1]"
|
|
style={{ color: "var(--text-primary)" }}
|
|
>
|
|
{data.headline}
|
|
</h1>
|
|
{data.subtext && (
|
|
<p
|
|
className="text-[17px] md:text-[18px] leading-relaxed max-w-2xl"
|
|
style={{ color: "var(--text-secondary)" }}
|
|
>
|
|
{data.subtext}
|
|
</p>
|
|
)}
|
|
</div>
|
|
</section>
|
|
|
|
{/* Visualisation (interactive centrepiece, e.g. Kanban / Email builder) */}
|
|
{data.extraSectionBefore}
|
|
|
|
{/* Feature Grid */}
|
|
<section className="section-full" style={{ background: "var(--surface)", paddingBlock: 80 }}>
|
|
<div
|
|
className="flex flex-col items-center gap-12 mx-auto"
|
|
style={{ maxWidth: "var(--content-width)" }}
|
|
>
|
|
<div className="flex flex-col items-center gap-4 text-center" style={{ maxWidth: 700 }}>
|
|
<h2
|
|
className="text-[32px] md:text-[42px] font-bold leading-[1.15]"
|
|
style={{ color: "var(--text-primary)" }}
|
|
>
|
|
{data.featureHeading}
|
|
</h2>
|
|
{data.featureSubtext && (
|
|
<p className="text-[16px] leading-relaxed" style={{ color: "var(--text-secondary)" }}>
|
|
{data.featureSubtext}
|
|
</p>
|
|
)}
|
|
</div>
|
|
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 w-full">
|
|
{data.features.map(({ icon: Icon, title, desc }) => (
|
|
<div
|
|
key={title}
|
|
className="relative overflow-hidden"
|
|
style={{
|
|
background: "var(--container-bg)",
|
|
padding: 32,
|
|
// Chamfered (cut) corners instead of rounded — echoes the
|
|
// honeycomb geometry and reads less generic-AI than uniform radii.
|
|
clipPath:
|
|
"polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px)",
|
|
}}
|
|
>
|
|
{/* HiveGrid honeycomb — subtle, top-right, faded into the card */}
|
|
<span
|
|
aria-hidden
|
|
className="absolute top-0 right-0 pointer-events-none"
|
|
style={{
|
|
width: "58%",
|
|
height: "66%",
|
|
backgroundImage: "url(/cta-honeycomb.svg)",
|
|
backgroundSize: "230px",
|
|
backgroundPosition: "top right",
|
|
backgroundRepeat: "no-repeat",
|
|
opacity: 0.5,
|
|
WebkitMaskImage: "radial-gradient(125% 125% at 100% 0%, #000 0%, transparent 62%)",
|
|
maskImage: "radial-gradient(125% 125% at 100% 0%, #000 0%, transparent 62%)",
|
|
}}
|
|
/>
|
|
<div className="relative z-10 flex flex-col gap-4">
|
|
<HexIcon icon={Icon} />
|
|
<h3 className="text-[18px] font-semibold" style={{ color: "var(--text-primary)" }}>{title}</h3>
|
|
<p className="text-[14px] leading-relaxed" style={{ color: "var(--text-secondary)" }}>{desc}</p>
|
|
</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* Extra section after feature grid (e.g. Bento Grid) */}
|
|
{data.extraSectionAfter}
|
|
|
|
{/* CTA — shared showcase; each product picks the variant that fits */}
|
|
<CtaBanner
|
|
variant={data.ctaVariant ?? "hex"}
|
|
headline={data.ctaHeadline}
|
|
sub={data.ctaSubtext}
|
|
/>
|
|
</>
|
|
);
|
|
}
|