use yew::prelude::{html, Component, Context, Html, Properties};
pub struct Font {}
#[derive(Properties, Debug, Clone, PartialEq, Eq)]
pub struct Props {
#[prop_or_default]
pub class: Option<&'static str>,
#[prop_or_default]
pub width: Option<&'static str>,
#[prop_or_default]
pub height: Option<&'static str>,
#[prop_or_default]
pub color: Option<&'static str>,
#[prop_or_default]
pub fill: Option<&'static str>,
#[prop_or_default]
pub spin: bool,
#[prop_or_default]
pub rotate: i16,
}
impl Component for Font {
type Properties = Props;
type Message = ();
fn create(_ctx: &Context<Self>) -> Self {
Self {}
}
fn view(&self, ctx: &Context<Self>) -> Html {
let props = ctx.props();
let mut style = String::new();
if props.rotate != 0 {
style += &format!("transform: rotate({}deg);", props.rotate);
}
html! {
<svg
xmlns={ "http://www.w3.org/2000/svg" }
class={ props.class.unwrap_or("") }
width={ props.width.unwrap_or("16") }
height={ props.height.unwrap_or("16") }
focusable={ "false" }
data-icon={ "Font" }
viewBox={ "0 0 16 16" }
fill={ props.fill.unwrap_or("currentColor") }
style={ style }
>
<path d="M765 1024H387l-85 256H167L509 256h134l268 802-81 162-65-196zm-43-128L576 458 430 896h292zm982 679q17 41 31 73t35 54 50 34 78 12v44h-449v-44h37q20 0 39-3t30-17 12-37q0-14-6-39t-16-54-21-59-22-58-19-46-11-27h-448q-3 8-12 27t-20 46-24 57-23 58-17 54-7 40q0 24 12 35t31 16 38 5 37 2v44H662v-44q49-9 76-21t44-32 30-52 33-79l392-924h82l385 935zm-291-295l-177-381-169 381h346z" />
</svg>
}
}
}