import { FieldName, useField } from "@conform-to/react/future"; import { Field, FieldProps } from "../field/Field"; import { SelectOption } from "../select/types"; import clsx from "clsx"; import { buttonGroupVariants } from "../../button"; import { Radio } from "./Radio"; interface Props extends Omit { name: FieldName; options: readonly SelectOption[]; asButton?: boolean; direction?: "horizontal" | "vertical"; } export function RadiosField({ name, options, className, asButton, direction, id: forcedId, ...rest }: Props) { const field = useField(name); const id = forcedId ?? field.id; return (
{options.map((option) => ( {option.label} ))}
); }