File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,24 +48,22 @@ defmodule PetalComponents.Table do
4848
4949 ~H"""
5050 < table class = { [ "pc-table--#{ @ variant } " , @ class ] } { @ rest } >
51- <%= if length ( @ col ) > 0 do %>
51+ <%= if @ col != [ ] do %>
5252 < thead >
5353 < . tr >
5454 < . th :for = { col <- @ col } class = { col [ :class ] } > { col [ :label ] } </ . th >
5555 </ . tr >
5656 </ thead >
5757 < tbody id = { @ id } phx-update = { match? ( % Phoenix.LiveView.LiveStream { } , @ rows ) && "stream" } >
58- <%= if length ( @ empty_state ) > 0 do %>
59- < . tr id = { @ id <> "-empty" } class = "hidden only:table-row " >
60- < . td
61- :for = { empty_state <- @ empty_state }
62- colspan = { length ( @ col ) }
63- class = { empty_state [ :row_class ] }
64- >
65- { render_slot ( empty_state ) }
66- </ . td >
67- </ . tr >
68- <% end %>
58+ < . tr :if = { @ empty_state != [ ] } id = { @ id <> "-empty" } class = "hidden only:table-row " >
59+ < . td
60+ :for = { empty_state <- @ empty_state }
61+ colspan = { length ( @ col ) }
62+ class = { empty_state [ :row_class ] }
63+ >
64+ { render_slot ( empty_state ) }
65+ </ . td >
66+ </ . tr >
6967 < . tr
7068 :for = { row <- @ rows }
7169 id = { @ row_id && @ row_id . ( row ) }
You can’t perform that action at this time.
0 commit comments