Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Cookbook Onboard (AI Assistant & Playground) integration #120

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions components/AskCookbook/AskCookbook.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react";
import dynamic from "next/dynamic";
const BaseAskCookbook = dynamic(() => import("@cookbookdev/docsbot/react"), { ssr: false });

/** It's going to be exposed in HTTP requests anyway so it's fine to just hardcode it here */
const COOKBOOK_PUBLIC_API_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NjdlZmMxYjcyYzRmNTI5YzMxODUyZmUiLCJpYXQiOjE3MTk1OTgxMDcsImV4cCI6MjAzNTE3NDEwN30.etICfDHEcewxP9QTajrS4ggral2IgaxY_rWAlK4kNiQ";

export const AskCookbook = () => {
return <BaseAskCookbook apiKey={COOKBOOK_PUBLIC_API_KEY} />;
};
4 changes: 4 additions & 0 deletions components/AskCookbook/ask-cookbook.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Solves the following error: "Cannot find module ... or its corresponding type declarations. There are types at ..., but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'. [2307]"
declare module "@cookbookdev/docsbot/react" {
export { default } from "@cookbookdev/docsbot/dist/react/index.d.ts"
}
1 change: 1 addition & 0 deletions components/AskCookbook/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './AskCookbook';
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"license": "MIT",
"dependencies": {
"@cookbookdev/docsbot": "^4.21.15",
"@mantine/core": "^7.10.1",
"@mantine/hooks": "^7.10.1",
"@mdx-js/loader": "^3.0.1",
Expand Down
3 changes: 2 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import '@rainbow-me/rainbowkit/styles.css';
import {ThemeProvider} from 'next-themes';
import '@mantine/core/styles.css';
import {MantineWrapper} from "../components/MantineWrapper";

import {AskCookbook} from "../components/AskCookbook";

export default function Nextra({ Component, pageProps }) {
return (
<ThemeProvider attribute="class">
<MantineWrapper>
<Component {...pageProps} />
</MantineWrapper>
<AskCookbook />
</ThemeProvider>

);
Expand Down
Loading
Loading