You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dropdown_component.rb
    path of file: ./repos/blacklight/app/components/blacklight/system
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Blacklight
  module System
    class DropdownComponent < Blacklight::Component
      renders_one :button, (lambda do |classes:, 
    
      def before_render
        with_button(classes: 'btn btn-outline-secondary dropdown-toggle', label: button_label) unless button

        return if options.any?

        with_options(@choices.map do |option|
          text, value = option_text_and_value(option)
          { text: text, url: helpers.url_for(@search_state.params_for_search(@param => value)), selected: @selected == value }
        end)
      end

      def render?
        @choices.many?
      end

      # rubocop:disable Style/CaseEquality
      # This method is from Rails to mirror how it handles native dropdowns
      def option_text_and_value(option)
        # Options are [text, value] pairs or strings used for both.
        if !option.is_a?(String) && option.respond_to?(:first) && option.respond_to?(:last)
          option = option.reject { |e| Hash === e } if Array === option
          [option.first, option.last]
        else
          [option, option]
        end
      end