預覽使用範例資料執行,不需要網路,也不需要頻道。
tsx
import { YuvaHelpArticle } from "@/components/yuva-help-article"
export function Article({ id }: { id: string }) {
return (
<YuvaHelpArticle
server={process.env.NEXT_PUBLIC_YUVA_SERVER}
channel={process.env.NEXT_PUBLIC_YUVA_CHANNEL}
id={id}
onAsk={(articleId) => openChat(articleId)}
/>
)
}安裝
在 shadcn 專案中執行。檔案會複製到你自己的程式碼裡。
Shell
npx shadcn@latest add https://useyuva.com/r/yuva-help-article.jsonShell
pnpm dlx shadcn@latest add https://useyuva.com/r/yuva-help-article.jsonShell
yarn dlx shadcn@latest add https://useyuva.com/r/yuva-help-article.jsonShell
bunx --bun shadcn@latest add https://useyuva.com/r/yuva-help-article.json用法
tsx
import { YuvaHelpArticle } from "@/components/yuva-help-article"
<YuvaHelpArticle server={server} channel={channel} id={articleId} onAsk={(id) => chat.open(id)} />Props
YuvaHelpArticleProps
| Prop | 類型 |
|---|---|
id | string |
server? | string |
channel? | string |
client? | YuvaClient |
identityToken? | IdentityTokenSource | null |
locale? | string |
help? | YuvaHelpState |
search? | string |
onSelect? | (article: ClientHelpArticleSummary) => void |
onAsk? | (articleId: string) => void |
labels? | Partial<YuvaHelpLabels> |
className? | string |
標籤
相依套件
安裝此項目時還會加入以下內容。