This commit is contained in:
seb
2026-10-06 12:57:53 +02:00
parent 543382c3e1
commit a2c18841c1

View File

@@ -527,11 +527,10 @@ export class VfsAttachmentLink extends PureComponent {
color: notFound color: notFound
? (isUser ? 'rgba(255,255,255,0.6)' : 'text.disabled') ? (isUser ? 'rgba(255,255,255,0.6)' : 'text.disabled')
: (isUser ? 'inherit' : 'primary.main'), : (isUser ? 'inherit' : 'primary.main'),
opacity: notFound ? 0.7 : ((isDownloading || isOpening) ? 0.75 : 1), opacity: notFound ? 0.7 : 1,
cursor: notFound ? 'not-allowed' : 'pointer', cursor: notFound ? 'not-allowed' : (isOpening || isDownloading ? 'wait' : 'pointer'),
verticalAlign: 'middle', verticalAlign: 'middle',
maxWidth: '100%', maxWidth: '100%',
transition: 'all 150ms ease-in-out',
'&:hover': notFound ? {} : { '&:hover': notFound ? {} : {
bgcolor: isUser ? 'rgba(255, 255, 255, 0.28)' : 'action.hover', bgcolor: isUser ? 'rgba(255, 255, 255, 0.28)' : 'action.hover',
borderColor: isUser ? '#fff' : 'primary.main', borderColor: isUser ? '#fff' : 'primary.main',
@@ -552,9 +551,8 @@ export class VfsAttachmentLink extends PureComponent {
textDecoration: notFound ? 'line-through' : 'none', textDecoration: notFound ? 'line-through' : 'none',
}} }}
> >
{downloadName} - {effectiveType || 'VFS'}{notFound ? ' (404)' : ''} {downloadName} - {effectiveType || 'VFS'}
</Typography> </Typography>
{!notFound && (
<Box <Box
sx={{ sx={{
display: 'inline-flex', display: 'inline-flex',
@@ -570,43 +568,36 @@ export class VfsAttachmentLink extends PureComponent {
size="small" size="small"
aria-label="In neuem Tab öffnen" aria-label="In neuem Tab öffnen"
onClick={this.handleOpenInNewTab} onClick={this.handleOpenInNewTab}
disabled={notFound}
sx={{ sx={{
p: 0, p: 0,
width: 22, width: 22,
height: 22, height: 22,
color: 'inherit', color: 'inherit',
opacity: 0.75, opacity: isOpening ? 0.35 : 0.75,
'&:hover': { opacity: 1, bgcolor: 'action.hover' }, '&:hover': { opacity: 1, bgcolor: 'action.hover' },
}} }}
> >
{isOpening ? (
<CircularProgress size={12} color="inherit" thickness={4} />
) : (
<OpenInNewRoundedIcon sx={{ fontSize: 15 }} /> <OpenInNewRoundedIcon sx={{ fontSize: 15 }} />
)}
</IconButton> </IconButton>
)} )}
<IconButton <IconButton
size="small" size="small"
aria-label="Herunterladen" aria-label="Herunterladen"
onClick={this.handleDownload} onClick={this.handleDownload}
disabled={notFound}
sx={{ sx={{
p: 0, p: 0,
width: 22, width: 22,
height: 22, height: 22,
color: 'inherit', color: 'inherit',
opacity: 0.75, opacity: isDownloading ? 0.35 : 0.75,
'&:hover': { opacity: 1, bgcolor: 'action.hover' }, '&:hover': { opacity: 1, bgcolor: 'action.hover' },
}} }}
> >
{isDownloading ? (
<CircularProgress size={12} color="inherit" thickness={4} />
) : (
<DownloadRoundedIcon sx={{ fontSize: 15 }} /> <DownloadRoundedIcon sx={{ fontSize: 15 }} />
)}
</IconButton> </IconButton>
</Box> </Box>
)}
</Box> </Box>
); );
} }