Refactor to use hooks (#436)
This commit is contained in:
parent
124efca9a1
commit
cb60f8b143
139 changed files with 8871 additions and 8726 deletions
|
|
@ -1,22 +1,7 @@
|
|||
import { nanoid } from '@/lib/utils'
|
||||
import { Chat } from '@/components/chat'
|
||||
import { AI } from '@/lib/chat/actions'
|
||||
import { auth } from '@/auth'
|
||||
import { Session } from '@/lib/types'
|
||||
import { getMissingKeys } from '@/app/actions'
|
||||
import { Chat } from "@/components/custom/chat";
|
||||
import { generateUUID } from "@/lib/utils";
|
||||
|
||||
export const metadata = {
|
||||
title: 'Next.js AI Chatbot'
|
||||
}
|
||||
|
||||
export default async function IndexPage() {
|
||||
const id = nanoid()
|
||||
const session = (await auth()) as Session
|
||||
const missingKeys = await getMissingKeys()
|
||||
|
||||
return (
|
||||
<AI initialAIState={{ chatId: id, messages: [] }}>
|
||||
<Chat id={id} session={session} missingKeys={missingKeys} />
|
||||
</AI>
|
||||
)
|
||||
export default async function Page() {
|
||||
const id = generateUUID();
|
||||
return <Chat key={id} id={id} initialMessages={[]} />;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue