11import axios from 'axios' ;
2- import Skeleton from 'react-loading-skeleton' ;
32import StarRating from './StarRating' ;
43import { HiSparkles } from 'react-icons/hi2' ;
54import { useQuery } from '@tanstack/react-query' ;
65import { Button } from '../ui/button' ;
76import { useState } from 'react' ;
7+ import ReviewSkeleton from './ReviewSkeleton' ;
88
99interface Props {
1010 productId : number ;
@@ -64,11 +64,7 @@ const ReviewList = ({ productId }: Props) => {
6464 return (
6565 < div className = "flex flex-col gap-5" >
6666 { [ 1 , 2 , 3 ] . map ( ( placeholder ) => (
67- < div key = { placeholder } >
68- < Skeleton width = { 150 } /> { /* User name placeholder */ }
69- < Skeleton width = { 100 } /> { /* Stars placeholder */ }
70- < Skeleton count = { 2 } /> { /* Review placeholder (2-liner) */ }
71- </ div >
67+ < ReviewSkeleton key = { placeholder } />
7268 ) ) }
7369 </ div >
7470 ) ;
@@ -93,10 +89,10 @@ const ReviewList = ({ productId }: Props) => {
9389 < p > { reviewData . summary } </ p >
9490 ) : generatingSummary ? (
9591 < div >
96- < Skeleton count = { 3 } /> { /* Review placeholder (2-liner) */ }
92+ < ReviewSkeleton />
9793 </ div >
9894 ) : (
99- < Button onClick = { generateSummary } >
95+ < Button onClick = { generateSummary } className = "cursor-pointer" >
10096 < HiSparkles className = "text-yellow-400" />
10197 Summarize
10298 </ Button >
0 commit comments