import React from 'react';
import Radio from '../../../radio';
import ProField from '../../../wau-field';
import createField from '../../create-field';
import { jsx as _jsx } from "react/jsx-runtime";
const RadioGroup = /*#__PURE__*/React.forwardRef(({
  fieldProps,
  options,
  radioType,
  layout,
  proFieldProps
}, ref) => {
  return /*#__PURE__*/_jsx(ProField, {
    mode: "edit",
    valueType: radioType === 'button' ? 'radioButton' : 'radio',
    ref: ref,
    fieldProps: {
      options,
      layout,
      ...fieldProps
    },
    ...proFieldProps
  });
});

/**
 * Radio
 *
 * @param
 */
const ProFormRadio = /*#__PURE__*/React.forwardRef(({
  fieldProps,
  children
}, ref) => {
  return /*#__PURE__*/_jsx(Radio, {
    ...fieldProps,
    ref: ref,
    children: children
  });
});
const Group = createField(RadioGroup, {
  customLightMode: true
});

// @ts-expect-error
const WrappedProFormRadio = createField(ProFormRadio, {
  valuePropName: 'checked'
});
WrappedProFormRadio.Group = Group;
WrappedProFormRadio.Button = Radio.Button;
export default WrappedProFormRadio;