{#if mailState.currentEmail.attachments && mailState.currentEmail.attachments.length > 0}
{#each mailState.currentEmail.attachments as att}
{#if att.contentType.startsWith("image/")}
{:else if att.contentType === "application/pdf" || att.filename.toLowerCase().endsWith(".pdf")}
{:else if att.filename.toLowerCase().endsWith(".eml")}
{:else if mailState.currentEmail.isPec && att.filename.toLowerCase().endsWith(".p7s")}
{att.filename}
{:else if mailState.currentEmail.isPec && att.filename.toLowerCase() === "daticert.xml"}
{att.filename}
{:else}
{#if att.contentType.startsWith("image/")}
{:else}
{/if}
{att.filename}
{/if}
{/each}
{:else}
{m.mail_no_attachments()}
{/if}