yggdrasil/components/skeletons/archive_skeleton.rs
1//! 归档页骨架屏
2//!
3//! 在归档数据加载期间展示按年份/月份分组的文章列表占位。
4
5use crate::components::skeletons::atoms::*;
6use dioxus::prelude::*;
7
8/// 归档页骨架屏组件。
9///
10/// 结构:统计行("共 N 篇文章")+ 年份标题 + 月份标题 + 文章条目列表。
11/// 模拟 2 个年份,每个年份 2 个月,每个月 3 篇文章。
12#[component]
13pub fn ArchiveSkeleton() -> Element {
14 rsx! {
15 div {
16 // 统计行占位
17 div { class: "mt-2 mb-6",
18 SkeletonBox { class: "h-5 w-32 rounded" }
19 }
20
21 // 年份分组占位
22 for _ in 0..2 {
23 div { class: "archive-year mt-10",
24 // 年份标题 (h2 text-2xl)
25 SkeletonBox { class: "h-8 w-24 rounded mb-4" }
26
27 // 月份分组
28 for _ in 0..2 {
29 div { class: "archive-month flex flex-col md:flex-row md:items-start py-2.5 border-b border-gray-100 dark:border-gray-700/50",
30 // 月份标题 (h3 text-lg, md:w-[200px])
31 SkeletonBox { class: "h-6 w-32 md:w-[200px] shrink-0 rounded mb-2 md:mb-0 md:py-1.5" }
32
33 // 文章条目列表
34 div { class: "flex-1 space-y-3",
35 for _ in 0..3 {
36 div { class: "archive-entry py-1.5 my-2.5",
37 // 文章标题
38 SkeletonBox { class: "h-4 w-3/4 rounded mb-1" }
39 // 日期
40 SkeletonBox { class: "h-3 w-20 rounded" }
41 }
42 }
43 }
44 }
45 }
46 }
47 }
48 }
49 }
50}