Sha256: 025ad378925d2ec14b6971dc006aeff47ac75fc15349016a97a7d092fb82e676

Contents?: true

Size: 448 Bytes

Versions: 9

Compression:

Stored size: 448 Bytes

Contents

# frozen_string_literal: true

class Avo::Fields::Common::BooleanCheckComponent < Avo::BaseComponent
  prop :checked, default: false
  prop :size, default: :md
  prop :icon do |value|
    @checked ? "heroicons/outline/check-circle" : "heroicons/outline/x-circle"
  end

  def classes
    helpers.class_names({
      "h-5": @size == :sm,
      "h-6": @size == :md,
      "text-green-600": @checked,
      "text-red-600": !@checked,
    })
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
avo-3.15.1 app/components/avo/fields/common/boolean_check_component.rb
avo-3.15.0 app/components/avo/fields/common/boolean_check_component.rb
avo-3.14.5 app/components/avo/fields/common/boolean_check_component.rb
avo-3.14.4 app/components/avo/fields/common/boolean_check_component.rb
avo-3.14.3 app/components/avo/fields/common/boolean_check_component.rb
avo-3.14.2 app/components/avo/fields/common/boolean_check_component.rb
avo-3.14.1 app/components/avo/fields/common/boolean_check_component.rb
avo-3.14.0 app/components/avo/fields/common/boolean_check_component.rb
avo-3.13.7 app/components/avo/fields/common/boolean_check_component.rb