{#if dragged}
🗂️
Add Files
Drop any files/images here to add to the conversation
{/if}
{#if autoScroll === false && messages.length > 0}
{/if}
{#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 (['application/pdf', 'text/plain', 'text/csv'].includes(file['type'])) { uploadDoc(file); filesInputElement.value = ''; } else { toast.error(`Unsupported File Type '${file['type']}'.`); inputFiles = null; } } else { toast.error(`File not found.`); } }} />
{ submitPrompt(prompt); }} > {#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
{/if}
{/each}
{/if}
{#if fileUploadEnabled}
{/if}