預覽使用範例資料執行,不需要網路,也不需要頻道。
tsx
import { YuvaDiscussionsProvider } from "@/hooks/use-yuva-discussions"
import { YuvaIdea } from "@/components/yuva-idea"
export function Idea({ id }: { id: string }) {
return (
<YuvaDiscussionsProvider
server={process.env.NEXT_PUBLIC_YUVA_SERVER}
channel={process.env.NEXT_PUBLIC_YUVA_CHANNEL}
>
<YuvaIdea id={id} />
</YuvaDiscussionsProvider>
)
}安裝
在 shadcn 專案中執行。檔案會複製到你自己的程式碼裡。
Shell
npx shadcn@latest add https://useyuva.com/r/yuva-idea.jsonShell
pnpm dlx shadcn@latest add https://useyuva.com/r/yuva-idea.jsonShell
yarn dlx shadcn@latest add https://useyuva.com/r/yuva-idea.jsonShell
bunx --bun shadcn@latest add https://useyuva.com/r/yuva-idea.json用法
tsx
import { YuvaIdea } from "@/components/yuva-idea"
<YuvaIdea id={ideaId} onBack={() => setIdea(null)} />Props
YuvaIdeaProps
| Prop | 類型 |
|---|---|
id | string |
labels? | Partial<YuvaRoadmapLabels> |
discussionLabels? | Partial<YuvaDiscussionsLabels> |
className? | string |
onBack? | () => void |
onGone? | () => void |
標籤
相依套件
安裝此項目時還會加入以下內容。