use yew::prelude::*; use crate::components::card::{Card, CardProps}; #[function_component(Hand)] pub fn hand(props: &HandProps) -> Html { let cards = props .cards .iter() .map(|c| { html! { } }); html! { { for cards } } } #[derive(Clone, Default, PartialEq, Properties)] pub struct HandProps { #[prop_or_default] cards: Vec, } impl> FromIterator for HandProps { fn from_iter(cards: Cards) -> Self where Cards: std::iter::IntoIterator, { HandProps { cards: cards.into_iter().map(Into::into).collect(), } } }