feat(ui): torrentleri tarihe göre sırala

This commit is contained in:
2026-01-03 23:59:42 +03:00
parent 90732e06ef
commit 915fb48828

View File

@@ -32,9 +32,11 @@ export const TorrentTable = () => {
const [query, setQuery] = useState(""); const [query, setQuery] = useState("");
const filtered = useMemo(() => { const filtered = useMemo(() => {
return torrents.filter((torrent) => return torrents
torrent.name.toLowerCase().includes(query.toLowerCase()) .filter((torrent) =>
); torrent.name.toLowerCase().includes(query.toLowerCase())
)
.sort((a, b) => (b.added_on ?? 0) - (a.added_on ?? 0));
}, [torrents, query]); }, [torrents, query]);
const deleteTorrent = async (hash: string) => { const deleteTorrent = async (hash: string) => {