Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

docs: address review — restore api option, accept api prop in dialog

Sushmithamallesh0aa7ed7b4c40
diff --git a/docs/app/layout.tsx b/docs/app/layout.tsx
index f11127ba3..f461eb484 100644
--- a/docs/app/layout.tsx
+++ b/docs/app/layout.tsx
@@ -114,6 +114,7 @@ export default function Layout({ children }: LayoutProps<'/'>) {
search={{
SearchDialog: CustomSearchDialog,
options: {
+ api: '/api/search',
defaultLinks,
} as Record<string, unknown>,
}}
diff --git a/docs/components/custom-search-dialog.tsx b/docs/components/custom-search-dialog.tsx
index 8f10edc14..4ee6aabb6 100644
--- a/docs/components/custom-search-dialog.tsx
+++ b/docs/components/custom-search-dialog.tsx
@@ -25,21 +25,21 @@ export interface DefaultLink {
interface CustomSearchDialogProps extends SharedProps {
defaultLinks?: DefaultLink[];
+ api?: string;
}
export default function CustomSearchDialog({
defaultLinks = [],
+ api = '/api/search',
...props
}: CustomSearchDialogProps) {
const { locale } = useI18n();
const { search, setSearch, query } = useDocsSearch({
type: 'fetch',
locale,
- api: '/api/search',
+ api,
});
- const isEmpty = query.data === 'empty';
-
return (
<SearchDialog
search={search}
@@ -54,7 +54,7 @@ export default function CustomSearchDialog({
<SearchDialogInput />
<SearchDialogClose />
</SearchDialogHeader>
- {isEmpty && defaultLinks.length > 0 ? (
+ {query.data === 'empty' && defaultLinks.length > 0 ? (
<div className="flex flex-col p-2">
{defaultLinks.map((link) => (
<Link