Skip to content

Commit

Permalink
update file icon
Browse files Browse the repository at this point in the history
  • Loading branch information
iceljc committed Sep 2, 2024
1 parent 9c98a46 commit 5f41b59
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 29 deletions.
31 changes: 8 additions & 23 deletions src/routes/chat/[agentId]/[conversationId]/chat-box.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
let loadTextEditor = false;
let autoScrollLog = false;
let disableAction = false;
let loadChatUtils = true;
let loadChatUtils = false;
$: {
Expand Down Expand Up @@ -1285,40 +1285,25 @@
>
<span>
<i
class="mdi mdi-image-plus"
class="bx bx-image-add"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="Upload image"
title="Upload images"
/>
</span>
</ChatFileUploader>
<ChatFileUploader
accept={'.pdf'}
accept={'.pdf,.xlsx,.xls,.csv'}
containerClasses={'line-align-center text-primary chat-util-item'}
disabled={disableAction}
on:filedroped={() => refresh()}
>
<span>
<i
class="mdi mdi-file-pdf"
class="bx bxs-folder-open"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="Upload pdf"
/>
</span>
</ChatFileUploader>
<ChatFileUploader
accept={'.xlsx,.xls,.csv'}
containerClasses={'line-align-center text-primary chat-util-item'}
disabled={disableAction}
on:filedroped={() => refresh()}
>
<span>
<i
class="mdi mdi-microsoft-excel"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="Upload excel"
title="Upload pdf, excel files"
/>
</span>
</ChatFileUploader>
Expand All @@ -1330,10 +1315,10 @@
>
<span>
<i
class="mdi mdi-file-music"
class="bx bxs-music"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="Upload audio"
title="Upload audios"
/>
</span>
</ChatFileUploader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<!-- svelte-ignore a11y-click-events-have-key-events -->
<i
class="bx bx-zoom-in clickable"
style="padding-top: 12px;"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="Zoom in"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/** @type {string} */
export let accept;
export let fileMaxSize = 10 * 1024 * 1024;
/** @type {boolean} */
export let disabled = false;
Expand All @@ -24,10 +26,10 @@
let disableFileDrop = false;
/** @type {number} */
let fileUploadLimit = 0;
let localFileUploadLimit = 0;
const fileUpperLimit = 5;
const fileMaxSize = 10 * 1024 * 1024;
const unsubscribe = conversationUserAttachmentStore.subscribe(value => {
const savedAttachments = $conversationUserAttachmentStore;
Expand All @@ -40,7 +42,7 @@
$: {
disableFileDrop = disabled || files.length >= fileUpperLimit;
fileUploadLimit = Math.max(fileUpperLimit - files.length, 0);
localFileUploadLimit = Math.max(fileUpperLimit - files.length, 0);
}
/** @param {any} e */
Expand All @@ -64,7 +66,7 @@
disableDefaultStyles
noDrag
disabled={disableFileDrop}
fileLimit={fileUploadLimit}
fileLimit={localFileUploadLimit}
maxSize={fileMaxSize}
on:drop={e => handleFileDrop(e)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
</button>
{/if}
{#if fileOption}
<ChatFileUploader accept=".png,.jpg,.jpeg,.pdf,.xlsx,.xls,.csv,.wav,.mp3">
<ChatFileUploader accept=".png,.jpg,.jpeg">
<span style="position: relative; top: 3px;" in:fade={{ duration: duration }}>
<i class="bx bx-image-add" />
</span>
Expand Down

0 comments on commit 5f41b59

Please sign in to comment.