module Pagy::UikitExtra

def pagy_uikit_nav(pagy, id: nil, aria_label: nil, **vars)

Pagination for uikit: it returns the html with the series of links to the pages
def pagy_uikit_nav(pagy, id: nil, aria_label: nil, **vars)
  id = %( id="#{id}") if id
  a  = pagy_anchor(pagy)
  html = %(<ul#{id} class="pagy-uikit nav uk-pagination uk-flex-center" role="navigation" #{
            nav_aria_label(pagy, aria_label:)}>#{
            uikit_prev_html(pagy, a)})
  pagy.series(**vars).each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
    html << case item
            when Integer
              %(<li>#{a.(item)}</li>)
            when String
              %(<li class="uk-active"><span role="link" aria-current="page" aria-disabled="true">#{
                  pagy.label_for(item)}</span></li>)
            when :gap
              %(<li class="uk-disabled"><span>#{pagy_t 'pagy.gap'}</span></li>)
            else
              raise InternalError, "expected item types in series to be Integer, String or :gap; got #{item.inspect}"
            end
  end
  html << %(#{uikit_next_html(pagy, a)}</ul>)
end