refactor: docubook@latest template nextjs-docker

This commit is contained in:
gitfromwildan
2026-05-30 18:52:21 +07:00
parent bf2ef37f49
commit 80eb49d968
101 changed files with 1759 additions and 4165 deletions

View File

@@ -1,6 +1,7 @@
"use client"
import { DocSearch } from "@docsearch/react"
import "@docsearch/css"
import { algoliaConfig } from "@/lib/search/algolia"
import { cn } from "@/lib/utils"
@@ -9,7 +10,7 @@ interface AlgoliaSearchProps {
}
export default function AlgoliaSearch({ className }: AlgoliaSearchProps) {
const { appId, apiKey, indexName } = algoliaConfig
const { appId, apiKey, indexName, askAiAssistantId } = algoliaConfig
if (!appId || !apiKey || !indexName) {
console.error("DocSearch credentials are not set in the environment variables.")
@@ -26,7 +27,15 @@ export default function AlgoliaSearch({ className }: AlgoliaSearchProps) {
appId={appId}
apiKey={apiKey}
indexName={indexName}
placeholder="Type something to search..."
placeholder="Search docs..."
askAi={
askAiAssistantId
? {
assistantId: askAiAssistantId,
suggestedQuestions: true,
} as const
: undefined
}
/>
</div>
)