diff --git a/app/javascript/dashboard/components-next/message/bubbles/Audio.vue b/app/javascript/dashboard/components-next/message/bubbles/Audio.vue index f50597fee..a1073d71b 100644 --- a/app/javascript/dashboard/components-next/message/bubbles/Audio.vue +++ b/app/javascript/dashboard/components-next/message/bubbles/Audio.vue @@ -3,19 +3,31 @@ import { computed } from 'vue'; import BaseBubble from './Base.vue'; import AudioChip from 'next/message/chips/Audio.vue'; import { useMessageContext } from '../provider.js'; +import { MESSAGE_VARIANTS } from '../constants'; -const { attachments } = useMessageContext(); +const { attachments, variant } = useMessageContext(); const attachment = computed(() => { return attachments.value[0]; }); + +const textClass = computed(() => { + const textClassMap = { + [MESSAGE_VARIANTS.AGENT]: 'text-[rgb(var(--bubble-agent-text))]', + [MESSAGE_VARIANTS.USER]: 'text-[rgb(var(--bubble-user-text))]', + [MESSAGE_VARIANTS.PRIVATE]: 'text-[rgb(var(--bubble-private-text))]', + [MESSAGE_VARIANTS.BOT]: 'text-[rgb(var(--bubble-bot-text))]', + }; + return textClassMap[variant.value] || 'text-[rgb(var(--bubble-agent-text))]'; +}); diff --git a/app/javascript/dashboard/components-next/message/bubbles/BaseAttachment.vue b/app/javascript/dashboard/components-next/message/bubbles/BaseAttachment.vue index 11ed3dc0a..c299518f8 100644 --- a/app/javascript/dashboard/components-next/message/bubbles/BaseAttachment.vue +++ b/app/javascript/dashboard/components-next/message/bubbles/BaseAttachment.vue @@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n'; import BaseBubble from './Base.vue'; import Icon from 'next/icon/Icon.vue'; import { useMessageContext } from '../provider.js'; +import { MESSAGE_VARIANTS } from '../constants'; defineProps({ icon: { type: [String, Object], required: true }, @@ -20,12 +21,32 @@ defineProps({ }, }); -const { sender } = useMessageContext(); +const { sender, variant } = useMessageContext(); const { t } = useI18n(); const senderName = computed(() => { return sender?.value?.name || ''; }); + +const primaryTextClass = computed(() => { + const classMap = { + [MESSAGE_VARIANTS.AGENT]: 'text-[rgb(var(--bubble-agent-text))]', + [MESSAGE_VARIANTS.USER]: 'text-[rgb(var(--bubble-user-text))]', + [MESSAGE_VARIANTS.PRIVATE]: 'text-[rgb(var(--bubble-private-text))]', + [MESSAGE_VARIANTS.BOT]: 'text-[rgb(var(--bubble-bot-text))]', + }; + return classMap[variant.value] || 'text-[rgb(var(--bubble-agent-text))]'; +}); + +const secondaryTextClass = computed(() => { + const classMap = { + [MESSAGE_VARIANTS.AGENT]: 'text-[rgb(var(--bubble-agent-meta))]', + [MESSAGE_VARIANTS.USER]: 'text-[rgb(var(--bubble-user-meta))]', + [MESSAGE_VARIANTS.PRIVATE]: 'text-[rgb(var(--bubble-private-meta))]', + [MESSAGE_VARIANTS.BOT]: 'text-[rgb(var(--bubble-bot-meta))]', + }; + return classMap[variant.value] || 'text-[rgb(var(--bubble-agent-meta))]'; +});