--- import testimonials from '@data/testimonials.json' import { people } from '@shared/lib/people' import Avatar from '@ui/Avatar.astro' import { relativeBase } from '@shared/lib/url' interface Props { class?: string limit?: number hideHeader?: boolean } const { class: className, limit = 99, hideHeader } = Astro.props const base = relativeBase(Astro.url.pathname) const sectionClass = ['section', className] // Slice testimonials and split into 3 columns. const list = (testimonials as string[]).slice(0, limit) const n = 3 // At least 1, or a limit below 2 would never advance the loop below. const chunkSize = Math.max(1, Math.round(list.length / n)) const groups: string[][] = [] for (let i = 0; i < list.length; i += chunkSize) { groups.push(list.slice(i, i + chunkSize)) } // Global counter starting at 1 — indexes people[i] (people[0] is intentionally skipped). let i = 1 const cards = groups.map((group) => group.map((testimonial) => { const person = people[i] ?? {} i += 1 return { testimonial, person } }), ) ---
{ !hideHeader && (

Trusted by hundreds

Our Users send us bunch of smilies with our services, and we love them 😍

) }
{ cards.map((group) => (
{group.map(({ testimonial, person }) => ( ))}
)) }