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


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

export default CheckboxWapper;
