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,61 +551,53 @@ 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', alignItems: 'center',
alignItems: 'center', gap: 0.2,
gap: 0.2, ml: 0.5,
ml: 0.5, flexShrink: 0,
flexShrink: 0, }}
}} onClick={(e) => e.stopPropagation()}
onClick={(e) => e.stopPropagation()} >
> {canView && (
{canView && (
<IconButton
size="small"
aria-label="In neuem Tab öffnen"
onClick={this.handleOpenInNewTab}
sx={{
p: 0,
width: 22,
height: 22,
color: 'inherit',
opacity: 0.75,
'&:hover': { opacity: 1, bgcolor: 'action.hover' },
}}
>
{isOpening ? (
<CircularProgress size={12} color="inherit" thickness={4} />
) : (
<OpenInNewRoundedIcon sx={{ fontSize: 15 }} />
)}
</IconButton>
)}
<IconButton <IconButton
size="small" size="small"
aria-label="Herunterladen" aria-label="In neuem Tab öffnen"
onClick={this.handleDownload} 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' },
}} }}
> >
{isDownloading ? ( <OpenInNewRoundedIcon sx={{ fontSize: 15 }} />
<CircularProgress size={12} color="inherit" thickness={4} />
) : (
<DownloadRoundedIcon sx={{ fontSize: 15 }} />
)}
</IconButton> </IconButton>
</Box> )}
)} <IconButton
size="small"
aria-label="Herunterladen"
onClick={this.handleDownload}
disabled={notFound}
sx={{
p: 0,
width: 22,
height: 22,
color: 'inherit',
opacity: isDownloading ? 0.35 : 0.75,
'&:hover': { opacity: 1, bgcolor: 'action.hover' },
}}
>
<DownloadRoundedIcon sx={{ fontSize: 15 }} />
</IconButton>
</Box>
</Box> </Box>
); );
} }