Fix: Behandlung von Bildladefehlern für Dokument-Cover Fallback
- onError-Handler zur renderCover-Komponente hinzugefügt, um ein Fallback-Symbol anzuzeigen, wenn das Dokumentbild nicht geladen werden kann. Verhindert eine fehlerhafte Bildanzeige durch , indem die Quelle durch ein standardmäßiges „unbekanntes“ Symbol ersetzt wird.
This commit is contained in:
parent
9b03b39db0
commit
383d2d5d34
@ -1,6 +1,7 @@
|
||||
import type { CardProps } from '@mui/material/Card';
|
||||
import type { IconifyName } from 'src/components/iconify';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { varAlpha } from 'minimal-shared/utils';
|
||||
|
||||
import Box from '@mui/material/Box';
|
||||
@ -102,6 +103,10 @@ export function DocItem({
|
||||
component="img"
|
||||
alt={doc.name}
|
||||
src={doc.iconSrc}
|
||||
onError={(e) => {
|
||||
e.currentTarget.onerror = null;
|
||||
e.currentTarget.src = 'assets/icons/file/unknown.svg';
|
||||
}}
|
||||
sx={{
|
||||
top: 0,
|
||||
width: 1,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user