feat(web/input): required fields

This commit is contained in:
Luke
2023-01-08 11:35:30 +01:00
parent 6c4485b570
commit d5a9a3fb90
7 changed files with 32 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ const NumberField: React.FC<Props> = (props) => {
name: `test.${props.index}.value`,
control: props.control,
defaultValue: props.row.default,
rules: { required: props.row.required },
});
return (
@@ -32,6 +33,7 @@ const NumberField: React.FC<Props> = (props) => {
max={props.row.max}
disabled={props.row.disabled}
icon={props.row.icon && <FontAwesomeIcon icon={props.row.icon} fixedWidth />}
withAsterisk={props.row.required}
/>
);
};