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