//! Application mode state.
//!
//! Brittle has three modes:
//! - **Normal** — keyboard shortcuts are active; the default state.
//! - **Command** — the `:` prompt is open; user types a command.
//! - **Search** — the `/` prompt is open; user types a search/filter query.

use leptos::prelude::*;

/// The current input mode of the application.
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum AppMode {
    Normal,
    Command,
    Search,
}

/// Create the application mode signal.
///
/// Returns the [`RwSignal`] which should be passed to components that need it.
/// Call once from the root component.
pub fn provide_mode() -> RwSignal<AppMode> {
    RwSignal::new(AppMode::Normal)
}
