Sha256: 0f2f64b3c7f0de4eeb979b65fe843429ee305e150c190bbd5e3947cc7be7fda8

Contents?: true

Size: 1.85 KB

Versions: 4

Compression:

Stored size: 1.85 KB

Contents

<% if @example.present? %>
<%= render_component_tag class: "not-prose border-b border-lookbook-divider rounded-sm overflow-hidden", "@navigation:start.window": "cleanup" do %>

  <%= render_component :toolbar, class: "border border-b-0 border-lookbook-divider" do |toolbar| %>
    <% toolbar.section padded: true do %>
      <h3>
        <%= @example.preview.label %> (<%= @example.label %>)
      </h3>
    <% end %>
    <% toolbar.section align: :right, divide: :left do %>
      <%= render_component :button_group do |group| %>
        <% group.button icon: :eye,
          href: lookbook_inspect_path(@example.path, @params),
          tooltip: "View in Inspector" %>
        <% group.button icon: :external_link,
          href: lookbook_inspect_path(@example.path, @params),
          tooltip: "Open in new window",
          target: "_blank" %>
      <% end %>
    <% end %>
  <% end %>

  <div
    x-show="tab === 'preview'"
    @viewport:loaded="loadResizer"
    @dom:update-complete="loadResizer"
    @viewport:resize-progress="resizeIframe"
    @viewport:resize-complete="resizeIframe"
    @tabs:change.window="resizeIframe"> 
    <%= render_component :viewport,
      src: lookbook_preview_path(@example.path, @params.merge(lookbook_embed: true)),
      alpine_data: "store",
      resize_height: false,
      max_height: @max_height,
      class: "mb-[-2px]" %>
  </div>

<% end %>
<% else %>
<%= render_component_tag class: "bg-white flex flex-col items-center justify-center border-2 border-dashed border-gray-200 p-6 rounded-md not-prose" do %>
  <div class="px-4 text-center">
    <%= icon  :alert_triangle, size: 6, class: "text-red-300 mx-auto" %>
    <div class="mt-2 max-w-xs">
      <h5 class="text-base">Preview not found</h5>
      <p class="mt-1 opacity-50 text-sm">
        The preview may have been renamed or deleted
      </p>
    </div>
  </div>
<% end %>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lookbook-1.0.0.rc.1 app/components/lookbook/embed/component.html.erb
lookbook-1.0.0.beta.8 app/components/lookbook/embed/component.html.erb
lookbook-1.0.0.beta.7 app/components/lookbook/embed/component.html.erb
lookbook-1.0.0.beta.6 app/components/lookbook/embed/component.html.erb