Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -4,13 +4,18 @@ import { QRCodeSVG } from 'qrcode.react';
|
|||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
||||||
import { startBroadcast, type BroadcasterHandle } from '@/lib/webrtc/broadcaster';
|
import { startBroadcast, type BroadcasterHandle } from '@/lib/webrtc/broadcaster';
|
||||||
|
import { getBroadcastSource } from '@/lib/webrtc/broadcastSource';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
|
|
||||||
interface ShareButtonProps {
|
interface ShareButtonProps {
|
||||||
variant?: 'default' | 'compact';
|
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 [open, setOpen] = useState(false);
|
||||||
const [starting, setStarting] = useState(false);
|
const [starting, setStarting] = useState(false);
|
||||||
const [handle, setHandle] = useState<BroadcasterHandle | null>(null);
|
const [handle, setHandle] = useState<BroadcasterHandle | null>(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user