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

<%= @section_view.name %>

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

<%= pluralize(length(@section_view.cell_views), "cell", "cells") %> collapsed

<.live_component module={LivebookWeb.SessionLive.InsertButtonsComponent} id={"insert-buttons-#{@section_view.id}-first"} persistent={@section_view.cell_views == []} smart_cell_definitions={@smart_cell_definitions} code_block_definitions={@code_block_definitions} runtime={@runtime} section_id={@section_view.id} cell_id={nil} session_id={@session_id} /> <%= for {cell_view, index} <- Enum.with_index(@section_view.cell_views) do %> <.live_component module={LivebookWeb.SessionLive.CellComponent} id={cell_view.id} session_id={@session_id} session_pid={@session_pid} client_id={@client_id} runtime={@runtime} installing?={@installing?} allowed_uri_schemes={@allowed_uri_schemes} cell_view={cell_view} /> <.live_component module={LivebookWeb.SessionLive.InsertButtonsComponent} id={"insert-buttons-#{@section_view.id}-#{index}"} persistent={false} smart_cell_definitions={@smart_cell_definitions} code_block_definitions={@code_block_definitions} runtime={@runtime} section_id={@section_view.id} cell_id={cell_view.id} session_id={@session_id} /> <% end %>
""" end end