<%= form_for @conn, "/sites/#{URI.encode_www_form(@site.domain)}/monthly-report/recipients", [class: "lg:hidden"], fn f -> %>
<% options = flat_settings_options(@conn) %>
<%= select(f, :tab, options,
class:
"dark:bg-gray-800 mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 dark:border-gray-500 outline-none focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md dark:text-gray-100",
onchange:
"location.href = '/" <>
URI.encode_www_form(@site.domain) <> "/settings/' + event.target.value",
selected:
Enum.find_value(options, &(is_current_tab(@conn, elem(&1, 1)) && elem(&1, 1)))
) %>
<% end %>
<%= for %{key: key, value: value, icon: icon} <- settings_tabs(@conn) do %>
<%= if is_binary(value) do %>
<%= render("_settings_tab.html",
icon: icon,
this_tab: value,
text: key,
site: @site,
conn: @conn,
submenu?: false
) %>
<% else %>
<%= render("_settings_tab.html",
icon: icon,
this_tab: nil,
text: key,
site: @site,
conn: @conn,
submenu?: false
) %>
<%= for %{key: key, value: val} <- value do %>
<%= render("_settings_tab.html",
icon: nil,
this_tab: val,
text: key,
site: @site,
conn: @conn,
submenu?: true
) %>
<% end %>
<% end %>
<% end %>