Sha256: d6534bbbac285db45599c87e8c141a5f8000b21109db1b34eb6119234e5f3dce
Contents?: true
Size: 414 Bytes
Versions: 7
Compression:
Stored size: 414 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').to_sym] @attributes = attributes.without(:name, :show, :max_width) end end
Version data entries
7 entries across 7 versions & 1 rubygems