feat(ui): add shimmer component and integrate into torrent details

This commit is contained in:
spinline
2026-02-20 23:53:37 +03:00
parent f075a87668
commit ec23285a6a
4 changed files with 30 additions and 8 deletions

View File

@@ -17,6 +17,7 @@ pub mod separator;
pub mod sheet;
pub mod sidenav;
pub mod skeleton;
pub mod shimmer;
pub mod svg_icon;
pub mod switch;
pub mod table;

View File

@@ -0,0 +1,13 @@
use leptos::prelude::*;
use tw_merge::tw_merge;
#[component]
pub fn Shimmer(
#[prop(optional, into)] class: String,
) -> impl IntoView {
let merged_class = tw_merge!(
"relative overflow-hidden bg-muted before:absolute before:inset-0 before:-translate-x-full before:animate-[shimmer_2s_infinite] before:bg-gradient-to-r before:from-transparent before:via-white/20 before:to-transparent dark:before:via-white/5",
class
);
view! { <div class=merged_class /> }
}