{#if dragged}
{/if}
{#if autoScroll === false && messages.length > 0}
{/if}
{#if prompt.charAt(0) === '/'} {:else if prompt.charAt(0) === '#'} { console.log(e); uploadWeb(e.detail); }} on:select={(e) => { console.log(e); files = [ ...files, { type: e?.detail?.type ?? 'doc', ...e.detail, upload_status: true } ]; }} /> {:else if prompt.charAt(0) === '@'} {:else if messages.length == 0 && suggestionPrompts.length !== 0} {/if}
{ let reader = new FileReader(); reader.onload = (event) => { files = [ ...files, { type: 'image', url: `${event.target.result}` } ]; inputFiles = null; filesInputElement.value = ''; }; if (inputFiles && inputFiles.length > 0) { const file = inputFiles[0]; if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) { reader.readAsDataURL(file); } else if ( SUPPORTED_FILE_TYPE.includes(file['type']) || SUPPORTED_FILE_EXTENSIONS.includes(file.name.split('.').at(-1)) ) { uploadDoc(file); filesInputElement.value = ''; } else { toast.error( `Unknown File Type '${file['type']}', but accepting and treating as plain text` ); uploadDoc(file); filesInputElement.value = ''; } } else { toast.error(`File not found.`); } }} />
{ submitPrompt(prompt, user); }} > {#if files.length > 0}
{#each files as file, fileIdx}
{#if file.type === 'image'} input {:else if file.type === 'doc'}
{#if file.upload_status} {:else} {/if}
{file.name}
Document
{:else if file.type === 'collection'}
#{file.name}
Collection
{/if}
{/each}
{/if}
{#if fileUploadEnabled}
{/if}