TestimonialCard.tsx 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. import React, { useState, useEffect, useCallback } from "react";
  2. import { TestimonialType } from "../services/types";
  3. const TestimonialCard: React.FC<{ item: TestimonialType }> = ({ item }) => (
  4. <div className="bg-white/10 backdrop-blur-md border border-white/20 rounded-[24px] md:rounded-[32px] p-5 md:p-6 min-w-[280px] md:min-w-[320px] max-w-[340px] shadow-xl text-white flex flex-col space-y-4">
  5. <div className="flex items-center space-x-3">
  6. <img
  7. src={item.avatar}
  8. alt={item.name}
  9. className="w-10 h-10 md:w-12 md:h-12 rounded-full border-2 border-white/50 object-cover"
  10. />
  11. <div>
  12. <h4 className="font-bold text-sm md:text-lg">{item.name}</h4>
  13. <p className="text-white/60 text-[10px] md:text-xs">{item.location}</p>
  14. </div>
  15. </div>
  16. <div className="flex space-x-1">
  17. {[...Array(item.rating)].map((_, i) => (
  18. <svg
  19. key={i}
  20. className="w-3.5 h-3.5 md:w-4 md:h-4 text-yellow-400"
  21. fill="currentColor"
  22. viewBox="0 0 20 20"
  23. >
  24. <path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
  25. </svg>
  26. ))}
  27. </div>
  28. <p className="text-xs md:text-sm font-medium leading-relaxed italic text-white/90 whitespace-normal">
  29. "{item.content}"
  30. </p>
  31. </div>
  32. );
  33. export default TestimonialCard;