--- import Icon from './Icon.astro' interface Props { items?: string[] icons?: string[] disabled?: number[] default?: number vertical?: boolean /** core/scss/ui/_segmented.scss `.nav-{size}` modifier classes */ size?: 'sm' | 'lg' | undefined /** w-100 — stretch across the container */ block?: boolean name?: string class?: string } const { items, icons, disabled, default: defaultIndex = 1, vertical, size, block, name, class: className } = Astro.props const itemsArr = items ?? [] const iconsArr = icons ?? [] const count = Math.max(itemsArr.length, iconsArr.length) const navClasses = ['nav', 'nav-segmented', vertical && 'nav-segmented-vertical', size && `nav-${size}`, block && 'w-100', className] const rows = Array.from({ length: count }, (_, i) => { const forloopIndex = i + 1 const index = String(forloopIndex) const isDisabled = disabled?.includes(forloopIndex) ?? false const isDefault = forloopIndex === defaultIndex const linkClasses = ['nav-link', isDisabled && 'disabled', isDefault && !name && 'active'] return { forloopIndex, index, isDisabled, isDefault, linkClasses, icon: iconsArr[i], item: itemsArr[i] } }) ---