defmodule LivebookWeb.HomeLive do
use LivebookWeb, :live_view
alias Livebook.{SessionSupervisor, Session, LiveMarkdown, Notebook}
@impl true
def mount(_params, _session, socket) do
if connected?(socket) do
Phoenix.PubSub.subscribe(Livebook.PubSub, "sessions")
end
session_summaries = sort_session_summaries(SessionSupervisor.get_session_summaries())
{:ok, assign(socket, path: default_path(), session_summaries: session_summaries)}
end
@impl true
def render(assigns) do
~L"""
<%= live_patch to: Routes.home_path(@socket, :import, "url"),
class: "button button-outlined-gray whitespace-nowrap" do %>
Import
<% end %>