command line warnings

This commit is contained in:
filipriec
2025-02-16 23:46:06 +01:00
parent b09e868c10
commit 03d1c4fff6
3 changed files with 25 additions and 15 deletions

View File

@@ -7,19 +7,27 @@ use ratatui::{
};
use crate::client::colors::Theme;
pub fn render_command_line(f: &mut Frame, area: Rect, input: &str, active: bool, theme: &Theme) {
pub fn render_command_line(f: &mut Frame, area: Rect, input: &str, active: bool, theme: &Theme, message: &str) {
let prompt = if active {
":"
} else {
""
};
// Combine the prompt, input, and message
let display_text = if message.is_empty() {
format!("{}{}", prompt, input)
} else {
format!("{}{} | {}", prompt, input, message)
};
let style = if active {
Style::default().fg(theme.accent)
} else {
Style::default().fg(theme.fg)
};
let paragraph = Paragraph::new(format!("{}{}", prompt, input))
let paragraph = Paragraph::new(display_text)
.block(Block::default().style(Style::default().bg(theme.bg)))
.style(style);