1
1
import { headers } from 'next/dist/client/components/headers'
2
2
import type { Metadata } from 'next'
3
3
4
+ import { NotSupport } from '~/components/common/NotSupport'
4
5
import { BottomToUpTransitionView } from '~/components/ui/transition/BottomToUpTransitionView'
5
- import { Comments } from '~/components/widgets/comment/Comments '
6
+ import { CommentRoot } from '~/components/widgets/comment/CommentRoot '
6
7
import { NoteMainContainer } from '~/components/widgets/note/NoteMainContainer'
7
- import { REQUEST_QUERY } from '~/constants/system'
8
+ import { REQUEST_GEO , REQUEST_QUERY } from '~/constants/system'
8
9
import { attachUA } from '~/lib/attach-ua'
9
10
import { getSummaryFromMd } from '~/lib/markdown'
10
11
import {
@@ -65,13 +66,17 @@ export default async (
65
66
} > ,
66
67
) => {
67
68
attachUA ( )
68
- const searchParams = new URLSearchParams ( headers ( ) . get ( REQUEST_QUERY ) || '' )
69
+ const header = headers ( )
70
+ const searchParams = new URLSearchParams ( header . get ( REQUEST_QUERY ) || '' )
69
71
const id = props . params . id
70
72
const query = queries . note . byNid (
71
73
id ,
72
74
searchParams . get ( 'password' ) || undefined ,
73
75
)
74
76
const data = await getQueryClient ( ) . fetchQuery ( query )
77
+ const geo = header . get ( REQUEST_GEO )
78
+
79
+ const isCN = geo === 'CN'
75
80
76
81
return (
77
82
< >
@@ -81,7 +86,7 @@ export default async (
81
86
82
87
< BottomToUpTransitionView className = "min-w-0" >
83
88
< Paper as = { NoteMainContainer } > { props . children } </ Paper >
84
- < Comments refId = { id } />
89
+ { isCN ? < NotSupport /> : < CommentRoot refId = { data . data . id } /> }
85
90
</ BottomToUpTransitionView >
86
91
</ >
87
92
)
0 commit comments