use yew::prelude::*; #[derive(PartialEq, Properties)] pub struct QrCodeProps { #[prop_or(24)] pub size: usize, #[prop_or(AttrValue::from("currentColor"))] pub color: AttrValue, #[prop_or(AttrValue::from("none"))] pub fill: AttrValue, #[prop_or(2)] pub stroke_width: usize, #[prop_or(false)] pub absolute_stroke_width: bool, #[prop_or_default] pub class: Classes, #[prop_or_default] pub style: std::option::Option, #[prop_or_default] pub node_ref: NodeRef, } #[function_component] pub fn QrCode(props: &QrCodeProps) -> Html { let stroke_width = if props.absolute_stroke_width { props.stroke_width * 24 / props.size } else { props.stroke_width }; html! { } }