Class: Plutonium::UI::Display::Components::Boolean

Inherits:
Phlexi::Display::Components::Base
  • Object
show all
Includes:
Phlexi::Display::Components::Concerns::DisplaysValue
Defined in:
lib/plutonium/ui/display/components/boolean.rb

Overview

Renders a boolean as a colored “Yes” / “No” pill with a leading icon.

Instance Method Summary collapse

Instance Method Details

#render_value(value) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/plutonium/ui/display/components/boolean.rb', line 11

def render_value(value)
  if value
    pill(label: true_label, variant: "pu-badge-success", icon: Phlex::TablerIcons::Check)
  else
    pill(label: false_label, variant: "pu-badge-neutral", icon: Phlex::TablerIcons::X)
  end
end