Die Vorschau läuft mit Beispieldaten. Sie braucht weder Netzwerk noch Kanal.
tsx
import { YuvaDiscussionComposer } from "@/components/yuva-discussion-composer"
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}
>
<YuvaDiscussionComposer withTitle onSubmit={async ({ title, body }) => save(title, body)} />
</YuvaDiscussionsProvider>
)
}Installation
Führen Sie das in einem shadcn-Projekt aus. Die Dateien werden in Ihren eigenen Code kopiert.
Shell
npx shadcn@latest add https://useyuva.com/r/yuva-discussion-composer.jsonShell
pnpm dlx shadcn@latest add https://useyuva.com/r/yuva-discussion-composer.jsonShell
yarn dlx shadcn@latest add https://useyuva.com/r/yuva-discussion-composer.jsonShell
bunx --bun shadcn@latest add https://useyuva.com/r/yuva-discussion-composer.jsonVerwendung
tsx
import { YuvaDiscussionComposer } from "@/components/yuva-discussion-composer"
<YuvaDiscussionComposer withTitle onSubmit={async ({ title, body }) => {}} />Props
YuvaDiscussionComposerProps
| Prop | Typ |
|---|---|
withTitle? | boolean |
initialTitle? | string |
initialBody? | string |
submitLabel? | string |
placeholder? | string |
autoFocus? | boolean |
labels? | Partial<YuvaDiscussionsLabels> |
className? | string |
onTitleChange? | (title: string) => void |
onSubmit | (input: { title: string; body: string }) => Promise<unknown> |
onCancel? | () => void |
YuvaSignInProps
| Prop | Typ |
|---|---|
labels? | Partial<YuvaDiscussionsLabels> |
className? | string |
Beschriftungen
Die Beschriftungen stehen auf der Seite Yuva discussions.
Abhängigkeiten
Die Installation dieses Elements fügt auch Folgendes hinzu.