import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger, } from "@/components/ui/context-menu"; import { CircleCheckBig, CircleDot } from "lucide-react"; import { updateStreamStatus } from "@/lib/firestore-particles"; import { toFirestoreDocPath, particlePath } from "@/lib/particle-path"; import type { StreamParticle } from "@/hooks/use-stream-particles"; interface StreamContextMenuProps { particle: StreamParticle; networkId: string; children: React.ReactNode; } export function StreamContextMenu({ particle, networkId, children }: StreamContextMenuProps) { const isOpen = particle.status === "open"; const docPath = toFirestoreDocPath(particlePath(networkId, [particle.id])); const toggleStatus = async () => { await updateStreamStatus(docPath, isOpen ? "closed" : "open"); }; return ( {children} {isOpen ? ( <> Close stream ) : ( <> Open stream )} ); }