import clsx from 'clsx' import { ReactNode } from 'react' import React from 'react' import { Col } from './layout/col' import { Spacer } from './layout/spacer' import { Input } from './input' export function NumberInput(props: { numberString: string onChange: (newNumberString: string) => void error: string | undefined disabled?: boolean placeholder?: string className?: string inputClassName?: string // Needed to focus the amount input inputRef?: React.MutableRefObject children?: ReactNode }) { const { numberString, onChange, error, disabled, placeholder, className, inputClassName, inputRef, children, } = props return ( onChange(e.target.value.substring(0, 9))} /> {error && (
{error}
)} {children} ) }