Skip to content

Commit

Permalink
fix(website): handle array values in interact
Browse files Browse the repository at this point in the history
  • Loading branch information
saeta-eth committed Oct 22, 2024
1 parent 1b1c886 commit 42854c5
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions packages/website/src/features/Packages/FunctionOutput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,11 @@ export const FunctionOutput: FC<{
</Text>
);
} else if (isArray(value)) {
if (index !== undefined) {
return (
<Text fontSize="xs" display="block">
{String(value[index])}
</Text>
);
} else {
return value.map((val, idx) => (
<Text fontSize="xs" display="block" key={idx}>
{String(val)}
</Text>
));
}
return value.map((val, idx) => (
<Text fontSize="xs" display="block" key={idx}>
{String(val)}
</Text>
));
} else {
return (
<Flex
Expand Down Expand Up @@ -154,7 +146,7 @@ export const FunctionOutput: FC<{
output.map((item, index) => (
<Box overflowX={'scroll'} p={2} key={index}>
<ItemLabel name={item.name || ''} type={item.internalType || ''} />
{renderOutput(item, result, index)}
{renderOutput(item, result)}
</Box>
))
) : (
Expand Down

0 comments on commit 42854c5

Please sign in to comment.