Skip to content

Commit

Permalink
Remove root parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
martmull committed Nov 13, 2024
1 parent 1599924 commit ea8253e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,21 @@ export const WorkflowEditActionFormServerlessFunction = (
const renderFields = (
functionInput: FunctionInput,
path: string[] = [],
isRoot = true,
): ReactNode | undefined => {
return Object.entries(functionInput).map(([inputKey, inputValue]) => {
const currentPath = [...path, inputKey];
const pathKey = currentPath.join('.');

if (inputValue !== null && typeof inputValue === 'object') {
if (isRoot) {
return renderFields(inputValue, currentPath, false);
}
return (
<StyledContainer key={pathKey}>
<StyledLabel>{inputKey}</StyledLabel>
<StyledInputContainer>
{renderFields(inputValue, currentPath)}
{renderFields(inputValue, currentPath, false)}
</StyledInputContainer>
</StyledContainer>
);
Expand Down

0 comments on commit ea8253e

Please sign in to comment.