Inboxes with voice enabled were showing a generic phone icon in the inbox list and sidebar, hiding the underlying channel (e.g. WhatsApp). Keep the native channel logo and overlay an audio-waveform badge when voice is enabled. The native Twilio Voice inbox (TwilioSms with no WhatsApp medium) still resolves to the phone icon.
31 lines
874 B
Vue
31 lines
874 B
Vue
<script setup>
|
|
import { computed, toRef } from 'vue';
|
|
import { isVoiceCallEnabled } from 'dashboard/helper/inbox';
|
|
import { useChannelIcon } from './provider';
|
|
import Icon from 'next/icon/Icon.vue';
|
|
|
|
const props = defineProps({
|
|
inbox: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
});
|
|
|
|
defineOptions({ inheritAttrs: false });
|
|
|
|
const channelIcon = useChannelIcon(toRef(props, 'inbox'));
|
|
const hasVoiceBadge = computed(() => isVoiceCallEnabled(props.inbox));
|
|
</script>
|
|
|
|
<template>
|
|
<span class="relative inline-flex" v-bind="$attrs">
|
|
<Icon :icon="channelIcon" class="size-full" />
|
|
<span
|
|
v-if="hasVoiceBadge"
|
|
class="absolute -top-1 -right-1 inline-flex items-center justify-center size-2.5 rounded-full bg-n-alpha-2 ring-1 ring-n-solid-1"
|
|
>
|
|
<Icon icon="i-lucide-audio-lines" class="size-1.5 text-n-slate-10" />
|
|
</span>
|
|
</span>
|
|
</template>
|