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);
|
setError(false);
|
||||||
// Load media through backend proxy with auth
|
// Load media through backend proxy with auth
|
||||||
const kind = asset.storage_key_thumb ? 'thumb' : 'original';
|
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 blob = await api.getMediaBlob(asset.id, kind);
|
||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
setThumbnailUrl(url);
|
setThumbnailUrl(url);
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Failed to load thumbnail:', err);
|
console.error('Failed to load thumbnail:', err);
|
||||||
setError(true);
|
setError(true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue