import { DatePicker, } from 'antd';
import FormItem from '../FormItem/FormItem'
import React from 'react';
import { getItemProps } from "../../utils"
import 'moment/locale/zh-cn';
import schema from "./schema"
const { RangePicker } = DatePicker;

const DateRangeWapper = (item: any) => {
  const data: any = getItemProps(schema, item)
  const { componentType, FormItemProps, ControlProps } = data

  return (
    <>
      {
        componentType === 'FormItem' ?
          <FormItem FormItemProps={...FormItemProps}  >
            <RangePicker className='kx_antd_rangepicker' {...ControlProps} />
          </FormItem> : <RangePicker className='kx_antd_rangepicker' {...ControlProps} />
      }
    </>
  );
};

export default DateRangeWapper;
