2020-04-10 11:12:37 +00:00
|
|
|
<template>
|
2022-04-01 15:29:03 +00:00
|
|
|
<div
|
|
|
|
v-if="!!items.length"
|
|
|
|
class="chat-bubble agent"
|
|
|
|
:class="$dm('bg-white', 'dark:bg-slate-700')"
|
|
|
|
>
|
2020-04-10 11:12:37 +00:00
|
|
|
<div v-for="item in items" :key="item.link" class="article-item">
|
|
|
|
<a :href="item.link" target="_blank" rel="noopener noreferrer nofollow">
|
2021-11-18 09:48:51 +00:00
|
|
|
<span class="title flex items-center text-black-900 font-medium">
|
2022-04-01 15:29:03 +00:00
|
|
|
<fluent-icon
|
|
|
|
icon="link"
|
|
|
|
class="mr-1"
|
|
|
|
:class="$dm('text-black-900', 'dark:text-slate-50')"
|
|
|
|
/>
|
|
|
|
<span :class="$dm('text-slate-900', 'dark:text-slate-50')">{{
|
|
|
|
item.title
|
|
|
|
}}</span>
|
2021-11-18 09:48:51 +00:00
|
|
|
</span>
|
2022-04-01 15:29:03 +00:00
|
|
|
<span
|
|
|
|
class="description"
|
|
|
|
:class="$dm('text-slate-700', 'dark:text-slate-200')"
|
|
|
|
>
|
2021-11-18 09:48:51 +00:00
|
|
|
{{ truncateMessage(item.description) }}
|
2020-04-10 11:12:37 +00:00
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import messageFormatterMixin from 'shared/mixins/messageFormatterMixin';
|
2021-11-18 09:48:51 +00:00
|
|
|
import FluentIcon from 'shared/components/FluentIcon/Index.vue';
|
2022-04-01 15:29:03 +00:00
|
|
|
import darkModeMixin from 'widget/mixins/darkModeMixin.js';
|
2020-04-10 11:12:37 +00:00
|
|
|
|
|
|
|
export default {
|
2021-11-18 09:48:51 +00:00
|
|
|
components: {
|
|
|
|
FluentIcon,
|
|
|
|
},
|
2022-04-01 15:29:03 +00:00
|
|
|
mixins: [messageFormatterMixin, darkModeMixin],
|
2020-04-10 11:12:37 +00:00
|
|
|
props: {
|
|
|
|
items: {
|
|
|
|
type: Array,
|
|
|
|
default: () => [],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import '~widget/assets/scss/variables.scss';
|
|
|
|
|
|
|
|
.article-item {
|
|
|
|
border-bottom: 1px solid $color-border;
|
|
|
|
font-size: $font-size-default;
|
|
|
|
padding: $space-small 0;
|
|
|
|
|
|
|
|
a {
|
|
|
|
color: $color-body;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.description {
|
|
|
|
display: block;
|
|
|
|
margin-top: $space-smaller;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
border-bottom: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|