Skip to main content

StatusBadge

Function StatusBadge 

Source
pub fn StatusBadge(_: StatusBadgeProps) -> Element
Expand description

状态徽章组件。

外层固定 BADGE_BASE,颜色类由调用方传入。之所以用 color_class prop 而非枚举变体,是因为部分场景(如回收站剩余天数)的颜色由动态逻辑决定 (>7 天中性 / ≤7 天主题绿 / ≤0 琥珀),硬编码 variant 反而不够灵活。

Props:

  • color_class:背景与文字颜色类(如 post.status_badge_class() 的返回值)
  • label:徽章文本

§Props

For details, see the props struct definition.