TwoUpFeature.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import LinkButton from "./LinkButton"
  2. export type TwoUpFeatureProps = {
  3. features: {
  4. Icon: (props: React.SVGProps<SVGElement>) => React.ReactElement
  5. title: React.ReactNode
  6. copy: React.ReactNode
  7. cta: React.ReactNode
  8. cta_link: string
  9. }[]
  10. padding?: string
  11. }
  12. /** Two-column (on desktop) feature section */
  13. const TwoUpFeature = ({ features, padding }: TwoUpFeatureProps) => {
  14. return (
  15. <div className="mb-32 gap-gutter lg:mb-0 lg:flex">
  16. {features.map(({ Icon, title, copy, cta, cta_link }, i) => (
  17. <div
  18. className={`grid justify-items-center py-8 text-center lg:grid-cols-6 lg:py-32 ${padding}`}
  19. key={i}
  20. >
  21. <Icon className="-ml-2 h-auto w-20 text-blurple-500 md:-ml-4 md:w-32 lg:col-span-6" />
  22. <h2 className="h4 mb-5 mt-4 lg:col-span-6">{title}</h2>
  23. <h2 className="sh1 mb-8 lg:col-span-6 lg:col-start-1 xl:col-span-4 xl:col-start-2">
  24. {copy}
  25. </h2>
  26. <div className="lg:col-span-6">
  27. <LinkButton size="large" href={cta_link}>
  28. {cta}
  29. </LinkButton>
  30. </div>
  31. </div>
  32. ))}
  33. </div>
  34. )
  35. }
  36. export default TwoUpFeature