use super::*;
#[component]
pub fn euv_label(node: VirtualNode<EuvLabelProps>) -> VirtualNode {
let EuvLabelProps {
html_for,
text,
disabled,
}: EuvLabelProps = node.try_get_props().unwrap_or_default();
let children: VirtualNode = node.get_children().into();
let content: VirtualNode = match children {
VirtualNode::Empty => VirtualNode::Text(TextNode::new(Cow::Owned(text.to_string()), None)),
other => other,
};
html! {
label {
for: html_for
"data-slot": "label"
class: if { disabled.get() } {
c_euv_label_disabled()
} else {
c_euv_label()
}
content
}
}
}