upstream #1

Merged
jblu merged 1007 commits from upstream into main 2024-11-04 22:35:57 -06:00
Showing only changes of commit 70e4a39d85 - Show all commits

View File

@ -5,13 +5,16 @@ import { useState } from 'react'
import siteMetadata from '@/data/siteMetadata'
export default function Comments({ slug }: { slug: string }) {
const [loadComments, setLoadComments] = useState(false)
const [loadComments, setLoadComments] = useState(false);
if (!siteMetadata.comments?.provider) {
return null;
}
return (
<>
{!loadComments && <button onClick={() => setLoadComments(true)}>Load Comments</button>}
{siteMetadata.comments && loadComments && (
{loadComments ? (
<CommentsComponent commentsConfig={siteMetadata.comments} slug={slug} />
)}
</>
) :
(<button onClick={() => setLoadComments(true)}>Load Comments</button>)
}
)
}