Skip to content

Commit d3706c9

Browse files
Merge pull request #2 from MarryamZulfiqar/cookbook-merged
Cookbook merged
2 parents 6cec1dc + 9150d9a commit d3706c9

File tree

3 files changed

+2165
-27
lines changed

3 files changed

+2165
-27
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"dependencies": {
2121
"@docsearch/css": "3",
2222
"@algolia/client-search": "^5.23.4",
23+
"@cookbookdev/docsbot": "^4.25.8",
2324
"@docusaurus/core": "^3.7.0",
2425
"@docusaurus/plugin-content-docs": "^3.7.0",
2526
"@docusaurus/plugin-google-gtag": "^3.7.0",
@@ -65,4 +66,4 @@
6566
"engines": {
6667
"node": ">=18.0"
6768
}
68-
}
69+
}

src/theme/SearchBar/index.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React from "react";
2+
import SearchBar from "@theme-original/SearchBar";
3+
import AskCookbook from "@cookbookdev/docsbot/react";
4+
import BrowserOnly from "@docusaurus/BrowserOnly";
5+
6+
/** It's a public API key, so it's safe to expose it here */
7+
const COOKBOOK_PUBLIC_API_KEY =
8+
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2N2ExNjZlN2Y4MTAzY2QxMjg4NDQ0MGMiLCJpYXQiOjE3Mzg2MzA4ODcsImV4cCI6MjA1NDIwNjg4N30.MoUziaM2dGeFiqa-L1xpqtZDh6Fbo_6invv8ah1DKSU";
9+
10+
export default function SearchBarWrapper(props) {
11+
return (
12+
<>
13+
<SearchBar {...props} />
14+
<BrowserOnly>
15+
{() => <AskCookbook apiKey={COOKBOOK_PUBLIC_API_KEY} />}
16+
</BrowserOnly>
17+
</>
18+
);
19+
}

0 commit comments

Comments
 (0)