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:
tekh 2025-07-11 13:44:07 +02:00
parent 9b03b39db0
commit 383d2d5d34

View File

@ -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';
@ -42,7 +43,7 @@ export function DocItem({
// />
// );
//#endregion
const renderTitle = (
<Link
color="inherit"
@ -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,