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

Header.tsx

34 lines1.1 KB

1import { Link } from "@tanstack/react-router";
2​
3import { allPosts } from "content-collections";
4​
5export default function Header() {
6 const categories = Array.from(
7 new Set(allPosts.flatMap((post) => post.categories))
8 );
9 return (
10 <header className="text-slate-700 font-serif font-extrabold fixed top-0 left-0 right-0 z-50 backdrop-blur-md bg-white/50 border-b border-slate-200/50 transition-all">
11 <nav className="max-w-7xl mx-auto p-4 flex gap-2 justify-between">
12 <div className="flex flex-row items-center space-x-6">
13 <div className="text-xl tracking-wide">
14 <Link to="/" className="hover:text-emerald-700 transition-colors">
15 Hawaii Adventures
16 </Link>
17 </div>
18 <div className="flex gap-6">
19 {categories.map((category) => (
20 <div key={category}>
21 <Link
22 to={`/category/${category}`}
23 className="hover:text-emerald-700 transition-colors"
24 >
25 {category}
26 </Link>
27 </div>
28 ))}
29 </div>
30 </div>
31 </nav>
32 </header>
33 );