Chika c193ad5f82 builders: fix update component value from store
fix debounce for options components
2022-06-01 14:03:33 +03:00

24 lines
635 B
TypeScript

import type { InputNumberProps as AntInputNumberProps } from 'antd';
import { Form, InputNumber as AntInputNumber } from 'antd';
import type { BaseElementProps } from './types';
const { Item: FormItem } = Form;
export default function InputNumber({
setValue,
status,
isValid,
help,
...props
}: BaseElementProps<number>) {
return (
<FormItem hasFeedback validateStatus={isValid === false ? 'error' : ''} help={help}>
<AntInputNumber onChange={setValue} disabled={status === 'Disabled'} {...props} />
</FormItem>
);
}
type InputNumberProps = AntInputNumberProps<number>;
export type { InputNumberProps };