Het voorbeeld draait op voorbeeldgegevens. Het heeft geen netwerk en geen kanaal nodig.
tsx
import { YuvaDiscussionThread } from "@/components/yuva-discussion-thread"
import { YuvaDiscussionsProvider } from "@/hooks/use-yuva-discussions"
export function Docs({ children }: { children: React.ReactNode }) {
return (
<YuvaDiscussionsProvider
server={process.env.NEXT_PUBLIC_YUVA_SERVER}
channel={process.env.NEXT_PUBLIC_YUVA_CHANNEL}
>
<YuvaDiscussionThread id={id} />
</YuvaDiscussionsProvider>
)
}Installatie
Voer dit uit in een shadcn-project. De bestanden worden naar je eigen code gekopieerd.
Shell
npx shadcn@latest add https://useyuva.com/r/yuva-discussion-thread.jsonShell
pnpm dlx shadcn@latest add https://useyuva.com/r/yuva-discussion-thread.jsonShell
yarn dlx shadcn@latest add https://useyuva.com/r/yuva-discussion-thread.jsonShell
bunx --bun shadcn@latest add https://useyuva.com/r/yuva-discussion-thread.jsonGebruik
tsx
import { YuvaDiscussionThread } from "@/components/yuva-discussion-thread"
<YuvaDiscussionThread id={id} onBack={() => setId(null)} />Props
YuvaDiscussionThreadProps
| Prop | Type |
|---|---|
id | string |
labels? | Partial<YuvaDiscussionsLabels> |
className? | string |
onBack? | () => void |
onGone? | () => void |
badges? | (discussion: Discussion) => React.ReactNode |
votingClosed? | (discussion: Discussion) => boolean |
Labels
De labels staan op Yuva discussions.
Afhankelijkheden
Als je dit item installeert, worden ook de volgende items toegevoegd.