"use client" /* eslint-disable no-restricted-syntax */ import type { ComponentPropsWithoutRef, ReactNode } from "react" import { type As, type MergeWithAs, type RadioGroupProps, RadioGroup } from "@heroui/react" import type { Field } from "soda-tanstack-form" import { getFieldProps } from "../utils/getFieldProps" export type FormRadioGroupProps = MergeWithAs< ComponentPropsWithoutRef<"div">, ComponentPropsWithoutRef, RadioGroupProps, AsComponent > & { field: Field component?: ( props: MergeWithAs, ComponentPropsWithoutRef, RadioGroupProps, AsComponent>, ) => ReactNode } export function FormRadioGroup({ field, component: RadioGroup2 = RadioGroup, ...rest }: FormRadioGroupProps): ReactNode { return ( value={field.state.value ?? ""} onValueChange={field.handleChange as (value: string) => void} {...getFieldProps(field)} {...rest} /> ) }