diff options
Diffstat (limited to 'webapp/src/components/trick_in_play.rs')
-rw-r--r-- | webapp/src/components/trick_in_play.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/webapp/src/components/trick_in_play.rs b/webapp/src/components/trick_in_play.rs new file mode 100644 index 0000000..086a422 --- /dev/null +++ b/webapp/src/components/trick_in_play.rs @@ -0,0 +1,23 @@ +use yew::prelude::*; +use crate::bridge_engine::PlayTurn; +use crate::components::Card; + +#[function_component(TrickInPlay)] +pub fn trick_in_play(props: &TrickInPlayProps) -> Html { + let cards = props.in_progress.cards_played().iter().map(|card| { + html! { + <Card card={ card.clone() } /> + } + }); +html! { + <> + <p>{ format!("Leader: {:?}", props.in_progress.leader()) }</p> + { for cards } + </> +} +} + +#[derive(PartialEq, Properties, Clone)] +pub struct TrickInPlayProps { + pub in_progress: PlayTurn, +} |