--- import TestimonialItem from './TestimonialItem.astro'; import StatsGrid from '../../ui/blocks/StatsGrid.astro'; const { title, subTitle, testimonials, statistics } = Astro.props; interface Props { title: string; subTitle?: string; testimonials?: Testimonial[]; statistics?: StatProps[]; } // TypeScript type for testimonials type Testimonial = { content: string; author: string; role: string; avatarSrc: string; }; // TypeScript type for stats. type StatProps = { count: string; description: string; }; ---
{/* Container for the testimonials */}
{/* Title and Subtitle */}

{title}

{ subTitle && (

{subTitle}

) }
{ /* Generate a blockquote for each testimonial in the testimonials array by mapping over the array. */ } { testimonials && testimonials.map(testimonial => ( )) }
{ statistics && (
    {/* Generate a list item for each stat in the statistics array by mapping over the array. */} {statistics.map((stat, index) => ( ))}
) }