"use client" /* eslint-disable no-restricted-syntax */ import type { ComponentPropsWithoutRef, ReactNode } from "react" import { type As, type MergeWithAs, type PaginationProps, Pagination } from "@heroui/react" import type { Field } from "soda-tanstack-form" import { getFieldProps } from "../utils/getFieldProps" export type FormPaginationProps = MergeWithAs< ComponentPropsWithoutRef<"nav">, ComponentPropsWithoutRef, PaginationProps, AsComponent > & { field: Field component?: ( props: MergeWithAs, ComponentPropsWithoutRef, PaginationProps, AsComponent>, ) => ReactNode } export function FormPagination({ field, component: Pagination2 = Pagination, ...rest }: FormPaginationProps): ReactNode { return ( page={field.state.value ?? 1} onPageChange={field.handleChange as (value: number) => void as any} {...getFieldProps(field, true)} {...rest} /> ) }