Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions packages/module/src/ContentHeader/ContentHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export interface PageHeaderLinkProps extends ButtonProps {
export interface ContentHeaderProps extends React.PropsWithChildren {
/** Title for content header */
title: string;
/** Subtitle for content header */
subtitle: string;
/** Optional subtitle for content header */
subtitle?: string;
/** Optional link below subtitle */
linkProps?: PageHeaderLinkProps;
/** Optional icon for content header (appears to the left of the content header's title with a divider) */
Expand Down Expand Up @@ -102,9 +102,11 @@ export const ContentHeader: React.FunctionComponent<React.PropsWithChildren<Cont
)}
</Split>
<TextContent>
<Text component="p" ouiaId={`${ouiaId}-subtitle`}>
{subtitle}
</Text>
{subtitle && (
<Text component="p" ouiaId={`${ouiaId}-subtitle`}>
{subtitle}
</Text>
)}
{linkProps && (
<Button variant={ButtonVariant.link} component="a" ouiaId={`${ouiaId}-link-button`} isInline icon={linkProps.isExternal ? <ExternalLinkAltIcon className='pf-v5-u-ml-sm' /> : null} iconPosition="end" {...linkProps}>
{linkProps.label}
Expand Down
Loading