plate-tool/src/components/plates/plate_container.rs

30 lines
838 B
Rust
Raw Normal View History

2023-05-21 16:45:12 +00:00
#![allow(non_snake_case)]
use yew::prelude::*;
2023-05-24 15:20:12 +00:00
use super::source_plate::SourcePlate;
2023-05-21 16:45:12 +00:00
use super::destination_plate::DestinationPlate;
#[derive(Properties, PartialEq)]
pub struct PlateContainerProps {
2023-05-24 15:42:54 +00:00
pub source_dims: Option<(u8,u8)>,
pub destination_dims: Option<(u8,u8)>,
}
2023-05-21 16:45:12 +00:00
#[function_component]
pub fn PlateContainer(props: &PlateContainerProps) -> Html {
html! {
<div class="plate_container">
2023-05-24 15:42:54 +00:00
if let Some((w,h)) = props.source_dims {
<SourcePlate width={w} height={h} />
} else {
<h2>{"No Source Plate Selected"}</h2>
}
if let Some((w,h)) = props.destination_dims {
<DestinationPlate width={w} height={h} />
} else {
<h2>{"No Destination Plate Selected"}</h2>
}
</div>
}
2023-05-21 16:45:12 +00:00
}