Skip to main content

email_components/components/
img.rs

1pub use yew::{AttrValue, Properties, function_component, html};
2
3#[derive(Properties, PartialEq)]
4pub struct Props {
5    pub src: AttrValue,
6
7    #[prop_or(AttrValue::Static("32"))]
8    pub width: AttrValue,
9    #[prop_or(AttrValue::Static("32"))]
10    pub height: AttrValue,
11
12    pub alt: AttrValue,
13}
14
15#[function_component]
16pub fn Img(props: &Props) -> yew::Html {
17    let Props {
18        src,
19        width,
20        height,
21        alt,
22    } = props;
23
24    yew::html! {
25        <img
26            src={src}
27            width={width}
28            height={height}
29            alt={alt}
30            style="display: block; outline: none; border: none; text-decoration: none"
31        />
32    }
33}