feat: include default alt-icon when icon is missing

This commit is contained in:
imgurbot12 2023-08-20 13:07:59 -07:00
parent 3f7baff1fb
commit 19901cbe34

View File

@ -63,10 +63,8 @@ fn render_image<'a, T>(
return cx.render(rsx! { img { class: "image", src: "{img}" } }); return cx.render(rsx! { img { class: "image", src: "{img}" } });
} }
} }
if let Some(alt) = alt { let alt = alt.map(|s| s.as_str()).unwrap_or_else(|| "?");
return cx.render(rsx! { div { class: "icon_alt", dangerous_inner_html: "{alt}" } }); return cx.render(rsx! { div { class: "icon_alt", dangerous_inner_html: "{alt}" } });
}
None
} }
/// render a single result entry w/ the given information /// render a single result entry w/ the given information