-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathconfig.ex
More file actions
29 lines (26 loc) · 770 Bytes
/
config.ex
File metadata and controls
29 lines (26 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
defmodule LiveDebugger.Components.Config do
@moduledoc """
Renders the LiveDebugger config meta tag and the browser features script.
It is meant to be injected to the debugged application layout.
"""
use Phoenix.Component
attr(:url, :string, required: true)
attr(:assets_url, :string, required: true)
attr(:browser_features?, :boolean, default: true)
attr(:debug_button?, :boolean, default: true)
attr(:highlighting?, :boolean, default: true)
def live_debugger_tags(assigns) do
~H"""
<meta
name="live-debugger-config"
url={@url}
debug-button={@debug_button?}
highlighting={@highlighting?}
/>
<%= if @browser_features? do %>
<script src={@assets_url}>
</script>
<% end %>
"""
end
end