2026-11-15 21:00:50 +00:00
|
|
|
import Link from "next/link";
|
|
|
|
|
|
|
|
|
|
import type { Me } from "@/lib/types";
|
|
|
|
|
|
|
|
|
|
import { LogoutButton } from "./LogoutButton";
|
|
|
|
|
import { NavLinks } from "./NavLinks";
|
|
|
|
|
|
|
|
|
|
export function Logo() {
|
|
|
|
|
return (
|
|
|
|
|
<Link href="/" className="logo">
|
|
|
|
|
sors<span>fonalak</span>
|
|
|
|
|
</Link>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function SiteHeader({ me }: { me: Me }) {
|
2026-11-16 06:37:59 +00:00
|
|
|
const links = [
|
|
|
|
|
{ href: "/keplet", label: "Képletem" },
|
|
|
|
|
{ href: "/profil", label: "Profil" },
|
|
|
|
|
];
|
2026-11-15 21:00:50 +00:00
|
|
|
if (me.user.roles.includes("admin")) links.push({ href: "/admin", label: "Admin" });
|
|
|
|
|
return (
|
|
|
|
|
<header className="site-header">
|
|
|
|
|
<Logo />
|
|
|
|
|
<NavLinks links={links} />
|
|
|
|
|
<div className="who">
|
|
|
|
|
<span>{me.user.display_name || me.user.email}</span>
|
|
|
|
|
<LogoutButton />
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
);
|
|
|
|
|
}
|