% content_for :title, t("live.index.meta_title") %>
<% content_for :meta_description, t("live.index.meta_description") %>
<% content_for :canonical_url, seo_absolute_url(public_live_index_path) %>
<% live_index_params = @club ? { club_id: @club.id } : {} %>
<% if @club %>
<%= link_to t("live.index.club_back_link", name: @club.name), public_club_path(@club), class: "back-link" %>
<%= t("live.index.club_title", name: @club.name) %>
<%= t("live.index.club_hint") %>
<%= link_to t("live.index.club_replay_link", name: @club.name), public_replay_index_path(club_id: @club.id), class: "btn btn-secondary" %>
<% else %>
<%= t("live.index.default_title") %>
<%= t("live.index.default_hint") %>
<%= link_to t("live.index.replay_archive_link"), public_replay_index_path, class: "btn btn-secondary" %>
<% end %>
<% if @club && @can_schedule_match %>
<%= link_to t("live.index.schedule_match_link"), public_new_club_match_path(@club), class: "btn btn-primary" %>
<% end %>
<%= form_with url: public_live_index_path, method: :get, local: true, class: "search-form" do %>
<% if @club %>
<%= hidden_field_tag :club_id, @club.id %>
<% end %>
"
aria-label="<%= t("live.index.search_aria_label") %>"
autocomplete="off"
/>
<% if @query.present? %>
<%= link_to t("live.index.reset_link"), public_live_index_path(live_index_params), class: "btn btn-secondary" %>
<% end %>
<% end %>
<% if @query.present? %>
<% club_suffix = @club ? t("live.index.results_hint_club_suffix", name: @club.name) : "" %>
<%= t("live.index.results_hint", query: @query, club_suffix: club_suffix, live_count: @sessions.size, upcoming_count: @upcoming_matches.size) %>
<% end %>
<% if @sessions.any? %>
<%= t("live.index.section_live_now") %>
<% @sessions.each do |session| %>
<% match = session.match %>
<% on_air = @online_paths.include?(session.mediamtx_path_name) %>
<%= live_match_card_heading(match) %>
<% if match.location.present? %><%= match.location %> · <% end %>
<%= session.platform == "matchlivetv" ? "Match Live TV" : session.platform.capitalize %>
<% if session.score_state %>
<%= live_score_sets_label(session.score_state) %>
<% if live_score_partials_label(session.score_state).present? %>
<%= t("score.partials_prefix", value: live_score_partials_label(session.score_state)) %>
<% end %>
<%= session.score_state.home_points %> - <%= session.score_state.away_points %>
<% end %>
<% if on_air %>
<%= t("live.index.badge_on_air") %>
<% elsif session.status == "live" %>
<%= t("live.index.badge_live") %>
<% elsif session.status == "paused" %>
<%= t("live.index.badge_paused") %>
<% elsif session.status == "reconnecting" %>
<%= t("live.index.badge_reconnecting") %>
<% else %>
<%= t("live.index.badge_starting") %>
<% end %>
<%= link_to t("live.index.watch_link"), public_live_path(session), class: "btn-watch" %>
<% end %>
<% end %>
<% if @upcoming_matches.any? %>
<%= t("live.index.section_upcoming") %>
<%= t("live.index.upcoming_hint") %>
<% @upcoming_matches.each do |match| %>
<%= live_match_card_heading(match) %>
<% if match.location.present? %><%= match.location %> · <% end %>
<%= match.category.presence || match.sport&.capitalize %>
<%= live_scheduled_relative(match.scheduled_at) %>
<%= t("live.index.badge_scheduled") %>
<% end %>
<% end %>
<% if @sessions.empty? && @upcoming_matches.any? %>
<%= t("live.index.empty_soft_title") %>
<%= t("live.index.empty_soft_body") %>
<% end %>
<% if @public_tournaments.any? %>
"><%= t("tournaments.directory.section_on_live") %>
<%= t("tournaments.directory.live_hint") %>
<% @public_tournaments.each do |tournament| %>
<%= render "public/tournament_pages/directory_card", tournament: tournament %>
<% end %>
<%= link_to t("tournaments.directory.all_link"), public_tournament_pages_path %>
<% end %>
<% if @sessions.empty? && @upcoming_matches.empty? && @public_tournaments.blank? %>
<% if @club %>
<%= t("live.index.empty_club_title", name: @club.name) %>
<% if @can_schedule_match %>
<%= link_to t("live.index.empty_club_schedule_link"), public_new_club_match_path(@club), class: "btn btn-primary" %>
<%= t("live.index.empty_club_schedule_suffix") %>
<% elsif @club.teams.any? %>
<%= t("live.index.empty_club_ask_staff") %>
<% else %>
<%= raw t(
"live.index.empty_club_add_team_html",
club_link: link_to(t("live.index.empty_club_page_link"), public_club_path(@club))
) %>
<% end %>
<%= link_to t("live.index.empty_club_back_link"), public_club_path(@club), class: "btn btn-secondary" %>
<% else %>
<%= t("live.index.empty_hero_title") %>
<%= t("live.index.empty_hero_body") %>
- <%= t("live.index.empty_hero_list_item1") %>
- <%= t("live.index.empty_hero_list_item2") %>
- <%= t("live.index.empty_hero_list_item3") %>
<%= link_to t("live.index.empty_hero_cta_signup"), public_signup_path, class: "btn btn-primary" %>
<%= link_to t("live.index.empty_hero_cta_features"), public_features_path, class: "btn btn-secondary" %>
<% end %>
<% end %>