mirror of
https://github.com/OwethuManagedServices/oms-website-nextjs.git
synced 2025-12-17 18:58:10 +00:00
23 lines
679 B
TypeScript
23 lines
679 B
TypeScript
// components/Header.tsx (Server Component)
|
|
import React from "react";
|
|
import { auth } from "@/auth"; // Only need auth (for session) from here now
|
|
|
|
import HeaderClient from "./HeaderClient";
|
|
import { handleSignInAction, handleSignOutAction } from "@/actions/auth-action";
|
|
|
|
const Header = async () => {
|
|
// Fetch session data on the server
|
|
const session = await auth();
|
|
|
|
// Pass the session data and YOUR Server Actions as props
|
|
return (
|
|
<HeaderClient
|
|
session={session}
|
|
handleSignIn={handleSignInAction} // Pass YOUR sign-in Server Action
|
|
handleSignOut={handleSignOutAction} // Pass YOUR sign-out Server Action
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default Header;
|