fix: avoid rendering search bar if no content plugin is enabled

This commit is contained in:
Hossein Mehrabi
2023-05-29 17:30:42 +03:30
parent 8826ea6fb8
commit 6573e734ab
@@ -1,7 +1,11 @@
import { useActivePlugin } from '@docusaurus/plugin-content-docs/lib/client/index.js'
import React from 'react'
import { SearchBar } from './SearchBar'
const SearchBarWrapper: React.FC = () => {
const activePlugin = useActivePlugin()
if (!activePlugin) return <></>
return typeof window === 'undefined' ? <></> : <SearchBar />
}