Document the 2026-11-05 UI/UX upgrade and keep roster/live gates aligned with face-check and presence. Co-authored-by: Cursor <cursoragent@cursor.com>
32 lines
764 B
TypeScript
32 lines
764 B
TypeScript
/**
|
|
* One presence poll for the whole admin shell — top pulse + join/roster rows share state.
|
|
*/
|
|
import { createContext, useContext, type ReactNode } from 'react'
|
|
import {
|
|
useSocialPresenceLive,
|
|
type PresenceSnap,
|
|
type PresencePeer,
|
|
} from './useSocialPresenceLive'
|
|
|
|
export type { PresencePeer, PresenceSnap }
|
|
|
|
const EMPTY: PresenceSnap = {
|
|
online: 0,
|
|
peers: [],
|
|
cityOnline: 0,
|
|
ok: false,
|
|
fromOffline: true,
|
|
bumped: null,
|
|
}
|
|
|
|
const Ctx = createContext<PresenceSnap>(EMPTY)
|
|
|
|
export function SocialPresenceProvider({ children }: { children: ReactNode }) {
|
|
const snap = useSocialPresenceLive()
|
|
return <Ctx.Provider value={snap}>{children}</Ctx.Provider>
|
|
}
|
|
|
|
export function useSharedSocialPresence(): PresenceSnap {
|
|
return useContext(Ctx)
|
|
}
|