import React from 'react'
import styles from './index.module.scss'
import { Select } from 'antd'

type Props = {
  value: string
  setValue: (val: string) => void
}

function A1selectDate({ value, setValue }: Props) {
  // 时间选择器改变
  // const timeChange = useCallback((date: any, dateString: any) => {
  //   let startTime = ''
  //   let endTime = ''
  //   if (dateString[0] && dateString[1]) {
  //     startTime = dateString[0] + ' 00:00:00'
  //     endTime = dateString[1] + ' 23:59:59'
  //   }
  // }, [])

  return (
    <div className={styles.A1selectDate}>
      <Select
        style={{ width: 120 }}
        value={value}
        onChange={e => setValue(e)}
        options={[
          { value: '', label: '全部' },
          { value: '30', label: '近30日' },
          { value: '7', label: '近7日' }
        ]}
      />
      {/* <div
        style={{
          opacity: value === 'xx' ? '1' : '0',
          pointerEvents: value === 'xx' ? 'auto' : 'none'
        }}
      >
        <RangePicker style={{ width: 220 }} onChange={timeChange} />
      </div> */}
    </div>
  )
}

const MemoA1selectDate = React.memo(A1selectDate)

export default MemoA1selectDate
