Files
oms-website-nextjs/components/Header.tsx

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;