attribute_to_args

in lib/primer/view_components/linters/argument_mappers/button.rb [33:50]


        def attribute_to_args(attribute)
          attr_name = attribute.name

          case attr_name
          when "disabled"
            { disabled: true }
          when "type"
            
            return {} if attribute.value == "button"

            raise ConversionError, "Button component does not support type \"#{attribute.value}\"" unless TYPE_OPTIONS.include?(attribute.value)

            { type: ":#{attribute.value}" }
          else
            { attr_name.to_sym => erb_helper.convert(attribute) }
          end
        end