diff --git a/.changeset/soft-friends-camp.md b/.changeset/soft-friends-camp.md new file mode 100644 index 0000000000000..d696f7d57533c --- /dev/null +++ b/.changeset/soft-friends-camp.md @@ -0,0 +1,5 @@ +--- +'@node-core/ui-components': patch +--- + +Allow the ChangeHistory component to accept a ReactNode as it's content diff --git a/packages/ui-components/src/Common/ChangeHistory/index.tsx b/packages/ui-components/src/Common/ChangeHistory/index.tsx index 401e67bd62d71..c3fc91498ce0c 100644 --- a/packages/ui-components/src/Common/ChangeHistory/index.tsx +++ b/packages/ui-components/src/Common/ChangeHistory/index.tsx @@ -2,13 +2,14 @@ import { ChevronDownIcon, ClockIcon } from '@heroicons/react/24/outline'; import classNames from 'classnames'; import type { LinkLike } from '#ui/types'; -import type { FC, ComponentProps } from 'react'; +import type { FC, ComponentProps, ReactNode } from 'react'; import styles from './index.module.css'; export type HistoryChange = { versions: Array; label: string; + content?: ReactNode; url?: string; }; @@ -51,7 +52,9 @@ const ChangeHistory: FC = ({ aria-label={`${change.label}: ${change.versions.join(', ')}`} href={change.url} > -
{change.label}
+
+ {change.content ?? change.label} +
{change.versions.join(', ')}