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

export let clientSocket: Socket | undefined;

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

    return clientSocket;
};
