use crate::state::UiShared;
pub enum HostKind {
Ops,
Contracts,
Kline { symbol: String },
}
pub struct State {
pub kind: HostKind,
}
impl State {
#[must_use]
pub fn new(kind: HostKind) -> Self {
Self { kind }
}
}
pub fn render(ui: &mut egui::Ui, st: &mut State, shared: &UiShared) {
match &st.kind {
HostKind::Ops => crate::render::render_ops_window(ui, shared),
HostKind::Contracts => crate::render::render_contracts_window(ui, shared),
HostKind::Kline { symbol } => {
let sym = symbol.clone();
if crate::render::render_kline_body(ui, shared, &sym) {
shared.close_kline(&sym);
}
}
}
}