defmodule LivebookWeb.HomeLive.CloseSessionComponent do use LivebookWeb, :live_component @impl true def render(assigns) do ~H"""

Close session

Are you sure you want to close this section - “<%= @session.notebook_name %>”?
<%= if @session.file, do: "This won't delete any persisted files.", else: "The notebook is not persisted and all content will be lost." %>

<%= live_patch "Cancel", to: @return_to, class: "button button-outlined-gray" %>
""" end @impl true def handle_event("close", %{}, socket) do Livebook.Session.close(socket.assigns.session.pid) {:noreply, push_patch(socket, to: socket.assigns.return_to)} end end