use super::*;
#[component]
pub fn euv_empty(node: VirtualNode<EuvEmptyProps>) -> VirtualNode {
let EuvEmptyProps {
icon,
title,
desc,
action_label,
on_action,
}: EuvEmptyProps = node.try_get_props().unwrap_or_default();
let has_action: bool = !action_label.is_empty();
html! {
div {
class: c_euv_empty()
if !icon.is_empty() {
div {
class: c_euv_empty_icon()
icon
}
}
div {
class: c_euv_empty_text()
title
}
if !desc.is_empty() {
div {
class: c_euv_empty_desc()
desc
}
}
if has_action {
div {
class: c_euv_empty_action()
euv_button {
variant: EuvButtonVariant::Primary
label: action_label
onclick: on_action
}
}
}
}
}
}