zuicon_mdl2/
variable.rs

1// Copyright (c) 2024 Xu Shaohua <shaohua@biofan.org>. All rights reserved.
2// Use of this source is governed by Lesser General Public License
3// that can be found in the LICENSE file.
4
5// Auto Generated! DO NOT EDIT!
6
7use yew::prelude::{html, Component, Context, Html, Properties};
8
9pub struct Variable {}
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 Variable {
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        // TODO(Shaohua): Do not generate style attribute if it is empty.
46        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={ "Variable" }
58                viewBox={ "0 0 16 16" }
59                fill={ props.fill.unwrap_or("currentColor") }
60                style={ style }
61            >
62            <path d="M1072 732H848l-159 743q-17 78-58 158t-100 146-136 107-164 42q-26 0-53-5t-49-17-36-32-15-52q0-40 24-68t67-29q25 0 45 11t36 28 29 38 25 40l7 12q32-2 58-22t46-50 37-67 28-75 20-72 14-59l167-777H505l20-81h173l12-62q16-80 54-161t97-146 133-105 166-41q26 0 53 5t49 17 37 32 14 52q0 42-22 70t-68 29q-32 0-53-12t-36-32-27-42-26-45q-37 2-66 28t-51 66-39 90-27 97-20 91-13 69h226l-19 81zm664 64q-25 20-53 53t-54 69-50 74-40 65q10 41 19 81t20 81q10 37 22 77t34 73 52 55 78 22q12 0 28-1t32-4 32-6 27-9l-16 59q-30 13-56 24t-53 19-54 12-62 5q-44 0-72-12t-47-35-31-55-24-70q-14-44-25-87t-22-88q-38 60-76 115t-83 110q-20 24-40 46t-43 39-51 27-60 10q-42 0-69-24t-28-68q0-26 10-45t27-33 39-19 46-7q30 0 57 11t57 19q57-57 106-121t88-134l-2-10q-4-19-12-51t-17-69-22-77-24-72-26-57-27-33q-34-20-77-20-27 0-56 5t-54 17l16-60q14-6 42-17t58-22 58-19 42-8q44 0 73 14t50 39 33 58 24 71q11 39 20 79t18 81l2 8v3q0 1 1 3 19-30 41-68t48-78 55-78 63-69 70-48 78-19q39 0 66 26t28 66q0 25-10 44t-26 32-38 19-45 7q-26 0-58-8t-57-17z" />
63            </svg>
64        }
65    }
66}