1use yew::prelude::{html, Component, Context, Html, Properties};
8
9pub struct Timer {}
10
11#[derive(Properties, Debug, Clone, PartialEq, Eq)]
12pub struct Props {
13 #[prop_or_default]
14 pub class: Option<&'static str>,
15
16 #[prop_or_default]
17 pub width: Option<&'static str>,
18
19 #[prop_or_default]
20 pub height: Option<&'static str>,
21
22 #[prop_or_default]
23 pub color: Option<&'static str>,
24
25 #[prop_or_default]
26 pub fill: Option<&'static str>,
27
28 #[prop_or_default]
29 pub spin: bool,
30
31 #[prop_or_default]
32 pub rotate: i16,
33}
34
35impl Component for Timer {
36 type Properties = Props;
37 type Message = ();
38
39 fn create(_ctx: &Context<Self>) -> Self {
40 Self {}
41 }
42
43 fn view(&self, ctx: &Context<Self>) -> Html {
44 let props = ctx.props();
45 let mut style = String::new();
47 if props.rotate != 0 {
48 style += &format!("transform: rotate({}deg);", props.rotate);
49 }
50 html! {
51 <svg
52 xmlns={ "http://www.w3.org/2000/svg" }
53 class={ props.class.unwrap_or("") }
54 width={ props.width.unwrap_or("16") }
55 height={ props.height.unwrap_or("16") }
56 focusable={ "false" }
57 data-icon={ "Timer" }
58 viewBox={ "0 0 16 16" }
59 fill={ props.fill.unwrap_or("currentColor") }
60 style={ style }
61 >
62 <path d="M1639 500q135 136 208 297t73 355q0 124-32 238t-90 214-140 181-181 140-214 91-239 32q-124 0-238-32t-214-90-181-140-140-181-91-214-32-239q0-111 26-216t75-198 118-172 154-141 185-103 210-57V128H640V0h640v128h-256v128q139 0 270 41t245 122l208-208 90 90-198 199zm-615 1420q159 0 298-60t244-165 165-244 61-299q0-159-60-298t-165-244-244-165-299-61q-159 0-298 60T482 609 317 853t-61 299q0 159 60 298t165 244 244 165 299 61zm640-896v128q0 133-50 249t-137 204-203 137-250 50q-133 0-249-50t-204-136-137-203-50-250q0-88 23-170t64-153 100-129 130-101 152-65 171-23h128v512h512zm-640 640q106 0 199-40t163-109 110-163 40-200h-512V640q-107 0-200 40T662 790 552 954t-40 200q0 106 40 199t110 162 163 109 199 40z" />
63 </svg>
64 }
65 }
66}