Was this page helpful?
预览使用示例数据运行,不需要网络,也不需要渠道。
tsx
import { YuvaPageFeedback } from "@/components/yuva-page-feedback"
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}
>
<YuvaPageFeedback pageTitle="Getting started" />
</YuvaDiscussionsProvider>
)
}安装
在 shadcn 项目中运行。文件会复制到你自己的代码里。
Shell
npx shadcn@latest add https://useyuva.com/r/yuva-page-feedback.jsonShell
pnpm dlx shadcn@latest add https://useyuva.com/r/yuva-page-feedback.jsonShell
yarn dlx shadcn@latest add https://useyuva.com/r/yuva-page-feedback.jsonShell
bunx --bun shadcn@latest add https://useyuva.com/r/yuva-page-feedback.json用法
tsx
import { YuvaPageFeedback } from "@/components/yuva-page-feedback"
<YuvaPageFeedback />Props
YuvaPageFeedbackProps
| Prop | 类型 |
|---|---|
page? | string |
pageTitle? | string |
labels? | Partial<YuvaDiscussionsLabels> |
className? | string |
标签
每个标签都有英文默认值。传入部分 labels 对象即可修改或翻译。
| 标签 | 默认值 |
|---|---|
feedbackQuestion | "Was this page helpful?" |
feedbackYes | "Yes" |
feedbackNo | "No" |
feedbackThanks | "Thanks for your feedback." |
依赖
安装此项时还会添加以下内容。