--- import type { Submit, Radio, RadioOption } from 'common/types'; import { FormGroup, FormControl } from './core'; import FieldSet from './components/FieldSet.astro'; import Field from './components/Field.astro'; export interface Props { formGroups: FormGroup | FormGroup[]; submitControl?: Submit; theme?: 'light' | 'dark'; showValidationHints?: boolean; } const { submitControl, formGroups: form, theme, showValidationHints = false } = Astro.props; const formTheme = theme ?? 'light'; const formName = Array.isArray(form) ? null : form?.name || null; ---
{ Array.isArray(form) ? form?.map((group) =>
) : form?.controls.map((control) => control.type === 'radio' ? ( [ , ...(control as Radio)?.value?.map((v: string | RadioOption) => ( )), ] ) : ( ) ) } { submitControl && ( ) }