Class: Crm::StatsCardComponent

Inherits:
Railsboot::CardComponent
  • Object
show all
Defined in:
app/components/crm/stats_card_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(title:, count:, percentage: nil, without_count: nil, without_url: nil, without_label: 'without', progress_stat: nil, turbo: true) ⇒ StatsCardComponent

Returns a new instance of StatsCardComponent.



2
3
4
5
6
7
8
9
10
11
12
# File 'app/components/crm/stats_card_component.rb', line 2

def initialize(title:, count:, percentage: nil, without_count: nil, without_url: nil, without_label: 'without', progress_stat: nil, turbo: true, **)
  @title = title
  @count = count
  @percentage = percentage
  @without_count = without_count
  @without_url = without_url
  @without_label = without_label
  @progress_stat = progress_stat.nil? ? percentage.present? : progress_stat
  @turbo = turbo
  super(**)
end