This commit is contained in:
Timothy Jaeryang Baek
2025-04-11 15:27:25 -07:00
parent c846a550fa
commit c5636ff68c
5 changed files with 49 additions and 13 deletions

View File

@@ -28,6 +28,14 @@
import { deleteFileById } from '$lib/apis/files';
let showModal = false;
const decodeString = (str: string) => {
try {
return decodeURIComponent(str);
} catch (e) {
return str;
}
};
</script>
{#if item}
@@ -82,7 +90,7 @@
{#if !small}
<div class="flex flex-col justify-center -space-y-0.5 px-2.5 w-full">
<div class=" dark:text-gray-100 text-sm font-medium line-clamp-1 mb-1">
{decodeURIComponent(name)}
{decodeString(name)}
</div>
<div class=" flex justify-between text-gray-500 text-xs line-clamp-1">
@@ -101,11 +109,7 @@
</div>
</div>
{:else}
<Tooltip
content={decodeURIComponent(name)}
className="flex flex-col w-full"
placement="top-start"
>
<Tooltip content={decodeString(name)} className="flex flex-col w-full" placement="top-start">
<div class="flex flex-col justify-center -space-y-0.5 px-2.5 w-full">
<div class=" dark:text-gray-100 text-sm flex justify-between items-center">
{#if loading}
@@ -113,7 +117,7 @@
<Spinner className="size-4" />
</div>
{/if}
<div class="font-medium line-clamp-1 flex-1">{decodeURIComponent(name)}</div>
<div class="font-medium line-clamp-1 flex-1">{decodeString(name)}</div>
<div class="text-gray-500 text-xs capitalize shrink-0">{formatFileSize(size)}</div>
</div>
</div>