Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sebelga committed Nov 14, 2024
1 parent 41b7e7b commit 7eafa1f
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,13 @@ export const EuiCollapsedNavPopover: FunctionComponent<
return item;
}

const { renderItem, href, linkProps, ...rest } = item;
const { renderItem, ...rest } = item;

const updatedItem: EuiCollapsibleNavSubItemProps = {
...rest,
};

if (href || linkProps) {
updatedItem.href = href;
updatedItem.linkProps = linkProps;
} else {
updatedItem.items = rest.items ? rest.items?.map(withOnClick) : undefined;
}
updatedItem.items = rest.items ? rest.items?.map(withOnClick) : undefined;

if (!updatedItem.items) {
// Only override the onClick if there are no sub-items (leaf node)
Expand Down

0 comments on commit 7eafa1f

Please sign in to comment.