| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import { Check } from 'lucide-react';
- import { cn } from '@/lib/utils';
- import { formatPrice } from '../theme';
- import type { FeaturedProductSection } from '../types';
- import { Container, Eyebrow, ImagePlaceholder, SfButton } from '../ui';
-
- export function FeaturedProduct({
- section,
- }: {
- section: FeaturedProductSection;
- }) {
- const { eyebrow, name, description, price, bullets, cta } = section.content;
-
- return (
- <section id={section.id} className="scroll-mt-20 bg-(--sf-surface)">
- <Container className="grid items-center gap-10 py-16 md:grid-cols-2 md:py-20">
- <ImagePlaceholder
- seed={2}
- label={name}
- className={cn(
- 'aspect-square w-full',
- section.variant === 'image-right' && 'md:order-last',
- )}
- />
-
- <div>
- {eyebrow && <Eyebrow>{eyebrow}</Eyebrow>}
- <h2 className="sf-heading mt-3 text-3xl leading-tight font-semibold sm:text-4xl">
- {name}
- </h2>
- <p className="mt-3 text-2xl font-semibold tabular-nums">
- {formatPrice(price)}
- </p>
- <p className="mt-4 max-w-md text-(--sf-muted)">
- {description}
- </p>
-
- {bullets.length > 0 && (
- <ul className="mt-6 space-y-2.5 text-sm">
- {bullets.map((bullet) => (
- <li key={bullet} className="flex gap-2.5">
- <Check
- aria-hidden
- className="mt-0.5 size-4 shrink-0 text-(--sf-primary)"
- />
- {bullet}
- </li>
- ))}
- </ul>
- )}
-
- <SfButton href={cta.href} className="mt-8">
- {cta.label}
- </SfButton>
- </div>
- </Container>
- </section>
- );
- }
|