فهرست منبع

refac: styling

Timothy Jaeryang Baek 2 ماه پیش
والد
کامیت
f19d5b05a8
2فایلهای تغییر یافته به همراه12 افزوده شده و 3 حذف شده
  1. 1 0
      src/lib/components/chat/MessageInput/Commands/Knowledge.svelte
  2. 11 3
      src/lib/components/common/FileItemModal.svelte

+ 1 - 0
src/lib/components/chat/MessageInput/Commands/Knowledge.svelte

@@ -153,6 +153,7 @@
 								...file,
 								...file,
 								name: file?.meta?.name,
 								name: file?.meta?.name,
 								description: `${file?.collection?.name} - ${file?.collection?.description}`,
 								description: `${file?.collection?.name} - ${file?.collection?.description}`,
+								knowledge: true, // DO NOT REMOVE, USED TO INDICATE KNOWLEDGE BASE FILE
 								type: 'file'
 								type: 'file'
 							}))
 							}))
 					]
 					]

+ 11 - 3
src/lib/components/common/FileItemModal.svelte

@@ -112,6 +112,12 @@
 								Formatting may be inconsistent from source.
 								Formatting may be inconsistent from source.
 							</div>
 							</div>
 						{/if}
 						{/if}
+
+						{#if item?.knowledge}
+							<div class="capitalize shrink-0">
+								{$i18n.t('Knowledge Base')}
+							</div>
+						{/if}
 					</div>
 					</div>
 
 
 					{#if edit}
 					{#if edit}
@@ -172,9 +178,11 @@
 					/>
 					/>
 				{/if}
 				{/if}
 
 
-				<div class="max-h-96 overflow-scroll scrollbar-hidden text-xs whitespace-pre-wrap">
-					{item?.file?.data?.content ?? 'No content'}
-				</div>
+				{#if item?.file?.data}
+					<div class="max-h-96 overflow-scroll scrollbar-hidden text-xs whitespace-pre-wrap">
+						{item?.file?.data?.content ?? 'No content'}
+					</div>
+				{/if}
 			{/if}
 			{/if}
 		</div>
 		</div>
 	</div>
 	</div>