| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import type { HeroSection } from '../types';
- import { Container, Eyebrow, ImagePlaceholder, SfButton } from '../ui';
-
- export function Hero({ section }: { section: HeroSection }) {
- const { eyebrow, headline, subheadline, primaryCta, secondaryCta } =
- section.content;
-
- const buttons = (
- <div className="mt-8 flex flex-wrap gap-3">
- <SfButton href={primaryCta.href}>{primaryCta.label}</SfButton>
- {secondaryCta && (
- <SfButton href={secondaryCta.href} variant="outline">
- {secondaryCta.label}
- </SfButton>
- )}
- </div>
- );
-
- if (section.variant === 'split') {
- return (
- <section id={section.id} className="scroll-mt-20">
- <Container className="grid items-center gap-10 py-16 md:grid-cols-2 md:py-24">
- <div>
- {eyebrow && <Eyebrow>{eyebrow}</Eyebrow>}
- <h1 className="sf-heading mt-4 text-4xl leading-[1.08] font-semibold text-balance sm:text-5xl lg:text-6xl">
- {headline}
- </h1>
- <p className="mt-5 max-w-md text-lg text-(--sf-muted)">
- {subheadline}
- </p>
- {buttons}
- </div>
- <ImagePlaceholder
- label={headline}
- className="aspect-[4/5] w-full md:aspect-square"
- />
- </Container>
- </section>
- );
- }
-
- return (
- <section id={section.id} className="scroll-mt-20 bg-(--sf-surface)">
- <Container className="flex flex-col items-center py-20 text-center md:py-28">
- {eyebrow && <Eyebrow>{eyebrow}</Eyebrow>}
- <h1 className="sf-heading mt-4 max-w-3xl text-4xl leading-[1.08] font-semibold text-balance sm:text-5xl lg:text-6xl">
- {headline}
- </h1>
- <p className="mt-5 max-w-xl text-lg text-(--sf-muted)">
- {subheadline}
- </p>
- <div className="flex justify-center">{buttons}</div>
- </Container>
- </section>
- );
- }
|