// socket.ts
import { io, Socket } from "socket.io-client";

export let chatClientSocket: Socket | undefined;

export const getChatClientSocket = (userId: string) => {
    const serverUrl = process.env.NEXT_PUBLIC_CHAT_URL;
    chatClientSocket = io(serverUrl, {
        auth: {
            userId,
        },
    });

    return chatClientSocket;
};
