'use client'; import React from 'react'; import { Star, ShieldCheck, PenLine } from 'lucide-react'; interface ReviewSummaryBreakdownProps { averageRating: number; totalReviews: number; verifiedCount: number; starDistribution: Record; onWriteReviewClick: () => void; } export function ReviewSummaryBreakdown({ averageRating, totalReviews, verifiedCount, starDistribution, onWriteReviewClick, }: ReviewSummaryBreakdownProps) { const starsList = [5, 4, 3, 2, 1]; return (
{/* Left: Big Score & Stars */}
{averageRating > 0 ? averageRating.toFixed(1) : '0.0'} / 5.0
{Array.from({ length: 5 }).map((_, i) => ( ))}

Based on {totalReviews} {totalReviews === 1 ? 'review' : 'customer reviews'}

{verifiedCount > 0 && (
{verifiedCount} Verified Purchases
)}
{/* Right: Star Distribution Progress Bars */}
{starsList.map((stars) => { const count = starDistribution[String(stars)] || 0; const percent = totalReviews > 0 ? Math.round((count / totalReviews) * 100) : 0; return (
{stars}
{percent}% ({count})
); })}
); }