import type { Moment } from 'moment'; import * as React from 'react'; import DatePicker from '../date-picker'; import type { PickerTimeProps, RangePickerTimeProps } from '../date-picker/generatePicker'; import warning from '../_util/warning'; import type { InputStatus } from '../_util/statusUtils'; const { TimePicker: InternalTimePicker, RangePicker: InternalRangePicker } = DatePicker; export interface TimePickerLocale { placeholder?: string; rangePlaceholder?: [string, string]; } export interface TimeRangePickerProps extends Omit, 'picker'> { popupClassName?: string; } const RangePicker = React.forwardRef((props, ref) => ( )); export interface TimePickerProps extends Omit, 'picker'> { addon?: () => React.ReactNode; popupClassName?: string; status?: InputStatus; } const TimePicker = React.forwardRef( ({ addon, renderExtraFooter, popupClassName, ...restProps }, ref) => { const internalRenderExtraFooter = React.useMemo(() => { if (renderExtraFooter) { return renderExtraFooter; } if (addon) { warning( false, 'TimePicker', '`addon` is deprecated. Please use `renderExtraFooter` instead.', ); return addon; } return undefined; }, [addon, renderExtraFooter]); return ( ); }, ); TimePicker.displayName = 'TimePicker'; type MergedTimePicker = typeof TimePicker & { RangePicker: typeof RangePicker; }; (TimePicker as MergedTimePicker).RangePicker = RangePicker; export default TimePicker as MergedTimePicker;