Method: Satis::Card::Component#initialize

Defined in:
app/components/satis/card/component.rb

#initialize(icon: nil, title: nil, description: nil, menu: nil, content_padding: true, header_background_color: { dark: 'bg-gray-800', light: 'bg-white' }, actions: [], key: nil) ⇒ Component

Returns a new instance of Component.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/components/satis/card/component.rb', line 12

def initialize(icon: nil,
               title: nil,
               description: nil,
               menu: nil,
               content_padding: true,
               header_background_color: {
                 dark: 'bg-gray-800', light: 'bg-white'
               },
               actions: [],
               key: nil)
  super
  @title = title
  @title = @title.reject(&:blank?).compact.join(' ') if @title.is_a?(Array)
  @description = description
  @icon = icon
  @menu = menu
  @content_padding = content_padding
  @header_background_color = header_background_color
  @initial_actions = actions
  @key = key
end