feat: ui render image thumbs

This commit is contained in:
kieran 2025-01-25 23:28:01 +00:00
parent 6763e53d41
commit 0bd531a21d
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941

View File

@ -30,15 +30,9 @@ export default function FileList({
}
function renderInner(f: FileInfo) {
if (f.type?.startsWith("image/") || !f.type) {
if (f.type?.startsWith("image/") || f.type?.startsWith("video/") || !f.type) {
return (
<img src={f.url} className="w-full h-full object-contain object-center" loading="lazy" />
);
} else if (f.type?.startsWith("video/")) {
return (
<div className="w-full h-full flex items-center justify-center">
Video
</div>
<img src={f.url.replace(`/${f.id}`, `/thumb/${f.id}`)} className="w-full h-full object-contain object-center" loading="lazy" />
);
}
}