Class: Arclight::CollectionInfoComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Arclight::CollectionInfoComponent
- Defined in:
- app/components/arclight/collection_info_component.rb
Overview
Render information about the collection
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
Instance Method Summary collapse
- #info_icon ⇒ Object
-
#initialize(collection:) ⇒ CollectionInfoComponent
constructor
A new instance of CollectionInfoComponent.
Constructor Details
#initialize(collection:) ⇒ CollectionInfoComponent
Returns a new instance of CollectionInfoComponent.
6 7 8 9 10 |
# File 'app/components/arclight/collection_info_component.rb', line 6 def initialize(collection:) super @collection = collection end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
12 13 14 |
# File 'app/components/arclight/collection_info_component.rb', line 12 def collection @collection end |
Instance Method Details
#info_icon ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'app/components/arclight/collection_info_component.rb', line 17 def info_icon icon = <<~SVG <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-info-circle-fill" viewBox="0 0 16 16"> <path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/> </svg> SVG icon.html_safe # rubocop:disable Rails/OutputSafety end |