import Link from "next/link";

import { getCurrentUser } from "@/lib/session";
import { HeaderClient } from "@/components/layout/header-client";

export async function Header() {
  const user = await getCurrentUser();

  return (
    <header className="sticky top-0 z-10 bg-white shadow-md dark:bg-gray-800">
      <div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
        <div className="flex h-14 items-center justify-between">
          <div className="flex items-center">
            <Link href="/" className="flex items-center space-x-3">
              <h1 className="text-2xl font-bold text-[#25263A] dark:text-white">
                Q58 Connect
              </h1>
            </Link>
          </div>

          <HeaderClient initialUser={user} />
        </div>
      </div>
    </header>
  );
}
