<% content_for :title, "Visits" %>
<%# Top navigation tabs %>
<%= link_to 'Visits', visits_path(status: :confirmed), role: 'tab', class: "tab font-bold text-xl #{active_visit_places_tab?('visits')}" %> <%= link_to 'Places', places_path, role: 'tab', class: "tab font-bold text-xl #{active_visit_places_tab?('places')}" %>
<%# Main content area with map and side panel %>
<%# Map container %>
<%# Side panel %>
<%# Visit filters %>
<%= link_to 'Confirmed', visits_path(status: :confirmed), role: 'tab', class: "tab #{active_tab?(visits_path(status: :confirmed))}" %> <%= link_to visits_path(status: :suggested), role: 'tab', class: "tab #{active_tab?(visits_path(status: :suggested))}" do %> Suggested <% if @suggested_visits_count.positive? %> <%= @suggested_visits_count %> <% end %> <% end %> <%= link_to 'Declined', visits_path(status: :declined), role: 'tab', class: "tab #{active_tab?(visits_path(status: :declined))}" %>
Order by: <%= link_to 'Newest', visits_path(order_by: :desc, status: params[:status]), class: 'btn btn-xs btn-primary mx-1' %> <%= link_to 'Oldest', visits_path(order_by: :asc, status: params[:status]), class: 'btn btn-xs btn-primary mx-1' %>
<%# Beta notice %> <%# Visits list %>
<% if @visits.empty? %>

No visits found

Here you'll find your <%= params[:status] %> visits, but now there are none. Create some areas on your map and pretty soon you'll see visit suggestions on this page!

<% else %>
<% @visits.each do |visit| %>
<%# Visit name %>
<%= render 'visits/name', visit: visit %>
<%= visit.status %>
<%# Visit time and duration %>
<%= "#{visit.started_at.strftime('%H:%M')} - #{visit.ended_at.strftime('%H:%M')}" %>
Duration: <%= (visit.duration / 60.0).round(1) %> hours
<%# Action buttons %>
<%= render 'visits/buttons', visit: visit %>
<%= render 'visits/modal', visit: visit %> <% end %>
<% end %>
<%# Pagination %>
<%= paginate @visits %>