AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

featured-product.tsx 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { Check } from 'lucide-react';
  2. import { cn } from '@/lib/utils';
  3. import { formatPrice } from '../theme';
  4. import type { FeaturedProductSection } from '../types';
  5. import { Container, Eyebrow, ImagePlaceholder, SfButton } from '../ui';
  6. export function FeaturedProduct({
  7. section,
  8. }: {
  9. section: FeaturedProductSection;
  10. }) {
  11. const { eyebrow, name, description, price, bullets, cta } = section.content;
  12. return (
  13. <section id={section.id} className="scroll-mt-20 bg-(--sf-surface)">
  14. <Container className="grid items-center gap-10 py-16 md:grid-cols-2 md:py-20">
  15. <ImagePlaceholder
  16. seed={2}
  17. label={name}
  18. className={cn(
  19. 'aspect-square w-full',
  20. section.variant === 'image-right' && 'md:order-last',
  21. )}
  22. />
  23. <div>
  24. {eyebrow && <Eyebrow>{eyebrow}</Eyebrow>}
  25. <h2 className="sf-heading mt-3 text-3xl leading-tight font-semibold sm:text-4xl">
  26. {name}
  27. </h2>
  28. <p className="mt-3 text-2xl font-semibold tabular-nums">
  29. {formatPrice(price)}
  30. </p>
  31. <p className="mt-4 max-w-md text-(--sf-muted)">
  32. {description}
  33. </p>
  34. {bullets.length > 0 && (
  35. <ul className="mt-6 space-y-2.5 text-sm">
  36. {bullets.map((bullet) => (
  37. <li key={bullet} className="flex gap-2.5">
  38. <Check
  39. aria-hidden
  40. className="mt-0.5 size-4 shrink-0 text-(--sf-primary)"
  41. />
  42. {bullet}
  43. </li>
  44. ))}
  45. </ul>
  46. )}
  47. <SfButton href={cta.href} className="mt-8">
  48. {cta.label}
  49. </SfButton>
  50. </div>
  51. </Container>
  52. </section>
  53. );
  54. }