import { formatDate, t } from "@/utils"; import { useEffect, useRef, useState } from "react"; import StarRating from "./StarRating"; import CustomImage from "@/components/Common/CustomImage"; const SellerReviewCard = ({ rating }) => { const [isExpanded, setIsExpanded] = useState(false); const [isTextOverflowing, setIsTextOverflowing] = useState(false); const textRef = useRef(null); useEffect(() => { const checkOverflow = () => { const content = textRef.current; if (content) { setIsTextOverflowing(content.scrollHeight > content.clientHeight); } }; checkOverflow(); window.addEventListener("resize", checkOverflow); return () => window.removeEventListener("resize", checkOverflow); }, []); return (

{rating?.buyer?.name}

{rating?.ratings}

{formatDate(rating?.created_at)}

{rating?.review}

{isTextOverflowing && (
)}
); }; export default SellerReviewCard;