email_components/components/
button.rs1use yew::{AttrValue, Html, Properties, function_component, html};
2
3#[derive(Properties, PartialEq)]
4pub struct Props {
5 #[prop_or(AttrValue::Static("_blank"))]
6 pub target: AttrValue,
7
8 pub children: Html,
9}
10
11#[function_component]
12pub fn Button(props: &Props) -> Html {
13 let Props { target, children } = props;
14
15 html! {
16 <a
17 style="
18 line-height: '100%';
19 text-decoration: 'none';
20 display: 'inline-block';
21 max-width: '100%';
22 mso-padding-alt: '0px'
23 "
24 target={target}
25 >
26 <span
27 style="
28 max-width: '100%';
29 display: 'inline-block';
30 line-height: '120%';
31 mso-padding-alt: '0px'
32 "
33 >
34 { children.clone() }
35 </span>
36 </a>
37 }
38}