import { createContext } from "react"; import type { Dump, OnlineUser } from "../model.ts"; export interface WSContextValue { onlineUsers: OnlineUser[]; voteCounts: Record; myVotes: Set; recentDumps: Dump[]; deletedDumpIds: Set; castVote: (dumpId: string) => void; removeVote: (dumpId: string) => void; } export const WSContext = createContext({ onlineUsers: [], voteCounts: {}, myVotes: new Set(), recentDumps: [], deletedDumpIds: new Set(), castVote: () => {}, removeVote: () => {}, });