--- import { Image } from 'astro:assets'; import Star from '../../assets/svg/star.svg'; import { getReviewsCourse } from '../../libs/reviews'; type Props = { course_id: any; }; const { course_id }: Props = Astro.props; const reviews = getReviewsCourse(course_id); const getDate = (date: string) => { const options: object = { year: 'numeric', month: 'long', day: 'numeric' }; return new Date(date).toLocaleDateString('es', options); }; const getStars = (rating: number) => { let stars = []; for (let i = 0; i < rating; i++) { stars.push(''); } return stars; }; const getOverallRating = (reviews: any) => { let total = 0; reviews.forEach((review: any) => { total += review.stars; }); return total / reviews.length; }; ---
{review.feedback}