feat: mvp
This commit is contained in:
@@ -42,9 +42,13 @@ const props = defineProps({
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
showAnalytics: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['edit', 'delete']);
|
||||
const emit = defineEmits(['edit', 'delete', 'analytics']);
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -116,7 +120,17 @@ const inboxIcon = computed(() => {
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-end w-20 gap-2">
|
||||
<div class="flex items-center justify-end w-28 gap-2">
|
||||
<Button
|
||||
v-if="showAnalytics"
|
||||
v-tooltip.top="t('CAMPAIGN.WHATSAPP.CARD.ANALYTICS')"
|
||||
variant="faded"
|
||||
size="sm"
|
||||
color="slate"
|
||||
icon="i-lucide-chart-no-axes-column"
|
||||
:title="t('CAMPAIGN.WHATSAPP.CARD.ANALYTICS')"
|
||||
@click="emit('analytics')"
|
||||
/>
|
||||
<Button
|
||||
v-if="isLiveChatType"
|
||||
variant="faded"
|
||||
|
||||
+12
-1
@@ -1,5 +1,7 @@
|
||||
<script setup>
|
||||
import CampaignCard from 'dashboard/components-next/Campaigns/CampaignCard/CampaignCard.vue';
|
||||
import { INBOX_TYPES } from 'dashboard/helper/inbox';
|
||||
import { useConfig } from 'dashboard/composables/useConfig';
|
||||
|
||||
defineProps({
|
||||
campaigns: {
|
||||
@@ -12,10 +14,13 @@ defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['edit', 'delete']);
|
||||
const emit = defineEmits(['edit', 'delete', 'analytics']);
|
||||
const STATUS_COMPLETED = 'completed';
|
||||
const { isEnterprise } = useConfig();
|
||||
|
||||
const handleEdit = campaign => emit('edit', campaign);
|
||||
const handleDelete = campaign => emit('delete', campaign);
|
||||
const handleAnalytics = campaign => emit('analytics', campaign);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -31,8 +36,14 @@ const handleDelete = campaign => emit('delete', campaign);
|
||||
:inbox="campaign.inbox"
|
||||
:scheduled-at="campaign.scheduled_at"
|
||||
:is-live-chat-type="isLiveChatType"
|
||||
:show-analytics="
|
||||
isEnterprise &&
|
||||
campaign.inbox?.channel_type === INBOX_TYPES.WHATSAPP &&
|
||||
campaign.campaign_status === STATUS_COMPLETED
|
||||
"
|
||||
@edit="handleEdit(campaign)"
|
||||
@delete="handleDelete(campaign)"
|
||||
@analytics="handleAnalytics(campaign)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user