import { NumberInputStep, TextInputStep } from 'models' import React, { FormEvent, useRef, useState } from 'react' import { SendIcon } from '../../../../assets/icons' type NumberInputProps = { step: NumberInputStep onSubmit: (value: string) => void } export const NumberInput = ({ step, onSubmit }: NumberInputProps) => { const inputRef = useRef(null) const [inputValue, setInputValue] = useState('') const handleSubmit = (e: FormEvent) => { e.preventDefault() if (inputValue === '') return onSubmit(inputValue) } return (
setInputValue(e.target.value)} style={{ appearance: 'auto' }} min={step.options?.min} max={step.options?.max} step={step.options?.step} required />
) }