<%# locals: (club: nil, entitlements: nil, subscription: nil, current_plan_slug: nil, show_stripe_portal: false) %> <% club ||= @club %> <% entitlements ||= @entitlements %> <% subscription ||= @subscription %> <% current_slug = local_assigns.fetch(:current_plan_slug, nil).presence || entitlements&.plan&.slug || subscription&.plan&.slug || "free" %> <% billing_mode = club.present? %>
<% @plans.each do |plan| %> <% action = billing_mode ? plan_billing_action( current_slug: current_slug, target_plan: plan, stripe_subscription_active: stripe_subscription_active?(subscription) ) : nil %>
">

<%= plan.name %>

<% if plan.slug == "free" %>
€0
<% elsif plan.slug == "premium_light" %>
€40/anno

oppure €5/mese

<% else %>
€200/anno

oppure €20/mese

<% end %> <% if billing_mode %> <% case action[:kind] %> <% when :current %> <%= action[:label] %> <% when :contact, :disabled %>

<%= action[:label] %>

<% when :checkout, :change %> <%= link_to action[:label], public_club_checkout_path(club, plan: plan.slug), class: "btn btn-primary" %> <% end %> <% elsif plan.slug == "free" %> <%= link_to "Inizia gratis", public_signup_path, class: "btn btn-secondary" %> <% else %> <%= link_to "Registrati", public_signup_path(plan: plan.slug), class: "btn btn-primary" %> <% end %>
<% end %>
<% if show_stripe_portal && billing_mode && subscription&.premium? && MatchLiveTv.stripe_enabled? && subscription&.stripe_customer_id.present? %>

<%= button_to "Gestisci fatturazione su Stripe", public_club_portal_path(club), class: "btn btn-secondary" %> Cambia metodo di pagamento, scarica fatture o disdici l'abbonamento.

<% end %>