--- /** * Shared Testimonial Section component * Displays customer testimonials in a grid */ import Container from '../atoms/Container.astro'; import Card from '../atoms/Card.astro'; import SectionHeader from '../atoms/SectionHeader.astro'; interface Testimonial { name: string; role?: string; company?: string; text: string; image?: string; rating?: number; } interface Props { title: string; subtitle?: string; testimonials: Testimonial[]; columns?: 1 | 2 | 3; showRating?: boolean; class?: string; id?: string; } const { title, subtitle, testimonials, columns = 3, showRating = true, class: className = '', id } = Astro.props; const gridCols = { 1: 'max-w-2xl mx-auto', 2: 'md:grid-cols-2 max-w-4xl mx-auto', 3: 'md:grid-cols-2 lg:grid-cols-3' }; ---
{testimonials.map((testimonial) => (
{testimonial.image ? ( {testimonial.name} ) : (
{testimonial.name.charAt(0)}
)}

{testimonial.name}

{testimonial.role && (

{testimonial.role}

)} {testimonial.company && (

{testimonial.company}

)}
"{testimonial.text}"
{showRating && testimonial.rating && (
{[...Array(5)].map((_, i) => ( ))}
)}
))}