add previw
This commit is contained in:
parent
6106a0e397
commit
c014f90773
|
|
@ -38,11 +38,9 @@ export default function MediaCard({ asset, selected, onSelect, onClick }: MediaC
|
|||
setError(false);
|
||||
// Load media through backend proxy with auth
|
||||
const kind = asset.storage_key_thumb ? 'thumb' : 'original';
|
||||
if (asset.type === 'photo' || asset.storage_key_thumb) {
|
||||
const blob = await api.getMediaBlob(asset.id, kind);
|
||||
const url = URL.createObjectURL(blob);
|
||||
setThumbnailUrl(url);
|
||||
}
|
||||
const blob = await api.getMediaBlob(asset.id, kind);
|
||||
const url = URL.createObjectURL(blob);
|
||||
setThumbnailUrl(url);
|
||||
} catch (err) {
|
||||
console.error('Failed to load thumbnail:', err);
|
||||
setError(true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue