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} You
{message?.user ?? ''}
{/if} {:else} You {/if} {#if message.timestamp}
{dayjs(message.timestamp * 1000).format('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}
Document
{:else if file.type === 'collection'}
{file?.title ?? `#${file.name}`}
Collection
{/if}
{/each}
{/if} {#if edit === true}
{ e.target.style.height = `${e.target.scrollHeight}px`; }} />
{ editMessageConfirmHandler(); }} > Save & Submit
{ cancelEditMessage(); }} > Cancel
{:else}
{message.content}
{#if siblings.length > 1}
{ showPreviousMessage(message); }} >
{siblings.indexOf(message.id) + 1} / {siblings.length}
{ showNextMessage(message); }} >
{/if}
{ editMessageHandler(); }} >
{ copyToClipboard(message.content); }} >
{/if}