--- import Icon from './Icon.astro' import questions from '@data/questions.json' interface Props { count?: number id?: string /** toggle-icon — when set, the toggle gets accordion-button-toggle-plus */ toggleIcon?: string /** each entry becomes accordion-{type} */ type?: string[] /** show-icon — renders the accordion-button-icon (link icon) */ showIcon?: boolean } const { count = 4, id = 'default', toggleIcon, type = [], showIcon } = Astro.props const resolvedToggleIcon = toggleIcon ?? 'chevron-down' const hasToggleIcon = toggleIcon !== undefined const types = type const items = questions.slice(0, count) const accordionClasses = ['accordion', ...types.map((t) => `accordion-${t}`)].join(' ') ---
{ items.map((question, i) => { const index = i + 1 const isFirst = index === 1 return (
{question.answer}
) }) }