diff --git a/src/components/media/MediaCard.tsx b/src/components/media/MediaCard.tsx deleted file mode 100644 index 68acc44..0000000 --- a/src/components/media/MediaCard.tsx +++ /dev/null @@ -1,141 +0,0 @@ -import { useEffect, useRef, useState } from 'react' -import { useTranslation } from 'react-i18next' -import { X, Scissors, RotateCcw } from 'lucide-react' -import { Button } from '@/components/ui/button' -import { Card } from '@/components/ui/card' -import { fmtTime } from '@/lib/ffmpeg' - -export type MediaItem = { - id: string - file: File - url: string - isAudio: boolean - duration: number | null - inSec: number - outSec: number | null -} - -export function MediaCard({ - item, - onUpdate, - onRemove, -}: { - item: MediaItem - onUpdate: (patch: Partial) => void - onRemove: () => void -}) { - const { t } = useTranslation() - const ref = useRef(null) - const [currentTime, setCurrentTime] = useState(0) - - useEffect(() => { - const el = ref.current - if (!el) return - const onLoaded = () => onUpdate({ duration: el.duration || null }) - const onTime = () => setCurrentTime(el.currentTime) - el.addEventListener('loadedmetadata', onLoaded) - el.addEventListener('timeupdate', onTime) - return () => { - el.removeEventListener('loadedmetadata', onLoaded) - el.removeEventListener('timeupdate', onTime) - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [item.url]) - - const setIn = () => { - const t = ref.current?.currentTime ?? 0 - if (item.outSec != null && t >= item.outSec) return - onUpdate({ inSec: t }) - } - const setOut = () => { - const t = ref.current?.currentTime ?? 0 - if (t <= item.inSec) return - onUpdate({ outSec: t }) - } - const reset = () => - onUpdate({ inSec: 0, outSec: item.duration }) - - const effectiveOut = item.outSec ?? item.duration ?? 0 - const trimmedDuration = Math.max(0, effectiveOut - item.inSec) - - return ( - -
-
-

- {item.file.name} -

-

- {(item.file.size / 1024 / 1024).toFixed(2)} MB ·{' '} - {item.file.type || '?'} -

-
- -
- -
- {item.isAudio ? ( -
- -
- - - -
- -
- - - -
-
- ) -} - -function Stat({ label, value }: { label: string; value: string }) { - return ( -
- {label} - {value} -
- ) -} diff --git a/src/i18n/zh-CN.json b/src/i18n/zh-CN.json index 51cfd57..03303e3 100644 --- a/src/i18n/zh-CN.json +++ b/src/i18n/zh-CN.json @@ -918,10 +918,10 @@ "dns": { "description": "基于 DoH 的 DNS 查询。默认解析器为 Cloudflare;勾选「对比解析器」会同时查 Google + Quad9。点击查询才会发起请求。", "typeLabel": "类型", - "status": "Status", - "answers": "{{n}} answers", - "noAnswers": "no answers", - "noDirect": "No direct answer; authority: {{authority}}", + "status": "状态", + "answers": "{{n}} 条记录", + "noAnswers": "无记录", + "noDirect": "无直接答案;授权服务器:{{authority}}", "empty": "填入域名 + 选择记录类型,点击 <1>查询", "compareResolvers": "对比解析器", "txt": {