import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef, useContext } from 'react';
import clsx from 'clsx';
import DatePicker from './DatePicker';
import TimePicker from './TimePicker';
import ConfigProviderContext from '../config-provider/ConfigProviderContext';
const DateTimePicker = forwardRef((props, ref) => {
  const {
    prefixCls,
    createNamespace
  } = useContext(ConfigProviderContext);
  const [bem] = createNamespace('datetime-picker', prefixCls);
  const isTimePicker = props.type === 'time';
  if (isTimePicker) return _jsx(TimePicker, Object.assign({
    ref: ref,
    className: clsx(bem())
  }, props));
  return _jsx(DatePicker, Object.assign({
    ref: ref,
    className: clsx(bem())
  }, props));
});
export default DateTimePicker;
export { DateTimePicker };