//! `fxt watch` -- TUI cockpit dashboard.

use anyhow::Result;
use clap::Parser;

/// Launch the full-screen TUI cockpit dashboard.
///
/// Displays six purpose-built views: Overview, Training, Trading,
/// Services, Risk, and Data.  Navigate with keys 1-6, quit with q.
#[derive(Parser, Debug)]
pub struct WatchCommand {
    /// API Gateway endpoint (used for future gRPC streaming).
    #[arg(
        long = "api-url",
        env = "FXT_API_URL",
        default_value = "https://api.fxhnt.ai"
    )]
    api_url: String,
}

impl WatchCommand {
    /// Launch the full-screen TUI dashboard.
    ///
    /// This command does not need a gRPC client at construction time --
    /// the TUI event loop manages its own connections.
    pub async fn execute(&self) -> Result<()> {
        crate::tui::event_loop::run(&self.api_url).await
    }
}
