"use client" /* eslint-disable no-restricted-syntax */ import type { ComponentPropsWithoutRef, ReactNode } from "react" import { type As, type MergeWithAs, type NumberInputProps, NumberInput } from "@heroui/react" import type { Field } from "soda-tanstack-form" import { getFieldProps } from "../utils/getFieldProps" export type FormNumberInputProps = MergeWithAs< ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef, NumberInputProps, AsComponent > & { field: Field component?: ( props: MergeWithAs, ComponentPropsWithoutRef, NumberInputProps, AsComponent>, ) => ReactNode } export function FormNumberInput({ field, component: NumberInput2 = NumberInput, ...rest }: FormNumberInputProps): ReactNode { return ( value={field.state.value ?? 0} onValueChange={field.handleChange as (value: number) => void} {...getFieldProps(field)} {...rest} /> ) }