1
0
Fork 0
blog/src/components/templates/Page.tsx

29 lines
618 B
TypeScript
Raw Normal View History

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'
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
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} />
<SEO slug={pathname} post={post} />
2018-11-07 01:15:41 +01:00
<h1 className={styles.pagetitle}>{title}</h1>
{section ? <section className={section}>{children}</section> : children}
2018-11-07 01:15:41 +01:00
</>
2018-09-16 15:08:52 +02:00
)
}