प्रिव्यू नमूना डेटा पर चलता है। इसे न नेटवर्क चाहिए, न चैनल।
tsx
import { YuvaHelpSearch } from "@/components/yuva-help-search"
export function Search() {
return (
<YuvaHelpSearch
server={process.env.NEXT_PUBLIC_YUVA_SERVER}
channel={process.env.NEXT_PUBLIC_YUVA_CHANNEL}
onSelect={(article, query) => console.log(article.title, query)}
/>
)
}इंस्टॉलेशन
इसे किसी shadcn प्रोजेक्ट में चलाएँ। फ़ाइलें आपके अपने कोड में कॉपी हो जाती हैं।
Shell
npx shadcn@latest add https://useyuva.com/r/yuva-help-search.jsonShell
pnpm dlx shadcn@latest add https://useyuva.com/r/yuva-help-search.jsonShell
yarn dlx shadcn@latest add https://useyuva.com/r/yuva-help-search.jsonShell
bunx --bun shadcn@latest add https://useyuva.com/r/yuva-help-search.jsonउपयोग
tsx
import { YuvaHelpSearch } from "@/components/yuva-help-search"
<YuvaHelpSearch server={server} channel={channel} onSelect={(article) => setId(article.id)} />Props
YuvaHelpSearchProps
| Prop | प्रकार |
|---|---|
server? | string |
channel? | string |
client? | YuvaClient |
identityToken? | IdentityTokenSource | null |
locale? | string |
help? | YuvaHelpState |
query? | string |
onQueryChange? | (query: string) => void |
onSelect? | (article: ClientHelpArticleSummary, query: string) => void |
labels? | Partial<YuvaHelpLabels> |
className? | string |
लेबल
लेबल Yuva help पेज पर सूचीबद्ध हैं।
निर्भरताएँ
इस आइटम को इंस्टॉल करने से नीचे दिए गए भी जुड़ जाते हैं।