| 1 | use ratatui::{ |
| 2 | Frame, |
| 3 | layout::{Alignment, Rect}, |
| 4 | style::Style, |
| 5 | widgets::Paragraph, |
| 6 | }; |
| 7 | |
| 8 | use crate::app::{Focus, Popups, Tabs}; |
| 9 | |
| 10 | pub fn draw(f: &mut Frame, area: Rect, focus: Focus) { |
| 11 | let help_msg = match focus { |
| 12 | Focus::Tab(tab) => match tab { |
| 13 | Tabs::KnownNetworks => { |
| 14 | "k, Up | j, Down | or ↵ Dis/connect | d Forget | t Autoconnect | r Scan | ⇄ Nav" |
| 15 | } |
| 16 | |
| 17 | Tabs::AvailableNetworks => "k, Up | j, Down | or ↵ Connect | r Scan | ⇄ Nav", |
| 18 | |
| 19 | Tabs::Devices => "r Scan | o Toggle Power | a Toggle Airplane | ⇄ Nav", |
| 20 | }, |
| 21 | Focus::Popup(popup) => match popup { |
| 22 | Popups::Password => "↵ Apply | ⇄ Hide/Show password | Discard", |
| 23 | }, |
| 24 | }; |
| 25 | |
| 26 | f.render_widget( |
| 27 | Paragraph::new(help_msg) |
| 28 | .alignment(Alignment::Center) |
| 29 | .style(Style::new().blue()), |
| 30 | area, |
| 31 | ); |
| 32 | } |
