--- import { markdownToHtml } from '@/lib/markdown'; import StarRating from './subcomponents/StarRating.astro'; interface Props { reviews: ReviewListComponent; } const reviews = Astro.props.reviews; let totalStars: number = 0; const totalReviews: number = reviews.reviews.length; reviews.reviews.forEach((review) => { totalStars = totalStars + review.stars; }); const averageStars = Math.round((totalStars / totalReviews) * 10) / 10; const reviewsToShow = reviews.reviews.slice(0, 5); ---

{reviews.title}

{reviews.text}

{averageStars} stars out of {totalReviews} {totalReviews === 1 ? "review" : "reviews"}.

{ reviewsToShow.map((review) => (

{review.name}

)) }