New formatting
This commit is contained in:
@ -49,7 +49,7 @@ export default function ({
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
id: string,
|
||||
value: string
|
||||
value: string,
|
||||
) {
|
||||
const newState = { ...state };
|
||||
newState[id] = value;
|
||||
@ -60,7 +60,7 @@ export default function ({
|
||||
function renderCheckboxOptions(
|
||||
c: component,
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
) {
|
||||
if (!c.options) throw new Error("Options for checkbox are undefined");
|
||||
|
||||
@ -88,7 +88,7 @@ export default function ({
|
||||
? groupValues.push(e.target.value)
|
||||
: groupValues.splice(
|
||||
groupValues.findIndex((v) => v === e.target.value),
|
||||
1
|
||||
1,
|
||||
);
|
||||
|
||||
newState[c.id] = groupValues;
|
||||
@ -97,7 +97,7 @@ export default function ({
|
||||
value={option.value}
|
||||
>
|
||||
{option.value}
|
||||
</Checkbox>
|
||||
</Checkbox>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ export default function ({
|
||||
function renderRadioElements(
|
||||
c: component,
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
) {
|
||||
if (!c.options) throw new Error("Options for radio buttons are undefined!");
|
||||
const buttons = [];
|
||||
@ -120,7 +120,7 @@ export default function ({
|
||||
buttons.push(
|
||||
<Radio checked={option.default} value={option.value}>
|
||||
{option.value}
|
||||
</Radio>
|
||||
</Radio>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ export default function ({
|
||||
function renderSelectElements(
|
||||
c: component,
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
) {
|
||||
if (!c.options) throw new Error("Options for select are undefined!");
|
||||
|
||||
@ -170,14 +170,14 @@ export default function ({
|
||||
function generateReactComponents(
|
||||
components: component[],
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
): JSX.Element[] {
|
||||
const fragmentsList = [];
|
||||
|
||||
for (const component of components) {
|
||||
fragmentsList.push(
|
||||
<Heading size="md">{component.title}</Heading>,
|
||||
<br />
|
||||
<br />,
|
||||
);
|
||||
|
||||
switch (component.type) {
|
||||
@ -204,7 +204,7 @@ export default function ({
|
||||
value={component.value}
|
||||
/>
|
||||
<FormErrorMessage>Field is required</FormErrorMessage>
|
||||
</FormControl>
|
||||
</FormControl>,
|
||||
);
|
||||
break;
|
||||
|
||||
@ -212,7 +212,7 @@ export default function ({
|
||||
fragmentsList.push(
|
||||
<NumberInput
|
||||
isInvalid={isNumberElemInvalid(
|
||||
document.getElementById(component.id) as HTMLInputElement
|
||||
document.getElementById(component.id) as HTMLInputElement,
|
||||
)}
|
||||
isReadOnly={read_only}
|
||||
>
|
||||
@ -227,7 +227,7 @@ export default function ({
|
||||
<NumberIncrementStepper />
|
||||
<NumberDecrementStepper />
|
||||
</NumberInputStepper>
|
||||
</NumberInput>
|
||||
</NumberInput>,
|
||||
);
|
||||
break;
|
||||
|
||||
@ -256,7 +256,7 @@ export default function ({
|
||||
style={{ display: page ? "none" : undefined }}
|
||||
>
|
||||
{generateReactComponents(componentList, responses, setResponses)}
|
||||
</div>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user