diff --git a/messages/en-US.json b/messages/en-US.json index c1e6321..9818338 100644 --- a/messages/en-US.json +++ b/messages/en-US.json @@ -22,7 +22,7 @@ "newFolder": "New Folder", "creating": "Creating...", "noFoldersYet": "No folders yet", - "folderInfo": "{id}. {name} ({totalPairs})", + "folderInfo": "ID: {id} • {totalPairs} pairs", "enterFolderName": "Enter folder name:", "confirmDelete": "Type \"{name}\" to delete:" }, diff --git a/messages/zh-CN.json b/messages/zh-CN.json index d6e0ba0..1489ea3 100644 --- a/messages/zh-CN.json +++ b/messages/zh-CN.json @@ -22,7 +22,7 @@ "newFolder": "新建文件夹", "creating": "创建中...", "noFoldersYet": "还没有文件夹", - "folderInfo": "{id}. {name} ({totalPairs})", + "folderInfo": "ID: {id} • {totalPairs} 个文本对", "enterFolderName": "输入文件夹名称:", "confirmDelete": "输入 \"{name}\" 以删除:" }, diff --git a/src/app/(features)/translator/page.tsx b/src/app/(features)/translator/page.tsx index 998a069..8eaad59 100644 --- a/src/app/(features)/translator/page.tsx +++ b/src/app/(features)/translator/page.tsx @@ -11,7 +11,7 @@ import { getTTSAudioUrl } from "@/lib/browser/tts"; import { logger } from "@/lib/logger"; import { Plus, Trash } from "lucide-react"; import { useTranslations } from "next-intl"; -import { useEffect, useRef, useState } from "react"; +import { useRef, useState } from "react"; import z from "zod"; import AddToFolder from "./AddToFolder"; import { @@ -35,9 +35,7 @@ export default function TranslatorPage() { const [ipaTexts, setIpaTexts] = useState(["", ""]); const [processing, setProcessing] = useState(false); const { load, play } = useAudioPlayer(); - const [history, setHistory] = useState< - z.infer[] - >([]); + const [history, setHistory] = useState[]>(() => tlso.get()); const [showAddToFolder, setShowAddToFolder] = useState(false); const [addToFolderItem, setAddToFolderItem] = useState(null); const { data: session } = authClient.useSession(); - useEffect(() => { - setHistory(tlso.get()); - }, []); - const tts = async (text: string, locale: string) => { if (lastTTS.current.text !== text) { const shortName = VOICES.find((v) => v.locale === locale)?.short_name; diff --git a/src/components/ui/cards/ACard.tsx b/src/components/ui/cards/ACard.tsx deleted file mode 100644 index 798cd1a..0000000 --- a/src/components/ui/cards/ACard.tsx +++ /dev/null @@ -1,16 +0,0 @@ -"use client"; - -interface ACardProps { - children?: React.ReactNode; - className?: string; -} - -export default function ACard({ children, className }: ACardProps) { - return ( -
- {children} -
- ); -} diff --git a/src/components/ui/cards/BCard.tsx b/src/components/ui/cards/BCard.tsx deleted file mode 100644 index e74675e..0000000 --- a/src/components/ui/cards/BCard.tsx +++ /dev/null @@ -1,12 +0,0 @@ -"use client"; - -interface BCardProps { - children?: React.ReactNode; - className?: string; -} - -export default function BCard({ children, className }: BCardProps) { - return ( -
{children}
- ); -}