import Link from "next/link"; import { cn } from "@/lib/utils"; import { Typography } from "@/components/Typography"; export type HeroButtonVariant = "primary" | "secondary" | "outline" | "ghost"; export type HeroButton = { label: string; href: string; variant: HeroButtonVariant; }; export type HeroProps = { tagline: string; heading: string; subheading: string; buttons: HeroButton[]; imageUrl: string; align: "left" | "center"; height: "md" | "lg" | "full"; tone: "light" | "dark"; }; const heightClass: Record = { md: "min-h-[60vh]", lg: "min-h-[80vh]", full: "min-h-screen", }; function buttonClass(variant: HeroButtonVariant, isDark: boolean): string { switch (variant) { case "primary": return cn( "inline-flex items-center justify-center rounded-md px-6 py-3 text-sm font-medium tracking-wide transition-opacity hover:opacity-90", isDark ? "bg-white text-black" : "bg-foreground text-background", ); case "secondary": case "outline": return cn( "inline-flex items-center justify-center rounded-md border px-6 py-3 text-sm font-medium tracking-wide transition-opacity hover:opacity-80", isDark ? "border-white text-white" : "border-foreground text-foreground", ); case "ghost": return cn( "inline-flex items-center justify-center rounded-md px-6 py-3 text-sm font-medium tracking-wide transition-opacity hover:opacity-80", isDark ? "text-white" : "text-foreground", ); } } export function Hero({ tagline, heading, subheading, buttons, imageUrl, align, height, tone, }: HeroProps) { const isDark = tone === "dark"; const visibleButtons = (buttons ?? []).filter((b) => b?.label); return (
{imageUrl ? ( ) : null}
{tagline ? ( {tagline} ) : null} {heading} {subheading ? ( {subheading} ) : null} {visibleButtons.length > 0 ? (
{visibleButtons.map((b, i) => ( {b.label} ))}
) : null}
); }