pub mod shell;
pub mod context;
pub mod explanation;
pub mod help;
pub mod lesson;
pub mod lesson_menu;
pub mod onboarding;
pub mod settings;
pub mod achievements;
pub mod progress;
pub mod challenges;
pub mod notification;
use ratatui::{layout::Rect, Frame};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PanelId {
Shell,
Output,
Context,
Explanation,
}
impl PanelId {
pub fn next(self) -> Self {
match self {
Self::Shell => Self::Output,
Self::Output => Self::Context,
Self::Context => Self::Explanation,
Self::Explanation => Self::Shell,
}
}
pub fn previous(self) -> Self {
match self {
Self::Shell => Self::Explanation,
Self::Output => Self::Shell,
Self::Context => Self::Output,
Self::Explanation => Self::Context,
}
}
pub fn title(self) -> &'static str {
match self {
Self::Shell => "Shell",
Self::Output => "Output",
Self::Context => "Context",
Self::Explanation => "Learning",
}
}
}
pub trait Panel {
fn render(&self, frame: &mut Frame, area: Rect, focused: bool);
fn handle_input(&mut self, key: crossterm::event::KeyEvent) -> bool;
}