Fully added filtering and searching!
This commit is contained in:
+2
-4
@@ -201,18 +201,16 @@ pub struct TableProps<'a, T> {
|
||||
pub constraints: Vec<Constraint>,
|
||||
}
|
||||
|
||||
fn draw_table<'a, B, T, F, S>(
|
||||
fn draw_table<'a, B, T, F>(
|
||||
f: &mut Frame<'_, B>,
|
||||
content_area: Rect,
|
||||
block: Block,
|
||||
table_props: TableProps<'a, T>,
|
||||
row_mapper: F,
|
||||
filter_fn: S,
|
||||
is_loading: bool,
|
||||
) where
|
||||
B: Backend,
|
||||
F: Fn(&T) -> Row<'a>,
|
||||
S: FnMut(&&T) -> bool,
|
||||
{
|
||||
let TableProps {
|
||||
content,
|
||||
@@ -221,7 +219,7 @@ fn draw_table<'a, B, T, F, S>(
|
||||
} = table_props;
|
||||
|
||||
if !content.items.is_empty() {
|
||||
let rows = content.items.iter().filter(filter_fn).map(row_mapper);
|
||||
let rows = content.items.iter().map(row_mapper);
|
||||
|
||||
let headers = Row::new(table_headers)
|
||||
.style(style_default_bold())
|
||||
|
||||
Reference in New Issue
Block a user