dashboard.rs 22 lignes · 895 octets
//! Admin-dashboard card factory.
//!
//! The card lands on `/admin` (the framework's admin index) and links
//! to the guard's hub at `/admin/fediverse-guard`. i18n keys
//! `admin.dashboard.guard_card_title` and `admin.dashboard.guard_card_desc`
//! are resolved at render time by the host UI — if the keys are missing
//! from `locales/*.yml`, the rendering layer falls back to the raw key
//! (so the card stays visible but unstyled).

use rustwarden_core::dashboard::DashboardCardDTO;

/// Build the dashboard card injected into the admin dashboard via
/// `RustwardenBuilder::add_dashboard_card`.
#[must_use]
pub fn dashboard_card() -> DashboardCardDTO {
    DashboardCardDTO {
        title_key: "admin.dashboard.guard_card_title".into(),
        desc_key: "admin.dashboard.guard_card_desc".into(),
        href: "/admin/fediverse-guard".into(),
        icon: "🛡️".into(),
    }
}