initial commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import Image from "next/image";
|
||||
import { Button } from "./ui/button";
|
||||
import login from "@/app/actions/login";
|
||||
import { getCurrentUser } from "@/lib/user";
|
||||
|
||||
export default async function Header() {
|
||||
const user = await getCurrentUser();
|
||||
|
||||
return (
|
||||
<header className="relative flex items-center justify-between w-full h-16 px-8 bg-gray-100">
|
||||
<div />
|
||||
<div className="absolute left-1/2 -translate-x-1/2 flex items-center gap-4">
|
||||
<Image
|
||||
src="/emblem.png"
|
||||
width={28}
|
||||
height={28}
|
||||
alt="Emblem of the European Federation"
|
||||
/>
|
||||
<h3>European Federation</h3>
|
||||
</div>
|
||||
{
|
||||
user ? (
|
||||
<div className="flex items-center gap-4">
|
||||
<span className="">
|
||||
{user.firstName} {user.secondName}
|
||||
</span>
|
||||
</div>
|
||||
) : (
|
||||
<form action={login}>
|
||||
<Button size="lg" type="submit">Sign in with Kotosoft ID</Button>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
</header>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user