chore: reorganize docs apps (#7228)
* reorganize docs apps * add README * fix directory * add condition for old docs
This commit is contained in:
1 parent
224ebb2154
commit
4fe28f5a95
6187 files changed
+601447
-598226
No files matched your search
@@ -0,0 +1,74 @@
|
||||
"use client"
|
||||
|
||||
import {
|
||||
SearchProvider as UiSearchProvider,
|
||||
AiAssistantCommandIcon,
|
||||
AiAssistantProvider,
|
||||
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_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}/resources/.*`),
|
||||
filterOptions: searchFilters,
|
||||
}}
|
||||
// TODO change once we have a dedicated index
|
||||
initialDefaultFilters={["docs"]}
|
||||
commands={[
|
||||
{
|
||||
name: "ai-assistant",
|
||||
icon: <AiAssistantCommandIcon />,
|
||||
component: (
|
||||
<AiAssistantProvider
|
||||
apiUrl={process.env.NEXT_PUBLIC_AI_ASSISTANT_URL || "temp"}
|
||||
websiteId={process.env.NEXT_PUBLIC_AI_WEBSITE_ID || "temp"}
|
||||
recaptchaSiteKey={
|
||||
process.env.NEXT_PUBLIC_AI_API_ASSISTANT_RECAPTCHA_SITE_KEY ||
|
||||
"temp"
|
||||
}
|
||||
/>
|
||||
),
|
||||
title: "AI Assistant",
|
||||
badge: {
|
||||
variant: "purple",
|
||||
children: "Beta",
|
||||
},
|
||||
},
|
||||
]}
|
||||
>
|
||||
{children}
|
||||
</UiSearchProvider>
|
||||
)
|
||||
}
|
||||
|
||||
export default SearchProvider
|
||||
Reference in new issue
Block a user