Forhåndsvisningen bruker eksempeldata. Den trenger verken nettverk eller kanal.
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>
)
}Installasjon
Kjør dette i et shadcn-prosjekt. Filene kopieres inn i din egen kode.
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.jsonBruk
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 |
Etiketter
Etikettene er listet opp på Yuva discussions.
Avhengigheter
Når du installerer dette elementet, legges også følgende til.