diff --git a/cyclops-ui/src/components/form/fields/array/ArrayField.tsx b/cyclops-ui/src/components/form/fields/array/ArrayField.tsx index f434a13c..f670055d 100644 --- a/cyclops-ui/src/components/form/fields/array/ArrayField.tsx +++ b/cyclops-ui/src/components/form/fields/array/ArrayField.tsx @@ -8,6 +8,8 @@ import { Input, Row, Tooltip, + Checkbox, + InputNumber, } from "antd"; import { InfoCircleOutlined, @@ -117,15 +119,11 @@ export const ArrayField = ({ onClick={() => remove(arrField.name)} /> - {arrFields !== null && - arrFields !== undefined && - index + 1 === arrFields.length ? ( + {index + 1 === arrFields.length ? ( - ) : ( - <> - )} + ) : null} ))} @@ -144,6 +142,138 @@ export const ArrayField = ({ ); } + + if (field.items.type === "number") { + return ( + + + {(arrFields, { add, remove }) => ( +
+ {arrFields.map((arrField, index) => ( + + + + + + remove(arrField.name)} + /> + + {index + 1 === arrFields.length ? ( + + ) : null} + + ))} + + + +
+ )} +
+
+ ); + } + + if (field.items.type === "boolean") { + return ( + + + {(arrFields, { add, remove }) => ( +
+ {arrFields.map((arrField, index) => ( + + + + + {field.display_name} + + + remove(arrField.name)} + /> + + {index + 1 === arrFields.length ? ( + + ) : null} + + ))} + + + +
+ )} +
+
+ ); + } + if (field.items.type === "object") { return (