<div class="crayons-card grid gap-6 p-6 mb-6">
  <h3>Connect</h3>
  <%= form_for(@user, html: { id: nil, class: "grid gap-6" }) do |f| %>
    <div class="crayons-field">
      <%= f.label :inbox_type, "Inbox type", class: "crayons-field__label" %>
      <p class="crayons-field__description">Open your inbox to messages from people you don't follow or keep your inbox private to mutual follows.</p>
      <%= f.select :inbox_type, [%w[Open open], %w[Private private]], class: "crayons-select" %>
    </div>

    <div class="crayons-field">
      <%= f.label :inbox_guidelines, "Open inbox guidelines/instructions", class: "crayons-field__label" %>
      <%= f.text_area :inbox_guidelines, maxlength: 200, class: "crayons-textfield", rows: 5, placeholder: "For example:
  - Only contact me about consulting opportunities.
  - I'm happy to help beginners with CSS.
  - Allow for a few days to respond.
  - etc.
        " %>
      <p class="crayons-field__description">(optional)</p>
    </div>

    <div><button type="submit" class="crayons-btn">Save Connect Settings</button></div>
  <% end %>
</div>

<%= render "language_settings" %>

<div class="crayons-card grid gap-6 p-6 mb-6">
  <header>
    <h3 class="mb-2">Sponsors</h3>
    <p>You have the option to remove sponsor messaging (where it is practical to do so). Our wonderful sponsors help sustain the platform and improve your experience, and we strive to make their presence constructive to the community, but feel free to use this setting if you wish.</p>
  </header>

  <%= form_for(@user, html: { id: nil, class: "grid gap-4" }) do |f| %>
    <div class="crayons-field crayons-field--checkbox">
      <%= f.check_box :display_sponsors, class: "crayons-checkbox" %>
      <%= f.label :display_sponsors, "Display Sponsors (When browsing)", class: "crayons-field__label" %>
    </div>

    <div class="crayons-field crayons-field--checkbox">
      <%= f.check_box :permit_adjacent_sponsors, class: "crayons-checkbox" %>
      <%= f.label :permit_adjacent_sponsors, "Permit Nearby Sponsors (When publishing)", class: "crayons-field__label" %>
    </div>

    <%= f.hidden_field :tab, value: @tab, id: nil %>
    <div><button type="submit" class="crayons-btn">Save Sponsors Settings</button></div>
  <% end %>
</div>

<div class="crayons-card grid gap-4 p-6 mb-6">
  <h3>Export content</h3>

  <% if @user.export_requested? %>
    <div class="crayons-notice crayons-notice--warning">
      <p>You have recently requested an export of your content. Please check your email.</p>
    </div>
  <% else %>
    <p class="-mt-2">You can request an export of all your content. Currently we only support the export of your posts and comments. They will be emailed to your inbox.</p>

    <%= form_for(@user, html: { id: nil }) do |f| %>
      <div class="crayons-field crayons-field--checkbox mb-6">
        <%= f.check_box :export_requested, class: "crayons-checkbox" %>
        <%= f.label :export_requested, "Request an export of your content", class: "crayons-field__label" %>
      </div>
      <%= f.hidden_field :tab, value: @tab, id: nil %>
      <div><button type="submit" class="crayons-btn">Submit data request</button></div>
    <% end %>
  <% end %>
</div>
