From f1dcd5afaa7194ebfc6890c950cbc5e823d90dec Mon Sep 17 00:00:00 2001 From: goddonebianu Date: Mon, 5 Jan 2026 18:37:12 +0800 Subject: [PATCH] ... --- src/app/(features)/dictionary/AddToFolder.tsx | 96 ------------------- src/app/(features)/dictionary/page.tsx | 2 +- 2 files changed, 1 insertion(+), 97 deletions(-) delete mode 100644 src/app/(features)/dictionary/AddToFolder.tsx diff --git a/src/app/(features)/dictionary/AddToFolder.tsx b/src/app/(features)/dictionary/AddToFolder.tsx deleted file mode 100644 index 0e84e7c..0000000 --- a/src/app/(features)/dictionary/AddToFolder.tsx +++ /dev/null @@ -1,96 +0,0 @@ -"use client"; - -import { LightButton } from "@/components/ui/buttons"; -import Container from "@/components/ui/Container"; -import { useEffect, useState } from "react"; -import { Folder } from "../../../../generated/prisma/browser"; -import { getFoldersByUserId } from "@/lib/server/services/folderService"; -import { Folder as Fd } from "lucide-react"; -import { createPair } from "@/lib/server/services/pairService"; -import { toast } from "sonner"; -import { authClient } from "@/lib/auth-client"; - -interface AddToFolderProps { - definitionLang: string; - queryLang: string; - standardForm: string; - definition: string; - ipa?: string; - setShow: (show: boolean) => void; -} - -const AddToFolder: React.FC = ({ - definitionLang, - queryLang, - standardForm, - definition, - ipa, - setShow, -}) => { - const { data: session } = authClient.useSession(); - const [folders, setFolders] = useState([]); - const [loading, setLoading] = useState(true); - - useEffect(() => { - if (!session) return; - const userId = session.user.id as string; - getFoldersByUserId(userId) - .then(setFolders) - .then(() => setLoading(false)); - }, [session]); - - if (!session) { - return null; - } - - return ( -
- -

选择文件夹保存

-
- {loading ? ( - 加载中... - ) : folders.length > 0 ? ( - folders.map((folder) => ( - - )) - ) : ( -
暂无文件夹
- )} -
-
- setShow(false)}>关闭 -
-
-
- ); -}; - -export default AddToFolder; diff --git a/src/app/(features)/dictionary/page.tsx b/src/app/(features)/dictionary/page.tsx index 0aca18e..4fbc9f7 100644 --- a/src/app/(features)/dictionary/page.tsx +++ b/src/app/(features)/dictionary/page.tsx @@ -304,7 +304,7 @@ export default function Dictionary() { toast.error("保存失败,请稍后重试"); }); }} - className="hover:bg-gray-200 hover:cursor-pointer rounded-4xl border border-gray-200 w-10 h-10 flex justify-center items-center flex-shrink-0" + className="hover:bg-gray-200 hover:cursor-pointer rounded-4xl border border-gray-200 w-10 h-10 flex justify-center items-center shrink-0" title="保存到文件夹" >