fix import and add fallback

This commit is contained in:
yujonglee 2024-07-26 22:00:48 +09:00
parent c54f23f936
commit 8a45abb563

View file

@ -24,7 +24,7 @@ export default function SearchBarWrapper(props) {
import("@getcanary/web/components/canary-content"), import("@getcanary/web/components/canary-content"),
import("@getcanary/web/components/canary-search"), import("@getcanary/web/components/canary-search"),
import("@getcanary/web/components/canary-search-input"), import("@getcanary/web/components/canary-search-input"),
import("@getcanary/web/components/canary-search-results"), import("@getcanary/web/components/canary-search-results-group"),
import("@getcanary/web/components/canary-footer"), import("@getcanary/web/components/canary-footer"),
import("@getcanary/web/components/canary-callout-calendly"), import("@getcanary/web/components/canary-callout-calendly"),
import("@getcanary/web/components/canary-callout-discord"), import("@getcanary/web/components/canary-callout-discord"),
@ -33,10 +33,6 @@ export default function SearchBarWrapper(props) {
.catch(console.error); .catch(console.error);
}, []); }, []);
if (!loaded || !path) {
return null;
}
return ( return (
<div <div
style={{ style={{
@ -46,6 +42,9 @@ export default function SearchBarWrapper(props) {
gap: "6px", gap: "6px",
}} }}
> >
{!loaded || !path ? (
<span style={{ fontSize: "2rem" }}>🐤</span>
) : (
<canary-root framework="docusaurus"> <canary-root framework="docusaurus">
<canary-provider-pagefind <canary-provider-pagefind
options={JSON.stringify({ ...options, path })} options={JSON.stringify({ ...options, path })}
@ -77,6 +76,7 @@ export default function SearchBarWrapper(props) {
</canary-modal> </canary-modal>
</canary-provider-pagefind> </canary-provider-pagefind>
</canary-root> </canary-root>
)}
<SearchBar {...props} /> <SearchBar {...props} />
</div> </div>