command line warnings
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user