refactor: remove unused fileType and downloadUrl properties from ArchiveComponent and ArchiveNode
All checks were successful
CI - Build and Push / Build and Push Docker Image (push) Successful in 18s

This commit is contained in:
2025-10-27 21:24:19 +08:00
parent 06426eb781
commit b4b36ae082
3 changed files with 7 additions and 62 deletions

View File

@@ -32,9 +32,7 @@ interface ArchiveComponentProps {
nodeKey: NodeKey;
fileName: string;
fileSize?: number;
fileType?: string;
fileKey?: string;
downloadUrl?: string;
uploadProgress?: number;
uploadError?: string;
uploadId?: string;
@@ -44,9 +42,7 @@ export default function ArchiveComponent({
nodeKey,
fileName,
fileSize,
fileType,
fileKey,
downloadUrl,
uploadProgress,
uploadError,
}: ArchiveComponentProps): JSX.Element {
@@ -55,14 +51,11 @@ export default function ArchiveComponent({
const containerRef = useRef<HTMLDivElement | null>(null);
const resolvedUrl = useMemo(() => {
if (downloadUrl) {
return downloadUrl;
}
if (fileKey) {
return getS3Url(fileKey);
}
return undefined;
}, [downloadUrl, fileKey]);
}, [fileKey]);
const readableSize = useMemo(() => formatFileSize(fileSize), [fileSize]);
const isUploading = uploadProgress !== undefined && uploadProgress < 100 && !uploadError;
@@ -137,13 +130,12 @@ export default function ArchiveComponent({
setSelected(true);
}}
>
<div className="editor-archive-icon" aria-hidden>ZIP</div>
<div className="editor-archive-icon" aria-hidden>
ZIP
</div>
<div className="editor-archive-details">
<div className="editor-archive-title">{fileName}</div>
<div className="editor-archive-meta">
{fileType || 'Archive'}
{readableSize ? `${readableSize}` : ''}
</div>
<div className="editor-archive-meta">Archive{readableSize ? `${readableSize}` : ''}</div>
{resolvedUrl ? (
<a
className="editor-archive-link"