diff --git a/components/FormGenerator.tsx b/components/FormGenerator.tsx index 333dc2c..c154966 100644 --- a/components/FormGenerator.tsx +++ b/components/FormGenerator.tsx @@ -138,6 +138,34 @@ export default function ({ ); } + function renderSelectElements( + c: component, + state: { [k: string]: string | string[] }, + setState: Dispatch> + ) { + if (!c.options) throw new Error("Options for select are undefined!"); + + const selectOptions = []; + + for (const option of c.options) { + selectOptions.push(); + } + + return ( + + ); + } + function generateReactComponents( components: component[], state: { [k: string]: string | string[] }, @@ -202,8 +230,13 @@ export default function ({ ); break; + case "radio": + fragmentsList.push(renderRadioElements(component, state, setState)); + break; + case "select": - fragmentsList.push(); + fragmentsList.push(renderSelectElements(component, state, setState)); + break; } fragmentsList.push(
,
,
);