defmodule LivebookWeb.SessionLive.SessionsComponent do use LivebookWeb, :live_component @impl true def render(assigns) do ~L"""
<%= for summary <- @session_summaries do %>
<%= live_redirect summary.notebook_name, to: Routes.session_path(@socket, :page, summary.session_id), class: "font-semibold text-gray-800 hover:text-gray-900" %>
<%= summary.path || "No file" %>
<%= link to: Routes.live_dashboard_path(@socket, :page, node(), "processes", info: Phoenix.LiveDashboard.Helpers.encode_pid(summary.pid)), class: "flex space-x-3 px-5 py-2 items-center text-gray-600 hover:bg-gray-50", target: "_blank" do %> <%= remix_icon("dashboard-2-line") %> See on Dashboard <% end %> <%= live_patch to: Routes.home_path(@socket, :close_session, summary.session_id), class: "flex space-x-3 px-5 py-2 items-center text-red-600 hover:bg-gray-50" do %> <%= remix_icon("close-circle-line") %> Close <% end %>
<% end %>
""" end end