checkbox.tsx 440 B

123456789101112131415
  1. import { IFlowNodeParameter } from '@/types/flow';
  2. import { convertKeysToCamelCase } from '@/utils/flow';
  3. import { Checkbox } from 'antd';
  4. export const renderCheckbox = (data: IFlowNodeParameter) => {
  5. const attr = convertKeysToCamelCase(data.ui?.attr || {});
  6. return (
  7. data.options?.length > 0 && (
  8. <div className='bg-white p-2 rounded'>
  9. <Checkbox.Group {...attr} options={data.options} />
  10. </div>
  11. )
  12. );
  13. };