Files
medusa-store/www/apps/ui/providers/search.tsx
Shahed Nasser d1a1135328 docs: migrate UI docs (#13245)
* docs: create a new UI docs project (#13233)

* docs: create a new UI docs project

* fix installation errors

* docs: migrate UI docs content to new project (#13241)

* Fix content

* added examples for some components

* finish adding examples

* lint fix

* fix build errors

* delete empty files

* path fixes + refactor

* fix build error
2025-08-20 11:42:25 +03:00

47 lines
1.2 KiB
TypeScript

"use client"
import { SearchProvider as UiSearchProvider } from "docs-ui"
import { config } from "../config"
type SearchProviderProps = {
children: React.ReactNode
}
const SearchProvider = ({ children }: SearchProviderProps) => {
return (
<UiSearchProvider
algolia={{
appId: process.env.NEXT_PUBLIC_ALGOLIA_APP_ID || "temp",
apiKey: process.env.NEXT_PUBLIC_ALGOLIA_API_KEY || "temp",
mainIndexName:
process.env.NEXT_PUBLIC_DOCS_ALGOLIA_INDEX_NAME || "temp",
}}
indices={[
{
value: process.env.NEXT_PUBLIC_DOCS_ALGOLIA_INDEX_NAME || "temp",
title: "Docs",
},
{
value: process.env.NEXT_PUBLIC_API_ALGOLIA_INDEX_NAME || "temp",
title: "Store & Admin API",
},
]}
defaultIndex={process.env.NEXT_PUBLIC_DOCS_ALGOLIA_INDEX_NAME || "temp"}
searchProps={{
isLoading: false,
suggestions: [
{
title: "Search Suggestions",
items: ["Install UI in Admin", "UI Icons", "UI Colors"],
},
],
checkInternalPattern: new RegExp(`^${config.baseUrl}/ui`),
}}
>
{children}
</UiSearchProvider>
)
}
export default SearchProvider