use super::messages::RenderInputMsg;
use gtk::prelude::*;
use super::monitor::MonitorModel;
use relm4::*;
pub struct RenderPanelModel {
    monitor: Controller<MonitorModel>,
}

#[relm4::component(pub)]
impl SimpleComponent for RenderPanelModel {
    type Init = ();
    type Output = ();
    type Input = ();

    view! {
        gtk::Box{
            set_orientation: gtk::Orientation::Horizontal,
            set_hexpand:true,
            set_vexpand:true,
            model.monitor.widget(),
        }
    }

    fn init(
        init: Self::Init,
        root: &Self::Root,
        sender: relm4::ComponentSender<Self>,
    ) -> relm4::ComponentParts<Self> {
        let monitor: Controller<MonitorModel> = MonitorModel::builder()
            .launch(())
            .forward(sender.input_sender(), |msg| {});

        let model = RenderPanelModel { monitor };
        let widgets = view_output!();
        ComponentParts { model, widgets }
    }

    fn update(&mut self, msg: Self::Input, _sender: ComponentSender<Self>) {}
}
