Class: Avo::Fields::Common::BooleanCheckComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/avo/fields/common/boolean_check_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(checked: false) ⇒ BooleanCheckComponent

Returns a new instance of BooleanCheckComponent.



4
5
6
7
# File 'app/components/avo/fields/common/boolean_check_component.rb', line 4

def initialize(checked: false)
  @icon = checked ? "heroicons/outline/check-circle" : "heroicons/outline/x-circle"
  @classes = "h-6 #{checked ? "text-green-600" : "text-red-500"}"
end