Sha256: eb493c9ba0fce55e881b2620e048ffe4f116d945b7cc487d04e053bb04d9b517

Contents?: true

Size: 296 Bytes

Versions: 1

Compression:

Stored size: 296 Bytes

Contents

class NoticeComponent < ViewComponent::Base
  TYPES = %w[notice alert].freeze
  def initialize(title:, messages: [], type: nil)
    super

    @type = type if TYPES.include?(type)
    @type ||= 'alert'
    @title = title
    @messages = messages
  end

  def render?
    @messages.any?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alveole-0.0.1 lib/alveole/components/notice_component.rb