use yew::prelude::*; use crate::components; pub enum Msg { LogOutClicked, LogOut(Option>), } #[derive(Properties, PartialEq)] pub struct MainProps { pub token: Option, pub logged_in: bool, #[prop_or_default] pub children: Children, } pub struct Main; impl Component for Main { type Message = Msg; type Properties = MainProps; fn create(_ctx: &Context) -> Self { Self } fn view(&self, ctx: &Context) -> Html { html! { <>
{ for ctx.props().children.iter() }
} } }