defmodule LivebookWeb.SettingsLive.FileSystemsComponent do use LivebookWeb, :live_component alias Livebook.FileSystem @impl true def render(assigns) do ~H"""
<%= for {file_system_id, file_system} <- @file_systems do %>
<.file_system_info file_system={file_system} />
<%= unless is_struct(file_system, FileSystem.Local) do %> <% end %>
<%= unless @default_file_system_id == file_system_id do %> <% end %>
<% end %>
<%= live_patch("Add file system", to: Routes.settings_path(@socket, :add_file_system), class: "button-base button-blue" ) %>
""" end defp file_system_info(%{file_system: %FileSystem.Local{}} = assigns) do ~H""" <.labeled_text label="Type">Local disk """ end defp file_system_info(%{file_system: %FileSystem.S3{}} = assigns) do ~H""" <.labeled_text label="Type">S3 <.labeled_text label="Bucket URL"><%= @file_system.bucket_url %> """ end end