import {HTMLProps, VFC} from 'react';

type NumericInputProps = Omit<HTMLProps<HTMLInputElement>, 'type'> & {
  block?: boolean,
}

export const NumericInput: VFC<NumericInputProps> = ({
  block = false,
  style = {},
  ...etcProps
}) => {
  return (
    <div>
      <input
        {...etcProps}
        type="number"
        style={{
          ...style,
          display: block ? 'block' : style?.display,
          width: block ? '100%' : style?.width,
          height: '2rem',
        }}
      />
    </div>
  )
}
