import { useEffect, useState } from 'react' import toast from 'react-hot-toast' import { RotateCcw, Trash2 } from 'lucide-react' import { recycleAPI } from '../api/recycle' import { confirmAction } from '../components/ConfirmDialog' import type { Media } from '../types' export function RecycleBinPage() { const [items, setItems] = useState([]) const [loading, setLoading] = useState(true) const refresh = () => recycleAPI .list() .then(setItems) .finally(() => setLoading(false)) useEffect(() => { refresh().catch(() => undefined) }, []) return (

回收站

软删除的媒体保留在数据库中,可以恢复。彻底删除不会移除磁盘上的文件,只会从数据库清除条目。

{loading &&

加载中…

} {!loading && items.length === 0 &&

回收站为空。

} {items.length > 0 && (
{items.map((m) => ( ))}
标题 路径 操作
{m.title} {m.path}
)}
) }