function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

import React, { forwardRef, useContext } from 'react';
import clsx from 'clsx';
import DatePicker from './DatePicker';
import TimePicker from './TimePicker';
import ConfigProviderContext from '../config-provider/ConfigProviderContext';
var DateTimePicker = /*#__PURE__*/forwardRef(function (props, ref) {
  var _useContext = useContext(ConfigProviderContext),
      prefixCls = _useContext.prefixCls,
      createNamespace = _useContext.createNamespace;

  var _createNamespace = createNamespace('datetime-picker', prefixCls),
      bem = _createNamespace[0];

  var isTimePicker = props.type === 'time';
  if (isTimePicker) return /*#__PURE__*/React.createElement(TimePicker, _extends({
    ref: ref,
    className: clsx(bem())
  }, props));
  return /*#__PURE__*/React.createElement(DatePicker, _extends({
    ref: ref,
    className: clsx(bem())
  }, props));
});
export default DateTimePicker;
export { DateTimePicker };