import ConfigProvider from '../config-provider';
import React, { Component } from 'react';
import cls from 'classnames';
import hoistNonReactStatics from 'hoist-non-react-statics';
import { TimePicker as NextTimePicker } from '@alifd/next';
import { TimePickerProps as NextTimePickerProps } from '@alifd/next/types/time-picker';

interface TimePickerProps extends NextTimePickerProps { }

class TimePicker extends Component<TimePickerProps> {
  render() {
    const {
      prefix = 'next-',
      className,
      popupAlign = 'bl tl',
      ...otherProps
    } = this.props;
    return (
      <NextTimePicker
        {...otherProps}
        prefix={prefix}
        popupAlign={popupAlign}
        className={cls(className, {})}
      />
    );
  }
}

hoistNonReactStatics(TimePicker, NextTimePicker);

export default ConfigProvider.config(TimePicker);
