Files
medusa-store/www/apps/book/providers/search.tsx
Shahed Nasser 5634a4762b docs: improve AI Assistant (#11208)
* initial implementation

* integrate new ai assistant in other projects + ux improvements

* fix chat window on mobile devices

* fixes to mobile

* allow pre

* change shortcut to i

* improved responsiveness

* align version in navbar
2025-01-29 19:13:51 +02:00

58 lines
1.6 KiB
TypeScript

"use client"
import { SearchProvider as UiSearchProvider, searchFilters } 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_DOCS_ALGOLIA_INDEX_NAME || "temp",
process.env.NEXT_PUBLIC_API_ALGOLIA_INDEX_NAME || "temp",
],
}}
searchProps={{
isLoading: false,
suggestions: [
{
title: "Getting started? Try one of the following terms.",
items: [
"Install Medusa with create-medusa-app",
"What is an API route?",
"What is a Module?",
"What is a Workflow?",
],
},
{
title: "Developing with Medusa",
items: [
"How to create a Module",
"How to create an API route",
"How to create a data model",
"How to create an admin widget",
],
},
],
checkInternalPattern: new RegExp(
`^${config.baseUrl}/([^(resources)])*`
),
filterOptions: searchFilters,
}}
initialDefaultFilters={["guides"]}
>
{children}
</UiSearchProvider>
)
}
export default SearchProvider