% content_for(:title) { page_title(@leaf, @book) } %>
<% content_for :header do %>
<%= render "leaves/header", book: @book, leaf: @leaf %>
<% end %>
<% if @leaf.section? %>
">
<%= simple_format @leaf.section.body %>
<% elsif @leaf.page? %>
<%= sanitize_content @leaf.page.body.to_html %>
<% elsif @leaf.picture? %>
<% if @leaf.picture.image.attached? %>
<%= link_to rails_blob_path(@leaf.picture.image), data: {
action: "lightbox#open:prevent",
lightbox_target: "image",
lightbox_url_value: rails_blob_path(@leaf.picture.image, disposition: "attachment", only_path: true) } do %>
<%= image_tag @leaf.picture.image.variant(:large), loading: "lazy" %>
<% end %>
<% else %>
<%= image_tag "default-picture.webp", alt: "No image uploaded", loading: "lazy" %>
<% end %>
<%= simple_format @leaf.picture.caption %>
<% end %>
<% content_for :footer do %>
<%= render "leaves/navigation", leaf: @leaf %>
<% end %>