summaryrefslogtreecommitdiff
path: root/webapp/src/components/error_info.rs
blob: 4ec5ba97ceaab11aab0a3d3c60290275c07b887a (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>
    }
}