summaryrefslogtreecommitdiff
path: root/webapp/src/components/trick_in_play.rs
blob: c034d201babb5b9816b2deef399d8a4cba77cf72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use yew::prelude::*;
use crate::bridge_engine::TurnInPlay;
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: TurnInPlay,
}