use wasm_bindgen::*;
use web_sys::*;
use yew::prelude::*;
#[derive(Properties, PartialEq)]
pub struct NumberInputProps {
pub max_value: f64,
pub on_max_value: Callback<String>,
}
#[function_component(NumberInput)]
pub fn number_input(props: &NumberInputProps) -> Html {
let oninput = props.on_max_value.reform(|event: InputEvent| {
event
.target()
.unwrap()
.unchecked_into::<HtmlInputElement>()
.value()
});
html! {
<>
<label>{ "Max" }</label>
<input
value={format!("{}", props.max_value)}
class="parameter"
type="number"
min="0"
{oninput}
/>
</>
}
}