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

Merged
merged 1 commit into from
Oct 31, 2024
Merged
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 components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ export * from './VersionFetcher';
export * from './PropertyInfo';
export * from './EcosystemMap';
export * from './InteractiveTerminal';
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.24.0",
"@mantine/code-highlight": "^7.12.2",
"@mantine/core": "^7.10.1",
"@mantine/hooks": "^7.10.1",
Expand Down
3 changes: 2 additions & 1 deletion pages/_app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import '@mantine/code-highlight/styles.css';
import '../styles/globals.css';
import '../styles/custom.css';
import { ThemeProvider } from 'next-themes';
import { MantineWrapper } from '../components';
import { MantineWrapper, AskCookbook } from '../components';

export default function Nextra({ Component, pageProps }) {
return (
<ThemeProvider attribute='class'>
<MantineWrapper>
<Component {...pageProps} />
<AskCookbook />
</MantineWrapper>
</ThemeProvider>
);
Expand Down
5,562 changes: 2,055 additions & 3,507 deletions yarn.lock

Large diffs are not rendered by default.

Loading