Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
792899f
feat: add MeetingBaas API integration and CORS headers configuration
techwithanirudh Apr 4, 2025
4ff2dc9
fix: migrate db
Lazare-42 Apr 4, 2025
3ecb955
refactor: update imports to use 'type' for type-only imports and adju…
techwithanirudh Apr 4, 2025
4985149
fix: rename baasApiKey to baasSession for clarity in API authentication
techwithanirudh Apr 4, 2025
f89cbf8
Merge branch 'main' of https://github.com/meeting-baas/ai-chat
techwithanirudh Apr 4, 2025
843a635
fix: add mcp logic
techwithanirudh Apr 4, 2025
2d40f58
Merge branch 'main' of https://github.com/techwithanirudh/ai-chatbot
techwithanirudh Apr 5, 2025
b05a3e7
fix: remove magic form
techwithanirudh Apr 5, 2025
f7d4c21
Merge branch 'main' of https://github.com/techwithanirudh/ai-chatbot
techwithanirudh Apr 5, 2025
14c9a52
Merge branch 'main' of https://github.com/techwithanirudh/ai-chatbot
techwithanirudh Apr 5, 2025
6421ea5
feat: add MCP tools schemas and integrate with POST request handling
techwithanirudh Apr 5, 2025
a536c98
Merge branch 'main' of https://github.com/techwithanirudh/ai-chatbot
techwithanirudh Apr 5, 2025
09ca46e
feat: update styles and metadata for MeetingBaas integration; add new…
techwithanirudh Apr 5, 2025
a9f871b
feat: update README to reflect MeetingBaas integration; change title …
techwithanirudh Apr 5, 2025
aa810b5
feat: update README header to simplify presentation and improve clarity
techwithanirudh Apr 5, 2025
b293ee1
feat: simplify README layout by removing unnecessary HTML elements
techwithanirudh Apr 5, 2025
8860b38
chore: fix build errors with ai-sdk dependency and page prerendering
Lazare-42 Apr 5, 2025
c1ea285
Merge branch 'main' of https://github.com/techwithanirudh/ai-chatbot
techwithanirudh Apr 7, 2025
8a7d4f9
Merge branch 'main' of https://github.com/meeting-baas/ai-chat
techwithanirudh Apr 7, 2025
ed999eb
fix: tools definition
techwithanirudh Apr 7, 2025
0b41738
feat: add MCPDetails component and accordion UI for tool details
techwithanirudh Apr 7, 2025
f7fd67f
fix: update CodeBlock usage for args and result in MCPDetails component
techwithanirudh Apr 7, 2025
6dbef56
fix: update styles in MCPDetails component for improved UI consistency
techwithanirudh Apr 7, 2025
4436c31
refactor: simplify tool selection logic in POST request and remove un…
techwithanirudh Apr 7, 2025
5a02bd4
fix: update color variables in globals.css for improved theme consist…
techwithanirudh Apr 7, 2025
7dfd459
fix: streamline argument and result display in MCPDetails component
techwithanirudh Apr 7, 2025
6d9873c
fix: update MCP client URL and enhance active tools configuration in …
techwithanirudh Apr 7, 2025
6301c3f
fix: update API key handling and improve error logging in POST request
techwithanirudh Apr 7, 2025
d60e03c
fix: correct API call for chat model in myProvider configuration
techwithanirudh Apr 7, 2025
1bc0551
fix: include MeetingBaas API key in system prompt for enhanced functi…
techwithanirudh Apr 7, 2025
8f9e112
fix: update MCPDetails component to use toolName for AccordionItem va…
techwithanirudh Apr 7, 2025
fc41f02
fix: remove defaultValue from Accordion component in MCPDetails for i…
techwithanirudh Apr 7, 2025
ebeeeed
fix: update MCPDetails component to use isLoading prop for better loa…
techwithanirudh Apr 7, 2025
5251b4c
fix: update button label to 'Open MeetingBaas Dashboard' for clarity
techwithanirudh Apr 7, 2025
d020d49
fix: update button label to 'Open MeetingBaas' for clarity
techwithanirudh Apr 7, 2025
fdb2f20
fix: improve selection styles and add view transition animations for …
techwithanirudh Apr 7, 2025
753c451
fix: replace SparklesIcon with FishIcon for consistency in message di…
techwithanirudh Apr 7, 2025
ba4b635
fix: update action label for webhook data and improve API key status …
techwithanirudh Apr 7, 2025
0581044
fix: unify tool details display by replacing MCPDetails with ToolDeta…
techwithanirudh Apr 7, 2025
351ba35
fix: remove MCPDetails component to streamline tool details display
techwithanirudh Apr 7, 2025
90ea40c
feat: enhance regularPrompt with detailed instructions and domain-spe…
techwithanirudh Apr 8, 2025
b886d1b
feat: integrate web search tool for MeetingBaas and update dependencies
techwithanirudh Apr 8, 2025
80af25a
fix: update MCP client configuration and enhance domain knowledge ins…
techwithanirudh Apr 8, 2025
dba549c
feat: enhance prompts with additional context for MeetingBaas and upd…
techwithanirudh Apr 8, 2025
7ad7c4d
Enhance prompts and API integration for MeetingBaas
techwithanirudh Apr 8, 2025
abb6ca2
fix: update chat-model to use gpt-4 for improved performance
techwithanirudh Apr 8, 2025
64d1573
feat: implement embedding generation and retrieval, add user and chat…
techwithanirudh Apr 8, 2025
c61246d
feat: add RAGDetails component and integrate understandQuery tool for…
techwithanirudh Apr 8, 2025
11fe524
feat: enhance build process and add content ingestion script
techwithanirudh Apr 8, 2025
332e68d
fix: remove text size class from action display in RAGDetails component
techwithanirudh Apr 8, 2025
35ee1e6
fix: update loading states and improve descriptions in RAGDetails and…
techwithanirudh Apr 8, 2025
518fb0b
fix: refine descriptions in getInformation and understandQuery tools …
techwithanirudh Apr 8, 2025
78da922
feat: add TextShimmer component for enhanced loading indicators in me…
techwithanirudh Apr 8, 2025
2246906
fix: remove unused data variable from ingestContent function
techwithanirudh Apr 8, 2025
ec4fda7
fix: update embedding model to use text-embedding-3-small for improve…
techwithanirudh Apr 8, 2025
a28b25d
fix: update embedding model to use text-embedding-3-small for consist…
techwithanirudh Apr 8, 2025
c9922ff
fix: enhance clarity and accuracy in BaasChat prompts regarding RAG a…
techwithanirudh Apr 8, 2025
00f5083
feat: add Firecrawl API key configuration and web search tool integra…
techwithanirudh Apr 8, 2025
819e45c
Refactor code structure for improved readability and maintainability
techwithanirudh Apr 8, 2025
8b30d60
feat: add MeetingBaas API documentation and sitemap integration
techwithanirudh Apr 8, 2025
7193788
refactor: remove web search tool and related dependencies for cleaner…
techwithanirudh Apr 8, 2025
9cf4c14
feat: enhance RAGDetails and ToolDetails components with expandable s…
techwithanirudh Apr 8, 2025
5c0bf92
feat: update RAGDetails component to display arguments and results ba…
techwithanirudh Apr 8, 2025
fcbdbae
fix: update loading message style in RAGDetails component for better …
techwithanirudh Apr 8, 2025
47b4224
Refactor AI embedding and query handling
techwithanirudh Apr 8, 2025
9450c04
refactor: improve system prompt and response structure in getInformat…
techwithanirudh Apr 8, 2025
99d4562
refactor: streamline RAG and web search guidance for improved clarity…
techwithanirudh Apr 8, 2025
91482be
refactor: enhance description and parameter details in getInformation…
techwithanirudh Apr 8, 2025
c316d67
refactor: enhance RAGDetails component to display question and loadin…
techwithanirudh Apr 8, 2025
c179242
refactor: update loading message in RAGDetails and enhance getInforma…
techwithanirudh Apr 8, 2025
adc9966
refactor: remove unused ingest-content and post-build scripts to stre…
techwithanirudh Apr 8, 2025
d8a3d99
refactor: remove Firecrawl API key from environment example and clean…
techwithanirudh Apr 9, 2025
6a882ee
refactor: enhance loading message in ToolDetails component and improv…
techwithanirudh Apr 9, 2025
403804c
refactor: update Markdown component in RAGDetails to apply muted text…
techwithanirudh Apr 9, 2025
18bb473
refactor: clarify response guidelines and enforce strict formatting r…
techwithanirudh Apr 9, 2025
16a4cf1
refactor: update CodeBlock component styles and enhance Tailwind conf…
techwithanirudh Apr 9, 2025
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
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
"editor.defaultFormatter": "biomejs.biome"
},
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.workingDirectories": [
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Next.js AI Chatbot (Upgraded)
# Baas Chat

