chore: Preview email attachments

This commit is contained in:
iamsivin
2025-05-02 20:20:14 +05:30
parent c1c488eafa
commit cc44e7ab88
3 changed files with 17 additions and 0 deletions
@@ -133,6 +133,7 @@ const handleSeeOriginal = () => {
:message="contentAttributes?.email"
:content="content"
:inbox="inbox"
:attachments="attachments"
:message-id="id"
class="absolute right-3 z-50 skip-context-menu top-10"
@close="showForwardMessageModal = false"
@@ -36,6 +36,10 @@ const props = defineProps({
type: Number,
default: null,
},
attachments: {
type: Array,
default: () => [],
},
});
const emit = defineEmits(['close']);
@@ -163,6 +167,7 @@ const handleSelectedContact = async ({ value, action, ...rest }) => {
:is-creating-contact="isCreatingContact"
:from-email="fromEmail"
:message="message"
:attachments="attachments"
:message-signature="messageSignature"
:content="content"
:is-plain-email="!message || !Object.keys(message).length"
@@ -13,6 +13,7 @@ import ContactSelector from 'dashboard/components-next/NewConversation/component
import ActionButtons from 'dashboard/components-next/NewConversation/components/ActionButtons.vue';
import AttachmentPreviews from 'dashboard/components-next/NewConversation/components/AttachmentPreviews.vue';
import EmailMessageEditor from './EmailMessageEditor.vue';
import AttachmentChips from 'next/message/chips/AttachmentChips.vue';
const props = defineProps({
forwardType: { type: String, default: 'email' }, // eslint-disable-line vue/no-unused-properties
@@ -28,6 +29,7 @@ const props = defineProps({
unquotedHtml: { type: String, default: '' },
textToShow: { type: String, default: '' },
hasQuotedMessage: { type: Boolean, default: false },
attachments: { type: Array, default: () => [] },
});
const emit = defineEmits([
@@ -170,6 +172,15 @@ const handleSendMessage = async () => {
:unquoted-html="unquotedHtml"
:text-to-show="textToShow"
/>
<section
v-if="Array.isArray(attachments) && attachments.length"
class="px-4 pb-4 pt-2 !border-t-0 space-y-2 bg-n-alpha-3"
>
<AttachmentChips
:attachments="attachments"
class="gap-1 !justify-start"
/>
</section>
<AttachmentPreviews
v-if="state.attachedFiles.length > 0"
:attachments="state.attachedFiles"