import { io } from 'socket.io-client'

let socketInstance = null

export function useSocket() {
  if (socketInstance) return socketInstance

  socketInstance = io({
    transports: ['websocket', 'polling'],
    withCredentials: true,
  })

  return socketInstance
}

