<%= tag.public_send @tag, class: "flex items-center justify-between mb-6 last:mb-0",
      data: @form_enabled ? {
        controller: "settings--toggle",
        :'settings--toggle-switch-enabled-value' => @enabled.to_s
      } : nil do %>
  <div class="flex flex-col">
    <label class="font-bold mb-1"><%= @title %></label>
    <p class="text-gray-500"><%= @descripton %></p>
  </div>
  <div class="relative ml-4 inline-flex flex-shrink-0">
    <%= render FormElements::ToggleComponent.new(
          enabled: @enabled,
          input_enabled: @input_enabled,
          class_names: @form_enabled ? "hidden" : nil,
          data: {
            :'settings--toggle-target' => "button",
            action: "settings--toggle#toggleSwitch"
          }) %>
    <% if @form_enabled %>
      <% if @attribute.present? %>
        <%= @form.check_box @attribute, {
              checked: @enabled,
              data: { :'settings--toggle-target' => "checkbox" }
            }, "true", "false" %>
      <% else %>
        <input name="<%= @field_name %>" type="hidden" value="false" autocomplete="off">
        <%= check_box_tag @field_name, "true", @enabled, {
              data: { :'settings--toggle-target' => "checkbox" }
            } %>
      <% end %>
    <% end %>
  </div>
<% end %>
