Skip to content

Commit 9affe26

Browse files
committed
chore(ui): allow ChangeHistory to accept ReactNode
1 parent 147063e commit 9affe26

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

.changeset/soft-friends-camp.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@node-core/ui-components': patch
3+
---
4+
5+
Allow the ChangeHistory component to accept a ReactNode as it's content

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ import { ChevronDownIcon, ClockIcon } from '@heroicons/react/24/outline';
22
import classNames from 'classnames';
33

44
import type { LinkLike } from '#ui/types';
5-
import type { FC, ComponentProps } from 'react';
5+
import type { FC, ComponentProps, ReactNode } from 'react';
66

77
import styles from './index.module.css';
88

99
export type HistoryChange = {
1010
versions: Array<string>;
1111
label: string;
12+
content: ReactNode;
1213
url?: string;
1314
};
1415

@@ -51,7 +52,9 @@ const ChangeHistory: FC<ChangeHistoryProps> = ({
5152
aria-label={`${change.label}: ${change.versions.join(', ')}`}
5253
href={change.url}
5354
>
54-
<div className={styles.dropdownLabel}>{change.label}</div>
55+
<div className={styles.dropdownLabel}>
56+
{change.content ?? change.label}
57+
</div>
5558
<div className={styles.dropdownVersions}>
5659
{change.versions.join(', ')}
5760
</div>

0 commit comments

Comments
 (0)