//! Cockpit trait -- interface that every TUI view must implement.

use ratatui::Frame;
use ratatui::layout::Rect;

use super::state::AppState;

/// A single TUI view that can render itself into a terminal frame region.
pub trait Cockpit {
    /// Human-readable name shown in the tab bar.
    fn name(&self) -> &str;

    /// Draw this cockpit into `area` using the current `state`.
    fn render(&self, frame: &mut Frame, area: Rect, state: &AppState);
}
