DUNGEONS-34: implement Webka local streaming app
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
42
frontend/components/GlassModal.vue
Normal file
42
frontend/components/GlassModal.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<script setup lang="ts">
|
||||
import { X } from "lucide-vue-next";
|
||||
const props = defineProps<{ open: boolean; title: string }>();
|
||||
const emit = defineEmits<{ close: [] }>();
|
||||
const dialog = ref<HTMLDialogElement>();
|
||||
const titleId = useId();
|
||||
watch(
|
||||
() => props.open,
|
||||
async (open) => {
|
||||
await nextTick();
|
||||
if (open) dialog.value?.showModal();
|
||||
else dialog.value?.close();
|
||||
},
|
||||
);
|
||||
onMounted(() => {
|
||||
if (props.open) dialog.value?.showModal();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<dialog
|
||||
ref="dialog"
|
||||
class="glass modal"
|
||||
:aria-labelledby="titleId"
|
||||
@cancel.prevent="emit('close')"
|
||||
@click="
|
||||
(e) => {
|
||||
if (e.target === dialog) emit('close');
|
||||
}
|
||||
"
|
||||
>
|
||||
<div class="section-heading">
|
||||
<h2 :id="titleId">{{ title }}</h2>
|
||||
<GlassButton
|
||||
:aria-label="$t('common.close')"
|
||||
class="icon-button"
|
||||
@click="emit('close')"
|
||||
><X :size="20"
|
||||
/></GlassButton>
|
||||
</div>
|
||||
<slot />
|
||||
</dialog>
|
||||
</template>
|
||||
Reference in New Issue
Block a user