_media_attachments.html.haml 661 B

1234567
  1. - if status.ordered_media_attachments.first.video?
  2. = render_video_component(status, visible: false)
  3. - elsif status.ordered_media_attachments.first.audio?
  4. - audio = status.ordered_media_attachments.first
  5. = react_component :audio, src: audio.file.url(:original), height: 110, alt: audio.description, lang: status.language, duration: audio.file.meta.dig(:original, :duration)
  6. - else
  7. = react_component :media_gallery, height: 343, sensitive: status.sensitive?, visible: false, lang: status.language, media: status.ordered_media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json }