PRODUCTREVIEWS COMPONENT
Display customer reviews with ratings, verification badges, and helpful votes.
REVIEW SUMMARY
CUSTOMER REVIEWS
CODE EXAMPLE
reviews-example.tsxtsx
1import { ProductReviews } from '@/components/fanbace/reviews';2import { useReviews } from '@/lib/sdk';3 4export default function ProductPage({ productId }: Props) {5 const { reviews, summary, loading } = useReviews(productId);6 7 return (8 <ProductReviews9 reviews={reviews}10 summary={summary}11 loading={loading}12 onHelpful={(reviewId) => markReviewHelpful(reviewId)}13 onReport={(reviewId) => reportReview(reviewId)}14 showVerifiedBadge15 />16 );17}PROPS
| Prop | Type | Description |
|---|---|---|
| reviews | Review[] | Array of customer reviews |
| summary | ReviewSummary | Average rating and distribution |
| onHelpful | (id) => void | Mark review as helpful |
| showVerifiedBadge | boolean | Show verified purchase badge |