feat(dash): improved frontend dashboard (#6)
Co-authored-by: Sharang Parnerkar <parnerkarsharang@gmail.com> Reviewed-on: #6
This commit was merged in pull request #6.
This commit is contained in:
23
src/components/page_header.rs
Normal file
23
src/components/page_header.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
/// Reusable page header with title, subtitle, and an optional action slot.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `title` - Main heading text for the page
|
||||
/// * `subtitle` - Secondary descriptive text below the title
|
||||
/// * `actions` - Optional element rendered on the right side (e.g. buttons)
|
||||
#[component]
|
||||
pub fn PageHeader(title: String, subtitle: String, actions: Option<Element>) -> Element {
|
||||
rsx! {
|
||||
div { class: "page-header",
|
||||
div { class: "page-header-text",
|
||||
h1 { class: "page-title", "{title}" }
|
||||
p { class: "page-subtitle", "{subtitle}" }
|
||||
}
|
||||
if let Some(actions) = actions {
|
||||
div { class: "page-header-actions", {actions} }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user