feat: pages

This commit is contained in:
Ivan Rezchikov
2026-06-22 16:44:06 +03:00
parent 48656b562a
commit 64923cd1b2
20 changed files with 1038 additions and 283 deletions
+10 -2
View File
@@ -4,14 +4,15 @@ import login from "@/app/actions/login";
import { getCurrentUser } from "@/lib/user";
import logout from "@/app/actions/logout";
import Link from "next/link";
import { getNavLinks } from "@/lib/navlinks/repository";
export default async function Header() {
const user = await getCurrentUser();
const links = await getNavLinks();
return (
<header className="relative flex items-center justify-between w-full h-16 px-8 bg-gray-100">
<div />
<Link href="/" className="absolute left-1/2 -translate-x-1/2 flex items-center gap-4">
<Link href="/" className="flex items-center gap-4">
<Image
src="/emblem.png"
width={28}
@@ -20,6 +21,13 @@ export default async function Header() {
/>
<h3>European Federation</h3>
</Link>
<div className="absolute left-1/2 -translate-x-1/2 flex items-center gap-6">
{
links.map((link) => (
<Link className="hover:underline underline-offset-8 decoration-2 duration-200" key={link.id} href={link.href || `/${link.page.type.toLowerCase()}/${link.page.slug}`}><h3>{link.label ?? link.page?.title}</h3></Link>
))
}
</div>
{
user ? (
<form action={logout}>