defmodule LivebookWeb.SettingsLive.FileSystemsComponent do use LivebookWeb, :live_component alias Livebook.FileSystem @impl true def render(assigns) do ~H"""
<.file_system_info file_system={file_system} />
<.file_system_actions file_system_id={file_system.id} default_file_system_id={@default_file_system_id} />
<.link patch={~p"/settings/add-file-system"} class="button-base button-blue"> Add file system
""" 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 defp file_system_actions(assigns) do ~H"""
Default <.menu :if={@default_file_system_id != @file_system_id or @file_system_id != "local"} id={"file-system-#{@file_system_id}-menu"} > <:toggle> <.menu_item> <.menu_item variant={:danger}>
""" end end