1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use wasm_bindgen::prelude::*;
use yew::prelude::*;

#[wasm_bindgen(module = "/build/mwc-icon.js")]
extern "C" {
    #[derive(Debug)]
    type Icon;

    #[wasm_bindgen(getter, static_method_of = Icon)]
    fn _dummy_loader() -> JsValue;
}

loader_hack!(Icon);

/// Props for [`MatIcon`]
///
/// [MWC Documentation for properties](https://github.com/material-components/material-components-web-components/tree/v0.27.0/packages/icon#propertiesattributes)
#[derive(Debug, Properties, PartialEq, Clone)]
pub struct IconProps {
    pub children: Children,
}

component!(
    MatIcon,
    IconProps,
    |props: &IconProps| {
        html! {
             <mwc-icon>{props.children.clone()}</mwc-icon>
        }
    },
    Icon,
    "icon"
);