dyna3/app-proto/src/main.rs
2024-11-18 11:49:45 -08:00

44 lines
No EOL
849 B
Rust

mod add_remove;
mod assembly;
mod display;
mod engine;
mod outline;
use rustc_hash::FxHashSet;
use sycamore::prelude::*;
use add_remove::AddRemove;
use assembly::{Assembly, ElementKey};
use display::Display;
use outline::Outline;
#[derive(Clone)]
struct AppState {
assembly: Assembly,
assembly_serial: Signal<u32>,
selection: Signal<FxHashSet<ElementKey>>
}
impl AppState {
fn new() -> AppState {
AppState {
assembly: Assembly::new(),
assembly_serial: create_signal(0),
selection: create_signal(FxHashSet::default())
}
}
}
fn main() {
sycamore::render(|| {
provide_context(AppState::new());
view! {
div(id="sidebar") {
AddRemove {}
Outline {}
}
Display {}
}
});
}