modelfile.tagName === message.user)?.imageUrl ?? '/user.png' : user?.profile_image_url ?? '/user.png'} />
{#if message.user} {#if $modelfiles.map((modelfile) => modelfile.tagName).includes(message.user)} {$modelfiles.find((modelfile) => modelfile.tagName === message.user)?.title} {:else} {$i18n.t('You')}
{message?.user ?? ''}
{/if} {:else if $settings.showUsername} {user.name} {:else} {$i18n.t('You')} {/if} {#if message.timestamp}
{dayjs(message.timestamp * 1000).format($i18n.t('DD/MM/YYYY HH:mm'))}
{/if}
{#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(); } }} />
{ editMessageConfirmHandler(); }} > {$i18n.t('Save & Submit')}
{ cancelEditMessage(); }} > {$i18n.t('Cancel')}
{:else}
{message.content}
{#if siblings.length > 1}
{ showPreviousMessage(message); }} >
{siblings.indexOf(message.id) + 1} / {siblings.length}
{ showNextMessage(message); }} >
{/if} {#if !readOnly}
{ editMessageHandler(); }} >
{/if}
{ copyToClipboard(message.content); }} >
{#if !isFirstMessage && !readOnly}
{ deleteMessageHandler(); }} >
{/if}
{/if}