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

<%= @section.name %>

<%# ^ Note it's important there's no space between

and

because we want the content to exactly match @section.name. %>
<%= for {cell, index} <- Enum.with_index(@section.cells) do %> <%= live_component @socket, LivebookWeb.InsertButtonsComponent, id: "#{@section.id}:#{index}", persistent: false, section_id: @section.id, insert_cell_index: index, insert_section_index: nil %> <%= live_component @socket, LivebookWeb.CellComponent, id: cell.id, session_id: @session_id, cell: cell, cell_info: @cell_infos[cell.id] %> <% end %> <%= live_component @socket, LivebookWeb.InsertButtonsComponent, id: "#{@section.id}:last", persistent: @section.cells == [], section_id: @section.id, insert_cell_index: length(@section.cells), insert_section_index: @index + 1 %>
""" end end