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

Import notebook

<%= live_patch to: Routes.home_path(@socket, :import, "url"), class: "tab #{if(@tab == "url", do: "active")}" do %> <%= remix_icon("download-cloud-2-line", class: "align-middle") %> From URL <% end %> <%= live_patch to: Routes.home_path(@socket, :import, "content"), class: "tab #{if(@tab == "content", do: "active")}" do %> <%= remix_icon("clipboard-line", class: "align-middle") %> From clipboard <% end %>
<%= case @tab do %> <% "url" -> %> <%= live_component @socket, LivebookWeb.HomeLive.ImportUrlComponent, id: "import_url" %> <% "content" -> %> <%= live_component @socket, LivebookWeb.HomeLive.ImportContentComponent, id: "import_content" %> <% end %>
""" end end