KI-AGENT: Anrufbuttons und Telefoniejournal erweitern

This commit is contained in:
2026-05-22 16:14:07 +02:00
parent 3594dc69e8
commit 8a2429827c
5 changed files with 210 additions and 19 deletions

View File

@@ -0,0 +1,51 @@
<script setup>
const props = defineProps({
number: {
type: [String, Number],
default: ""
},
label: {
type: String,
default: ""
},
size: {
type: String,
default: "xs"
},
variant: {
type: String,
default: "soft"
}
})
const router = useRouter()
const normalizedNumber = computed(() => String(props.number || "").trim())
const displayLabel = computed(() => props.label || normalizedNumber.value)
const canCall = computed(() => normalizedNumber.value.length > 0)
const openSoftphone = async () => {
if (!canCall.value) return
await router.push({
path: "/communication/phone",
query: {
call: normalizedNumber.value,
name: props.label || undefined
}
})
}
</script>
<template>
<UButton
icon="i-heroicons-phone"
color="primary"
:size="size"
:variant="variant"
:disabled="!canCall"
@click="openSoftphone"
>
{{ displayLabel }}
</UButton>
</template>