<% if DawarichSettings.store_geodata? %>
  <div class="stat text-center">
    <div class="stat-value text-secondary">
      <%= number_with_delimiter @points_reverse_geocoded %>
    </div>
    <div class="stat-title">Reverse geocoded points</div>
    <div class="stat-title">
      <span class="tooltip underline decoration-dotted" data-tip="Points that were reverse geocoded but had no data">
        <%= number_with_delimiter @points_reverse_geocoded_without_data %> points without data
      </span>
    </div>
  </div>
<% end %>

<div class="stat text-center">
  <div class="stat-value text-warning underline hover:no-underline  hover:cursor-pointer" onclick="countries_visited.showModal()">
    <%= number_with_delimiter current_user.total_countries %>
  </div>
  <div class="stat-title">Countries visited</div>

  <dialog id="countries_visited" class="modal">
    <div class="modal-box">
      <h3 class="font-bold text-lg">Countries visited</h3>
      <p class="py-4">
        <% current_user.countries_visited.each do |country| %>
          <p><%= country %></p>
        <% end %>
      </p>
    </div>
    <form method="dialog" class="modal-backdrop">
      <button>close</button>
    </form>
  </dialog>
</div>

<div class="stat text-center">
  <div class="stat-value hover:cursor-pointer hover:no-underline underline" onclick="cities_visited.showModal()">
    <%= current_user.total_cities %>
  </div>
  <div class="stat-title">Cities visited</div>
    <dialog id="cities_visited" class="modal">
      <div class="modal-box">
        <h3 class="font-bold text-lg">Cities visited</h3>
        <p class="py-4">
          <% current_user.cities_visited.each do |city| %>
            <p><%= city %></p>
          <% end %>
        </p>
      </div>
      <form method="dialog" class="modal-backdrop">
        <button>close</button>
      </form>
    </dialog>
  </div>
</div>
