yggdrasil/components/post/post_meta.rs
1//! 文章元信息组件
2//!
3//! 展示文章发布日期、阅读时长与字数统计。
4
5use dioxus::prelude::*;
6
7use crate::models::post::Post;
8
9/// 文章元信息组件。
10///
11/// Props:
12/// - `post`:文章数据模型
13///
14/// 渲染格式:`日期 · min read · words`
15#[component]
16pub fn PostMeta(post: Post) -> Element {
17 rsx! {
18 div { class: "post-meta",
19 span { "{post.formatted_date()}" }
20 span { "·" }
21 span { "{post.reading_time} min read" }
22 span { "·" }
23 span { "{post.word_count} words" }
24 }
25 }
26}