|
import { siteConfig } from '@/lib/config' |
|
import { loadExternalResource } from '@/lib/utils' |
|
import { useEffect } from 'react' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Artalk = ({ siteInfo }) => { |
|
const artalkCss = siteConfig('COMMENT_ARTALK_CSS') |
|
const artalkServer = siteConfig('COMMENT_ARTALK_SERVER') |
|
const artalkLocale = siteConfig('LANG') |
|
const site = siteConfig('TITLE') |
|
|
|
useEffect(() => { |
|
initArtalk() |
|
}, []) |
|
|
|
const initArtalk = async () => { |
|
await loadExternalResource(artalkCss, 'css') |
|
window?.Artalk?.init({ |
|
server: artalkServer, |
|
el: '#artalk', |
|
locale: artalkLocale, |
|
|
|
|
|
site: site |
|
}) |
|
} |
|
return ( |
|
<div id="artalk"></div> |
|
) |
|
} |
|
|
|
export default Artalk |
|
|