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