2020-07-07 23:00:16 +02:00
|
|
|
import React, { ReactElement } from 'react'
|
|
|
|
import classNames from 'classnames/bind'
|
2020-05-07 08:03:30 +02:00
|
|
|
import styles from './PageHeader.module.css'
|
2021-10-27 12:27:14 +02:00
|
|
|
import Markdown from '@shared/Markdown'
|
2020-05-07 08:03:30 +02:00
|
|
|
|
2020-07-07 23:00:16 +02:00
|
|
|
const cx = classNames.bind(styles)
|
|
|
|
|
2020-05-07 08:03:30 +02:00
|
|
|
export default function PageHeader({
|
|
|
|
title,
|
2020-07-15 14:34:40 +02:00
|
|
|
description,
|
|
|
|
center
|
2020-05-07 08:03:30 +02:00
|
|
|
}: {
|
2021-10-21 20:58:55 +02:00
|
|
|
title: ReactElement
|
2020-05-07 08:03:30 +02:00
|
|
|
description?: string
|
2020-07-07 23:00:16 +02:00
|
|
|
center?: boolean
|
|
|
|
}): ReactElement {
|
|
|
|
const styleClasses = cx({
|
2020-07-15 14:34:40 +02:00
|
|
|
header: true,
|
|
|
|
center: center
|
2020-07-07 23:00:16 +02:00
|
|
|
})
|
|
|
|
|
2020-05-07 08:03:30 +02:00
|
|
|
return (
|
2020-07-07 23:00:16 +02:00
|
|
|
<header className={styleClasses}>
|
2020-05-07 08:03:30 +02:00
|
|
|
<h1 className={styles.title}>{title}</h1>
|
2021-09-15 12:50:41 +02:00
|
|
|
{description && (
|
|
|
|
<Markdown text={description} className={styles.description} />
|
|
|
|
)}
|
2020-05-07 08:03:30 +02:00
|
|
|
</header>
|
|
|
|
)
|
|
|
|
}
|