Was this page helpful?
Bản xem trước chạy trên dữ liệu mẫu. Không cần mạng hay kênh.
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>
)
}Cài đặt
Chạy lệnh này trong một dự án shadcn. Các tệp được sao chép vào mã của bạn.
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.jsonCách dùng
tsx
import { YuvaPageFeedback } from "@/components/yuva-page-feedback"
<YuvaPageFeedback />Props
YuvaPageFeedbackProps
| Prop | Kiểu |
|---|---|
page? | string |
pageTitle? | string |
labels? | Partial<YuvaDiscussionsLabels> |
className? | string |
Nhãn
Mỗi nhãn có mặc định tiếng Anh. Truyền một đối tượng labels một phần để đổi hoặc dịch chúng.
| Nhãn | Mặc định |
|---|---|
feedbackQuestion | "Was this page helpful?" |
feedbackYes | "Yes" |
feedbackNo | "No" |
feedbackThanks | "Thanks for your feedback." |
Phụ thuộc
Cài mục này cũng sẽ thêm các mục sau.