预览使用示例数据运行,不需要网络,也不需要渠道。
tsx
import { YuvaChatComposer } from "@/components/yuva-chat-composer"
import { useYuvaChat } from "@/hooks/use-yuva-chat"
export function Composer() {
const chat = useYuvaChat({
server={process.env.NEXT_PUBLIC_YUVA_SERVER}
channel={process.env.NEXT_PUBLIC_YUVA_CHANNEL},
})
return <YuvaChatComposer chat={chat} />
}安装
在 shadcn 项目中运行。文件会复制到你自己的代码里。
Shell
npx shadcn@latest add https://useyuva.com/r/yuva-chat-composer.jsonShell
pnpm dlx shadcn@latest add https://useyuva.com/r/yuva-chat-composer.jsonShell
yarn dlx shadcn@latest add https://useyuva.com/r/yuva-chat-composer.jsonShell
bunx --bun shadcn@latest add https://useyuva.com/r/yuva-chat-composer.json用法
tsx
import { YuvaChatComposer } from "@/components/yuva-chat-composer"
<YuvaChatComposer chat={chat} />Props
YuvaChatComposerProps
| Prop | 类型 |
|---|---|
chat | YuvaChatState |
labels? | Partial<YuvaChatLabels> |
locale? | string |
disabled? | boolean |
onCapture? | () => File | null | undefined | Promise<File | null | undefined> |
className? | string |
标签
依赖
安装此项时还会添加以下内容。