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

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