Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 07:00 UTC
docs: address review — restore api option, accept api prop in dialog
- Restore api: '/api/search' in search options (single source of truth) - CustomSearchDialog accepts api prop from options spread - Remove unused isEmpty variable (TS can't narrow through intermediates) - Keep options spread approach (verified: SearchProvider line 52 does ...options) - Type cast needed because RootProvider types options more narrowly than SearchProvider actually consumes them Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sushmithamallesh committed
Feb 19, 2026 at 22:59 UTC
0aa7ed7b4c40eff2636763faae054ded629957b8
2 files changed
+5
-4
docs/app/layout.tsx
+1
@@ -114,6 +114,7 @@ export default function Layout({ children }: LayoutProps<'/'>) {
114
search={{
115
SearchDialog: CustomSearchDialog,
116
options: {
117
+ api: '/api/search',
118
defaultLinks,
119
} as Record<string, unknown>,
120
}}
docs/components/custom-search-dialog.tsx
+4
-4
@@ -25,21 +25,21 @@ export interface DefaultLink {
25
26
interface CustomSearchDialogProps extends SharedProps {
27
defaultLinks?: DefaultLink[];
28
+ api?: string;
29
}
30
31
export default function CustomSearchDialog({
32
defaultLinks = [],
33
+ api = '/api/search',
34
...props
35
}: CustomSearchDialogProps) {
36
const { locale } = useI18n();
37
const { search, setSearch, query } = useDocsSearch({
38
type: 'fetch',
39
locale,
38
- api: '/api/search',
40
+ api,
41
});
42
41
- const isEmpty = query.data === 'empty';
42
-
43
return (
44
<SearchDialog
45
search={search}
@@ -54,7 +54,7 @@ export default function CustomSearchDialog({
54
<SearchDialogInput />
55
<SearchDialogClose />
56
</SearchDialogHeader>
57
- {isEmpty && defaultLinks.length > 0 ? (
57
+ {query.data === 'empty' && defaultLinks.length > 0 ? (
58
<div className="flex flex-col p-2">
59
{defaultLinks.map((link) => (
60
<Link