Skip to content
Source
Sign inSign up
TanStack/cli
Open History to see the last commit

header.tsx.ejs

28 lines1.1 KB

1<% if (addOns.length === 0 && integrations.length === 0 && routes.length === 0) { ignoreFile() } %>
2import { component$ } from "@builder.io/qwik";
3import { Link } from '@builder.io/qwik-city';
4<% for(const integration of integrations.filter(i => i.type === 'header-user')) { %>
5import <%= integration.jsName %> from "<%= relativePath(integration.path) %>";
6<% } %>
7​
8export default component$(() => {
9 return (
10 <header class="p-2 flex gap-2 bg-white text-black justify-between">
11 <nav class="flex flex-row">
12 <div class="px-2 font-bold">
13 <Link to="/">Home</Link>
14 </div>
15<% for(const addOn of addOns) { for(const route of (addOn?.routes||[])?.filter(r => r.url && r.name)) { %>
16<div class="px-2 font-bold"><Link href="<%= route.url %>"><%= route.name %></Link></div>
17<% } } %>
18 </nav>
19<% if (integrations.filter(i => i.type === 'header-user').length > 0) { %>
20 <div>
21<% for(const integration of integrations.filter(i => i.type === 'header-user')) { %>
22 <<%= integration.jsName %> />
23<% } %>
24 </div>
25<% } %>
26 </header>
27 );
28})