From 5ca9da378b4d27b27120feed6c7ad50ad653993d Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 18 Jul 2025 12:02:38 -0400 Subject: [PATCH] chore: add missing SidePanelProvider for AgentMarketplace and organize imports --- .../SidePanel/Agents/AgentMarketplace.tsx | 247 +++++++++--------- 1 file changed, 125 insertions(+), 122 deletions(-) diff --git a/client/src/components/SidePanel/Agents/AgentMarketplace.tsx b/client/src/components/SidePanel/Agents/AgentMarketplace.tsx index 1731708681..93afbc6bcd 100644 --- a/client/src/components/SidePanel/Agents/AgentMarketplace.tsx +++ b/client/src/components/SidePanel/Agents/AgentMarketplace.tsx @@ -1,25 +1,24 @@ import React, { useState, useEffect, useMemo } from 'react'; import { useOutletContext } from 'react-router-dom'; -import { useSearchParams, useParams, useNavigate } from 'react-router-dom'; import { useSetRecoilState, useRecoilValue } from 'recoil'; - +import { PermissionTypes, Permissions } from 'librechat-data-provider'; +import { useSearchParams, useParams, useNavigate } from 'react-router-dom'; import type t from 'librechat-data-provider'; import type { ContextType } from '~/common'; - import { useGetEndpointsQuery, useGetAgentCategoriesQuery } from '~/data-provider'; -import { useDocumentTitle, useHasAccess } from '~/hooks'; -import useLocalize from '~/hooks/useLocalize'; -import { TooltipAnchor, Button } from '~/components/ui'; -import { NewChatIcon } from '~/components/svg'; -import { OpenSidebar } from '~/components/Chat/Menus'; -import { SidePanelGroup } from '~/components/SidePanel'; import { MarketplaceProvider } from './MarketplaceContext'; +import { useDocumentTitle, useHasAccess } from '~/hooks'; +import { TooltipAnchor, Button } from '~/components/ui'; +import { SidePanelGroup } from '~/components/SidePanel'; +import { OpenSidebar } from '~/components/Chat/Menus'; +import { SidePanelProvider } from '~/Providers'; +import { NewChatIcon } from '~/components/svg'; +import useLocalize from '~/hooks/useLocalize'; import CategoryTabs from './CategoryTabs'; import AgentDetail from './AgentDetail'; import SearchBar from './SearchBar'; import AgentGrid from './AgentGrid'; import store from '~/store'; -import { PermissionTypes, Permissions } from 'librechat-data-provider'; interface AgentMarketplaceProps { className?: string; @@ -191,128 +190,132 @@ const AgentMarketplace: React.FC = ({ className = '' }) = return (
- -
- {/* Simplified header for agents marketplace - only show nav controls when needed */} -
-
- {!navVisible && } - {!navVisible && ( - - - - } - /> - )} -
-
-
- {/* Hero Section - ChatGPT Style */} -
-

- {localize('com_agents_marketplace')} -

-

- {localize('com_agents_marketplace_subtitle')} -

- - {/* Search bar */} -
- + + +
+ {/* Simplified header for agents marketplace - only show nav controls when needed */} +
+
+ {!navVisible && } + {!navVisible && ( + + + + } + /> + )}
+
+ {/* Hero Section - ChatGPT Style */} +
+

+ {localize('com_agents_marketplace')} +

+

+ {localize('com_agents_marketplace_subtitle')} +

- {/* Category tabs */} - + {/* Search bar */} +
+ +
+
- {/* Category header - only show when not searching */} - {!searchQuery && ( -
- {(() => { - // Get category data for display - const getCategoryData = () => { - if (activeTab === 'promoted') { + {/* Category tabs */} + + + {/* Category header - only show when not searching */} + {!searchQuery && ( +
+ {(() => { + // Get category data for display + const getCategoryData = () => { + if (activeTab === 'promoted') { + return { + name: localize('com_agents_top_picks'), + description: localize('com_agents_recommended'), + }; + } + if (activeTab === 'all') { + return { + name: 'All Agents', + description: 'Browse all shared agents across all categories', + }; + } + + // Find the category in the API data + const categoryData = categoriesQuery.data?.find( + (cat) => cat.value === activeTab, + ); + if (categoryData) { + return { + name: categoryData.label, + description: categoryData.description || '', + }; + } + + // Fallback for unknown categories return { - name: localize('com_agents_top_picks'), - description: localize('com_agents_recommended'), + name: activeTab.charAt(0).toUpperCase() + activeTab.slice(1), + description: '', }; - } - if (activeTab === 'all') { - return { - name: 'All Agents', - description: 'Browse all shared agents across all categories', - }; - } - - // Find the category in the API data - const categoryData = categoriesQuery.data?.find( - (cat) => cat.value === activeTab, - ); - if (categoryData) { - return { - name: categoryData.label, - description: categoryData.description || '', - }; - } - - // Fallback for unknown categories - return { - name: activeTab.charAt(0).toUpperCase() + activeTab.slice(1), - description: '', }; - }; - const { name, description } = getCategoryData(); + const { name, description } = getCategoryData(); - return ( -
-

{name}

- {description && ( -

{description}

- )} -
- ); - })()} -
+ return ( +
+

+ {name} +

+ {description && ( +

{description}

+ )} +
+ ); + })()} +
+ )} + + {/* Agent grid */} + +
+ + {/* Agent detail dialog */} + {isDetailOpen && selectedAgent && ( + )} - - {/* Agent grid */} - -
- - {/* Agent detail dialog */} - {isDetailOpen && selectedAgent && ( - - )} -
-
+ + +
);