Say hello
Hi, ask us anything about Acme.
प्रिव्यू नमूना डेटा पर चलता है। इसे न नेटवर्क चाहिए, न चैनल।
tsx
import { YuvaChatThread } from "@/components/yuva-chat-thread"
import { useYuvaChat } from "@/hooks/use-yuva-chat"
export function Thread({ id }: { id: string }) {
const chat = useYuvaChat({
server={process.env.NEXT_PUBLIC_YUVA_SERVER}
channel={process.env.NEXT_PUBLIC_YUVA_CHANNEL},
})
const { loading, open } = chat
React.useEffect(() => {
if (!loading) void open(id)
}, [loading, open, id])
return (
<div className="flex h-96 flex-col rounded-xl border">
<YuvaChatThread chat={chat} />
</div>
)
}इंस्टॉलेशन
इसे किसी shadcn प्रोजेक्ट में चलाएँ। फ़ाइलें आपके अपने कोड में कॉपी हो जाती हैं।
Shell
npx shadcn@latest add https://useyuva.com/r/yuva-chat-thread.jsonShell
pnpm dlx shadcn@latest add https://useyuva.com/r/yuva-chat-thread.jsonShell
yarn dlx shadcn@latest add https://useyuva.com/r/yuva-chat-thread.jsonShell
bunx --bun shadcn@latest add https://useyuva.com/r/yuva-chat-thread.jsonउपयोग
tsx
import { YuvaChatThread } from "@/components/yuva-chat-thread"
<YuvaChatThread chat={chat} />Props
YuvaChatThreadProps
| Prop | प्रकार |
|---|---|
chat | YuvaChatState |
labels? | Partial<YuvaChatLabels> |
locale? | string |
greeting? | string |
lined? | boolean |
className? | string |
लेबल
लेबल Yuva chat पेज पर सूचीबद्ध हैं।
निर्भरताएँ
इस आइटम को इंस्टॉल करने से नीचे दिए गए भी जुड़ जाते हैं।