defmodule LivebookWeb.SettingsLive.EnvVarsComponent do use LivebookWeb, :live_component @impl true def render(assigns) do assigns = assigns |> assign_new(:target, fn -> nil end) |> assign_new(:edit_label, fn -> "Edit" end) ~H"""
<.env_var_info env_var={env_var} edit_label={@edit_label} target={@target} />
<.link patch={@add_env_var_path} class="button-base button-blue" id="add-env-var"> Add environment variable
""" end defp env_var_info(assigns) do ~H"""
<.labeled_text label="Name"> <%= @env_var.name %>
<.menu id={"env-var-#{@env_var.name}-menu"}> <:toggle> <.menu_item> <.menu_item variant={:danger}>
""" end end