AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

testimonials.tsx 3.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import { cn } from '@/lib/utils';
  2. import type { TestimonialsSection } from '../types';
  3. import { Container, SectionHeading } from '../ui';
  4. export function Testimonials({ section }: { section: TestimonialsSection }) {
  5. const { heading, items } = section.content;
  6. if (section.variant === 'single') {
  7. const first = items[0];
  8. return (
  9. <section
  10. id={section.id}
  11. className="sf-section scroll-mt-20 bg-(--sf-surface) py-16 md:py-24"
  12. >
  13. <Container className="max-w-3xl text-center">
  14. <p className="text-sm font-semibold text-(--sf-primary)">
  15. {heading}
  16. </p>
  17. <blockquote className="sf-heading mt-6 text-2xl leading-snug text-balance sm:text-3xl">
  18. “{first.quote}”
  19. </blockquote>
  20. <p className="mt-6 text-sm text-(--sf-muted)">
  21. {first.name}
  22. {first.role ? ` · ${first.role}` : ''}
  23. </p>
  24. </Container>
  25. </section>
  26. );
  27. }
  28. // wall: cards of different heights packed in columns, like notes on a board.
  29. const wall = section.variant === 'wall';
  30. return (
  31. <section
  32. id={section.id}
  33. className="sf-section scroll-mt-20 bg-(--sf-surface) py-16 md:py-20"
  34. data-layout={section.variant}
  35. >
  36. <Container>
  37. <SectionHeading heading={heading} />
  38. <ul
  39. className={
  40. wall
  41. ? 'mt-10 columns-1 gap-5 sm:columns-2 lg:columns-3'
  42. : 'mt-10 grid gap-5 md:grid-cols-3'
  43. }
  44. >
  45. {items.map((item, index) => (
  46. <li
  47. key={item.name + item.quote}
  48. className={cn(
  49. 'sf-card flex flex-col justify-between gap-6 rounded-(--sf-radius-card) border border-(--sf-border) bg-(--sf-bg) p-6',
  50. wall && 'mb-5 break-inside-avoid',
  51. wall && index % 3 === 0 && 'sf-heading text-lg',
  52. )}
  53. >
  54. <blockquote className="leading-relaxed">
  55. “{item.quote}”
  56. </blockquote>
  57. <p className="text-sm">
  58. <span className="font-semibold">
  59. {item.name}
  60. </span>
  61. {item.role && (
  62. <span className="text-(--sf-muted)">
  63. {' '}
  64. · {item.role}
  65. </span>
  66. )}
  67. </p>
  68. </li>
  69. ))}
  70. </ul>
  71. </Container>
  72. </section>
  73. );
  74. }