use dioxus::prelude::*;
#[derive(Props, Clone, PartialEq)]
pub struct AppShellHeaderProps {
#[props(default)]
pub height: Option<String>,
#[props(default = true)]
pub sticky: bool,
#[props(default = true)]
pub border: bool,
#[props(default)]
pub class: String,
pub children: Element,
}
#[component]
pub fn AppShellHeader(props: AppShellHeaderProps) -> Element {
let height_val = props.height.unwrap_or_else(|| "60px".to_string());
let border_class = if props.border {
"sd-app-shell__header--border"
} else {
""
};
let sticky_class = if props.sticky {
"sd-app-shell__header--sticky"
} else {
""
};
rsx! {
header {
role: "banner",
class: "sd-app-shell__header {border_class} {sticky_class} {props.class}",
style: "height: {height_val}; min-height: {height_val};",
{props.children}
}
}
}