--- import { Icon } from 'astro-icon/components' import { cn } from '../lib/cn' import { baseInputClassNames } from '../lib/formInputs' import InputWrapper from './InputWrapper.astro' import type { ComponentProps } from 'astro/types' type Props = Omit, 'children' | 'inputId'> & { options: { label: string value: string icon?: string[] | string iconClassName?: string[] | string }[] disabled?: boolean selectedValues?: string[] size?: 'lg' | 'md' } const { options, disabled, selectedValues = [], size = 'md', ...wrapperProps } = Astro.props const inputId = Astro.locals.makeId(`input-${wrapperProps.name}`) const hasError = !!wrapperProps.error && wrapperProps.error.length > 0 ---
{ options.map((option) => { const icons = option.icon ? (Array.isArray(option.icon) ? option.icon : [option.icon]) : [] const iconClassName = option.iconClassName ? Array.isArray(option.iconClassName) ? option.iconClassName : Array.from({ length: icons.length }, () => option.iconClassName) : [] return ( ) }) }