feat: show hint if no logs
This commit is contained in:
parent
cad140b752
commit
c704dd1a47
@ -459,13 +459,20 @@ impl Widget for &mut App {
|
|||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let table = Table::new(items, [Constraint::Min(200), Constraint::Min(20)])
|
let empty = items.is_empty();
|
||||||
|
|
||||||
|
let mut table = Table::new(items, [Constraint::Min(200), Constraint::Min(20)])
|
||||||
.block(block)
|
.block(block)
|
||||||
.header(header)
|
.header(header)
|
||||||
.highlight_symbol("> ")
|
.highlight_symbol("> ")
|
||||||
.row_highlight_style(highlight_style)
|
.row_highlight_style(highlight_style)
|
||||||
.highlight_spacing(HighlightSpacing::Always);
|
.highlight_spacing(HighlightSpacing::Always);
|
||||||
|
|
||||||
|
if empty {
|
||||||
|
table = table.footer(
|
||||||
|
Row::new(vec!["Nothing here yet"]).style(Style::default().fg(COLOR_SECONDARY)),
|
||||||
|
);
|
||||||
|
}
|
||||||
StatefulWidget::render(table, area, buf, &mut self.state);
|
StatefulWidget::render(table, area, buf, &mut self.state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user