Skip to content

Commit

Permalink
make modal a bit bigger (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonom authored Aug 7, 2024
1 parent abad5ed commit 772d326
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion apps/docs/components/docs-chat/DocsChat.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import { FC } from "react";
import {
AssistantModal,
ChatModelAdapter,
Expand All @@ -9,6 +10,7 @@ import { makeMarkdownText } from "@assistant-ui/react-markdown";
import { makePrismAsyncSyntaxHighlighter } from "@assistant-ui/react-syntax-highlighter";
import { coldarkDark } from "react-syntax-highlighter/dist/esm/styles/prism";
import remarkGfm from "remark-gfm";
import { Thread, type ThreadConfig } from "@assistant-ui/react";

function asAsyncIterable<T>(source: ReadableStream<T>): AsyncIterable<T> {
return {
Expand Down Expand Up @@ -75,7 +77,7 @@ export const DocsChat = () => {
const runtime = useLocalRuntime(MyCustomAdapter);

return (
<AssistantModal
<MyAssistantModal
runtime={runtime}
welcome={{
message: "Ask me anything about the docs!",
Expand All @@ -84,3 +86,14 @@ export const DocsChat = () => {
/>
);
};

const MyAssistantModal: FC<ThreadConfig> = (config) => {
return (
<AssistantModal.Root config={config}>
<AssistantModal.Trigger />
<AssistantModal.Content className="h-[800px] w-[600px]">
<Thread />
</AssistantModal.Content>
</AssistantModal.Root>
);
};

0 comments on commit 772d326

Please sign in to comment.