use crate::*;
#[component]
pub(crate) fn primary_button(props: PrimaryButtonProps) -> VirtualNode {
let PrimaryButtonProps {
label,
onclick: click_handler,
disabled,
children,
} = props;
let content: VirtualNode = match children {
VirtualNode::Empty => VirtualNode::Text(TextNode::new(label.to_string(), None)),
other => other,
};
html! {
button {
class: if { disabled } { c_primary_button_disabled() } else { c_primary_button() }
onclick: click_handler
content
}
}
}
#[component]
pub(crate) fn modal_primary_button(props: PrimaryButtonProps) -> VirtualNode {
let PrimaryButtonProps {
label,
onclick: click_handler,
disabled,
children,
} = props;
let content: VirtualNode = match children {
VirtualNode::Empty => VirtualNode::Text(TextNode::new(label.to_string(), None)),
other => other,
};
html! {
button {
class: if { disabled } { c_modal_primary_button_disabled() } else { c_modal_primary_button() }
onclick: click_handler
content
}
}
}