mirror of
https://github.com/open-webui/computer.git
synced 2026-11-22 21:50:43 -05:00
34 lines
836 B
Svelte
34 lines
836 B
Svelte
<script lang="ts">
|
|
import type { Snippet } from 'svelte';
|
|
|
|
interface Props {
|
|
onclose: () => void;
|
|
class?: string;
|
|
children: Snippet;
|
|
}
|
|
|
|
let { onclose, class: className = '', children }: Props = $props();
|
|
|
|
function handleKeydown(e: KeyboardEvent) {
|
|
if (e.key === 'Escape') onclose();
|
|
}
|
|
</script>
|
|
|
|
<svelte:window onkeydown={handleKeydown} />
|
|
|
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
<div
|
|
class="fixed inset-0 bg-black/50 z-[100] flex items-center justify-center"
|
|
onmousedown={onclose}
|
|
onkeydown={() => {}}
|
|
>
|
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
<div
|
|
class="bg-white dark:bg-[#0a0a0a] dark:border dark:border-white/8 rounded-3xl overflow-visible shadow-2xl {className}"
|
|
onmousedown={(e) => e.stopPropagation()}
|
|
onkeydown={() => {}}
|
|
>
|
|
{@render children()}
|
|
</div>
|
|
</div>
|