fix falsy values not displaying

This commit is contained in:
AykutSarac 2022-08-19 15:45:47 +03:00
parent 33c3e74b49
commit 4ead8b1de7

View File

@ -16,9 +16,7 @@ const ObjectNode: React.FC<CustomNodeProps<[string, string][]>> = ({
<Styled.StyledForeignObject width={width} height={height} x={0} y={0}> <Styled.StyledForeignObject width={width} height={height} x={0} y={0}>
<ConditionalWrapper condition={performance}> <ConditionalWrapper condition={performance}>
<Styled.StyledText width={width} height={height}> <Styled.StyledText width={width} height={height}>
{value.map( {value.map((val, idx) => (
(val, idx) =>
val[1] && (
<Styled.StyledRow <Styled.StyledRow
data-key={JSON.stringify(val[1])} data-key={JSON.stringify(val[1])}
data-x={x} data-x={x}
@ -27,11 +25,14 @@ const ObjectNode: React.FC<CustomNodeProps<[string, string][]>> = ({
width={width} width={width}
value={JSON.stringify(val[1])} value={JSON.stringify(val[1])}
> >
<Styled.StyledKey objectKey>{JSON.stringify(val[0]).replaceAll('"', "")}: </Styled.StyledKey> <Styled.StyledKey objectKey>
<Styled.StyledLinkItUrl>{JSON.stringify(val[1])}</Styled.StyledLinkItUrl> {JSON.stringify(val[0]).replaceAll('"', "")}:{" "}
</Styled.StyledKey>
<Styled.StyledLinkItUrl>
{JSON.stringify(val[1])}
</Styled.StyledLinkItUrl>
</Styled.StyledRow> </Styled.StyledRow>
) ))}
)}
</Styled.StyledText> </Styled.StyledText>
</ConditionalWrapper> </ConditionalWrapper>
</Styled.StyledForeignObject> </Styled.StyledForeignObject>