<% add_gem_component_stylesheet("devolved-nations") shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns) devolved_nations_helper = GovukPublishingComponents::Presenters::DevolvedNationsHelper.new(local_assigns) applies_to ||= t("components.devolved_nations.applies_to") heading_level ||= 2 ga4_tracking ||= false data_attributes = {} if ga4_tracking data_attributes[:ga4_devolved_nations_banner] = devolved_nations_helper.ga4_applicable_nations_title_text(true) data_attributes[:module] = "ga4-link-tracker" data_attributes[:ga4_track_links_only] = "" data_attributes[:ga4_set_indexes] = "" data_attributes[:ga4_link] = { event_name: "navigation", type: "devolved nations banner", section: t("components.devolved_nations.applies_to", locale: :en) + " " + devolved_nations_helper.ga4_applicable_nations_title_text, }.to_json end %> <% if national_applicability.any? { |k,v| v[:applicable] == true } %> <%= tag.section class: "gem-c-devolved-nations", data: data_attributes do %> <%= content_tag(shared_helper.get_heading_level, class: "govuk-heading-s govuk-!-margin-bottom-0") do %> <%= applies_to %> <%= devolved_nations_helper.applicable_nations_title_text %> <% end %> <% if devolved_nations_helper.nations_with_urls.any? %> <%= content_tag :ul, class: "govuk-list govuk-!-margin-top-1 govuk-!-margin-bottom-0" do -%> <% devolved_nations_helper.nations_with_urls.each do |k, v| %> <%= content_tag(:li, link_to(devolved_nations_helper.alternative_content_text(k), v[:alternative_url], class: "govuk-link")) %> <% end %> <% end %> <% end %> <% end %> <% end %>