defmodule LivebookWeb.SessionLive.SecretsComponent do use LivebookWeb, :live_component @impl true def update(assigns, socket) do socket = assign(socket, assigns) prefill_form = prefill_secret_name(socket) socket = if socket.assigns[:data] do socket else assign(socket, data: %{"name" => prefill_form, "value" => "", "store" => "session"}, errors: [{"value", {"can't be blank", []}}], title: title(socket), grant_access: must_grant_access(socket), has_prefill: prefill_form != "" ) end {:ok, socket} end @impl true def render(assigns) do ~H"""
Choose a secret
Add new secret
<% end %> <.input_wrapper form={f} field={:name}>