diff --git a/apps/frontend/src/utils/createInputComponents.tsx b/apps/frontend/src/utils/createInputComponents.tsx
index 54e7db8..4e09b6e 100644
--- a/apps/frontend/src/utils/createInputComponents.tsx
+++ b/apps/frontend/src/utils/createInputComponents.tsx
@@ -1,4 +1,6 @@
import {
+ Fieldset,
+ FieldsetProps,
MultiSelect,
MultiSelectProps,
NumberInput,
@@ -36,55 +38,58 @@ type SelectType = {
type: "select";
} & SelectProps;
+type Group = {
+ type: "group";
+ inputs: AcceptedInput[];
+} & FieldsetProps;
+
+type AcceptedInput = (
+ | TextInputType
+ | MultiSelectInputType
+ | PasswordInputType
+ | NumberInputType
+ | SelectType
+ | Group
+) &
+ GeneralInputProps;
+
interface Options {
disableAll?: boolean;
readonlyAll?: boolean;
- inputs: ((
- | TextInputType
- | MultiSelectInputType
- | PasswordInputType
- | NumberInputType
- | SelectType
- ) &
- GeneralInputProps)[];
+ inputs: AcceptedInput[];
}
function createInputComponents(options: Options) {
const components = [] as ReactNode[];
- for (const input of options.inputs) {
- if (input.hidden) continue;
-
+ const createComponent = (input: AcceptedInput) => {
switch (input.type) {
case "text":
- components.push(
+ return (