use ratatui::{
    DefaultTerminal, buffer::Buffer, crossterm::event::{self, Event, KeyCode, KeyEventKind, KeyModifiers}, layout::{Constraint, Layout, Rect}, macros::horizontal, style::{Color, Stylize, palette::tailwind}, text::{Line, Text}, widgets::{Block, List, ListDirection, ListItem, Padding, Paragraph, Tabs, Widget}
};
use strum::{Display, EnumIter, FromRepr, IntoEnumIterator};

#[derive(Default)]
pub struct Manga {
    selected_tab: MangaTab
}

#[derive(Default, Clone, Copy, Display, FromRepr, EnumIter)]
pub enum MangaTab {
    #[default]
    #[strum(to_string = "Latest")]
    Tab1,
    #[strum(to_string = "Top")]
    Tab2,
    #[strum(to_string = "Search")]
    Tab3
}

impl MangaTab {
    pub fn title(self) -> Line<'static> {
        format!("  {self}  ")
            .fg(tailwind::SLATE.c200)
            // .bg(self.palette().c900)
            .into()
    }
}