Summary
Hey!
It looks like the empty state of the Flop.Phoenix.table component does not work when working with Phoenix.LiveView.LiveStream as a list of items.
The empty state is rendered if @items == [] (see flop_phoenix.ex), but if we pass a stream, the items assign is never an empty list, but always a Phoenix.LiveView.LiveStream struct.
Steps to reproduce
- Create a
Phoenix.LiveView.LiveStream with no items
{:ok, {items, meta}} = MyApp.list(%{})
socket
|> stream(:items, [], reset: true)
|> assign(:meta, meta)
- Pass the stream to the
table/1 component.
<Flop.Phoenix.table items={@streams.items} meta={@meta} path={~p"/"}>
...
</Flop.Phoenix.table>
- See empty state does not work.
Expected behaviour
The empty state of table/1 component should work with Phoenix.LiveView.LiveStream
Actual behaviour
The empty state of table/1 component is not displayed if working with Phoenix.LiveView.LiveStream.
Elixir/Erlang version
Elixir 1.18.3 (compiled with Erlang/OTP 25)
Flop and Ecto versions
- ecto 3.12.5 (Hex package) (mix)
- ecto_sql 3.12.1 (Hex package) (mix)
locked at 3.12.1 (ecto_sql) aff5b958
- flop 0.26.1 (Hex package) (mix)
locked at 0.26.1 (flop) 5fcab8a1
- flop_phoenix 0.24.1 (Hex package) (mix)
locked at 0.24.1 (flop_phoenix) 543c8eb7
Additional context
No response
Summary
Hey!
It looks like the empty state of the
Flop.Phoenix.tablecomponent does not work when working withPhoenix.LiveView.LiveStreamas a list of items.The empty state is rendered if
@items == [](see flop_phoenix.ex), but if we pass a stream, theitemsassign is never an empty list, but always aPhoenix.LiveView.LiveStreamstruct.Steps to reproduce
Phoenix.LiveView.LiveStreamwith no itemstable/1component.Expected behaviour
The empty state of
table/1component should work withPhoenix.LiveView.LiveStreamActual behaviour
The empty state of
table/1component is not displayed if working withPhoenix.LiveView.LiveStream.Elixir/Erlang version
Elixir 1.18.3 (compiled with Erlang/OTP 25)
Flop and Ecto versions
locked at 3.12.1 (ecto_sql) aff5b958
locked at 0.26.1 (flop) 5fcab8a1
locked at 0.24.1 (flop_phoenix) 543c8eb7
Additional context
No response