2025-09-29 13:29:03 +09:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import React, { useState, useRef } from "react";
|
|
|
|
|
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
|
import { Badge } from "@/components/ui/badge";
|
|
|
|
|
import { FileInfo, FileUploadConfig } from "./types";
|
2026-03-10 18:30:18 +09:00
|
|
|
import {
|
|
|
|
|
Upload,
|
|
|
|
|
Download,
|
|
|
|
|
Trash2,
|
|
|
|
|
Eye,
|
|
|
|
|
File,
|
|
|
|
|
FileText,
|
2025-09-29 13:29:03 +09:00
|
|
|
Image as ImageIcon,
|
|
|
|
|
Video,
|
|
|
|
|
Music,
|
|
|
|
|
Archive,
|
|
|
|
|
Presentation,
|
2025-11-04 17:32:46 +09:00
|
|
|
X,
|
2026-03-10 18:30:18 +09:00
|
|
|
Star,
|
2025-09-29 13:29:03 +09:00
|
|
|
} from "lucide-react";
|
|
|
|
|
import { formatFileSize } from "@/lib/utils";
|
|
|
|
|
import { FileViewerModal } from "./FileViewerModal";
|
|
|
|
|
|
|
|
|
|
interface FileManagerModalProps {
|
|
|
|
|
isOpen: boolean;
|
|
|
|
|
onClose: () => void;
|
|
|
|
|
uploadedFiles: FileInfo[];
|
|
|
|
|
onFileUpload: (files: File[]) => Promise<void>;
|
|
|
|
|
onFileDownload: (file: FileInfo) => void;
|
|
|
|
|
onFileDelete: (file: FileInfo) => void;
|
|
|
|
|
onFileView: (file: FileInfo) => void;
|
2025-11-04 17:32:46 +09:00
|
|
|
onSetRepresentative?: (file: FileInfo) => void; // 대표 이미지 설정 콜백
|
2025-09-29 13:29:03 +09:00
|
|
|
config: FileUploadConfig;
|
|
|
|
|
isDesignMode?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const FileManagerModal: React.FC<FileManagerModalProps> = ({
|
|
|
|
|
isOpen,
|
|
|
|
|
onClose,
|
|
|
|
|
uploadedFiles,
|
|
|
|
|
onFileUpload,
|
|
|
|
|
onFileDownload,
|
|
|
|
|
onFileDelete,
|
|
|
|
|
onFileView,
|
2025-11-04 17:32:46 +09:00
|
|
|
onSetRepresentative,
|
2025-09-29 13:29:03 +09:00
|
|
|
config,
|
|
|
|
|
isDesignMode = false,
|
|
|
|
|
}) => {
|
|
|
|
|
const [dragOver, setDragOver] = useState(false);
|
|
|
|
|
const [uploading, setUploading] = useState(false);
|
|
|
|
|
const [viewerFile, setViewerFile] = useState<FileInfo | null>(null);
|
|
|
|
|
const [isViewerOpen, setIsViewerOpen] = useState(false);
|
2025-11-05 15:39:02 +09:00
|
|
|
const [selectedFile, setSelectedFile] = useState<FileInfo | null>(null); // 선택된 파일 (좌측 미리보기용)
|
|
|
|
|
const [previewImageUrl, setPreviewImageUrl] = useState<string | null>(null); // 이미지 미리보기 URL
|
2025-09-29 13:29:03 +09:00
|
|
|
const fileInputRef = useRef<HTMLInputElement>(null);
|
|
|
|
|
|
|
|
|
|
// 파일 아이콘 가져오기
|
|
|
|
|
const getFileIcon = (fileExt: string) => {
|
|
|
|
|
const ext = fileExt.toLowerCase();
|
2026-03-10 18:30:18 +09:00
|
|
|
|
|
|
|
|
if (["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(ext)) {
|
|
|
|
|
return <ImageIcon className="h-5 w-5 text-blue-500" />;
|
|
|
|
|
} else if (["pdf", "doc", "docx", "txt", "rtf"].includes(ext)) {
|
|
|
|
|
return <FileText className="h-5 w-5 text-red-500" />;
|
|
|
|
|
} else if (["xls", "xlsx", "csv"].includes(ext)) {
|
|
|
|
|
return <FileText className="h-5 w-5 text-green-500" />;
|
|
|
|
|
} else if (["ppt", "pptx"].includes(ext)) {
|
|
|
|
|
return <Presentation className="h-5 w-5 text-orange-500" />;
|
|
|
|
|
} else if (["mp4", "avi", "mov", "webm"].includes(ext)) {
|
|
|
|
|
return <Video className="h-5 w-5 text-purple-500" />;
|
|
|
|
|
} else if (["mp3", "wav", "ogg"].includes(ext)) {
|
|
|
|
|
return <Music className="h-5 w-5 text-pink-500" />;
|
|
|
|
|
} else if (["zip", "rar", "7z"].includes(ext)) {
|
|
|
|
|
return <Archive className="h-5 w-5 text-yellow-500" />;
|
2025-09-29 13:29:03 +09:00
|
|
|
} else {
|
2026-03-10 18:30:18 +09:00
|
|
|
return <File className="h-5 w-5 text-gray-500" />;
|
2025-09-29 13:29:03 +09:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 파일 업로드 핸들러
|
|
|
|
|
const handleFileUpload = async (files: FileList | File[]) => {
|
|
|
|
|
if (!files || files.length === 0) return;
|
2026-03-10 18:30:18 +09:00
|
|
|
|
2025-09-29 13:29:03 +09:00
|
|
|
setUploading(true);
|
|
|
|
|
try {
|
|
|
|
|
const fileArray = Array.from(files);
|
|
|
|
|
await onFileUpload(fileArray);
|
2026-03-10 18:30:18 +09:00
|
|
|
console.log("✅ FileManagerModal: 파일 업로드 완료");
|
2025-09-29 13:29:03 +09:00
|
|
|
} catch (error) {
|
2026-03-10 18:30:18 +09:00
|
|
|
console.error("❌ FileManagerModal: 파일 업로드 오류:", error);
|
2025-09-29 13:29:03 +09:00
|
|
|
} finally {
|
|
|
|
|
setUploading(false);
|
2026-03-10 18:30:18 +09:00
|
|
|
console.log("🔄 FileManagerModal: 업로드 상태 초기화");
|
2025-09-29 13:29:03 +09:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 드래그 앤 드롭 핸들러
|
|
|
|
|
const handleDragOver = (e: React.DragEvent) => {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
setDragOver(true);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleDragLeave = (e: React.DragEvent) => {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
setDragOver(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleDrop = (e: React.DragEvent) => {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
setDragOver(false);
|
2026-03-10 18:30:18 +09:00
|
|
|
|
2025-09-29 13:29:03 +09:00
|
|
|
if (config.disabled || isDesignMode) return;
|
2026-03-10 18:30:18 +09:00
|
|
|
|
2025-09-29 13:29:03 +09:00
|
|
|
const files = e.dataTransfer.files;
|
|
|
|
|
handleFileUpload(files);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 파일 선택 핸들러
|
|
|
|
|
const handleFileSelect = () => {
|
|
|
|
|
if (config.disabled || isDesignMode) return;
|
|
|
|
|
fileInputRef.current?.click();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleFileInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
|
|
|
const files = e.target.files;
|
|
|
|
|
if (files) {
|
|
|
|
|
handleFileUpload(files);
|
|
|
|
|
}
|
|
|
|
|
// 입력값 초기화
|
2026-03-10 18:30:18 +09:00
|
|
|
e.target.value = "";
|
2025-09-29 13:29:03 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 파일 뷰어 핸들러
|
|
|
|
|
const handleFileViewInternal = (file: FileInfo) => {
|
|
|
|
|
setViewerFile(file);
|
|
|
|
|
setIsViewerOpen(true);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleViewerClose = () => {
|
|
|
|
|
setIsViewerOpen(false);
|
|
|
|
|
setViewerFile(null);
|
|
|
|
|
};
|
|
|
|
|
|
2025-11-05 15:39:02 +09:00
|
|
|
// 파일 클릭 시 미리보기 로드
|
|
|
|
|
const handleFileClick = async (file: FileInfo) => {
|
|
|
|
|
setSelectedFile(file);
|
2026-03-10 18:30:18 +09:00
|
|
|
|
2025-11-05 15:39:02 +09:00
|
|
|
// 이미지 파일인 경우 미리보기 로드
|
2026-03-10 18:30:18 +09:00
|
|
|
const imageExtensions = ["jpg", "jpeg", "png", "gif", "webp", "svg"];
|
2025-11-05 15:39:02 +09:00
|
|
|
if (imageExtensions.includes(file.fileExt.toLowerCase())) {
|
|
|
|
|
try {
|
|
|
|
|
// 이전 Blob URL 해제
|
|
|
|
|
if (previewImageUrl) {
|
|
|
|
|
URL.revokeObjectURL(previewImageUrl);
|
|
|
|
|
}
|
2026-03-10 18:30:18 +09:00
|
|
|
|
2025-11-05 15:39:02 +09:00
|
|
|
const { apiClient } = await import("@/lib/api/client");
|
|
|
|
|
const response = await apiClient.get(`/files/preview/${file.objid}`, {
|
2026-03-10 18:30:18 +09:00
|
|
|
responseType: "blob",
|
2025-11-05 15:39:02 +09:00
|
|
|
});
|
2026-03-10 18:30:18 +09:00
|
|
|
|
2025-11-05 15:39:02 +09:00
|
|
|
const blob = new Blob([response.data]);
|
|
|
|
|
const blobUrl = URL.createObjectURL(blob);
|
|
|
|
|
setPreviewImageUrl(blobUrl);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error("이미지 로드 실패:", error);
|
|
|
|
|
setPreviewImageUrl(null);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
setPreviewImageUrl(null);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 컴포넌트 언마운트 시 Blob URL 해제
|
|
|
|
|
React.useEffect(() => {
|
|
|
|
|
return () => {
|
|
|
|
|
if (previewImageUrl) {
|
|
|
|
|
URL.revokeObjectURL(previewImageUrl);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}, [previewImageUrl]);
|
|
|
|
|
|
2025-09-29 13:29:03 +09:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Dialog open={isOpen} onOpenChange={() => {}}>
|
2026-03-10 18:30:18 +09:00
|
|
|
<DialogContent className="max-h-[90vh] max-w-6xl overflow-hidden [&>button]:hidden">
|
2025-09-29 13:29:03 +09:00
|
|
|
<DialogHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
2026-03-10 18:30:18 +09:00
|
|
|
<DialogTitle className="text-lg font-semibold">파일 관리 ({uploadedFiles.length}개)</DialogTitle>
|
|
|
|
|
<Button variant="ghost" size="sm" className="h-8 w-8 p-0 hover:bg-gray-100" onClick={onClose} title="닫기">
|
|
|
|
|
<X className="h-4 w-4" />
|
2025-09-29 13:29:03 +09:00
|
|
|
</Button>
|
|
|
|
|
</DialogHeader>
|
2026-03-10 18:30:18 +09:00
|
|
|
|
|
|
|
|
<div className="flex h-[75vh] flex-col space-y-3">
|
2025-11-05 15:39:02 +09:00
|
|
|
{/* 파일 업로드 영역 - 높이 축소 */}
|
2025-09-29 13:29:03 +09:00
|
|
|
{!isDesignMode && (
|
|
|
|
|
<div
|
2026-03-10 18:30:18 +09:00
|
|
|
className={`cursor-pointer rounded-lg border-2 border-dashed p-4 text-center transition-colors ${dragOver ? "border-blue-400 bg-blue-50" : "border-gray-300"} ${config.disabled ? "cursor-not-allowed opacity-50" : "hover:border-gray-400"} ${uploading ? "opacity-75" : ""} `}
|
2025-11-05 15:39:02 +09:00
|
|
|
onClick={() => {
|
|
|
|
|
if (!config.disabled && !isDesignMode) {
|
|
|
|
|
fileInputRef.current?.click();
|
|
|
|
|
}
|
|
|
|
|
}}
|
2025-09-29 13:29:03 +09:00
|
|
|
onDragOver={handleDragOver}
|
|
|
|
|
onDragLeave={handleDragLeave}
|
|
|
|
|
onDrop={handleDrop}
|
|
|
|
|
>
|
|
|
|
|
<input
|
|
|
|
|
ref={fileInputRef}
|
|
|
|
|
type="file"
|
|
|
|
|
multiple={config.multiple}
|
|
|
|
|
accept={config.accept}
|
|
|
|
|
onChange={handleFileInputChange}
|
|
|
|
|
className="hidden"
|
|
|
|
|
disabled={config.disabled}
|
|
|
|
|
/>
|
2026-03-10 18:30:18 +09:00
|
|
|
|
2025-09-29 13:29:03 +09:00
|
|
|
{uploading ? (
|
2025-11-05 15:39:02 +09:00
|
|
|
<div className="flex items-center justify-center gap-2">
|
2026-03-10 18:30:18 +09:00
|
|
|
<div className="h-5 w-5 animate-spin rounded-full border-b-2 border-blue-600"></div>
|
|
|
|
|
<span className="text-sm font-medium text-blue-600">업로드 중...</span>
|
2025-09-29 13:29:03 +09:00
|
|
|
</div>
|
|
|
|
|
) : (
|
2025-11-05 15:39:02 +09:00
|
|
|
<div className="flex items-center justify-center gap-3">
|
|
|
|
|
<Upload className="h-6 w-6 text-gray-400" />
|
2026-03-10 18:30:18 +09:00
|
|
|
<p className="text-sm font-medium text-gray-700">파일을 드래그하거나 클릭하여 업로드하세요</p>
|
2025-09-29 13:29:03 +09:00
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
2025-11-05 15:39:02 +09:00
|
|
|
{/* 좌우 분할 레이아웃 */}
|
2026-03-10 18:30:18 +09:00
|
|
|
<div className="flex min-h-0 flex-1 gap-4">
|
2025-11-05 15:39:02 +09:00
|
|
|
{/* 좌측: 이미지 미리보기 */}
|
2026-03-10 18:30:18 +09:00
|
|
|
<div className="flex w-1/2 items-center justify-center overflow-hidden rounded-lg border border-gray-200 bg-gray-50">
|
2025-11-05 15:39:02 +09:00
|
|
|
{selectedFile && previewImageUrl ? (
|
2026-03-10 18:30:18 +09:00
|
|
|
<img
|
|
|
|
|
src={previewImageUrl}
|
2025-11-05 15:39:02 +09:00
|
|
|
alt={selectedFile.realFileName}
|
2026-03-10 18:30:18 +09:00
|
|
|
className="max-h-full max-w-full object-contain"
|
2025-11-05 15:39:02 +09:00
|
|
|
/>
|
|
|
|
|
) : selectedFile ? (
|
|
|
|
|
<div className="flex flex-col items-center text-gray-400">
|
|
|
|
|
{getFileIcon(selectedFile.fileExt)}
|
|
|
|
|
<p className="mt-2 text-sm">미리보기 불가능</p>
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="flex flex-col items-center text-gray-400">
|
2026-03-10 18:30:18 +09:00
|
|
|
<ImageIcon className="mb-2 h-16 w-16" />
|
2025-11-05 15:39:02 +09:00
|
|
|
<p className="text-sm">파일을 선택하면 미리보기가 표시됩니다</p>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* 우측: 파일 목록 */}
|
2026-03-10 18:30:18 +09:00
|
|
|
<div className="flex w-1/2 flex-col overflow-hidden rounded-lg border border-gray-200">
|
|
|
|
|
<div className="border-b border-gray-200 bg-gray-50 p-3">
|
2025-11-05 15:39:02 +09:00
|
|
|
<div className="flex items-center justify-between">
|
2026-03-10 18:30:18 +09:00
|
|
|
<h3 className="text-sm font-medium text-gray-700">업로드된 파일</h3>
|
2025-11-05 15:39:02 +09:00
|
|
|
{uploadedFiles.length > 0 && (
|
|
|
|
|
<Badge variant="secondary" className="text-xs">
|
|
|
|
|
총 {formatFileSize(uploadedFiles.reduce((sum, file) => sum + file.fileSize, 0))}
|
|
|
|
|
</Badge>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2025-09-29 13:29:03 +09:00
|
|
|
</div>
|
|
|
|
|
|
2025-11-05 15:39:02 +09:00
|
|
|
<div className="flex-1 overflow-y-auto p-3">
|
|
|
|
|
{uploadedFiles.length > 0 ? (
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
{uploadedFiles.map((file) => (
|
|
|
|
|
<div
|
|
|
|
|
key={file.objid}
|
2026-03-10 18:30:18 +09:00
|
|
|
className={`flex cursor-pointer items-center space-x-3 rounded-lg p-2 transition-colors ${selectedFile?.objid === file.objid ? "border border-blue-200 bg-blue-50" : "bg-gray-50 hover:bg-gray-100"} `}
|
2025-11-05 15:39:02 +09:00
|
|
|
onClick={() => handleFileClick(file)}
|
|
|
|
|
>
|
2026-03-10 18:30:18 +09:00
|
|
|
<div className="flex-shrink-0">{getFileIcon(file.fileExt)}</div>
|
|
|
|
|
<div className="min-w-0 flex-1">
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
<span className="truncate text-sm font-medium text-gray-900">{file.realFileName}</span>
|
|
|
|
|
{file.isRepresentative && (
|
|
|
|
|
<Badge variant="default" className="h-5 px-1.5 text-xs">
|
|
|
|
|
대표
|
|
|
|
|
</Badge>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
<p className="text-xs text-gray-500">
|
|
|
|
|
{formatFileSize(file.fileSize)} • {file.fileExt.toUpperCase()}
|
|
|
|
|
</p>
|
2025-11-04 17:32:46 +09:00
|
|
|
</div>
|
2026-03-10 18:30:18 +09:00
|
|
|
<div className="flex items-center space-x-1">
|
|
|
|
|
{onSetRepresentative && (
|
|
|
|
|
<Button
|
|
|
|
|
variant={file.isRepresentative ? "default" : "ghost"}
|
|
|
|
|
size="sm"
|
|
|
|
|
className="h-7 w-7 p-0"
|
|
|
|
|
onClick={(e) => {
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
onSetRepresentative(file);
|
|
|
|
|
}}
|
|
|
|
|
title={file.isRepresentative ? "현재 대표 파일" : "대표 파일로 설정"}
|
|
|
|
|
>
|
|
|
|
|
<Star className={`h-3 w-3 ${file.isRepresentative ? "fill-white" : ""}`} />
|
|
|
|
|
</Button>
|
|
|
|
|
)}
|
2025-11-04 17:32:46 +09:00
|
|
|
<Button
|
2026-03-10 18:30:18 +09:00
|
|
|
variant="ghost"
|
2025-11-04 17:32:46 +09:00
|
|
|
size="sm"
|
2025-11-05 15:39:02 +09:00
|
|
|
className="h-7 w-7 p-0"
|
|
|
|
|
onClick={(e) => {
|
|
|
|
|
e.stopPropagation();
|
2026-03-10 18:30:18 +09:00
|
|
|
handleFileViewInternal(file);
|
2025-11-05 15:39:02 +09:00
|
|
|
}}
|
2026-03-10 18:30:18 +09:00
|
|
|
title="미리보기"
|
2025-11-04 17:32:46 +09:00
|
|
|
>
|
2026-03-10 18:30:18 +09:00
|
|
|
<Eye className="h-3 w-3" />
|
2025-11-04 17:32:46 +09:00
|
|
|
</Button>
|
2025-09-29 13:29:03 +09:00
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="sm"
|
2026-03-10 18:30:18 +09:00
|
|
|
className="h-7 w-7 p-0"
|
2025-11-05 15:39:02 +09:00
|
|
|
onClick={(e) => {
|
|
|
|
|
e.stopPropagation();
|
2026-03-10 18:30:18 +09:00
|
|
|
onFileDownload(file);
|
2025-11-05 15:39:02 +09:00
|
|
|
}}
|
2026-03-10 18:30:18 +09:00
|
|
|
title="다운로드"
|
2025-09-29 13:29:03 +09:00
|
|
|
>
|
2026-03-10 18:30:18 +09:00
|
|
|
<Download className="h-3 w-3" />
|
2025-09-29 13:29:03 +09:00
|
|
|
</Button>
|
2026-03-10 18:30:18 +09:00
|
|
|
{!isDesignMode && (
|
|
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="sm"
|
|
|
|
|
className="h-7 w-7 p-0 text-red-500 hover:text-red-700"
|
|
|
|
|
onClick={(e) => {
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
onFileDelete(file);
|
|
|
|
|
}}
|
|
|
|
|
title="삭제"
|
|
|
|
|
>
|
|
|
|
|
<Trash2 className="h-3 w-3" />
|
|
|
|
|
</Button>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2025-09-29 13:29:03 +09:00
|
|
|
</div>
|
2026-03-10 18:30:18 +09:00
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="flex flex-col items-center justify-center py-8 text-gray-500">
|
|
|
|
|
<File className="mb-3 h-12 w-12 text-gray-300" />
|
|
|
|
|
<p className="text-sm font-medium text-gray-600">업로드된 파일이 없습니다</p>
|
|
|
|
|
<p className="mt-1 text-xs text-gray-500">
|
|
|
|
|
{isDesignMode
|
|
|
|
|
? "디자인 모드에서는 파일을 업로드할 수 없습니다"
|
|
|
|
|
: "위의 영역에 파일을 업로드하세요"}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2025-09-29 13:29:03 +09:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</DialogContent>
|
|
|
|
|
</Dialog>
|
|
|
|
|
|
|
|
|
|
{/* 파일 뷰어 모달 */}
|
|
|
|
|
<FileViewerModal
|
|
|
|
|
file={viewerFile}
|
|
|
|
|
isOpen={isViewerOpen}
|
|
|
|
|
onClose={handleViewerClose}
|
|
|
|
|
onDownload={onFileDownload}
|
|
|
|
|
onDelete={!isDesignMode ? onFileDelete : undefined}
|
|
|
|
|
/>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|