Add Ping frontend

React 19 + TypeScript client built with Vite. Zustand for local state,
react-oidc-context for the login flow, a SignalR connection for chat and
presence events, and LiveKit's React components for voice/video calls.
This commit is contained in:
2026-09-21 19:33:02 +02:00
parent 0623875dfa
commit 95a2d46408
48 changed files with 4356 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import { create } from 'zustand'
export type ToastTone = 'error' | 'info'
export interface Toast {
id: number
message: string
tone: ToastTone
}
let nextId = 1
interface ToastState {
toasts: Toast[]
push: (message: string, tone?: ToastTone) => void
dismiss: (id: number) => void
}
export const useToastStore = create<ToastState>((set) => ({
toasts: [],
push: (message, tone = 'info') => {
const id = nextId++
set((s) => ({ toasts: [...s.toasts, { id, message, tone }] }))
setTimeout(() => set((s) => ({ toasts: s.toasts.filter((t) => t.id !== id) })), 5000)
},
dismiss: (id) => set((s) => ({ toasts: s.toasts.filter((t) => t.id !== id) })),
}))