import { Radio } from 'antd';
import React from 'react';
import schema from "./schema"
import { getItemProps } from "../../utils"
import FormItem from '../FormItem/FormItem'


const RadioWapper = (item: any) => {
  const data: any = getItemProps(schema, item)
  const { componentType, FormItemProps, ControlProps } = data
  const RadioBox = () => {
    return <Radio.Group {...ControlProps} />
  }
  return <>
    {
      componentType === 'FormItem' ? <FormItem FormItemProps={...FormItemProps} >
        {RadioBox()}
      </FormItem> : RadioBox()
    }
  </>
};

export default RadioWapper;
