--- import { Icon } from 'astro-icon/components' import { omit } from 'lodash-es' import { cn } from '../lib/cn' import { baseInputClassNames } from '../lib/formInputs' import InputWrapper from './InputWrapper.astro' import type { ComponentProps, HTMLAttributes } from 'astro/types' type Props = Omit, 'children' | 'inputId' | 'required'> & { inputProps?: Omit, 'name'> & { 'transition:persist'?: boolean } inputIcon?: string inputIconClass?: string } const { inputProps, inputIcon, inputIconClass, ...wrapperProps } = Astro.props const inputId = inputProps?.id ?? Astro.locals.makeId(`input-${wrapperProps.name}`) const hasError = !!wrapperProps.error && wrapperProps.error.length > 0 --- { inputIcon ? (
) : ( ) }