Files
t5de-hub/apps/web/components/header.tsx
T
dhkatzandClaude Opus 5.5 07bbc11565
CI / test (push) Successful in 1m11s
Website header: the T5DE logo, four links, and a profile menu
The header shows T5DE's logo (the client's, also the tab icon) and Online, Rooms, Products and
Catalogs; the person's pages (Account, Library, Console for moderators) and signing out are in a menu
under their picture: their first linked IMVU account's avatar picture, which /me now gives (kept an
hour), or their initial. Creating a product moves to Products (New product, /products/new; /create
redirects there), as creating a room is on Rooms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 07:18:26 -07:00

44 lines
1.6 KiB
TypeScript

import Image from "next/image";
import Link from "next/link";
import { getMe, isModerator } from "@/lib/api";
import { buttonVariants } from "@/components/ui/button";
import { NavLink, ProfileMenu } from "./header-client";
import logo from "./t5de.png";
export function Logo({ className }: { className?: string }) {
return <Image src={logo} alt="T5DE" priority className={className ?? "size-9"} />;
}
export async function Header() {
const me = await getMe();
return (
<header className="border-b">
<div className="mx-auto flex max-w-5xl flex-wrap items-center gap-x-6 gap-y-2 px-4 py-3 sm:px-6">
<Link href="/" aria-label="T5DE Hub home" className="shrink-0">
<Logo />
</Link>
<nav className="order-last flex w-full flex-wrap items-center gap-1 text-sm sm:order-none sm:w-auto">
<NavLink href="/online">Online</NavLink>
<NavLink href="/rooms">Rooms</NavLink>
<NavLink href="/products">Products</NavLink>
<NavLink href="/catalogs">Catalogs</NavLink>
</nav>
<div className="ml-auto flex items-center gap-2 text-sm">
{me ? (
<ProfileMenu username={me.username} picture={me.picture} console={isModerator(me)} />
) : (
<>
<Link href="/signin" className={buttonVariants({ variant: "ghost" })}>
Sign in
</Link>
<Link href="/signup" className={buttonVariants()}>
Create account
</Link>
</>
)}
</div>
</div>
</header>
);
}