mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 14:22:28 +08:00
22 lines
595 B
TypeScript
22 lines
595 B
TypeScript
"use client";
|
|
|
|
import { AssistantRuntimeProvider } from "@assistant-ui/react";
|
|
import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
|
|
import { Thread } from "@/components/assistant-ui/thread";
|
|
import { ThreadList } from "@/components/assistant-ui/thread-list";
|
|
|
|
export const Assistant = () => {
|
|
const runtime = useChatRuntime({
|
|
api: "/api/chat",
|
|
});
|
|
|
|
return (
|
|
<AssistantRuntimeProvider runtime={runtime}>
|
|
<div className="grid h-dvh grid-cols-[200px_1fr] gap-x-2 px-4 py-4">
|
|
<ThreadList />
|
|
<Thread />
|
|
</div>
|
|
</AssistantRuntimeProvider>
|
|
);
|
|
};
|