load 优化

This commit is contained in:
tangly1024.com
2023-12-01 12:50:54 +08:00
parent 23ac2195c9
commit 3b181f3069
8 changed files with 118 additions and 61 deletions

View File

@@ -1,4 +1,5 @@
import { siteConfig } from '@/lib/config'
import { isSearchEngineBot } from '@/lib/utils'
import dynamic from 'next/dynamic'
import WebWhiz from './Webwhiz'
@@ -29,6 +30,10 @@ const AdBlockDetect = dynamic(() => import('@/components/AdBlockDetect'), { ssr:
* @returns
*/
const ExternalPlugin = (props) => {
if (isSearchEngineBot()) {
return null
}
return <>
{JSON.parse(siteConfig('THEME_SWITCH')) && <ThemeSwitch />}
{JSON.parse(siteConfig('DEBUG')) && <DebugPanel />}