--- import { cn } from '../lib/cn' import type InputWrapper from './InputWrapper.astro' import type { AstroChildren } from '../lib/astro' import type { ComponentProps } from 'astro/types' type Props = Pick, 'error' | 'name' | 'required'> & { disabled?: boolean id?: string } & ( | { label: string children?: undefined } | { label?: undefined children: AstroChildren } ) const { disabled, name, required, error, id, label } = Astro.props const hasError = !!error && error.length > 0 --- {}
{ hasError && (typeof error === 'string' ? (

{error}

) : ( )) }