import type { FC, ReactNode } from 'react'; import { Heading } from '../../atoms'; import { Meta, type MetaData } from './meta'; import styles from './page-header.module.scss'; export type PageHeaderProps = { /** * Set additional classnames to the header element. */ className?: string; /** * The page introduction. */ intro?: string | ReactNode; /** * The page metadata. */ meta?: MetaData; /** * The page title. */ title: ReactNode; }; /** * PageHeader component * * Render a header element with page title, meta and intro. */ export const PageHeader: FC = ({ className = '', intro, meta, title, }) => { const headerClass = `${styles.wrapper} ${className}`; const getIntro = () => { if (typeof intro === 'string') return (
); return
{intro}
; }; return (
{title} {meta ? ( ) : null} {intro ? getIntro() : null}
); };