use adw::prelude::WidgetExt;
use gtk::prelude::{BoxExt, ButtonExt, GtkWindowExt, OrientableExt, ToggleButtonExt};
use relm4::*;

pub struct ControlPanelModel;

#[derive(Debug)]
pub enum HeaderOutput {
    View,
    Edit,
    Export,
}

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

    view! {
        #[root]
        gtk::Box {
            set_orientation: gtk::Orientation::Horizontal,
            set_spacing: 10,
            set_size_request: (100, 150),
            gtk::Button {
                set_label: "View",
            },
            gtk::Button {
                set_label: "Edit",
            },
            gtk::Button {
                set_label: "Export",
            },
        }
    }

    fn init(
        init: Self::Init,
        root: &Self::Root,
        sender: relm4::ComponentSender<Self>,
    ) -> relm4::ComponentParts<Self> {
        let model = ControlPanelModel {};
        // Insert the macro code generation here
        let widgets = view_output!();

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