Reduce the depth of the node tree
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
This commit is contained in:
@@ -65,14 +65,14 @@ const SupportListItem = ({ item }: { item: SupportItem }) => {
|
||||
</ListItemIcon>
|
||||
<ListItemText
|
||||
primary={item.title}
|
||||
secondary={
|
||||
item.links &&
|
||||
item.links
|
||||
.map<React.ReactNode>(link => (
|
||||
<SupportLink link={link} key={link.url} />
|
||||
))
|
||||
.reduce((prev, curr, idx) => [prev, <br key={idx} />, curr])
|
||||
}
|
||||
secondary={item.links?.reduce<React.ReactNodeArray>(
|
||||
(prev, link, idx) => [
|
||||
...prev,
|
||||
idx > 0 && <br key={idx} />,
|
||||
<SupportLink link={link} key={link.url} />,
|
||||
],
|
||||
[],
|
||||
)}
|
||||
/>
|
||||
</ListItem>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user