use yew::prelude::*; #[derive(PartialEq)] pub struct Repository { pub name: String, pub url: Option, } #[derive(Properties, PartialEq)] pub struct Props { pub name: AttrValue, pub repositories: Vec, pub on_click: Option>, } pub enum Msg { Emit(usize), } pub struct UserPane; impl Component for UserPane { type Message = Msg; type Properties = Props; fn create(_ctx: &Context) -> Self { Self } fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { match msg { Msg::Emit(i) => { ctx.props().on_click.as_ref().unwrap().emit(i); false } } } fn view(&self, ctx: &Context) -> Html { html! { } } }