ప్రివ్యూ నమూనా డేటాతో నడుస్తుంది. దీనికి నెట్వర్క్ లేదా ఛానెల్ అవసరం లేదు.
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 పేజీలో జాబితా చేయబడ్డాయి.
ఆధారపడేవి
ఈ ఐటమ్ను ఇన్స్టాల్ చేస్తే కింది వాటిని కూడా జోడిస్తుంది.