Sha256: 3681471c185be0ce82e764ee96cb47ea6107bcc4522b5c878680ddb7e39520a7
Contents?: true
Size: 566 Bytes
Versions: 11
Compression:
Stored size: 566 Bytes
Contents
# frozen_string_literal: true module Blacklight module System class FlashMessageComponent < ViewComponent::Base with_collection_parameter :message def initialize(message:, type:) @message = message @classes = alert_class(type) end def alert_class(type) case type.to_s when 'success' then "alert-success" when 'notice' then "alert-info" when 'alert' then "alert-warning" when 'error' then "alert-danger" else "alert-#{type}" end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems