diff --git a/src/components/CustomRoadmap/CustomRoadmapRatings.tsx b/src/components/CustomRoadmap/CustomRoadmapRatings.tsx index 257014b11..9cf4f1160 100644 --- a/src/components/CustomRoadmap/CustomRoadmapRatings.tsx +++ b/src/components/CustomRoadmap/CustomRoadmapRatings.tsx @@ -1,9 +1,8 @@ -import { useState, type CSSProperties } from 'react'; +import { useState } from 'react'; import { Rating } from '../Rating/Rating'; import type { RoadmapDocument } from './CreateRoadmap/CreateRoadmapModal'; import { CustomRoadmapRatingsModal } from './CustomRoadmapRatingsModal'; import { Star } from 'lucide-react'; -import { cn } from '../../lib/classname'; type CustomRoadmapRatingsProps = { roadmapSlug: string; @@ -16,6 +15,11 @@ export function CustomRoadmapRatings(props: CustomRoadmapRatingsProps) { const { ratings, roadmapSlug, canManage, unseenRatingCount } = props; const average = ratings?.average || 0; + const totalPeopleWhoRated = Object.keys(ratings?.breakdown || {}).reduce( + (acc, key) => acc + ratings?.breakdown[key as any], + 0, + ); + const [isDetailsOpen, setIsDetailsOpen] = useState(false); return ( @@ -30,30 +34,46 @@ export function CustomRoadmapRatings(props: CustomRoadmapRatingsProps) { canManage={canManage} /> )} -
- Share your thoughts with the roadmap creator. -
- - {(isRatingRoadmap || userRatingId) && ( ++ Rate and share your thoughts with the roadmap creator. +
+ + > + )} + + {!isLoading && !isRatingRoadmap && userRatingId && ( +{userFeedback}
} ++ Share your thoughts with the roadmap creator. +
+