* configured base paths + added development banner * fix typelist site url * added navbar and sidebar badges * configure algolia filters * remove AI assistant * remove unused imports * change navbar text and badge * lint fixes * fix build error * add to api reference rewrites * fix build error * fix build errors in user-guide * fix feedback component * add parent title to pagination * added breadcrumbs component * remove user-guide links * resolve todos * fix details about authentication * change documentation title * lint content
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
"use client"
|
|
|
|
import { SearchProvider as UiSearchProvider, searchFiltersV2 } 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: [
|
|
process.env.NEXT_PUBLIC_API_ALGOLIA_INDEX_NAME || "temp",
|
|
process.env.NEXT_PUBLIC_DOCS_ALGOLIA_INDEX_NAME || "temp",
|
|
],
|
|
}}
|
|
searchProps={{
|
|
isLoading: false,
|
|
suggestions: [
|
|
{
|
|
title: "Search Suggestions",
|
|
items: [
|
|
"Medusa Configurations",
|
|
"Commerce Modules",
|
|
"Medusa JS Reference",
|
|
"Medusa React Reference",
|
|
"Workflows API Reference",
|
|
],
|
|
},
|
|
],
|
|
checkInternalPattern: new RegExp(`^${config.baseUrl}/v2/resources/.*`),
|
|
filterOptions: searchFiltersV2,
|
|
}}
|
|
initialDefaultFilters={["resources"]}
|
|
>
|
|
{children}
|
|
</UiSearchProvider>
|
|
)
|
|
}
|
|
|
|
export default SearchProvider
|