<.topbar :if={@teams_auth == :online} variant="warning">
This Livebook instance has been configured for notebook deployment and is in read-only mode.
<.topbar :if={@teams_auth == :offline} variant="warning">
You are running an offline Workspace for deployment. You cannot modify its settings.
<.topbar :for={notification <- @notifications} variant={notification.kind}>
{notification.message}
<%= if @topbar_action do %>
{render_slot(@topbar_action)}
<% else %>
<.link navigate={~p"/"} class="flex items-center" aria-label="go to home">
<.remix_icon icon="home-6-line" />
Home
<%= if @inner_block != [] do %>
{render_slot(@inner_block)}
<% else %>
{@text}
<% end %>
"""
end
@doc """
Topbar for showing pinned, page-specific messages.
"""
attr :variant, :string, default: "info", values: ~w(warning info error)
slot :inner_block, required: true
def topbar(assigns) do
~H"""
{render_slot(@inner_block)}
"""
end
defp topbar_class("warning"), do: "bg-yellow-200 text-gray-900"
defp topbar_class("info"), do: "bg-blue-200 text-gray-900"
defp topbar_class("error"), do: "bg-red-200 text-gray-900"
@doc """
Returns an inline script to inject in dev mode.
The main JS file is loaded asynchronously as a module, so we inline
the live reloader listener to make sure it is already registered
when the event is dispatched.
"""
if Mix.env() == :dev do
def dev_script(assigns) do
~H"""
"""
end
else
def dev_script(assigns), do: ~H""
end
end