{#if message.files}
{#each message.files as file}
{#if file.type === 'image'}
{:else if file.type === 'doc'}
{ if (file?.url) { window.open(file?.url, '_blank').focus(); } }} >
{file.name}
{$i18n.t('Document')}
{:else if file.type === 'collection'}
{file?.title ?? `#${file.name}`}
{$i18n.t('Collection')}
{/if}
{/each}
{/if} {#if edit === true}
{ e.target.style.height = ''; e.target.style.height = `${e.target.scrollHeight}px`; }} on:keydown={(e) => { if (e.key === 'Escape') { document.getElementById('close-edit-message-button')?.click(); } const isCmdOrCtrlPressed = e.metaKey || e.ctrlKey; const isEnterPressed = e.key === 'Enter'; if (isCmdOrCtrlPressed && isEnterPressed) { document.getElementById('save-edit-message-button')?.click(); } }} />
{ cancelEditMessage(); }} > {$i18n.t('Cancel')}
{ editMessageConfirmHandler(); }} > {$i18n.t('Send')}
{:else}
{message.content}
{#if !readOnly}
{ editMessageHandler(); }} >
{/if}
{ copyToClipboard(message.content); }} >
{#if !isFirstMessage && !readOnly}
{ deleteMessageHandler(); }} >
{/if} {#if siblings.length > 1}
{ showPreviousMessage(message); }} >
{siblings.indexOf(message.id) + 1}/{siblings.length}
{ showNextMessage(message); }} >
{/if}
{/if}