Skip to content

Commit

Permalink
Show item count
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoos committed Nov 23, 2024
1 parent 88f6d52 commit 26a6b61
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin/ui_filters.ml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ let genre_formula =
{ name = "genre-formula"; default = None; label = [] })
.field

let item_count =
Lwd.map (Lwd.get view) ~f:(fun { View.item_count; _ } -> item_count)

let search_and_sort =
let f_search =
let open Field_textinput in
Expand Down Expand Up @@ -199,7 +202,11 @@ let search_and_sort =
{ name = "view-order"; default = "desc"; label = [] }
options
in
[ `R f_sort.field; `R f_order.field; `R f_search.field ]
let item_count =
Lwd.map item_count ~f:(fun i -> El.txt' @@ Printf.sprintf "%i results" i)
|> fun txt -> Elwd.div [ `R txt ]
in
[ `R f_sort.field; `R f_order.field; `R f_search.field; `R item_count ]

let library_chooser =
let at = Attrs.O.(v (`P (C "vertical-picker"))) in
Expand Down

0 comments on commit 26a6b61

Please sign in to comment.