(text: &str, width: usize)
| 41 | } |
| 42 | |
| 43 | pub fn center_text(text: &str, width: usize) -> String { |
| 44 | let text_width = text.width(); |
| 45 | if text_width >= width { |
| 46 | return text.to_string(); |
| 47 | } |
| 48 | let left_pad = (width - text_width) / 2; |
| 49 | format!("{}{}", " ".repeat(left_pad), text) |
| 50 | } |
| 51 | |
| 52 | pub fn highlight_text<'a>(text: &'a str, color: ratatui::style::Color) -> Span<'a> { |
| 53 | Span::styled(text, ratatui::style::Style::default().fg(color)) |
nothing calls this directly
no outgoing calls
no test coverage detected