Added Connection Component, Store, JWT logic

This commit is contained in:
PxlLoewe
2025-03-14 19:46:09 -07:00
parent d7e4ae468d
commit abf3475c7c
9 changed files with 65 additions and 21 deletions

View File

@@ -0,0 +1,17 @@
import { useSession } from "next-auth/react";
import { connectionStore } from "../../_store/connectionStore";
import { useEffect } from "react";
export const Connection = () => {
const session = useSession();
const cStore = connectionStore((state) => state);
const uid = session.data?.user?.id;
useEffect(() => {
if (uid) {
cStore.connect(uid);
}
}, [uid]);
return <div>{cStore.isConnected ? "Connected" : "Not Connected"}</div>;
};