--- /** * DEFAULT INPUT COMPONENT */ import type { FormControl } from '../../core/form-control'; export interface Props { control: FormControl; } const { control } = Astro.props; const { validators = [] } = control; const hasErrors: boolean = !!control.errors?.length; const validatorAttributes: Record = validators?.reduce((prev, validator) => { const split: string[] = validator.split(':'); const label: string = `data-${split[0]}` || 'invalid'; const value: string | null = split.length > 1 ? split[1] ?? null : 'true'; return { ...prev, [label]: value, }; }, {}); ---