diff --git a/client/src/components/Chat/Input/BadgeRow.tsx b/client/src/components/Chat/Input/BadgeRow.tsx index ed9f4b82c2..57646b218a 100644 --- a/client/src/components/Chat/Input/BadgeRow.tsx +++ b/client/src/components/Chat/Input/BadgeRow.tsx @@ -14,6 +14,7 @@ import CodeInterpreter from './CodeInterpreter'; import type { BadgeItem } from '~/common'; import { useChatBadges } from '~/hooks'; import { Badge } from '~/components/ui'; +import ToolsDropdown from './ToolsDropdown'; import MCPSelect from './MCPSelect'; import WebSearch from './WebSearch'; import store from '~/store'; @@ -313,7 +314,8 @@ function BadgeRow({ }, [dragState.draggedBadge, handleMouseMove, handleMouseUp]); return ( -
+
+ {tempBadges.map((badge, index) => ( {dragState.draggedBadge && dragState.insertIndex === index && ghostBadge && ( diff --git a/client/src/components/Chat/Input/ToolsDropdown.tsx b/client/src/components/Chat/Input/ToolsDropdown.tsx new file mode 100644 index 0000000000..19d94789ce --- /dev/null +++ b/client/src/components/Chat/Input/ToolsDropdown.tsx @@ -0,0 +1,100 @@ +import React, { useState, useMemo } from 'react'; +import * as Ariakit from '@ariakit/react'; +import { Settings2, Search, ImageIcon, Globe, PenTool } from 'lucide-react'; +import { TooltipAnchor, DropdownPopup } from '~/components'; +import { useLocalize } from '~/hooks'; +import { cn } from '~/utils'; + +interface ToolsDropdownProps { + conversationId?: string | null; + disabled?: boolean; +} + +const ToolsDropdown = ({ disabled, conversationId }: ToolsDropdownProps) => { + const localize = useLocalize(); + const isDisabled = disabled ?? false; + const [isPopoverActive, setIsPopoverActive] = useState(false); + + const dropdownItems = useMemo(() => { + return [ + { + render: () => ( +
+ {localize('com_ui_tools')} +
+ ), + hideOnClick: false, + }, + { + label: 'Search connectors', + onClick: () => { + // TODO: Implement search connectors functionality + console.log('Search connectors clicked'); + }, + icon: , + badge: 'NEW', + }, + { + label: 'Create an image', + onClick: () => { + // TODO: Implement create image functionality + console.log('Create an image clicked'); + }, + icon: , + }, + { + label: 'Search the web', + onClick: () => { + // TODO: Implement web search functionality + console.log('Search the web clicked'); + }, + icon: , + }, + { + label: 'Write or code', + onClick: () => { + // TODO: Implement write or code functionality + console.log('Write or code clicked'); + }, + icon: , + }, + ]; + }, []); + + const menuTrigger = ( + +
+ +
+ + } + id="tools-dropdown-button" + description={localize('com_ui_tools')} + disabled={isDisabled} + /> + ); + + return ( + + ); +}; + +export default React.memo(ToolsDropdown);