use ratatui::layout::{Constraint, Direction, Layout, Rect}; pub fn render_popup(percent_x: u16, percent_y: u16, r: Rect) -> Rect { let popup_layput = Layout::default() .direction(Direction::Vertical) .constraints([ Constraint::Percentage((100 - percent_y) / 2), Constraint::Percentage(percent_y), Constraint::Percentage((100 - percent_y) / 2), ]) .split(r); Layout::default() .direction(Direction::Horizontal) .constraints([ Constraint::Percentage((100 - percent_y) / 2), Constraint::Percentage(percent_y), Constraint::Percentage((100 - percent_y) / 2), ]) .split(popup_layput[1])[1] }