<% return unless entitlements&.youtube_enabled? %> <% yt = Youtube::TeamStatus.new(entitlements_team) if entitlements_team %> <% cred = club.youtube_credential %>

<%= t("club.youtube.heading") %>

<% if params[:youtube] == "connected" %>

<%= t("club.youtube.connected_notice") %>

<% end %> <% if entitlements.plan.youtube_mode == "matchlivetv_light" %>

<%= raw t("club.youtube.light_body_html") %>

<% if yt&.selectable? %>

<%= t("club.youtube.light_ready") %>

<% else %>

<%= t("club.youtube.light_configuring") %>

<% end %> <% elsif entitlements.premium_full? %> <% if cred %>

<%= raw t("club.youtube.full_connected_html", channel: cred.channel_title.presence || cred.channel_id || "YouTube") %>

<%= t("club.youtube.full_connected_hint") %>

<%= button_to t("club.youtube.disconnect"), public_club_youtube_disconnect_path(club), method: :delete, class: "btn btn-secondary", form: { data: { turbo_confirm: t("club.youtube.disconnect_confirm"), confirm_kind: "delete" } } %> <% else %>

<%= raw t("club.youtube.full_not_connected_html") %>

<% if yt&.selectable? %>

<%= t("club.youtube.ready_in_app") %>

<% end %> <% if ENV["YOUTUBE_CLIENT_ID"].present? %> <%= link_to t("club.youtube.connect"), public_club_youtube_connect_path(club), class: "btn btn-primary" %> <% else %>

<%= t("club.youtube.oauth_not_configured") %>

<% end %> <% end %> <% else %>

<%= t("club.youtube.requires_full") %>

<%= link_to t("club.youtube.see_plans"), public_prezzi_path, class: "btn btn-secondary" %> <% end %>