Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🔥 refactor(sidebar): remove the unused useProjectMenuItems hook (#21877)

AmAzing-27c79be23a6d
diff --git a/src/features/HomeSidebar/hooks/index.ts b/src/features/HomeSidebar/hooks/index.ts
index 90e6f638f3f..9e5773ccba7 100644
--- a/src/features/HomeSidebar/hooks/index.ts
+++ b/src/features/HomeSidebar/hooks/index.ts
@@ -1,4 +1,3 @@
export { useCreateMenuItems } from './useCreateMenuItems';
-export { useProjectMenuItems } from './useProjectMenuItems';
export { useRevealSidebarSection } from './useRevealSidebarSection';
export { useSessionGroupMenuItems } from './useSessionGroupMenuItems';
diff --git a/src/features/HomeSidebar/hooks/useProjectMenuItems.tsx b/src/features/HomeSidebar/hooks/useProjectMenuItems.tsx
deleted file mode 100644
index 980b6cfabdd..00000000000
--- a/src/features/HomeSidebar/hooks/useProjectMenuItems.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import type { ItemType } from '@lobehub/ui';
-import { Icon } from '@lobehub/ui';
-import { BoxIcon } from 'lucide-react';
-import { useCallback } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { useCreateNewModal } from '@/features/LibraryModal/CreateNew';
-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
-
-/**
- * Hook for generating menu items/buttons for knowledge base actions
- * Used in Body/Project/Actions.tsx
- */
-export const useProjectMenuItems = () => {
- const { t } = useTranslation('knowledgeBase');
- const navigate = useWorkspaceAwareNavigate();
- const { open } = useCreateNewModal();
-
- /**
- * Create knowledge base action
- */
- const createProject = useCallback(() => {
- open({
- onSuccess: (id) => {
- navigate(`/knowledge/bases/${id}`);
- },
- });
- }, [open, navigate]);
-
- const createProjectMenuItem = useCallback(
- (): ItemType => ({
- icon: <Icon icon={BoxIcon} />,
- key: 'createProject',
- label: t('createNew.title'),
- onClick: (info) => {
- info.domEvent?.stopPropagation();
- createProject();
- },
- }),
- [t, createProject],
- );
-
- return {
- createProject,
- createProjectMenuItem,
- };
-};