|
4 | 4 | use ratatui::Frame; |
5 | 5 | use ratatui::layout::{Constraint, Rect}; |
6 | 6 | use ratatui::text::{Line, Span}; |
7 | | -use ratatui::widgets::{Block, Borders, Cell, Padding, Paragraph, Row, Table}; |
| 7 | +use ratatui::widgets::{Block, Borders, Cell, Padding, Row, Table}; |
8 | 8 |
|
9 | 9 | use crate::app::App; |
10 | 10 |
|
@@ -83,14 +83,7 @@ pub fn draw(frame: &mut Frame<'_>, app: &App, area: Rect, focused: bool) { |
83 | 83 | frame.render_widget(table, area); |
84 | 84 |
|
85 | 85 | if app.provider_count == 0 { |
86 | | - let inner = Rect { |
87 | | - x: area.x + 2, |
88 | | - y: area.y + 2, |
89 | | - width: area.width.saturating_sub(4), |
90 | | - height: area.height.saturating_sub(3), |
91 | | - }; |
92 | | - let msg = Paragraph::new(Span::styled(" No providers. Press [c] to create.", t.muted)); |
93 | | - frame.render_widget(msg, inner); |
| 86 | + super::draw_empty_message(frame, area, " No providers. Press [c] to create.", t.muted); |
94 | 87 | } |
95 | 88 | } |
96 | 89 |
|
@@ -172,13 +165,6 @@ fn draw_v2(frame: &mut Frame<'_>, app: &App, area: Rect, focused: bool) { |
172 | 165 | frame.render_widget(table, area); |
173 | 166 |
|
174 | 167 | if app.provider_count == 0 { |
175 | | - let inner = Rect { |
176 | | - x: area.x + 2, |
177 | | - y: area.y + 2, |
178 | | - width: area.width.saturating_sub(4), |
179 | | - height: area.height.saturating_sub(3), |
180 | | - }; |
181 | | - let msg = Paragraph::new(Span::styled(" No providers found.", t.muted)); |
182 | | - frame.render_widget(msg, inner); |
| 168 | + super::draw_empty_message(frame, area, " No providers found.", t.muted); |
183 | 169 | } |
184 | 170 | } |
0 commit comments