1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
use crate::*; /// A card component that wraps children with a styled container. /// /// # Arguments /// /// - `VirtualNode` - The props node containing title and children. /// /// # Returns /// /// - `VirtualNode` - A styled card element. pub fn my_card(props: VirtualNode) -> VirtualNode { let children: Vec<VirtualNode> = props.get_children(); let MyCardProps { title, .. }: MyCardProps = props.into(); let children_node: VirtualNode = VirtualNode::Fragment(children); html! { div { class: c_card() h3 { class: c_card_title() title } children_node } } }