34 lines
915 B
Rust
34 lines
915 B
Rust
use crate::app::App;
|
|
use ratatui::{
|
|
layout::{Alignment, Constraint, Direction, Layout},
|
|
style::{Color, Modifier, Style},
|
|
widgets::{Block, Borders, Paragraph},
|
|
Frame,
|
|
};
|
|
|
|
pub fn render(f: &mut Frame, app: &App) {
|
|
let area = f.area();
|
|
|
|
let chunks = Layout::default()
|
|
.direction(Direction::Vertical)
|
|
.constraints([
|
|
Constraint::Percentage(40),
|
|
Constraint::Length(5),
|
|
Constraint::Percentage(40),
|
|
])
|
|
.split(area);
|
|
|
|
let message = app.status_message.as_deref().unwrap_or("Загрузка...");
|
|
|
|
let loading = Paragraph::new(message)
|
|
.style(
|
|
Style::default()
|
|
.fg(Color::Cyan)
|
|
.add_modifier(Modifier::BOLD),
|
|
)
|
|
.alignment(Alignment::Center)
|
|
.block(Block::default().borders(Borders::ALL).title(" TTUI "));
|
|
|
|
f.render_widget(loading, chunks[1]);
|
|
}
|