31 lines
934 B
Rust
31 lines
934 B
Rust
// src/client/components/status_line.rs
|
|
use ratatui::{
|
|
widgets::{Paragraph, Block},
|
|
style::Style,
|
|
layout::{Rect, Alignment},
|
|
text::{Line, Span},
|
|
Frame,
|
|
};
|
|
use crate::client::colors::Theme;
|
|
|
|
pub fn render_status_line(f: &mut Frame, area: Rect, current_dir: &str, theme: &Theme) {
|
|
// Program name and version
|
|
let program_info = format!("multieko2 v{}", env!("CARGO_PKG_VERSION"));
|
|
|
|
// Create the status line text
|
|
let status_line = Line::from(vec![
|
|
Span::styled(current_dir, Style::default().fg(theme.fg)),
|
|
Span::styled(
|
|
program_info,
|
|
Style::default().fg(theme.accent).add_modifier(ratatui::style::Modifier::BOLD),
|
|
),
|
|
]);
|
|
|
|
// Render the status line
|
|
let paragraph = Paragraph::new(status_line)
|
|
.block(Block::default().style(Style::default().bg(theme.bg)))
|
|
.alignment(Alignment::Left);
|
|
|
|
f.render_widget(paragraph, area);
|
|
}
|