worldwideportal/src/main.rs
2024-07-21 17:01:56 +10:00

31 lines
861 B
Rust

use std::rc::Rc;
use yew::prelude::*;
pub mod term_view;
use crate::term_view::*;
#[function_component(App)]
fn app() -> Html {
let frames_handle: UseStateHandle<Rc<RegisteredTermFrames>> =
use_state(|| RegisteredTermFrames::new().into());
let frames = RegisteredTermFrameLens {
get: (*frames_handle).clone(),
set: Callback::from(move |s| frames_handle.set(s)),
};
html! {
<div class="vpane toplevel">
<TermView terminal={TermFrame(0)} frames={frames.clone()}/>
<TermView terminal={TermFrame(1)} frames={frames.clone()}/>
<div class="hpane">
<TermView terminal={TermFrame(2)} frames={frames.clone()}/>
<TermView terminal={TermFrame(3)} {frames}/>
</div>
</div>
}
}
fn main() {
yew::Renderer::<App>::new().render();
}