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

Header.tsx.ejs

27 lines1.0 KB

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