--- import Avatar from '@ui/Avatar.astro' import { people } from '@shared/lib/people' import Icon from '@ui/Icon.astro' import ListGroup from '@ui/ListGroup.astro' import ListGroupItem from '@ui/ListGroupItem.astro' import CardTitle from '@ui/CardTitle.astro' import commits from '@data/commits.json' import { randomNumber } from '@shared/lib/pseudo-random' interface Props { offset?: number hoverable?: boolean checkbox?: boolean /** 1-based indices of the checked rows, e.g. [2, 5, 8] */ checkedIds?: number[] title?: string class?: string } const { offset = 0, hoverable = false, checkbox = false, checkedIds, title = 'Last commits', class: className } = Astro.props const limit = 8 const colors = ['green', 'red', 'yellow', 'x', 'x'] const commitList = commits as { description: string }[] const rows = people.slice(offset, offset + limit).map((person, idx) => { const index = idx + 1 const color = colors[randomNumber(index + 5, 0, colors.length - 1)] const checked = checkedIds?.includes(index) ?? false const i = index + offset return { person, color, checked, description: commitList[i]?.description, starColor: checked ? 'text-yellow' : 'text-secondary', } }) ---
{title}
{ rows.map((row) => ( {checkbox ? : } {row.person.full_name}
{row.description}
{hoverable && ( )}
)) }