diff --git a/web/src/components/WebFastForm/index.tsx b/web/src/components/WebFastForm/index.tsx index 6288f5e7..25f36922 100644 --- a/web/src/components/WebFastForm/index.tsx +++ b/web/src/components/WebFastForm/index.tsx @@ -11,12 +11,14 @@ import { FastFormText } from './types/Text'; import { FastFormTextArea } from './types/TextArea'; import { FastFormPassword } from './types/Password'; import { FastFormSelect } from './types/Select'; +import { FastFormCheckbox } from './types/Checkbox'; import { FastFormCustom } from './types/Custom'; regField('text', FastFormText); regField('textarea', FastFormTextArea); regField('password', FastFormPassword); regField('select', FastFormSelect); +regField('checkbox', FastFormCheckbox); regField('custom', FastFormCustom); const WebFastFormContainer: FastFormContainerComponent = React.memo((props) => { diff --git a/web/src/components/WebFastForm/types/Checkbox.tsx b/web/src/components/WebFastForm/types/Checkbox.tsx new file mode 100644 index 00000000..6b8425c9 --- /dev/null +++ b/web/src/components/WebFastForm/types/Checkbox.tsx @@ -0,0 +1,25 @@ +import React from 'react'; +import { Form, Checkbox } from 'antd'; +import type { FastFormFieldComponent } from 'tailchat-shared'; +import { getValidateStatus } from '../utils'; + +export const FastFormCheckbox: FastFormFieldComponent = React.memo((props) => { + const { name, label, value, onChange, error } = props; + + return ( +