<%# locals: (club:, entitlements: nil, subscription: nil, on_billing_page: false) %>
<% current_plan = entitlements&.plan || subscription&.plan || Plan["free"] %>
<p style="color:#aaa;margin-bottom:8px">
  Società: <strong><%= club.name %></strong>
  · Piano attuale: <strong><%= current_plan.name %></strong>
  (valido per tutte le squadre)
  <% unless local_assigns[:on_billing_page] %>
    · <%= link_to "Gestisci abbonamento", public_club_billing_path(club) %>
  <% end %>
</p>
<% if subscription&.stripe_subscription_id.present? %>
  <p style="color:#888;font-size:0.9rem;margin-top:0">
    <% if subscription.cancel_at_period_end? %>
      <span style="color:#e53935">
        Abbonamento valido fino al
        <strong><%= subscription.current_period_end.present? ? l_local(subscription.current_period_end.to_date) : "fine periodo" %></strong>,
        poi piano Free.
      </span>
    <% elsif subscription.current_period_end.present? %>
      Prossimo rinnovo: <strong><%= l_local(subscription.current_period_end) %></strong>
    <% end %>
  </p>
<% end %>
