|
1 | | -import * as React from 'react' |
| 1 | +import cs from 'classnames' |
2 | 2 | import dynamic from 'next/dynamic' |
3 | | -import Image from 'next/image' |
| 3 | +import Image from 'next/legacy/image' |
4 | 4 | import Link from 'next/link' |
5 | 5 | import { useRouter } from 'next/router' |
6 | | - |
7 | | -import cs from 'classnames' |
8 | | -import { PageBlock } from 'notion-types' |
| 6 | +import { type PageBlock } from 'notion-types' |
9 | 7 | import { formatDate, getBlockTitle, getPageProperty } from 'notion-utils' |
| 8 | +import * as React from 'react' |
10 | 9 | import BodyClassName from 'react-body-classname' |
11 | 10 | import { NotionRenderer } from 'react-notion-x' |
12 | 11 | import TweetEmbed from 'react-tweet-embed' |
13 | 12 | import { useSearchParam } from 'react-use' |
14 | 13 |
|
| 14 | +import type * as types from '@/lib/types' |
15 | 15 | import * as config from '@/lib/config' |
16 | | -import * as types from '@/lib/types' |
17 | 16 | import { mapImageUrl } from '@/lib/map-image-url' |
18 | 17 | import { getCanonicalPageUrl, mapPageUrl } from '@/lib/map-page-url' |
19 | 18 | import { searchNotion } from '@/lib/search-notion' |
@@ -97,7 +96,7 @@ const Modal = dynamic( |
97 | 96 | } |
98 | 97 | ) |
99 | 98 |
|
100 | | -const Tweet = ({ id }: { id: string }) => { |
| 99 | +function Tweet({ id }: { id: string }) { |
101 | 100 | return <TweetEmbed tweetId={id} /> |
102 | 101 | } |
103 | 102 |
|
@@ -142,12 +141,12 @@ const propertyTextValue = ( |
142 | 141 | return defaultFn() |
143 | 142 | } |
144 | 143 |
|
145 | | -export const NotionPage: React.FC<types.PageProps> = ({ |
| 144 | +export function NotionPage({ |
146 | 145 | site, |
147 | 146 | recordMap, |
148 | 147 | error, |
149 | 148 | pageId |
150 | | -}) => { |
| 149 | +}: types.PageProps) { |
151 | 150 | const router = useRouter() |
152 | 151 | const lite = useSearchParam('lite') |
153 | 152 |
|
|
0 commit comments