<!--
  Copyright © 2025-26 l5yth & contributors

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<% reference_json = node_reference_json || "{}"
   short_display = node_page_short_name || "Loading"
   long_display = node_page_long_name
   identifier_display = node_page_identifier || "" %>
<section
  id="nodeDetail"
  class="node-detail"
  data-node-reference="<%= Rack::Utils.escape_html(reference_json) %>"
  data-private-mode="<%= private_mode ? "true" : "false" %>"
>
  <header class="node-detail__header">
    <h2 class="node-detail__title">
      <span class="node-detail__badge" data-node-badge><%= Rack::Utils.escape_html(short_display) %></span>
      <% if long_display %>
        <span class="node-detail__name" data-node-long-name><%= Rack::Utils.escape_html(long_display) %></span>
      <% end %>
      <% if identifier_display && !identifier_display.empty? %>
        <span class="node-detail__identifier" data-node-identifier>[<%= Rack::Utils.escape_html(identifier_display) %>]</span>
      <% end %>
    </h2>
  </header>
  <p class="node-detail__status" data-node-status>Loading node details…</p>
  <noscript>
    <p class="node-detail__noscript">This page requires JavaScript to display node information.</p>
  </noscript>
</section>
<script type="module">
  import { initializeNodeDetailPage } from '/assets/js/app/node-page.js';
  initializeNodeDetailPage();
</script>
