diff --git a/ui/autoMate/src/renderer/src/components/CategoryItem/index.tsx b/ui/autoMate/src/renderer/src/components/CategoryItem/index.tsx
index 3ba0d3b..2616d08 100644
--- a/ui/autoMate/src/renderer/src/components/CategoryItem/index.tsx
+++ b/ui/autoMate/src/renderer/src/components/CategoryItem/index.tsx
@@ -1,8 +1,8 @@
-import { Delete, FolderClose } from "@icon-park/react"
+import { FolderClose } from "@icon-park/react"
import { NavLink, useFetcher, useSubmit } from "react-router-dom"
import styles from "./styles.module.scss"
-import { useContextMenu } from "mantine-contextmenu"
import { useStore } from "@renderer/store/useStore"
+import useCategory from "@renderer/hooks/useCategory"
interface Props {
category: CategoryType
}
@@ -10,9 +10,9 @@ interface Props {
export const CategoryItem = ({ category }: Props) => {
// fetcher 不会刷新路由
const fetcher = useFetcher()
- const { showContextMenu } = useContextMenu()
const setEditCategoryId = useStore(state => state.setEditCategoryId)
const editCategoryId = useStore(state => state.editCategoryId)
+ const { contextMenu } = useCategory()
return (
<>
{editCategoryId == category.id ? (
@@ -43,17 +43,7 @@ export const CategoryItem = ({ category }: Props) => {
className={({ isActive }) => {
return isActive ? styles.active : styles.link
}}
- onContextMenu={showContextMenu([
- {
- key: 'remove',
- icon: