use log::info; use yew::prelude::*; use yew_router::prelude::*; use crate::use_app_context; #[function_component(Table)] pub fn table(props: &TableProps) -> Html { let ctx = use_app_context(); let table_state: UseStateHandle> = use_state(|| None); { let table_state = table_state.clone(); let ctx = ctx.clone(); ctx.spawn_async(async move { info!("Getting table state"); Err(anyhow::anyhow!("Not implemented yet")) }); } let leave_table = { let ctx = ctx.clone(); Callback::from(move |_| { ctx.leave_table(); }) }; html! { <>

{ format!("This is table {}", props.table.id) }

} } #[derive(PartialEq, Properties, Clone)] pub struct TableProps { pub table: protocol::Table, }