2021-03-01 01:44:05 +01:00
|
|
|
import React, { ReactElement, ReactNode } from 'react'
|
2019-10-11 23:50:03 +02:00
|
|
|
import { Helmet } from 'react-helmet'
|
2022-11-11 03:31:54 +01:00
|
|
|
import SEO, { SeoPost } from '../atoms/SEO'
|
|
|
|
import * as styles from './Page.module.css'
|
2018-09-16 15:08:52 +02:00
|
|
|
|
2019-10-02 13:35:50 +02:00
|
|
|
export default function Page({
|
|
|
|
title,
|
|
|
|
section,
|
|
|
|
children,
|
2021-03-01 00:36:51 +01:00
|
|
|
pathname,
|
2019-10-02 13:35:50 +02:00
|
|
|
post
|
|
|
|
}: {
|
|
|
|
title: string
|
2021-03-01 00:36:51 +01:00
|
|
|
children: ReactNode
|
|
|
|
pathname: string
|
2019-10-02 13:35:50 +02:00
|
|
|
section?: string
|
2022-11-11 03:31:54 +01:00
|
|
|
post?: SeoPost
|
2020-05-22 14:38:19 +02:00
|
|
|
}): ReactElement {
|
2018-09-16 15:08:52 +02:00
|
|
|
return (
|
2018-11-07 01:15:41 +01:00
|
|
|
<>
|
|
|
|
<Helmet title={title} />
|
2022-11-11 03:31:54 +01:00
|
|
|
<SEO slug={pathname} post={post} />
|
2018-11-07 01:15:41 +01:00
|
|
|
|
2022-11-11 03:31:54 +01:00
|
|
|
<h1 className={styles.pagetitle}>{title}</h1>
|
2019-11-17 23:56:29 +01:00
|
|
|
{section ? <section className={section}>{children}</section> : children}
|
2018-11-07 01:15:41 +01:00
|
|
|
</>
|
2018-09-16 15:08:52 +02:00
|
|
|
)
|
|
|
|
}
|