Alingment
This commit is contained in:
parent
2819df185e
commit
3a87c7a011
9 changed files with 325 additions and 78 deletions
27
src/ui/components/footer.rs
Normal file
27
src/ui/components/footer.rs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
use ratatui::{
|
||||
Frame,
|
||||
layout::{Alignment, Rect},
|
||||
style::{Color, Modifier, Style},
|
||||
text::Span,
|
||||
widgets::{Block, Borders, Paragraph},
|
||||
};
|
||||
|
||||
use chrono::Local;
|
||||
|
||||
pub fn render_footer(frame: &mut Frame, area: Rect) {
|
||||
let now = Local::now();
|
||||
let datatime_str = now.format("%Y-%m-%d %H:%M:%S").to_string();
|
||||
|
||||
let footer = Paragraph::new(Span::styled(
|
||||
datatime_str,
|
||||
Style::default().fg(Color::Gray).add_modifier(Modifier::DIM),
|
||||
))
|
||||
.block(
|
||||
Block::default()
|
||||
.borders(Borders::TOP)
|
||||
.border_style(Style::default().fg(Color::Blue)),
|
||||
)
|
||||
.alignment(Alignment::Center);
|
||||
|
||||
frame.render_widget(footer, area);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue