blob: 5400b490266a5406c4e14ad532e61b5a0578608f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
use protocol::bridge_engine::TurnInPlay;
use crate::components::Card;
use yew::prelude::*;
#[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>
<p>{ format!("It is {:?} to play", props.in_progress.current_player()) }</p>
{ for cards }
</>
}
}
#[derive(PartialEq, Properties, Clone)]
pub struct TrickInPlayProps {
pub in_progress: TurnInPlay,
}
|