import React from 'react';
import PropTypes from 'prop-types';
import { Radio } from 'antd';
import { columnType } from './types';
import { FieldSchemaWarning } from './FormValidations';
import { jsx as _jsx } from "react/jsx-runtime";
import { Fragment as _Fragment } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
function RadioGroupFormField(props) {
  const {
    value,
    disabled,
    column,
    onChange
  } = props;
  const handleChange = e => {
    onChange(e.target.value);
  };
  return /*#__PURE__*/_jsxs(_Fragment, {
    children: [/*#__PURE__*/_jsx(FieldSchemaWarning, {
      expectedType: "object",
      fieldSchema: column['ui:createUpdatePage:enum']
    }), typeof column['ui:createUpdatePage:enum'] !== 'object' ? null : /*#__PURE__*/_jsx(Radio.Group, {
      onChange: handleChange,
      value: value,
      disabled: disabled,
      children: column['ui:createUpdatePage:enum'].map(r => /*#__PURE__*/_jsx(Radio, {
        value: r,
        children: r
      }, r))
    })]
  });
}
export default RadioGroupFormField;
RadioGroupFormField.propTypes = {
  value: PropTypes.string,
  disabled: PropTypes.bool.isRequired,
  column: columnType.isRequired,
  onChange: PropTypes.func
};
RadioGroupFormField.defaultProps = {
  onChange: () => {}
};
//# sourceMappingURL=RadioGroupFormField.js.map