forked from NotionX/react-notion-x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NotionPage.tsx
38 lines (32 loc) · 746 Bytes
/
NotionPage.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import * as React from 'react'
import Head from 'next/head'
import { ExtendedRecordMap } from 'notion-types'
import { getPageTitle } from 'notion-utils'
import { NotionRenderer } from 'react-notion-x'
export const NotionPage = ({
recordMap,
rootPageId
}: {
recordMap: ExtendedRecordMap
rootPageId?: string
}) => {
if (!recordMap) {
return null
}
const title = getPageTitle(recordMap)
console.log(title, recordMap)
return (
<>
<Head>
<meta name='description' content='React Notion X Minimal Demo' />
<title>{title}</title>
</Head>
<NotionRenderer
recordMap={recordMap}
fullPage={true}
darkMode={false}
rootPageId={rootPageId}
/>
</>
)
}