Sha256: b295d32a6739ffc145eed8374dd4d64621e6ad4b5d18bdb2b8efdefbe785b0db

Contents?: true

Size: 467 Bytes

Versions: 22

Compression:

Stored size: 467 Bytes

Contents

module Spina
  module UserInterface
    class FlashMessageComponent < ApplicationComponent
      
      def initialize(type:, message:)
        @type = type
        @message = message
      end
      
      def confetti?
        @type == "confetti" && !Spina.config.party_pooper
      end
      
      def theme
        case @type
        when "alert", "error"
          "bg-red-400"
        else
          "bg-gray-400"
        end
      end
      
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
spina-2.1.1 app/components/spina/user_interface/flash_message_component.rb
spina-2.1.0 app/components/spina/user_interface/flash_message_component.rb