use ratatui::style::{Color, Modifier, Style};
use crate::theme::palette;
const SEND_BG: Color = Color::Indexed(30);
const SENT_BG: Color = Color::Indexed(22);
const BLOCKED_BG: Color = Color::Indexed(58);
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) enum SendState {
Ready,
Sent,
Blocked(String),
}
pub(crate) fn style(state: &SendState, count: usize) -> Style {
match state {
SendState::Ready if count == 0 => {
Style::new().fg(palette().idle_fg).bg(palette().toolbar_bg).add_modifier(Modifier::DIM)
}
SendState::Ready => Style::new().fg(Color::Black).bg(SEND_BG).bold(),
SendState::Sent => Style::new().fg(Color::Black).bg(SENT_BG).bold(),
SendState::Blocked(_) => Style::new().fg(Color::Black).bg(BLOCKED_BG).bold(),
}
}