feat(frontend): add unpair button to phone
This commit is contained in:
@@ -3,9 +3,10 @@
|
||||
|
||||
interface Props {
|
||||
oncapture: (base64: string, mediaType: string, thumbnailBase64: string) => void;
|
||||
onunpair?: () => void;
|
||||
}
|
||||
|
||||
let { oncapture }: Props = $props();
|
||||
let { oncapture, onunpair }: Props = $props();
|
||||
|
||||
let videoElement: HTMLVideoElement | null = $state(null);
|
||||
let stream: MediaStream | null = $state(null);
|
||||
@@ -123,4 +124,12 @@
|
||||
<div class="fixed inset-0 z-40 bg-black">
|
||||
<video bind:this={videoElement} autoplay playsinline muted class="h-full w-full object-cover"
|
||||
></video>
|
||||
{#if onunpair}
|
||||
<button
|
||||
onclick={onunpair}
|
||||
class="absolute top-4 left-4 z-10 rounded-full bg-red-600/80 px-3 py-1.5 text-xs text-white"
|
||||
>
|
||||
unpair
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -669,6 +669,10 @@
|
||||
{/if}
|
||||
|
||||
{#if hasCamera && isPaired}
|
||||
<SilentCapture bind:this={silentCaptureRef} oncapture={handleSilentCapture} />
|
||||
<SilentCapture
|
||||
bind:this={silentCaptureRef}
|
||||
oncapture={handleSilentCapture}
|
||||
onunpair={handleUnpair}
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user