Commit d6520e7f authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

fix: document selector

parent c54e3d5b
......@@ -58,74 +58,80 @@
class="w-full max-w-[300px] rounded-lg px-1 py-1.5 border border-gray-300/30 dark:border-gray-700/50 z-50 bg-white dark:bg-gray-850 dark:text-white shadow-lg"
sideOffset={8}
side="bottom"
align="end"
align="start"
transition={flyAndScale}
>
<div class="max-h-[10rem] overflow-y-scroll">
{#each items as item}
<DropdownMenu.Item
class="flex gap-2.5 items-center px-3 py-2 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md"
on:click={() => {
if (!knowledge.find((k) => k.name === item.name)) {
knowledge = [
...knowledge,
{
...item,
type: item?.type ?? 'doc'
}
];
}
}}
>
<div class="flex self-start">
{#if (item?.type ?? 'doc') === 'doc'}
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
class="w-4"
>
<path
fill-rule="evenodd"
d="M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5H5.625ZM7.5 15a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 7.5 15Zm.75 2.25a.75.75 0 0 0 0 1.5H12a.75.75 0 0 0 0-1.5H8.25Z"
clip-rule="evenodd"
/>
<path
d="M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"
/>
</svg>
{:else if item.type === 'collection'}
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
class="size-4"
>
<path
d="M7.5 3.375c0-1.036.84-1.875 1.875-1.875h.375a3.75 3.75 0 0 1 3.75 3.75v1.875C13.5 8.161 14.34 9 15.375 9h1.875A3.75 3.75 0 0 1 21 12.75v3.375C21 17.16 20.16 18 19.125 18h-9.75A1.875 1.875 0 0 1 7.5 16.125V3.375Z"
/>
<path
d="M15 5.25a5.23 5.23 0 0 0-1.279-3.434 9.768 9.768 0 0 1 6.963 6.963A5.23 5.23 0 0 0 17.25 7.5h-1.875A.375.375 0 0 1 15 7.125V5.25ZM4.875 6H6v10.125A3.375 3.375 0 0 0 9.375 19.5H16.5v1.125c0 1.035-.84 1.875-1.875 1.875h-9.75A1.875 1.875 0 0 1 3 20.625V7.875C3 6.839 3.84 6 4.875 6Z"
/>
</svg>
{/if}
</div>
{#if items.length === 0}
<div class="text-center text-sm text-gray-500 dark:text-gray-400">
{$i18n.t('No documents found')}
</div>
{:else}
{#each items as item}
<DropdownMenu.Item
class="flex gap-2.5 items-center px-3 py-2 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md"
on:click={() => {
if (!knowledge.find((k) => k.name === item.name)) {
knowledge = [
...knowledge,
{
...item,
type: item?.type ?? 'doc'
}
];
}
}}
>
<div class="flex self-start">
{#if (item?.type ?? 'doc') === 'doc'}
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
class="w-4"
>
<path
fill-rule="evenodd"
d="M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5H5.625ZM7.5 15a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 7.5 15Zm.75 2.25a.75.75 0 0 0 0 1.5H12a.75.75 0 0 0 0-1.5H8.25Z"
clip-rule="evenodd"
/>
<path
d="M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"
/>
</svg>
{:else if item.type === 'collection'}
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
class="size-4"
>
<path
d="M7.5 3.375c0-1.036.84-1.875 1.875-1.875h.375a3.75 3.75 0 0 1 3.75 3.75v1.875C13.5 8.161 14.34 9 15.375 9h1.875A3.75 3.75 0 0 1 21 12.75v3.375C21 17.16 20.16 18 19.125 18h-9.75A1.875 1.875 0 0 1 7.5 16.125V3.375Z"
/>
<path
d="M15 5.25a5.23 5.23 0 0 0-1.279-3.434 9.768 9.768 0 0 1 6.963 6.963A5.23 5.23 0 0 0 17.25 7.5h-1.875A.375.375 0 0 1 15 7.125V5.25ZM4.875 6H6v10.125A3.375 3.375 0 0 0 9.375 19.5H16.5v1.125c0 1.035-.84 1.875-1.875 1.875h-9.75A1.875 1.875 0 0 1 3 20.625V7.875C3 6.839 3.84 6 4.875 6Z"
/>
</svg>
{/if}
</div>
<div class="flex items-center">
<div class="flex flex-col">
<div
class=" w-fit text-xs font-black px-1 rounded uppercase line-clamp-1 bg-gray-500/20 text-gray-700 dark:text-gray-200"
>
{item?.type ?? 'Document'}
</div>
<div class="flex items-center">
<div class="flex flex-col">
<div
class=" w-fit text-xs font-black px-1 rounded uppercase line-clamp-1 bg-gray-500/20 text-gray-700 dark:text-gray-200"
>
{item?.type ?? 'Document'}
</div>
<div class="line-clamp-1 font-medium pr-0.5">
{item.name}
<div class="line-clamp-1 font-medium pr-0.5">
{item.name}
</div>
</div>
</div>
</div>
</DropdownMenu.Item>
{/each}
</DropdownMenu.Item>
{/each}
{/if}
</div>
</DropdownMenu.Content>
</div>
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "تجاوز التحقق من SSL للموقع",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "اللغاء",
"Capabilities": "قدرات",
"Change Password": "تغير الباسورد",
......@@ -318,6 +319,7 @@
"Name your model": "قم بتسمية النموذج الخاص بك",
"New Chat": "دردشة جديدة",
"New Password": "كلمة المرور الجديدة",
"No documents found": "",
"No results found": "لا توجد نتايج",
"No search query generated": "لم يتم إنشاء استعلام بحث",
"No source available": "لا يوجد مصدر متاح",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "Изключване на SSL проверката за сайтове",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "Отказ",
"Capabilities": "Възможности",
"Change Password": "Промяна на Парола",
......@@ -318,6 +319,7 @@
"Name your model": "Дайте име на вашия модел",
"New Chat": "Нов чат",
"New Password": "Нова парола",
"No documents found": "",
"No results found": "Няма намерени резултати",
"No search query generated": "Не е генерирана заявка за търсене",
"No source available": "Няма наличен източник",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "ওয়েবসাইটের জন্য SSL যাচাই বাতিল করুন",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "বাতিল",
"Capabilities": "সক্ষমতা",
"Change Password": "পাসওয়ার্ড পরিবর্তন করুন",
......@@ -318,6 +319,7 @@
"Name your model": "আপনার মডেলের নাম দিন",
"New Chat": "নতুন চ্যাট",
"New Password": "নতুন পাসওয়ার্ড",
"No documents found": "",
"No results found": "কোন ফলাফল পাওয়া যায়নি",
"No search query generated": "কোনও অনুসন্ধান ক্যোয়ারী উত্পন্ন হয়নি",
"No source available": "কোন উৎস পাওয়া যায়নি",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "Desactivar la verificació SSL per a l'accés a l'Internet",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "Cancel·la",
"Capabilities": "Capacitats",
"Change Password": "Canvia la Contrasenya",
......@@ -318,6 +319,7 @@
"Name your model": "Posa un nom al model",
"New Chat": "Xat Nou",
"New Password": "Nova Contrasenya",
"No documents found": "",
"No results found": "No s'han trobat resultats",
"No search query generated": "No es genera cap consulta de cerca",
"No source available": "Sense font disponible",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "Pagkanselar",
"Capabilities": "",
"Change Password": "Usba ang password",
......@@ -318,6 +319,7 @@
"Name your model": "",
"New Chat": "Bag-ong diskusyon",
"New Password": "Bag-ong Password",
"No documents found": "",
"No results found": "",
"No search query generated": "",
"No source available": "Walay tinubdan nga anaa",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "Bypass SSL-Verifizierung für Websites",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "Abbrechen",
"Capabilities": "Fähigkeiten",
"Change Password": "Passwort ändern",
......@@ -318,6 +319,7 @@
"Name your model": "Benennen Sie Ihr Modell",
"New Chat": "Neuer Chat",
"New Password": "Neues Passwort",
"No documents found": "",
"No results found": "Keine Ergebnisse gefunden",
"No search query generated": "Keine Suchanfrage generiert",
"No source available": "Keine Quelle verfügbar.",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "Cancel",
"Capabilities": "",
"Change Password": "Change Password",
......@@ -318,6 +319,7 @@
"Name your model": "",
"New Chat": "New Bark",
"New Password": "New Barkword",
"No documents found": "",
"No results found": "",
"No search query generated": "",
"No source available": "No source available",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "",
"Capabilities": "",
"Change Password": "",
......@@ -318,6 +319,7 @@
"Name your model": "",
"New Chat": "",
"New Password": "",
"No documents found": "",
"No results found": "",
"No search query generated": "",
"No source available": "",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "",
"Capabilities": "",
"Change Password": "",
......@@ -318,6 +319,7 @@
"Name your model": "",
"New Chat": "",
"New Password": "",
"No documents found": "",
"No results found": "",
"No search query generated": "",
"No source available": "",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "Desactivar la verificación SSL para sitios web",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "Cancelar",
"Capabilities": "Capacidades",
"Change Password": "Cambia la Contraseña",
......@@ -318,6 +319,7 @@
"Name your model": "Asigne un nombre a su modelo",
"New Chat": "Nuevo Chat",
"New Password": "Nueva Contraseña",
"No documents found": "",
"No results found": "No se han encontrado resultados",
"No search query generated": "No se ha generado ninguna consulta de búsqueda",
"No source available": "No hay fuente disponible",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "عبور از تأیید SSL برای وب سایت ها",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "لغو",
"Capabilities": "قابلیت",
"Change Password": "تغییر رمز عبور",
......@@ -318,6 +319,7 @@
"Name your model": "نام مدل خود را",
"New Chat": "گپ جدید",
"New Password": "رمز عبور جدید",
"No documents found": "",
"No results found": "نتیجه\u200cای یافت نشد",
"No search query generated": "پرسوجوی جستجویی ایجاد نشده است",
"No source available": "منبعی در دسترس نیست",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "Ohita SSL-varmennus verkkosivustoille",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "Peruuta",
"Capabilities": "Ominaisuuksia",
"Change Password": "Vaihda salasana",
......@@ -318,6 +319,7 @@
"Name your model": "Mallin nimeäminen",
"New Chat": "Uusi keskustelu",
"New Password": "Uusi salasana",
"No documents found": "",
"No results found": "Ei tuloksia",
"No search query generated": "Hakukyselyä ei luotu",
"No source available": "Ei lähdettä saatavilla",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "Parcourir la vérification SSL pour les sites Web",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "Annuler",
"Capabilities": "Capacités",
"Change Password": "Changer le mot de passe",
......@@ -318,6 +319,7 @@
"Name your model": "Nommez votre modèle",
"New Chat": "Nouvelle discussion",
"New Password": "Nouveau mot de passe",
"No documents found": "",
"No results found": "Aucun résultat trouvé",
"No search query generated": "Aucune requête de recherche générée",
"No source available": "Aucune source disponible",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "Contourner la vérification SSL pour les sites Web.",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "Annuler",
"Capabilities": "Capacités",
"Change Password": "Changer le mot de passe",
......@@ -318,6 +319,7 @@
"Name your model": "Nommez votre modèle",
"New Chat": "Nouveau chat",
"New Password": "Nouveau mot de passe",
"No documents found": "",
"No results found": "Aucun résultat",
"No search query generated": "Aucune requête de recherche générée",
"No source available": "Aucune source disponible",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "עקוף אימות SSL עבור אתרים",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "בטל",
"Capabilities": "יכולות",
"Change Password": "שנה סיסמה",
......@@ -318,6 +319,7 @@
"Name your model": "תן שם לדגם שלך",
"New Chat": "צ'אט חדש",
"New Password": "סיסמה חדשה",
"No documents found": "",
"No results found": "לא נמצאו תוצאות",
"No search query generated": "לא נוצרה שאילתת חיפוש",
"No source available": "אין מקור זמין",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "वेबसाइटों के लिए SSL सुनिश्चिती को छोड़ें",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "रद्द करें",
"Capabilities": "क्षमताओं",
"Change Password": "पासवर्ड बदलें",
......@@ -318,6 +319,7 @@
"Name your model": "अपने मॉडल को नाम दें",
"New Chat": "नई चैट",
"New Password": "नया पासवर्ड",
"No documents found": "",
"No results found": "कोई परिणाम नहीं मिला",
"No search query generated": "कोई खोज क्वेरी जनरेट नहीं हुई",
"No source available": "कोई स्रोत उपलब्ध नहीं है",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "Zaobiđi SSL provjeru za web stranice",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "Otkaži",
"Capabilities": "Mogućnosti",
"Change Password": "Promijeni lozinku",
......@@ -318,6 +319,7 @@
"Name your model": "Dodijelite naziv modelu",
"New Chat": "Novi razgovor",
"New Password": "Nova lozinka",
"No documents found": "",
"No results found": "Nema rezultata",
"No search query generated": "Nije generiran upit za pretraživanje",
"No source available": "Nema dostupnog izvora",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "Aggira la verifica SSL per i siti web",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "Annulla",
"Capabilities": "Funzionalità",
"Change Password": "Cambia password",
......@@ -318,6 +319,7 @@
"Name your model": "Assegna un nome al tuo modello",
"New Chat": "Nuova chat",
"New Password": "Nuova password",
"No documents found": "",
"No results found": "Nessun risultato trovato",
"No search query generated": "Nessuna query di ricerca generata",
"No source available": "Nessuna fonte disponibile",
......
......@@ -74,6 +74,7 @@
"Bypass SSL verification for Websites": "SSL 検証をバイパスする",
"Call": "",
"Call feature is not supported when using Web STT engine": "",
"Camera": "",
"Cancel": "キャンセル",
"Capabilities": "資格",
"Change Password": "パスワードを変更",
......@@ -318,6 +319,7 @@
"Name your model": "モデルに名前を付ける",
"New Chat": "新しいチャット",
"New Password": "新しいパスワード",
"No documents found": "",
"No results found": "結果が見つかりません",
"No search query generated": "検索クエリは生成されません",
"No source available": "使用可能なソースがありません",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment