add validation to checkbox

This commit is contained in:
Chika 2020-12-10 14:38:31 +03:00
parent 889795a878
commit 6141d1158e

View File

@ -2,9 +2,16 @@ import { Checkbox as AntCheckbox, Form } from 'antd';
import { ElementStatus } from 'core/types/statuses';
import React from 'react';
const Checkbox = ({ value, setCurrentValue, status, ...props }) => {
const Checkbox = ({
value,
setCurrentValue,
status,
validateStatus,
message,
...props
}) => {
return (
<Form.Item>
<Form.Item validateStatus={validateStatus} help={message}>
<AntCheckbox
{...props}
disabled={status === ElementStatus.Disabled}