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


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

export default SwitchWapper;
