Class: Tramway::Chats::MessageComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/tramway/chats/message_component.rb

Overview

Renders a single chat message with alignment and state styling.

Constant Summary

Constants included from Helpers::ViewsHelper

Helpers::ViewsHelper::FORM_SIZES

Instance Method Summary collapse

Methods included from Helpers::ViewsHelper

#tramway_back_button, #tramway_badge, #tramway_button, #tramway_cell, #tramway_chat, #tramway_container, #tramway_flash, #tramway_form_for, #tramway_header, #tramway_main_container, #tramway_row, #tramway_table, #tramway_title

Methods included from Helpers::ComponentHelper

#component

Methods included from Helpers::DecorateHelper

#tramway_decorate

Instance Method Details

#data_viewObject



13
14
15
16
17
18
19
# File 'app/components/tramway/chats/message_component.rb', line 13

def data_view
  if data.nil?
    nil
  elsif array_2d?(data)
    :table
  end
end

#text_colorObject



21
22
23
24
25
26
27
# File 'app/components/tramway/chats/message_component.rb', line 21

def text_color
  if pending?
    'text-gray-400 dark:text-gray-600'
  else
    'text-black dark:text-white'
  end
end