mod collapsed;
use yew::{classes, function_component, html, AttrValue, Children, Classes, Html, Properties};
use crate::typography::Typography;
pub const DEFAULT_EXPAND_TEXT: &str = "Show path";
pub const DEFAULT_ITEMS_AFTER_COLLAPSE: i32 = 1;
pub const DEFAULT_ITEMS_BEFORE_COLLAPSE: i32 = 1;
pub const DEFAULT_MAX_ITEMS: i32 = 8;
pub const DEFAULT_SEPARATOR: &str = "/";
#[derive(Debug, Clone, PartialEq, Properties)]
pub struct Props {
#[prop_or_default]
pub aria_label: AttrValue,
#[prop_or_default]
pub children: Children,
#[prop_or_default]
pub classes: Classes,
#[prop_or(AttrValue::from("nav"))]
pub component: AttrValue,
#[prop_or_default]
pub expand_text: AttrValue,
#[prop_or(DEFAULT_ITEMS_AFTER_COLLAPSE)]
pub items_after_collapse: i32,
#[prop_or(DEFAULT_ITEMS_BEFORE_COLLAPSE)]
pub items_before_collapse: i32,
#[prop_or(DEFAULT_MAX_ITEMS)]
pub max_items: i32,
#[prop_or_default]
pub separator: Option<Html>,
#[prop_or_default]
pub style: AttrValue,
}
#[function_component(Breadcrumbs)]
pub fn breadcrumbs(props: &Props) -> Html {
let root_cls = classes!("ZuBreadcrumb-root", props.classes.clone(),);
html! {
<Typography
classes={root_cls}
aria_label={&props.aria_label}
component={&props.component}
style={&props.style}>
<ol class="ZuBreadcrumb-ol">
{for props.children.iter()}
</ol>
</Typography>
}
}