Files
chatwoot/app/javascript/widget/components/template/Article.vue
Sivin Varghese 3a693947b5 feat: Add RTL Support to Widget (#11022)
This PR adds RTL support to the web widget for improved right-to-left language compatibility, updates colors, and cleans up code.

Fixes https://linear.app/chatwoot/issue/CW-4089/rtl-issues-on-widget

https://github.com/chatwoot/chatwoot/issues/9791

Other PR: https://github.com/chatwoot/chatwoot/pull/11016
2025-03-21 09:39:03 -07:00

52 lines
1.3 KiB
Vue

<script>
import { useMessageFormatter } from 'shared/composables/useMessageFormatter';
import FluentIcon from 'shared/components/FluentIcon/Index.vue';
export default {
components: {
FluentIcon,
},
props: {
items: {
type: Array,
default: () => [],
},
},
setup() {
const { truncateMessage } = useMessageFormatter();
return { truncateMessage };
},
};
</script>
<!-- eslint-disable-next-line vue/no-root-v-if -->
<template>
<div
v-if="!!items.length"
class="chat-bubble agent bg-n-background dark:bg-n-solid-3"
>
<div
v-for="item in items"
:key="item.link"
class="border-b border-solid border-n-weak text-sm py-2 px-0 last:border-b-0"
>
<a
:href="item.link"
target="_blank"
rel="noopener noreferrer nofollow"
class="text-n-slate-12 no-underline"
>
<span class="flex items-center text-black-900 font-medium">
<FluentIcon icon="link" class="ltr:mr-1 rtl:ml-1 text-n-slate-12" />
<span class="text-n-slate-12">
{{ item.title }}
</span>
</span>
<span class="block mt-1 text-n-slate-12">
{{ truncateMessage(item.description) }}
</span>
</a>
</div>
</div>
</template>