/** * * SizeInput */ import React, { useState } from 'react'; import PropTypes from 'prop-types'; import { InputNumber, Select } from '@buffetjs/core'; import Wrapper from './Wrapper'; function SizeInput({ onChange, value, ...rest }) { const options = ['KB', 'MB', 'GB']; const [size, setSize] = useState(0); const [format, setFormat] = useState('KB'); const handleChangeValue = ({ target: { value } }) => { setSize(value); handleChange(); }; const handleChangeFormat = ({ target: { value } }) => { setFormat(value); handleChange(); }; const handleChange = () => { onChange({ target: { name: 'value', value: { size, format, }, }, }); }; return (