Class: PhlexKit::Message
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::Message
- Defined in:
- app/components/phlex_kit/message/message.rb
Overview
Chat message row (avatar + content), ported from ruby_ui's RubyUI::Message. align: :end reverses the row. Compose Message > MessageContent (+ Avatar/ Header/Footer); group several in a MessageGroup.
Instance Method Summary collapse
-
#initialize(align: :start, **attrs) ⇒ Message
constructor
A new instance of Message.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(align: :start, **attrs) ⇒ Message
Returns a new instance of Message.
6 7 8 9 |
# File 'app/components/phlex_kit/message/message.rb', line 6 def initialize(align: :start, **attrs) @align = align.to_sym @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
10 11 12 |
# File 'app/components/phlex_kit/message/message.rb', line 10 def view_template(&) div(**mix({ class: "pk-message", data: { slot: "message", align: @align } }, @attrs), &) end |