From 5cc2fdd8b4a30da56810ba0e3ad3a0fbf347516c Mon Sep 17 00:00:00 2001 From: spinline Date: Thu, 12 Feb 2026 01:01:36 +0300 Subject: [PATCH] feat: add empty state to torrent table for better user feedback --- frontend/src/components/torrent/table.rs | 121 ++++++++++++++++------- frontend/src/components/ui/mod.rs | 1 + 2 files changed, 89 insertions(+), 33 deletions(-) diff --git a/frontend/src/components/torrent/table.rs b/frontend/src/components/torrent/table.rs index 1e986e9..cc0119f 100644 --- a/frontend/src/components/torrent/table.rs +++ b/frontend/src/components/torrent/table.rs @@ -1,7 +1,7 @@ use leptos::prelude::*; use leptos::task::spawn_local; use std::collections::HashSet; -use icons::{ArrowUpDown}; +use icons::{ArrowUpDown, Inbox}; use crate::store::{get_action_messages, show_toast}; use crate::api; use shared::NotificationLevel; @@ -10,6 +10,7 @@ use crate::components::ui::card::{Card, CardHeader, CardTitle, CardContent as Ca use crate::components::ui::data_table::*; use crate::components::ui::checkbox::Checkbox; use crate::components::ui::button::{Button, ButtonVariant}; +use crate::components::ui::empty::*; fn format_bytes(bytes: i64) -> String { const UNITS: [&str; 6] = ["B", "KB", "MB", "GB", "TB", "PB"]; @@ -220,29 +221,68 @@ pub fn TorrentTable() -> impl IntoView { - - } + + + + + + + + "Torrent Bulunamadı" + + {move || { + let query = store.search_query.get(); + if query.is_empty() { + "Henüz eklenmiş bir torrent bulunmuyor.".to_string() + } else { + format!("'{}' araması için sonuç bulunamadı.", query) + } + }} + + + + + + + + } - } /> + > + + } + } + } /> + @@ -259,16 +299,31 @@ pub fn TorrentTable() -> impl IntoView { // --- MOBILE VIEW ---
- - -
- } + + + + + + "Boş Görünüyor" + "Burada gösterilecek bir şey yok." + + } - } /> + > + + +
+ } + } + } /> + @@ -424,4 +479,4 @@ fn TorrentCard( } }.into_any() -} +} \ No newline at end of file diff --git a/frontend/src/components/ui/mod.rs b/frontend/src/components/ui/mod.rs index 3b95cbd..081bc42 100644 --- a/frontend/src/components/ui/mod.rs +++ b/frontend/src/components/ui/mod.rs @@ -7,3 +7,4 @@ pub mod theme_toggle; pub mod svg_icon; pub mod table; pub mod data_table;pub mod checkbox; +pub mod empty;