Skip to content

Commit fb29316

Browse files
committed
feat(ui-components): address copilot
1 parent e3f500c commit fb29316

File tree

1 file changed

+12
-9
lines changed
  • packages/ui-components/Common/ChangeHistory

1 file changed

+12
-9
lines changed

packages/ui-components/Common/ChangeHistory/index.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,20 @@ const ChangeHistory: FC<ChangeHistoryProps> = ({
4747
</>
4848
);
4949

50-
return (
51-
<a
52-
key={index}
53-
href={change.url}
54-
className={styles.dropdownItem}
55-
role="menuitem"
56-
tabIndex={0}
57-
aria-label={`${change.label}: ${change.versions.join(', ')}`}
58-
>
50+
const itemProps = {
51+
key: index,
52+
className: styles.dropdownItem,
53+
role: 'menuitem',
54+
tabIndex: 0,
55+
['aria-label']: `${change.label}: ${change.versions.join(', ')}`,
56+
};
57+
58+
return change.url ? (
59+
<a {...itemProps} href={change.url}>
5960
{content}
6061
</a>
62+
) : (
63+
<div {...itemProps}>{content}</div>
6164
);
6265
})}
6366
</div>

0 commit comments

Comments
 (0)