Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-05-14 18:05:11 +00:00
parent eb7b7f53d1
commit 83f6142623
+6 -1
View File
@@ -4,13 +4,18 @@ import { QRCodeSVG } from 'qrcode.react';
import { Button } from '@/components/ui/button';
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import { startBroadcast, type BroadcasterHandle } from '@/lib/webrtc/broadcaster';
import { getBroadcastSource } from '@/lib/webrtc/broadcastSource';
import { toast } from 'sonner';
interface ShareButtonProps {
variant?: 'default' | 'compact';
/** Opens the dialog automatically when toggled. Used by the in-XR HUD. */
autoOpen?: boolean;
onHandleChange?: (h: BroadcasterHandle | null) => void;
onViewerCountChange?: (n: number) => void;
}
export function ShareButton({ variant = 'default' }: ShareButtonProps) {
export function ShareButton({ variant = 'default', autoOpen, onHandleChange, onViewerCountChange }: ShareButtonProps) {
const [open, setOpen] = useState(false);
const [starting, setStarting] = useState(false);
const [handle, setHandle] = useState<BroadcasterHandle | null>(null);