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. %>
<%= live_component @socket, LivebookWeb.InsertCellComponent, id: "#{@section.id}:0", section_id: @section.id, index: 0, persistent: @section.cells == [] %> <%= for {cell, index} <- Enum.with_index(@section.cells) do %> <%= live_component @socket, LivebookWeb.CellComponent, id: cell.id, session_id: @session_id, cell: cell, cell_info: @cell_infos[cell.id] %> <%= live_component @socket, LivebookWeb.InsertCellComponent, id: "#{@section.id}:#{index + 1}", section_id: @section.id, index: index + 1, persistent: false %> <% end %>
""" end end