Sha256: fb3ae39cea214a211321f80763d34342250e90a9b0abb482d56cbe2c10912d42

Contents?: true

Size: 813 Bytes

Versions: 39

Compression:

Stored size: 813 Bytes

Contents

class ModalContentComponent < ViewComponent::Base
  def initialize(src: nil, turbo_frame_id: :modal_content)
    @turbo_frame_id = turbo_frame_id
    @src = src
    with_content(loading_html) if @src.present?

    super
  end

  def loading_html
    <<~HTML.html_safe
      <div class="text-center text-body-secondary fs-3" style="min-height: 15em">
        Cargando...
      </div>
    HTML
  end

  erb_template <<~ERB
    <div class="modal-body">
      <div class="d-flex justify-content-around sticky-top">
        <div class="flash position-relative w-100 d-flex justify-content-center">
        </div>
      </div>
      <%= helpers.turbo_frame_tag @turbo_frame_id,
                                  **{ src: @src, refresh: :morph }.compact do %>
        <%= content %>
      <% end %>
    </div>
  ERB
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
pg_rails-7.6.27 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.26 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.25 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.24 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.24.pre.5 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.24.pre.4 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.24.pre.3 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.23 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.22 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.22.pre.3 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.22.pre.2 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.22.pre.1 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.21 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.21.pre.11 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.21.pre.10 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.21.pre.9 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.21.pre.8 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.21.pre.7 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.21.pre.6 pg_engine/app/components/modal_content_component.rb
pg_rails-7.6.21.pre.5 pg_engine/app/components/modal_content_component.rb