Class: InnerPlan::Tasks::Show::ItemComponent
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- InnerPlan::Tasks::Show::ItemComponent
- Defined in:
- app/components/inner_plan/tasks/show/item_component.rb
Instance Method Summary collapse
-
#initialize(icon:, title: nil) ⇒ ItemComponent
constructor
A new instance of ItemComponent.
- #template(&content) ⇒ Object
Constructor Details
#initialize(icon:, title: nil) ⇒ ItemComponent
Returns a new instance of ItemComponent.
3 4 5 6 |
# File 'app/components/inner_plan/tasks/show/item_component.rb', line 3 def initialize(icon:, title: nil) @icon = icon @title = title end |
Instance Method Details
#template(&content) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/components/inner_plan/tasks/show/item_component.rb', line 8 def template(&content) div(class: "d-flex mt-4") do div(class: "me-3 text-body-tertiary", style: "margin-top:-.2rem") do render(@icon.new(width: 24, height: 24)) end div do h6 { @title } render content end end end |