After thinking on this a bit, I ended up with something that I think works, but I’m open to other ideas!
def flop_table_and_pagination(assigns) do
~H"""
<div class="flex flex-col items-center gap-4">
{render_slot(@inner_block)}
<.pagination meta={@meta} path={@path} />
</div>
"""
end
def flop_table_opts(pointer_on_hover? \\ true) do
[
table_attrs: [class: "table table-zebra w-full"],
tbody_tr_attrs: [
class:
Enum.join(["hover:bg-base-content/10 ", pointer_on_hover? && "hover:cursor-pointer"])
]
]
end
Then usage is something like
<.flop_table_and_pagination meta={meta} path={~p"/foo"}>
<Flop.Phoenix.table opts={flop_table_opts()} ...>
<:col let={foo} label="Bar" field={:bar}>{foo.bar}</:col>
...
</Flop.Phoenix.table>
</.flop_table_and_pagination>






















