--- // `photo` and `index` are passed explicitly from the parent loop. import Avatar from '@ui/Avatar.astro' import Icon from '@ui/Icon.astro' import { randomNumber, timeagoLabel } from '@shared/lib/pseudo-random' interface Photo { file: string [key: string]: unknown } interface Person { full_name?: string photo?: string [key: string]: unknown } interface Props { photo: Photo person: Person /** 1-based loop index — seeds the deterministic pseudo-random values */ index: number hideLikes?: boolean } const { photo, person, index, hideLikes } = Astro.props // Heart filled when (index > 2 && index < 9) || index === 10. const heartClass = (index > 2 && index < 9) || index === 10 ? 'icon-filled text-red' : undefined ---
{person.full_name}
{timeagoLabel(index, 10)}
{ !hideLikes && ( ) }