<?xml version="1.0" encoding="UTF-8"?>
<templates>

    <t t-name="mail.WebClientViewAttachmentView" owl="1">
        <t t-if="webClientViewAttachmentView.thread.mainAttachment">
            <t t-if="!webClientViewAttachmentView.thread.mainAttachment.isPdf">
                <h3 class="mt0 mb8 ps-2 text-muted float-end"><t t-esc="webClientViewAttachmentView.thread.mainAttachment.filename"/></h3>
            </t>
            <div t-if="webClientViewAttachmentView.thread.mainAttachment.isImage" class="o_attachment_preview_img">
                <img id="attachment_img" class="img img-fluid d-block" t-attf-src="/web/image/#{webClientViewAttachmentView.thread.mainAttachment.id}?unique=1"/>
            </div>
            <iframe t-if="webClientViewAttachmentView.thread.mainAttachment.isPdf" class="mb48" t-attf-src="/web/static/lib/pdfjs/web/viewer.html?file=/web/content/#{webClientViewAttachmentView.thread.mainAttachment.id}?filename%3D#{window.encodeURIComponent(webClientViewAttachmentView.thread.mainAttachment.name)}" t-ref="iframeViewerPdf"/>
            <t t-if="webClientViewAttachmentView.thread.attachmentsInWebClientView.length > 1 or (webClientViewAttachmentView.thread.attachmentsInWebClientView.length > 0 and !(webClientViewAttachmentView.thread.mainAttachment.isPdf or webClientViewAttachmentView.thread.mainAttachment.isImage))">
                <a class="arrow o_move_previous text-center" href="#" t-on-click="webClientViewAttachmentView.onClickPrevious">
                    <span class="fa fa-chevron-left"/>
                </a>
                <a class="arrow o_move_next text-center" href="#" t-on-click="webClientViewAttachmentView.onClickNext">
                    <span class="fa fa-chevron-right"/>
                </a>
            </t>
        </t>
    </t>

</templates>
