import { useEffect, useState } from 'react' import Input from '~components/common/Input' import TableField from '~components/common/TableField' import './index.scss' interface Props { name: string label: string description?: string placeholder?: string value?: number className?: string imageAlt?: string imageClass?: string imageSrc?: string[] onValueChange: (value: number) => void } const InputTableField = (props: Props) => { const [value, setValue] = useState(0) useEffect(() => { if (props.value) setValue(props.value) }, [props.value]) useEffect(() => { props.onValueChange(value) }, [value]) function onInputChange(event: React.ChangeEvent) { setValue(parseInt(event.currentTarget?.value)) } return ( ) } export default InputTableField