mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-05 07:26:46 +00:00
Code🤣
This commit is contained in:
33
components/Cusdis.js
Normal file
33
components/Cusdis.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import BLOG from '@/blog.config'
|
||||
import { useEffect } from 'react'
|
||||
const Cusdis = ({ id, url, title }) => {
|
||||
useEffect(() => {
|
||||
const script = document.createElement('script')
|
||||
const anchor = document.getElementById('comments')
|
||||
script.setAttribute(
|
||||
'src',
|
||||
BLOG.comment.cusdisConfig.scriptSrc ||
|
||||
'https://cusdis.com/js/cusdis.es.js'
|
||||
)
|
||||
script.setAttribute('async', true)
|
||||
script.setAttribute('defer', true)
|
||||
anchor.appendChild(script)
|
||||
return () => {
|
||||
anchor.innerHTML = ''
|
||||
}
|
||||
})
|
||||
return (
|
||||
<div id="comments">
|
||||
<div
|
||||
id="cusdis_thread"
|
||||
data-host={BLOG.comment.cusdisConfig.host || 'https://cusdis.com'}
|
||||
data-app-id={BLOG.comment.cusdisConfig.appId}
|
||||
data-page-id={id}
|
||||
data-page-url={url}
|
||||
data-page-title={title}
|
||||
></div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Cusdis
|
||||
Reference in New Issue
Block a user