Sha256: 8ae01d460a346bdaa99cf0721ac3db14221d22143f98ec76df0b0b3e0117ef66

Contents?: true

Size: 449 Bytes

Versions: 15

Compression:

Stored size: 449 Bytes

Contents

class InputErrorComponent < ViewComponent::Base
  erb_template <<~ERB
    <div <%= sanitize @attributes.join(" ") %>>
      <p class="text-sm text-red-600 dark:text-red-400">
        <%= @message %>
      </p>
    </div>
  ERB

  def initialize(attributes = {})
    @message = attributes[:message]
    @attributes = attributes.without(:message).map { |key, attribute| "#{key}=\"#{attribute}\"" }
  end

  def render?
    @message.present?
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
kaze-0.17.0 stubs/hotwire/app/components/input_error_component.rb
kaze-0.16.0 stubs/hotwire/app/components/input_error_component.rb
kaze-0.15.0 stubs/hotwire/app/components/input_error_component.rb
kaze-0.14.0 stubs/hotwire/app/components/input_error_component.rb
kaze-0.13.0 stubs/hotwire/app/components/input_error_component.rb
kaze-0.12.0 stubs/hotwire/app/components/input_error_component.rb
kaze-0.11.0 stubs/hotwire/app/components/input_error_component.rb
kaze-0.10.0 stubs/hotwire/app/components/input_error_component.rb
kaze-0.9.0 stubs/hotwire/app/components/input_error_component.rb
kaze-0.8.0 stubs/hotwire/app/components/input_error_component.rb
kaze-0.7.0 stubs/hotwire/app/components/input_error_component.rb
kaze-0.6.0 stubs/hotwire/app/components/input_error_component.rb
kaze-0.5.0 stubs/hotwire/app/components/input_error_component.rb
kaze-0.4.0 stubs/hotwire/app/components/input_error_component.rb
kaze-0.3.0 stubs/hotwire/app/components/input_error_component.rb