Current section

Files

Jump to
phoenix_webcomponent lib mix tasks yew_icon_item.eex
Raw

lib/mix/tasks/yew_icon_item.eex

#![allow(non_camel_case_types)]
use yew::prelude::*;
use super::props::IconProps;
#[function_component(<%= ns %>_<%= name |> String.split("-") |> Enum.map(&String.capitalize/1) |> Enum.join("") %>)]
pub fn r#icon_<%= String.replace(name, "-", "_") %>(props: &IconProps) -> Html {
let owned_props = props.clone();
html! {
<svg xmlns="http://www.w3.org/2000/svg" viewBox="<%= vb %>" id={owned_props.id} class={owned_props.class} width={owned_props.size} fill={owned_props.color} style={owned_props.style}>
<%= inner %>
</svg>
}
}