2026-10-15 23:08:47 -06:00
|
|
|
import type { ReactNode } from "react";
|
|
|
|
|
import { Link } from "react-router";
|
|
|
|
|
import logo from "../assets/logo.png";
|
|
|
|
|
|
|
|
|
|
interface TopBarProps {
|
2026-10-16 07:40:29 -06:00
|
|
|
/** The role switcher, drawn between the brand and the spacer. */
|
|
|
|
|
nav?: ReactNode;
|
|
|
|
|
/** Right-hand side: the signed-in user, the role chip, Account and Sign out. */
|
2026-10-15 23:08:47 -06:00
|
|
|
children?: ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Sticky shop header. Same markup classes as the old page's header.top. */
|
2026-10-16 07:40:29 -06:00
|
|
|
export function TopBar({ nav, children }: TopBarProps) {
|
2026-10-15 23:08:47 -06:00
|
|
|
return (
|
|
|
|
|
<header className="top">
|
|
|
|
|
<div className="top-in">
|
|
|
|
|
<Link className="brand" to="/" aria-label="Packet Station home">
|
|
|
|
|
<img alt="PESCO" src={logo} width={119} height={34} />
|
|
|
|
|
<div className="nm">
|
|
|
|
|
Packet <span>Station</span>
|
|
|
|
|
</div>
|
|
|
|
|
</Link>
|
2026-10-16 07:40:29 -06:00
|
|
|
{nav}
|
2026-10-15 23:08:47 -06:00
|
|
|
<div className="sp" />
|
|
|
|
|
{children ? <div className="who">{children}</div> : null}
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
);
|
|
|
|
|
}
|