//! Status bar widget.

use ratatui::{prelude::*, widgets::Paragraph};

use crate::daemon::tui::app::{App, InputMode};

pub fn render(f: &mut Frame, area: Rect, app: &App) {
    let keybindings = match app.input_mode {
        InputMode::Normal => {
            "↑↓:Navigate  Enter:View  e:Edit  d:Delete  Tab:Preview  /:Search  q:Quit"
        }
        InputMode::Search => "Type to search  Enter:Select  Esc:Cancel",
        InputMode::Confirm => "y:Confirm  n:Cancel",
    };

    let status = Paragraph::new(keybindings).style(Style::default().bg(Color::DarkGray));

    f.render_widget(status, area);
}
