We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b03b997 + 88fafff commit f88e368Copy full SHA for f88e368
components/Comments.tsx
@@ -6,11 +6,16 @@ import siteMetadata from '@/data/siteMetadata'
6
7
export default function Comments({ slug }: { slug: string }) {
8
const [loadComments, setLoadComments] = useState(false)
9
+
10
+ if (!siteMetadata.comments?.provider) {
11
+ return null
12
+ }
13
return (
14
<>
- {!loadComments && <button onClick={() => setLoadComments(true)}>Load Comments</button>}
- {siteMetadata.comments && loadComments && (
15
+ {loadComments ? (
16
<CommentsComponent commentsConfig={siteMetadata.comments} slug={slug} />
17
+ ) : (
18
+ <button onClick={() => setLoadComments(true)}>Load Comments</button>
19
)}
20
</>
21
)
0 commit comments