import { memo } from 'react'
import './index.scss'
import TimePicker from '../timePicker'
import Popup from '@/components/popup'

type DateArg = string | number | Date
interface Props {
  showTime: boolean
  closePopup?: () => void
  end?: DateArg
  start?: DateArg
  onSelectDate?: (any) => void
}
const TimePickerPopup = (props: Props) => {
  const { showTime = false, closePopup, start = '', end = '', onSelectDate } = props

  return (
    <Popup title="选择时间" show={showTime} onClose={() => closePopup?.()}>
      <TimePicker start={start} end={end} onSelectDate={onSelectDate}></TimePicker>
    </Popup>
  )
}
export default memo(TimePickerPopup)
