Class: DaisyUI::ChatBubble::Metadata
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- DaisyUI::ChatBubble::Metadata
- Defined in:
- app/components/daisy_ui/data_display/chat_bubble/metadata.rb
Overview
Component for chat bubble metadata (header/footer)
Constant Summary collapse
- TYPES =
i[header ].freeze
- TYPE_CLASSES =
{ header: 'chat-header', footer: 'chat-footer opacity-50' }.freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(text:, type:, time: nil, **system_arguments) ⇒ Metadata
constructor
A new instance of Metadata.
Constructor Details
#initialize(text:, type:, time: nil, **system_arguments) ⇒ Metadata
Returns a new instance of Metadata.
24 25 26 27 28 29 |
# File 'app/components/daisy_ui/data_display/chat_bubble/metadata.rb', line 24 def initialize(text:, type:, time: nil, **system_arguments) @text = text @time = time @type = validate_type!(type) super(**system_arguments) end |
Instance Method Details
#call ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'app/components/daisy_ui/data_display/chat_bubble/metadata.rb', line 31 def call tag.div(**html_attributes) do safe_join([ @text, render_time ].compact) end end |