An upgraded version of Vercel's AI Chatbot template, Built With Next.js and the AI SDK.
An Open-Source AI Chatbot w/ MeetingBaas Integrated - Fork of [Vercel's AI Chatbot](https://github.com/techwithanirudh/ai-chatbot)

## Features

- [MeetingBaas](https://meetingbaas.com)
- Unified API for integrating with Google Meet, Zoom, and Microsoft Teams meetings
- Automated recording, transcription, and LLM summaries through simple API endpoints
- [Next.js](https://nextjs.org) App Router
- Advanced routing for seamless navigation and performance
- React Server Components (RSCs) and Server Actions for server-side rendering and increased performance
Expand Down
4 changes: 2 additions & 2 deletions app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type { Metadata } from 'next';
import { CardWrapper } from '@/components/auth/card-wrapper';
import { MagicLinkForm } from '@/components/auth/magic-form';

import { MessageSquare } from 'lucide-react';
import { abstractImages } from '@/lib/images';
import { MessageSquare } from 'lucide-react';

export const metadata: Metadata = {
title: 'Login',
Expand All @@ -24,7 +24,7 @@ export default async function SignInPage() {
<div className="relative hidden h-full rounded-3xl overflow-hidden lg:block p-4">
<img
src={image.url}
className="object-cover w-full h-full rounded-3xl"
className="object-cover size-full rounded-3xl"
alt="Abstract background"
/>
<div className="absolute bottom-6 left-7 text-primary-foreground">
Expand Down
2 changes: 1 addition & 1 deletion app/(auth)/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function RegisterPage() {
{/* todo: use next-image optimizations and limit urls available in next config */}
<img
src={image.url}
className="object-cover w-full h-full rounded-3xl"
className="object-cover size-full rounded-3xl"
alt="Abstract background"
/>
<div className="absolute bottom-6 left-7 text-primary-foreground">
Expand Down
4 changes: 2 additions & 2 deletions app/(chat)/actions.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use server';

import { generateText, Message } from 'ai';
import { generateText, type Message } from 'ai';
import { cookies } from 'next/headers';

import {
deleteMessagesByChatIdAfterTimestamp,
getMessageById,
updateChatVisiblityById,
} from '@/server/db/queries';
import { VisibilityType } from '@/components/chat/visibility-selector';
import type { VisibilityType } from '@/components/chat/visibility-selector';
import { myProvider } from '@/lib/ai/providers';

export async function saveChatModelAsCookie(model: string) {
Expand Down
41 changes: 37 additions & 4 deletions app/(chat)/api/chat/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {
UIMessage,
type UIMessage,
appendResponseMessages,
createDataStreamResponse,
experimental_createMCPClient as createMCPClient,
smoothStream,
streamText,
} from 'ai';
Expand All @@ -25,6 +26,9 @@ import { requestSuggestions } from '@/lib/ai/tools/request-suggestions';
import { getWeather } from '@/lib/ai/tools/get-weather';
import { isProductionEnvironment } from '@/lib/constants';
import { myProvider } from '@/lib/ai/providers';
import * as meetingBaas from '@/server/meetingbaas';
import { activeTools as mcpActiveTools } from '@/lib/ai/tools/mcp';
import { getInformation } from '@/lib/ai/tools/get-information';

export const maxDuration = 60;

Expand All @@ -41,6 +45,7 @@ export async function POST(request: Request) {
} = await request.json();

const session = await auth();
const baasSession = await meetingBaas.auth();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Ensure MeetingBaas authentication is properly handled

The authentication with MeetingBaas is correctly implemented, but there's no error handling if the authentication fails.

Consider adding error handling for the MeetingBaas authentication:

-    const baasSession = await meetingBaas.auth();
+    let baasSession;
+    try {
+      baasSession = await meetingBaas.auth();
+    } catch (error) {
+      console.error('MeetingBaas authentication failed:', error);
+      // Continue without MeetingBaas features
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const baasSession = await meetingBaas.auth();
let baasSession;
try {
baasSession = await meetingBaas.auth();
} catch (error) {
console.error('MeetingBaas authentication failed:', error);
// Continue without MeetingBaas features
}


if (!session || !session.user || !session.user.id) {
return new Response('Unauthorized', { status: 401 });
Expand Down Expand Up @@ -79,11 +84,28 @@ export async function POST(request: Request) {
],
});

const client = await createMCPClient({
transport: {
type: 'sse',
url: 'https://mcp.meetingbaas.com/sse',
headers: {
'x-meeting-baas-api-key': baasSession?.apiKey ?? 'invalid-api-key',
},
},
onUncaughtError: (error) => {
console.error('MCP Client error:', error);
},
});
const mcpTools = await client.tools();

return createDataStreamResponse({
execute: (dataStream) => {
execute: async (dataStream) => {
const result = streamText({
model: myProvider.languageModel(selectedChatModel),
system: systemPrompt({ selectedChatModel }),
system: systemPrompt({
selectedChatModel,
baasApiKey: baasSession?.apiKey,
}),
messages,
maxSteps: 5,
experimental_activeTools:
Expand All @@ -94,6 +116,8 @@ export async function POST(request: Request) {
'createDocument',
'updateDocument',
'requestSuggestions',
'getInformation',
...(mcpActiveTools as any[]),
],
experimental_transform: smoothStream({ chunking: 'word' }),
experimental_generateMessageId: generateUUID,
Expand All @@ -105,6 +129,8 @@ export async function POST(request: Request) {
session,
dataStream,
}),
getInformation,
...mcpTools
Comment on lines +132 to +133
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify tool implementation consistency

The getInformation tool is directly imported while mcpTools are spread. Ensure both approaches are used consistently and the tools have matching interfaces.


🏁 Script executed:

#!/bin/bash
# Check mcpActiveTools implementation
cat lib/ai/tools/mcp.ts

Length of output: 346


Action Required: Align Tool Interfaces

The getInformation tool is imported directly while the tools spread from mcpTools (defined in lib/ai/tools/mcp.ts) are sourced from an array of tool names. Currently, mcpTools is an array of strings that doesn’t include getInformation. This discrepancy implies that their interfaces might not match.

  • Review Definition: Confirm whether getInformation intentionally deviates from the common tool interface expected from mcpTools or if it should be incorporated into the same export.
  • Next Steps: If both should behave uniformly, either add getInformation to the exported tools array in mcp.ts or update its implementation to align with the spread tools’ structure.

},
onFinish: async ({ response }) => {
if (session.user?.id) {
Expand Down Expand Up @@ -141,6 +167,11 @@ export async function POST(request: Request) {
console.error('Failed to save chat');
}
}

client.close();
},
onError: async () => {
client.close();
},
experimental_telemetry: {
isEnabled: isProductionEnvironment,
Expand All @@ -154,7 +185,9 @@ export async function POST(request: Request) {
sendReasoning: true,
});
},
onError: () => {
onError: (error) => {
console.error('Error in data stream:', error);
client.close();
return 'Oops, an error occured!';
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/(chat)/api/document/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { auth } from '@/server/auth';
import { ArtifactKind } from '@/components/artifact';
import type { ArtifactKind } from '@/components/artifact';
import {
deleteDocumentsByIdAfterTimestamp,
getDocumentsById,
Expand Down
4 changes: 2 additions & 2 deletions app/(chat)/chat/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { Chat } from '@/components/chat';
import { getChatById, getMessagesByChatId } from '@/server/db/queries';
import { DataStreamHandler } from '@/components/data-stream-handler';
import { DEFAULT_CHAT_MODEL } from '@/lib/ai/models';
import { DBMessage } from '@/server/db/schema';
import { Attachment, UIMessage } from 'ai';
import type { DBMessage } from '@/server/db/schema';
import type { Attachment, UIMessage } from 'ai';

export default async function Page(props: { params: Promise<{ id: string }> }) {
const params = await props.params;
Expand Down
76 changes: 52 additions & 24 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;
--background: 168, 29%, 97%;
--foreground: 240, 6%, 25%;
--card: 0 0% 100%;
--card-foreground: 240 10% 3.9%;
--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;
--primary: 240 5.9% 10%;
--primary: 176 100% 43%;
--primary-foreground: 0 0% 98%;
--secondary: 240 4.8% 95.9%;
--secondary-foreground: 240 5.9% 10%;
Expand Down Expand Up @@ -58,26 +58,26 @@
--sidebar-border: 220 13% 91%;
--sidebar-ring: 217.2 91.2% 59.8%;
}

.dark {
--background: 240 10% 3.9%;
--foreground: 0 0% 98%;
--card: 240 10% 3.9%;
--card-foreground: 0 0% 98%;
--popover: 240 10% 3.9%;
--popover-foreground: 0 0% 98%;
--primary: 0 0% 98%;
--primary-foreground: 240 5.9% 10%;
--secondary: 240 3.7% 15.9%;
--secondary-foreground: 0 0% 98%;
--muted: 240 3.7% 15.9%;
--muted-foreground: 240 5% 64.9%;
--accent: 240 3.7% 15.9%;
--accent-foreground: 0 0% 98%;
--background: 0, 0%, 17%;
--foreground: 0, 0%, 100%;
--card: 0, 0%, 17%;
--card-foreground: 0, 0%, 100%;
--popover: 0, 0%, 17%;
--popover-foreground: 0, 0%, 100%;
--primary: 176 100% 43%;
--primary-foreground: 213, 16%, 27%;
--secondary-foreground: 0, 0%, 100%;
--muted: 173 8% 22%;
--muted-foreground: 0 0% 65%;
--accent: 173 8% 22%;
--accent-foreground: 0 0% 100%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 0% 98%;
--border: 240 3.7% 15.9%;
--input: 240 3.7% 15.9%;
--ring: 240 4.9% 83.9%;
--border: 173 8% 22%;
--input: 173 8% 22%;
--ring: 197 100% 44%;
--chart-1: 220 70% 50%;
--chart-2: 160 60% 45%;
--chart-3: 30 80% 55%;
Expand All @@ -87,13 +87,14 @@
--sidebar-foreground: 240 4.8% 95.9%;
--sidebar-primary: 224.3 76.3% 48%;
--sidebar-primary-foreground: 0 0% 100%;
--sidebar-accent: 240 3.7% 15.9%;
--sidebar-accent: 173 8% 22%;
--sidebar-accent-foreground: 240 4.8% 95.9%;
--sidebar-border: 240 3.7% 15.9%;
--sidebar-border: 173 8% 22%;
--sidebar-ring: 217.2 91.2% 59.8%;
}
}


@layer base {
* {
@apply border-border;
Expand All @@ -102,6 +103,33 @@
body {
@apply bg-background text-foreground;
}

::selection {
background-color: hsl(var(--accent));
color: hsl(var(--foreground));
}

.dark ::selection {
background-color: hsl(var(--accent));
color: hsl(var(--foreground));
}
}

@media (prefers-reduced-motion: no-preference) {
::view-transition-new(theme-transition) {
clip-path: inset(0 0 100% 0);
animation: slide-in-from-top 0.65s forwards cubic-bezier(0.65, 0, 0.35, 1);
}

::view-transition-old(theme-transition) {
animation: none;
}

@keyframes slide-in-from-top {
to {
clip-path: inset(0 0 0 0);
}
}
}

.skeleton {
Expand Down Expand Up @@ -132,7 +160,7 @@
@apply bg-background dark:bg-zinc-800 outline-none selection:bg-zinc-900 !important;
}

.ͼo.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground,
.ͼo.cm-focused>.cm-scroller>.cm-selectionLayer .cm-selectionBackground,
.ͼo.cm-selectionBackground,
.ͼo.cm-content::selection {
@apply bg-zinc-200 dark:bg-zinc-900 !important;
Expand Down Expand Up @@ -161,4 +189,4 @@

.suggestion-highlight {
@apply bg-blue-200 hover:bg-blue-300 dark:hover:bg-blue-400/50 dark:text-blue-50 dark:bg-blue-500/40;
}
}
8 changes: 4 additions & 4 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { ThemeProvider } from '@/components/theme-provider';
import './globals.css';

export const metadata: Metadata = {
metadataBase: new URL('https://chat.techwithanirudh.com'),
title: 'AI Chatbot',
description: 'An upgraded version of the AI Chatbot built using Next.js and the AI SDK.',
metadataBase: new URL('https://chat.meetingbaas.com'),
title: 'Baas Chat - by MeetingBaas',
description: 'An AI Chatbot that can answer questions related to MeetingBaas',
};

export const viewport = {
Expand Down Expand Up @@ -72,7 +72,7 @@ export default async function RootLayout({
<body className="antialiased">
<ThemeProvider
attribute="class"
defaultTheme="system"
defaultTheme="dark"
enableSystem
disableTransitionOnChange
>
Expand Down
4 changes: 2 additions & 2 deletions artifacts/code/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { toast } from 'sonner';
import { generateUUID } from '@/lib/utils';
import {
Console,
ConsoleOutput,
ConsoleOutputContent,
type ConsoleOutput,
type ConsoleOutputContent,
} from '@/components/artifact/code/console';

const OUTPUT_HANDLERS = {
Expand Down
3 changes: 1 addition & 2 deletions artifacts/text/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ export const textArtifact = new Artifact<'text', TextArtifactMetadata>({
onSaveContent={onSaveContent}
/>

{metadata &&
metadata.suggestions &&
{metadata?.suggestions &&
metadata.suggestions.length > 0 ? (
<div className="md:hidden h-dvh w-12 shrink-0" />
) : null}
Expand Down
6 changes: 4 additions & 2 deletions components/artifact/code/code-block.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use client';

import { cn } from "@/lib/utils";

interface CodeBlockProps {
node: any;
inline: boolean;
Expand All @@ -16,10 +18,10 @@ export function CodeBlock({
}: CodeBlockProps) {
if (!inline) {
return (
<div className="not-prose flex flex-col">
<div className="not-prose inline-flex flex-col">
<pre
{...props}
className={`text-sm w-full overflow-x-auto dark:bg-zinc-900 p-4 border border-zinc-200 dark:border-zinc-700 rounded-xl dark:text-zinc-50 text-zinc-900`}
className={cn(`text-sm w-full overflow-x-auto dark:bg-zinc-900 px-3 py-2 border border-zinc-200 dark:border-zinc-700 rounded-xl dark:text-zinc-50 text-zinc-900`, className)}
>
<code className="whitespace-pre-wrap break-words">{children}</code>
</pre>
Expand Down
10 changes: 5 additions & 5 deletions components/artifact/create-artifact.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Suggestion } from '@/server/db/schema';
import { UseChatHelpers } from '@ai-sdk/react';
import { ComponentType, Dispatch, ReactNode, SetStateAction } from 'react';
import { DataStreamDelta } from '../data-stream-handler';
import { UIArtifact } from '.';
import type { Suggestion } from '@/server/db/schema';
import type { UseChatHelpers } from '@ai-sdk/react';
import type { ComponentType, Dispatch, ReactNode, SetStateAction } from 'react';
import type { DataStreamDelta } from '../data-stream-handler';
import type { UIArtifact } from '.';

export type ArtifactActionContext<M = any> = {
content: string;
Expand Down
2 changes: 0 additions & 2 deletions components/artifact/document/toolbar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'use client';

import type { Message } from 'ai';
import cx from 'classnames';
import {
AnimatePresence,
Expand Down
Loading