defmodule LivebookWeb.SessionLive.SectionComponent do use LivebookWeb, :live_component def render(assigns) do ~H"""

<%= @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 %>
<% end %> <%= unless @section_view.has_children? do %> <%= live_patch to: Routes.session_path(@socket, :delete_section, @session_id, @section_view.id), class: "icon-button" do %> <.remix_icon icon="delete-bin-6-line" class="text-xl" /> <% end %> <% end %>
<%= if @section_view.parent do %>

<.remix_icon icon="git-branch-line" class="text-lg font-normal flip-horizontally leading-none" /> from ”<%= @section_view.parent.name %>”

<% end %>
<%= for {cell_view, index} <- Enum.with_index(@section_view.cell_views) do %> <%= live_component LivebookWeb.SessionLive.InsertButtonsComponent, id: "#{@section_view.id}:#{index}", persistent: false, section_id: @section_view.id, insert_cell_index: index %> <%= live_component LivebookWeb.SessionLive.CellComponent, id: cell_view.id, session_id: @session_id, cell_view: cell_view %> <% end %> <%= live_component 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) %>
""" end end