IconCard.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import Image from "next/legacy/image"
  2. export type IconCardProps = {
  3. /** Card's heading */
  4. title: React.ReactNode
  5. /** Card's visual element, using a predefined set of icons */
  6. icon: string
  7. /** Card's copy */
  8. copy: React.ReactNode
  9. /** Extra class names, used for homepage carousel */
  10. className?: string
  11. }
  12. /**
  13. * Renders a feature card with a visual element and copy.
  14. * Layout (width, height, positioning) can be set from the parent.
  15. */
  16. export const IconCard = ({ title, icon, copy, className }: IconCardProps) => {
  17. return (
  18. <div
  19. className={`flex flex-col items-center justify-start overflow-hidden rounded bg-white text-center ${className}`}
  20. >
  21. <div className="flex h-44 w-full items-center justify-center text-blurple-500">
  22. <div className="relative h-[7.5rem] w-[7.5rem]">
  23. <Image
  24. src={require(`../public/icons/${icon}.svg`)}
  25. layout="fill"
  26. alt=""
  27. />
  28. </div>
  29. </div>
  30. <div className="flex flex-col gap-2 p-8 pt-0">
  31. <h3 className="h5">{title}</h3>
  32. <p className="b2 text-gray-1">{copy}</p>
  33. </div>
  34. </div>
  35. )
  36. }