diff --git a/deja_vu/src/components/title.rs b/deja_vu/src/components/title.rs index 01799ec..9d89163 100644 --- a/deja_vu/src/components/title.rs +++ b/deja_vu/src/components/title.rs @@ -21,17 +21,25 @@ use ratatui::{ use tokio::sync::mpsc::UnboundedSender; use super::Component; -use crate::{action::Action, config::Config}; +use crate::{action::Action, cli, config::Config}; #[derive(Default)] pub struct Title { command_tx: Option>, config: Config, + title_text: String, } impl Title { - pub fn new() -> Self { - Self::default() + pub fn new(cli_cmd: cli::Command) -> Self { + let title_text = match cli_cmd { + cli::Command::Clone => String::from("Deja-Vu: Clone"), + cli::Command::Diagnose => String::from("Deja-Vu: Diagnostics"), + }; + Self { + title_text, + ..Default::default() + } } } @@ -55,7 +63,7 @@ impl Component for Title { fn draw(&mut self, frame: &mut Frame, area: Rect) -> Result<()> { // Title Block - let title_text = Span::styled("WizardKit: Deja-Vu", Style::default().fg(Color::LightCyan)); + let title_text = Span::styled(&self.title_text, Style::default().fg(Color::LightCyan)); let title = Paragraph::new(Line::from(title_text).centered()) .block(Block::default().borders(Borders::ALL)); frame.render_widget(title, area);