2019-08-14 09:48:44 +00:00
|
|
|
<template>
|
2019-10-29 07:20:54 +00:00
|
|
|
<div
|
2021-07-13 13:24:33 +00:00
|
|
|
class="small-6 medium-4 large-3 columns channel"
|
2020-08-05 12:16:17 +00:00
|
|
|
:class="{ inactive: !isActive }"
|
2019-10-29 07:20:54 +00:00
|
|
|
@click="onItemClick"
|
|
|
|
>
|
|
|
|
<img
|
2020-08-05 12:16:17 +00:00
|
|
|
v-if="channel.key === 'facebook'"
|
2019-10-29 07:20:54 +00:00
|
|
|
src="~dashboard/assets/images/channels/facebook.png"
|
|
|
|
/>
|
|
|
|
<img
|
2020-08-05 12:16:17 +00:00
|
|
|
v-if="channel.key === 'twitter'"
|
2019-10-29 07:20:54 +00:00
|
|
|
src="~dashboard/assets/images/channels/twitter.png"
|
|
|
|
/>
|
|
|
|
<img
|
2020-08-05 12:16:17 +00:00
|
|
|
v-if="channel.key === 'telegram'"
|
2019-10-29 07:20:54 +00:00
|
|
|
src="~dashboard/assets/images/channels/telegram.png"
|
|
|
|
/>
|
2020-07-21 06:45:24 +00:00
|
|
|
<img
|
2021-06-07 18:52:36 +00:00
|
|
|
v-if="channel.key === 'api' && !channel.thumbnail"
|
2020-07-21 06:45:24 +00:00
|
|
|
src="~dashboard/assets/images/channels/api.png"
|
|
|
|
/>
|
2021-06-07 18:52:36 +00:00
|
|
|
<img
|
|
|
|
v-if="channel.key === 'api' && channel.thumbnail"
|
|
|
|
:src="channel.thumbnail"
|
|
|
|
/>
|
2020-07-21 06:45:24 +00:00
|
|
|
<img
|
2020-08-05 12:16:17 +00:00
|
|
|
v-if="channel.key === 'email'"
|
2020-07-21 06:45:24 +00:00
|
|
|
src="~dashboard/assets/images/channels/email.png"
|
|
|
|
/>
|
2019-10-29 07:20:54 +00:00
|
|
|
<img
|
2020-08-05 12:16:17 +00:00
|
|
|
v-if="channel.key === 'line'"
|
2019-10-29 07:20:54 +00:00
|
|
|
src="~dashboard/assets/images/channels/line.png"
|
|
|
|
/>
|
|
|
|
<img
|
2020-08-05 12:16:17 +00:00
|
|
|
v-if="channel.key === 'website'"
|
2019-10-29 07:20:54 +00:00
|
|
|
src="~dashboard/assets/images/channels/website.png"
|
|
|
|
/>
|
2020-04-05 16:41:27 +00:00
|
|
|
<img
|
2021-07-12 17:03:39 +00:00
|
|
|
v-if="channel.key === 'sms'"
|
|
|
|
src="~dashboard/assets/images/channels/sms.png"
|
|
|
|
/>
|
|
|
|
<img
|
|
|
|
v-if="channel.key === 'whatsapp'"
|
|
|
|
src="~dashboard/assets/images/channels/whatsapp.png"
|
2020-04-05 16:41:27 +00:00
|
|
|
/>
|
2019-10-29 07:20:54 +00:00
|
|
|
<h3 class="channel__title">
|
2020-08-05 12:16:17 +00:00
|
|
|
{{ channel.name }}
|
2019-10-29 07:20:54 +00:00
|
|
|
</h3>
|
2019-08-14 09:48:44 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
2019-10-29 07:20:54 +00:00
|
|
|
props: {
|
|
|
|
channel: {
|
2020-08-05 12:16:17 +00:00
|
|
|
type: Object,
|
2019-10-29 07:20:54 +00:00
|
|
|
required: true,
|
|
|
|
},
|
2020-07-06 05:46:19 +00:00
|
|
|
enabledFeatures: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
2020-08-05 12:16:17 +00:00
|
|
|
computed: {
|
|
|
|
isActive() {
|
|
|
|
const { key } = this.channel;
|
2020-10-03 08:37:50 +00:00
|
|
|
if (Object.keys(this.enabledFeatures).length === 0) {
|
2020-07-06 05:46:19 +00:00
|
|
|
return false;
|
|
|
|
}
|
2020-08-05 12:16:17 +00:00
|
|
|
if (key === 'facebook') {
|
2020-07-06 05:46:19 +00:00
|
|
|
return this.enabledFeatures.channel_facebook;
|
|
|
|
}
|
2020-08-05 12:16:17 +00:00
|
|
|
if (key === 'twitter') {
|
2020-07-09 10:58:09 +00:00
|
|
|
return this.enabledFeatures.channel_twitter;
|
2020-07-06 05:46:19 +00:00
|
|
|
}
|
2020-08-05 12:16:17 +00:00
|
|
|
if (key === 'email') {
|
2020-07-21 06:45:24 +00:00
|
|
|
return this.enabledFeatures.channel_email;
|
|
|
|
}
|
2021-07-12 17:03:39 +00:00
|
|
|
return ['website', 'twilio', 'api', 'whatsapp', 'sms'].includes(key);
|
2019-10-29 07:20:54 +00:00
|
|
|
},
|
2020-08-05 12:16:17 +00:00
|
|
|
},
|
|
|
|
methods: {
|
2019-10-29 07:20:54 +00:00
|
|
|
onItemClick() {
|
2020-08-05 12:16:17 +00:00
|
|
|
if (this.isActive) {
|
|
|
|
this.$emit('channel-item-click', this.channel.key);
|
2019-10-29 07:20:54 +00:00
|
|
|
}
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|