import { cache } from "react"; import Link from "next/link"; import { listReposForUser } from "@/lib/repos"; import { SIGNUPS_ENABLED } from "@/lib/signups"; import type { Theme } from "@/lib/theme"; import type { User } from "@/lib/users"; import { BRAND, Logo, LogoMark } from "./brand"; import { PlusIcon } from "./icons"; import { NavLinks } from "./nav-links"; import { SearchBox } from "./search-box"; import { AppSidebar, MobileNav } from "./sidebar-nav"; import { ButtonLink } from "./ui"; // The sidebar and the search box both list them; one query per request. const sidebarRepos = cache(async (viewerId: string) => (await listReposForUser(viewerId)).map((r) => ({ owner: r.owner, name: r.name, imageVersion: r.imageVersion })), ); const viewerOf = (viewer: User) => ({ username: viewer.username, name: viewer.name }); /** Left rail for signed-in users: account menu, places and repository shortcuts. */ export async function SiteSidebar({ viewer, theme }: { viewer: User; theme: Theme }) { return ; } /** Thin bar above the sheet for signed-in users. On small screens it also carries the navigation. */ export async function TopBar({ viewer }: { viewer: User }) { return (
}> New
); } /** Header for signed-out visitors. */ export function SiteHeader() { return (
Sign In {SIGNUPS_ENABLED && ( Create Account )}
); }