feat(frontend): add unpair button to phone

This commit is contained in:
h
2026-01-24 17:15:17 +01:00
parent 65d2d49355
commit d9ca679fe3
2 changed files with 15 additions and 2 deletions

View File

@@ -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>

View File

@@ -669,6 +669,10 @@
{/if}
{#if hasCamera && isPaired}
<SilentCapture bind:this={silentCaptureRef} oncapture={handleSilentCapture} />
<SilentCapture
bind:this={silentCaptureRef}
oncapture={handleSilentCapture}
onunpair={handleUnpair}
/>
{/if}
</div>