% add_gem_component_stylesheet("previous-and-next-navigation") disable_ga4 ||= false component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns) component_helper.add_class("govuk-pagination govuk-pagination--block") component_helper.add_aria_attribute({ label: t("components.previous_and_next_navigation.pagination") }) component_helper.add_data_attribute({ module: "ga4-link-tracker" }) unless disable_ga4 if local_assigns.include?(:next_page) || local_assigns.include?(:previous_page) %> <%= tag.nav(**component_helper.all_attributes) do %> <% if local_assigns.include?(:previous_page) %> <% title = previous_page[:title] || t("components.previous_and_next_navigation.previous") link_text_classes = %w[govuk-pagination__link-title] link_text_classes << "govuk-pagination__link-title--decorated" unless previous_page[:label].present? %>
<% end %> <% if local_assigns.include?(:next_page) %> <% title = next_page[:title] || t("components.previous_and_next_navigation.next") link_text_classes = %w[govuk-pagination__link-title] link_text_classes << "govuk-pagination__link-title--decorated" unless next_page[:label].present? %> <% end %> <% end %> <% end %>