<%= @section_view.name %>
<%# ^ Note it's important there's no space between
and
because we want the content to exactly match section name. %>
<.remix_icon icon="link" class="text-xl" />
<%= if @section_view.valid_parents != [] and not @section_view.has_children? do %>
<.menu id={"section-#{@section_view.id}-branch-menu"}>
<:toggle>
<:content>
<%= for parent <- @section_view.valid_parents do %>
<%= if @section_view.parent && @section_view.parent.id == parent.id do %>
<% else %>
<% end %>
<% end %>
<% end %>
<%= live_patch to: Routes.session_path(@socket, :delete_section, @session_id, @section_view.id),
class: "icon-button #{if @section_view.has_children?, do: "disabled"}",
aria_label: "delete section" do %>
<.remix_icon icon="delete-bin-6-line" class="text-xl" />
<% end %>
<%= for {cell_view, index} <- Enum.with_index(@section_view.cell_views) do %>
<.live_component module={LivebookWeb.SessionLive.InsertButtonsComponent}
id={"#{@section_view.id}:#{index}"}
persistent={false}
section_id={@section_view.id}
insert_cell_index={index} />
<.live_component module={LivebookWeb.SessionLive.CellComponent}
id={cell_view.id}
session_id={@session_id}
runtime={@runtime}
cell_view={cell_view} />
<% end %>
<.live_component module={LivebookWeb.SessionLive.InsertButtonsComponent}
id={"#{@section_view.id}:last"}
persistent={@section_view.cell_views == []}
section_id={@section_view.id}
insert_cell_index={length(@section_view.cell_views)} />