This repository has been archived on 2025-05-09. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-23 09:49:14 +03:00

27 lines
540 B
JavaScript

import { Form, Switch as AntSwitch } from 'antd';
import { ElementStatus } from 'core/types/statuses';
const Switch = ({
value,
setCurrentValue,
status,
validateStatus,
message,
...props
}) => {
return (
<Form.Item validateStatus={validateStatus} help={message}>
<AntSwitch
{...props}
disabled={status === ElementStatus.Disabled}
checked={value}
onChange={(checked, event) => {
setCurrentValue(checked);
}}
/>
</Form.Item>
);
};
export default Switch;