'use client';


import { useAuth } from "../useAuth/useAuth.mjs";
import { useLogout } from "../reactQuery.mjs";

//#region src/hooks/useUser/index.ts
const useUser = () => {
	const { session, revalidateSession, setSession } = useAuth();
	const { mutate: logout } = useLogout();
	const status = session?.user ? "authenticated" : "unauthenticated";
	const isAuthenticated = status === "authenticated";
	const isUnauthenticated = status === "unauthenticated";
	const user = session?.user;
	const logoutHandle = async () => {
		setSession(null);
		logout();
	};
	return {
		isAuthenticated,
		isUnauthenticated,
		user,
		revalidateSession,
		logout: logoutHandle
	};
};

//#endregion
export { useUser };
//# sourceMappingURL=index.mjs.map