<h1>Components</h1>
<p class="context-switch">
  <% for (const c of ['base', 'web', 'product']) { %><a href="?context=<%= c %>" class="badge<%= c === ctx ? ' active' : '' %>"><%= c %></a><% } %>
</p>

<% if (components.length === 0) { %>
<p>No components found for the <%= ctx %> context.</p>
<% } else { %>
  <% for (const c of components) { %>
  <div class="component-card">
    <h3><%= c.name %> <span class="context-badge"><%= c.category %></span></h3>
    <% if (c.description) { %><p><%= c.description %></p><% } %>
    <% if (c.variants && c.variants.length > 0) { %>
    <div>
      <% for (const v of c.variants) { %><span class="variant-tag"><%= v %></span><% } %>
    </div>
    <% } %>
    <% if (c.usage) { %><p class="usage-note"><%= c.usage %></p><% } %>
    <% if (c.examples && c.examples.length > 0) { %>
    <div class="examples">
      <% for (const ex of c.examples) { %><pre><%= ex %></pre><% } %>
    </div>
    <% } %>
  </div>
  <% } %>
<% } %>
