yggdrasil/components/skeletons/
post_card_skeleton.rs1use dioxus::prelude::*;
6
7use crate::components::skeletons::atoms::SkeletonBox;
8
9#[component]
14pub fn PostCardSkeleton(
15 #[props(default = false)] has_cover: bool,
16 #[props(default = false)] compact: bool,
17) -> Element {
18 let article_class: &'static str = if compact {
19 "post-card-editorial post-card-compact"
20 } else {
21 "mb-10 flex flex-col bg-[var(--color-paper-entry)] rounded-[2rem] border border-transparent overflow-hidden"
22 };
23
24 rsx! {
25 article { class: article_class,
26 if has_cover {
27 div { class: "post-card-cover overflow-hidden",
28 SkeletonBox { class: "w-full aspect-[21/9] !rounded-none" }
29 }
30 }
31 div { class: "post-card-body p-8 flex flex-col gap-3.5 min-w-0",
32 div { class: "flex flex-wrap items-center gap-3",
33 SkeletonBox { class: "h-3.5 w-20" }
34 SkeletonBox { class: "h-3.5 w-16" }
35 }
36 SkeletonBox { class: "h-7 w-3/4 rounded" }
38 SkeletonBox { class: "h-4 w-full rounded" }
40 SkeletonBox { class: "h-4 w-5/6 rounded" }
41 div { class: "flex flex-wrap items-center gap-3 mt-1",
42 SkeletonBox { class: "h-4 w-16" }
43 SkeletonBox { class: "h-4 w-20" }
44 }
45 }
46 }
47 }
48}