<% if @team.club %>
  <p style="margin-bottom:16px"><%= link_to "← #{@team.club.name}", admin_club_path(@team.club) %></p>
<% end %>

<h2><%= @team.name %></h2>
<p>Sport: <%= @team.sport %></p>
<% if @team.club %>
  <p>Società: <%= @team.club.name %> · <%= link_to "Pagamenti e fatture", admin_billing_path(club_id: @team.club.id) %></p>
<% end %>
<% yt = Youtube::TeamStatus.new(@team) %>
<p>
  YouTube:
  <% if yt.selectable? %>
    <strong><%= yt.channel_title || "—" %></strong>
    <% if yt.uses_platform_channel? %>
      (canale piattaforma<%= @team.entitlements.premium_full? && @team.club.youtube_credential.blank? ? ", default senza OAuth società" : "" %>)
    <% else %>
      (canale società)
    <% end %>
  <% else %>
    non pronto
  <% end %>
</p>
<% if @team.entitlements.premium_full? && @team.club.youtube_credential.blank? %>
  <p class="muted">
    Senza canale collegato, l’app usa il canale Match Live TV.
    <%= link_to "Collega canale (pagina società)", public_club_path(@team.club) %>.
  </p>
<% end %>

<h3>Partite</h3>
<ul>
  <% @matches.each do |m| %>
    <li><%= m.opponent_name %> — <%= m.scheduled_at %></li>
  <% end %>
</ul>
