use iced::{Length, alignment::Horizontal, widget::Column};

#[allow(unused_imports)]
use crate::ui::main_window::{MainWindowMsg, TabContent};

#[derive(Default)]
pub struct HomePage {}
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub enum HomePageMsg {
    #[default]
    Nothing,
}

impl TabContent for HomePage {
    fn content(&self) -> iced::Element<'_, MainWindowMsg> {
        let btn = iced::widget::button("HomePage")
            .on_press(MainWindowMsg::HomePage(HomePageMsg::Nothing));

        Column::new()
            .align_x(Horizontal::Left)
            .width(Length::Fill)
            .height(Length::Fill)
            .push(btn)
            .into()
    }

    type TabMessage = HomePageMsg;

    fn update(&self, msg: Self::TabMessage) {
        match msg {
            HomePageMsg::Nothing => {
                println!("This way ok.");
            }
        }
    }
}
