import { useField } from "formik" import React from "react" import ErrorMessage from "./ErrorMessage" import RequiredAsterisk from "./RequiredAsterisk" import * as RadioGroup from "@radix-ui/react-radio-group" const RadioGroupField = ({ name, label, options, ...props }: { name: string label: string options: string[] [x: string]: any // Allow any other props }) => { const { required, ...restProps } = props const [field, meta, helpers] = useField({ ...restProps, name }) const handleChange = (value: string) => { helpers.setValue(value) } return (