use leptos::*; use leptos_icons::*; use std::fmt::Display; #[component] pub fn ServerError( #[prop(optional, into, default="An Error Occurred".into())] title: TextProp, #[prop(optional, into)] message: TextProp, #[prop(optional, into)] error: Option>, ) -> impl IntoView { view!{

{title}

{message}

{error.map(|error| format!("{}", error))}

} } #[component] pub fn Error( #[prop(optional, into, default="An Error Occurred".into())] title: TextProp, #[prop(optional, into)] message: TextProp, #[prop(optional, into)] error: Option, ) -> impl IntoView { view! {

{title}

{message}

{error.map(|error| format!("{}", error))}

} }