Sha256: 83100e85524f66ac13a62aaf1169ae4b2b107594ff7d7b8915797c0f6a17d09a

Contents?: true

Size: 419 Bytes

Versions: 4

Compression:

Stored size: 419 Bytes

Contents

class ModalComponent < ViewComponent::Base
  def initialize(attributes = {})
    @name = attributes[:name]
    @show = attributes[:show] || false
    @max_width = {
      :sm => 'sm:max-w-sm',
      :md => 'sm:max-w-md',
      :lg => 'sm:max-w-lg',
      :xl => 'sm:max-w-xl',
      '2xl' => 'sm:max-w-2xl'
    }[attributes[:max_width] || '2xl']
    @attributes = attributes.without(:name, :show, :max_width)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kaze-0.8.0 stubs/hotwire/app/components/modal_component.rb
kaze-0.7.0 stubs/hotwire/app/components/modal_component.rb
kaze-0.6.0 stubs/hotwire/app/components/modal_component.rb
kaze-0.5.0 stubs/hotwire/app/components/modal_component.rb