diff --git a/front/components/assistant/AssistantDropdownMenu.tsx b/front/components/assistant/AssistantDropdownMenu.tsx deleted file mode 100644 index 89b0a510dd5c..000000000000 --- a/front/components/assistant/AssistantDropdownMenu.tsx +++ /dev/null @@ -1,210 +0,0 @@ -import { - Button, - ChatBubbleBottomCenterTextIcon, - ClipboardIcon, - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuTrigger, - EyeIcon, - Icon, - MoreIcon, - PencilSquareIcon, - StarIcon, - StarStrokeIcon, - TrashIcon, -} from "@dust-tt/sparkle"; -import type { - LightAgentConfigurationType, - UserType, - WorkspaceType, -} from "@dust-tt/types"; -import { assertNever, isBuilder } from "@dust-tt/types"; -import { useRouter } from "next/router"; -import { useState } from "react"; - -import { DeleteAssistantDialog } from "@app/components/assistant/DeleteAssistantDialog"; -import { useUpdateUserFavorite } from "@app/lib/swr/assistants"; -import { useUser } from "@app/lib/swr/user"; -import { setQueryParam } from "@app/lib/utils/router"; - -interface AssistantDetailsMenuProps { - agentConfiguration: LightAgentConfigurationType; - owner: WorkspaceType; - user: UserType; - variant?: "button" | "plain"; - canDelete?: boolean; - isMoreInfoVisible?: boolean; - showAddRemoveToFavorite?: boolean; -} - -export function AssistantDropdownMenu({ - agentConfiguration, - owner, - variant = "plain", - canDelete, - isMoreInfoVisible, - showAddRemoveToFavorite = false, -}: AssistantDetailsMenuProps) { - const [showDeletionModal, setShowDeletionModal] = useState(false); - - const router = useRouter(); - - const { user } = useUser(); - const { updateUserFavorite, isUpdatingFavorite } = useUpdateUserFavorite({ - owner, - agentConfigurationId: agentConfiguration.sId, - }); - - if ( - !agentConfiguration || - agentConfiguration.status === "archived" || - !user - ) { - return <>; - } - - const isPrivate = agentConfiguration.scope === "private"; - if (isPrivate && agentConfiguration.versionAuthorId !== user.id) { - return <>; - } - - const isAgentWorkspace = agentConfiguration.scope === "workspace"; - const isGlobalAgent = agentConfiguration.scope === "global"; - - const isFavorite = agentConfiguration.userFavorite; - const allowDeletion = canDelete && (isBuilder(owner) || !isAgentWorkspace); - - const updateFavorite = async (favorite: boolean) => { - await updateUserFavorite(favorite); - }; - - const dropdownButton = (() => { - switch (variant) { - case "button": - return ( -