% content_for :shell do %>
<% if Lookbook.previews? || Lookbook.pages? %>
<%= render_component :split_layout,
alpine_data: "$store.layout.main",
":class": "$store.layout.mobile && '!block'" do |layout| %>
<% layout.pane id: "app-sidebar", class: "flex flex-col bg-lookbook-sidebar relative translate-x-0",
":class": "{
'transition': $store.layout.mobile,
'translate-x-full': $store.layout.mobile && sidebarHidden,
'!absolute right-0 bottom-0 top-[40px] h-[calc(100%_-_40px)] w-full max-w-[420px] z-50 border-l border-lookbook-divider': $store.layout.mobile
}",
"@click.outside": "closeMobileSidebar",
cloak: true do %>
<%= render_component :split_layout,
alpine_data: "$store.layout.#{Lookbook.pages? && Lookbook.previews? ? "sidebar" : "singleSectionSidebar"}",
style: "height: calc(100vh - 2.5rem);" do |layout| %>
<% if Lookbook.previews? %>
<% layout.pane class: "overflow-hidden" do %>
<%= render_component :nav,
id: "previews-nav",
collection: Lookbook.previews,
alpine_data: "$store.nav.previews",
collapse_singles: true do |nav| %>
<%= nav.toolbar do |toolbar| %>
<% toolbar.section padded: true do %>
Previews
<% end %>
<% end %>
<% nav.filter store: "$store.nav.previews.filter", placeholder: "Filter previews by name…" %>
<% end %>
<% end %>
<% end %>
<% if Lookbook.pages? %>
<% layout.pane class: "overflow-hidden" do %>
<%= render_component :nav,
id: "pages-nav",
collection: Lookbook.pages,
alpine_data: "$store.nav.pages" do |nav| %>
<%= nav.toolbar do |toolbar| %>
<% toolbar.section padded: true do %>
Pages
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>
<% if Lookbook::Preview.errors.any? %>
<%= render_component :toolbar do |toolbar| %>
<% toolbar.section padded: true, class: "flex items-center" do %>
<%= icon :alert_triangle, size: 4, class: "text-red-700" %>
Preview load errors
<% end %>
<% toolbar.section align: :right do %>
<% render_component :button, icon: :x, "@click": "hidden = !hidden" %>
<% end %>
<% end %>
<% Lookbook::Preview.errors.each do |error| %>
<% error = error.is_a?(Lookbook::Error) ? error : Lookbook::Error.new(error) %>
-
<%= error.file_name %><%= ":#{error.line_number}" if error.line_number %>
<%= error.message %>
<% end %>
<% end %>
<% end %>
<% layout.pane id: "app-main", class: "overflow-hidden h-full", ":class": "$store.layout.mobile && 'w-screen'" do %>
<%= content_for?(:main) ? yield(:main) : yield %>
<% end %>
<% end %>
<% else %>
<%= content_for?(:main) ? yield(:main) : yield %>
<% end %>
<% end %>
<%= render template: "layouts/lookbook/shell" %>