zuicon_mdl2/
external_git.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 ExternalGit {}
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 ExternalGit {
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={ "ExternalGit" }
58                viewBox={ "0 0 16 16" }
59                fill={ props.fill.unwrap_or("currentColor") }
60                style={ style }
61            >
62            <path d="M1342 640q38 0 65 27l614 614q27 27 27 65 0 37-27 64l-611 612q-13 13-30 19t-35 7q-17 0-34-6t-30-20l-614-615q-27-27-27-64 0-38 27-65l421-421 160 160q-9 20-9 42 0 21 8 41t24 35q7 7 9 7t11 3v390q-8 4-14 10t-12 12q-19 19-28 38t-10 46q0 23 9 43t24 36 35 24 44 9q24 0 45-7t36-22 25-35 10-44q0-29-17-58t-43-43v-379l146 145q-9 20-9 42t8 41 24 35 34 23 42 9q22 0 42-8t34-23 23-34 9-43q0-23-8-42t-23-34-35-23-42-9q-9 0-18 1t-17 4l-156-156q6-16 6-35 0-22-8-42t-24-34-34-22-42-9q-20 0-34 5l-162-162 127-127q27-27 64-27zM256 1792h512v128H128V128h1792v640h-128V256H256v1536z" />
63            </svg>
64        }
65    }
66}