dummy content
This commit is contained in:
parent
568c6bdcb9
commit
df83c9d3f0
7 changed files with 225 additions and 5 deletions
23
components/Chat/Chat.tsx
Normal file
23
components/Chat/Chat.tsx
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
"use client"
|
||||
import { useChat } from "ai/react"
|
||||
|
||||
export default function Chat() {
|
||||
const { messages, input, handleInputChange, handleSubmit } = useChat()
|
||||
|
||||
return (
|
||||
<div>
|
||||
{messages.map((m) => (
|
||||
<div key={m.id}>
|
||||
{m.role}: {m.content}
|
||||
</div>
|
||||
))}
|
||||
|
||||
<form onSubmit={handleSubmit}>
|
||||
<label>
|
||||
Say something...
|
||||
<input value={input} onChange={handleInputChange} />
|
||||
</label>
|
||||
</form>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue