import { ConfirmDeleteDialog } from '@/components/confirm-delete-dialog'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; import { useDeleteMcpServer } from '@/hooks/use-mcp-request'; import { PenLine, Trash2 } from 'lucide-react'; import { MouseEventHandler, PropsWithChildren, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; export function McpDropdown({ children, mcpId, }: PropsWithChildren & { mcpId: string }) { const { t } = useTranslation(); const { deleteMcpServer } = useDeleteMcpServer(); const handleShowAgentRenameModal: MouseEventHandler = useCallback((e) => { e.stopPropagation(); }, []); const handleDelete: MouseEventHandler = useCallback(() => { deleteMcpServer([mcpId]); }, [deleteMcpServer, mcpId]); return ( {children} {t('common.edit')} { e.preventDefault(); }} onClick={(e) => { e.stopPropagation(); }} > {t('common.delete')} ); }