useReviewSummary
sample usage:
const {
average_rating,
total_questions,
total_reviews,
ratings,
productId,
openAddReview,
isLoading,
} = useReviewSummary(props);
Hook return data
| Name | Description | |
|---|---|---|
| average_rating | Average Review with 1 decimal point | |
| total_reviews | Total number of reviews | |
| productId | Current product ID | |
| ratings | Array of object with ratings data, sample: [{ rating, percentage, count}] | |
| total_questions | Total number of questions | |
| onShowFullReview | Function to Open review list | |
| openAddReview | Function to Open add review page | |
| isLoading | Boolean value to show loading while data is being retrieved |