import DatePickerDiy from '../DatePickerDiy';

export default function SeperatedDateRangePicker({
  values,
  onChange,
  title = '时间选择',
  beginKey,
  beginName = '开始时间',
  endKey,
  endName = '结束时间',
}) {
  return (
    <>
      <div style={{ fontSize: '0.32rem', color: '#333' }}>{title}</div>
      <DatePickerDiy
        style={{ marginTop: '0.3rem' }}
        name={beginName}
        value={values[beginKey]}
        onChange={beginTime => onChange({ ...values, [beginKey]: beginTime })}
      />
      <DatePickerDiy
        style={{ marginTop: '0.3rem' }}
        name={endName}
        value={values[endKey]}
        onChange={beginTime => onChange({ ...values, [endKey]: beginTime })}
      />
    </>
  );
}
