blob: cb5a9c1380be1e42fc348d45e978df4b22e3f7e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
use crate::components::app_context_provider::ErrorInfoProperties;
use yew::prelude::*;
#[function_component(ErrorInfo)]
pub fn error_info(props: &ErrorInfoProperties) -> Html {
let reload = Callback::from(move |_| {
web_sys::window().unwrap().location().reload().unwrap();
});
html! {
<div class="error-box">
<p>
{ format!("Error: {}. ", props.message) }
<button onclick={reload}>{ "Reload" }</button>
</p>
</div>
}
}
|