use leptos::*; use crate::locales::trl; use crate::validator::Validator; #[component] pub fn ValidationErr( validator: Validator, ) -> impl IntoView { view! {{move || { if !validator.is_valid() { if let Some(msgs) = validator.messages() { let out_msgs = msgs.into_iter().map(move |e| { view! {
{trl(&e)}
} }).collect_view(); view! {
{out_msgs}
} } else { view! {
{trl("Validation error")}
} } } else { view! {
} } }} } }