Testimonials.tsx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import Image from 'next/image';
  2. import testimonials from '@/data/testimonials.json';
  3. import clsx from 'clsx';
  4. import TestimonialsShare from './TestimonialsShare';
  5. export default function Testimonials({ limit = 0 }) {
  6. let testimonialsList = testimonials;
  7. if (limit) {
  8. testimonialsList = testimonials.slice(0, limit);
  9. }
  10. return (
  11. <>
  12. <div className="row" data-aos-id-blocks-testimonials>
  13. {testimonialsList.map((column, id) => (
  14. <div
  15. className={clsx('col-12 sm:col', id === 2 && 'd-none lg:d-block')}
  16. key={id}
  17. >
  18. {column.map((testimonial, id2) => (
  19. <a
  20. href={testimonial.url}
  21. className="testimonial"
  22. target="_blank"
  23. rel="noopener noreferrer"
  24. key={id2}
  25. data-aos="fade-up"
  26. data-aos-anchor="[data-aos-id-blocks-testimonials]"
  27. data-aos-delay={id2 * 150 + id * 50}
  28. >
  29. <div className="row g-3 items-center">
  30. <div className="col-auto">
  31. <Image
  32. className="avatar avatar-lg d-block"
  33. src={`/img/testimonials/${testimonial.avatar}`}
  34. width={48}
  35. height={48}
  36. alt={testimonial.name}
  37. />
  38. </div>
  39. <div className="col">
  40. <div className="font-bold">{testimonial.name}</div>
  41. <div className="text-muted">{testimonial.job}</div>
  42. </div>
  43. </div>
  44. <div className="mt-3">{testimonial.description}</div>
  45. </a>
  46. ))}
  47. </div>
  48. ))}
  49. </div>
  50. <div className="mt-5">
  51. <TestimonialsShare />
  52. </div>
  53. </>
  54. );
  55. }