From 958aeb2d539f9cde83b621c54e0047f07b1b069a Mon Sep 17 00:00:00 2001 From: dohyeons Date: Tue, 4 Nov 2025 17:32:46 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=97=85=EB=A1=9C?= =?UTF-8?q?=EB=93=9C=20=EC=AA=BD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file-upload/FileManagerModal.tsx | 29 +- .../file-upload/FileUploadComponent.tsx | 298 ++++++++++-------- .../registry/components/file-upload/types.ts | 3 + 3 files changed, 194 insertions(+), 136 deletions(-) diff --git a/frontend/lib/registry/components/file-upload/FileManagerModal.tsx b/frontend/lib/registry/components/file-upload/FileManagerModal.tsx index f8c76ca0..cfed8223 100644 --- a/frontend/lib/registry/components/file-upload/FileManagerModal.tsx +++ b/frontend/lib/registry/components/file-upload/FileManagerModal.tsx @@ -17,7 +17,8 @@ import { Music, Archive, Presentation, - X + X, + Star } from "lucide-react"; import { formatFileSize } from "@/lib/utils"; import { FileViewerModal } from "./FileViewerModal"; @@ -30,6 +31,7 @@ interface FileManagerModalProps { onFileDownload: (file: FileInfo) => void; onFileDelete: (file: FileInfo) => void; onFileView: (file: FileInfo) => void; + onSetRepresentative?: (file: FileInfo) => void; // 대표 이미지 설정 콜백 config: FileUploadConfig; isDesignMode?: boolean; } @@ -42,6 +44,7 @@ export const FileManagerModal: React.FC = ({ onFileDownload, onFileDelete, onFileView, + onSetRepresentative, config, isDesignMode = false, }) => { @@ -228,14 +231,32 @@ export const FileManagerModal: React.FC = ({ {getFileIcon(file.fileExt)}
-

- {file.realFileName} -

+
+ + {file.realFileName} + + {file.isRepresentative && ( + + 대표 + + )} +

{formatFileSize(file.fileSize)} • {file.fileExt.toUpperCase()}

+ {onSetRepresentative && ( + + )} + return ( + <> + {isImage && representativeImageUrl ? ( +
+ {representativeFile.realFileName}
-
- - {uploadedFiles.length > 0 ? ( -
- {uploadedFiles.map((file) => ( -
-
{getFileIcon(file.fileExt)}
- handleFileView(file)} - style={{ textShadow: "none" }} - > - {file.realFileName} - - - {formatFileSize(file.fileSize)} - -
- ))} -
- 💡 파일명 클릭으로 미리보기 또는 "전체 자세히보기"로 파일 관리 -
+ ) : isImage && !representativeImageUrl ? ( +
+
+

이미지 로딩 중...

) : ( -
- -

- 업로드된 파일이 없습니다 -

-

- 상세설정에서 파일을 업로드하세요 +

+ {getFileIcon(representativeFile.fileExt)} +

+ {representativeFile.realFileName}

+ + 대표 파일 +
)} -
+ + {/* 우측 하단 자세히보기 버튼 */} +
+ +
+ + ); + })() : ( +
+ +

업로드된 파일이 없습니다

+
)} - - {/* 도움말 텍스트 */} - {safeComponentConfig.helperText && ( -

{safeComponentConfig.helperText}

- )}
{/* 파일뷰어 모달 */} @@ -1098,6 +1131,7 @@ const FileUploadComponent: React.FC = ({ onFileDownload={handleFileDownload} onFileDelete={handleFileDelete} onFileView={handleFileView} + onSetRepresentative={handleSetRepresentative} config={safeComponentConfig} isDesignMode={isDesignMode} /> diff --git a/frontend/lib/registry/components/file-upload/types.ts b/frontend/lib/registry/components/file-upload/types.ts index 15eceab7..109561b4 100644 --- a/frontend/lib/registry/components/file-upload/types.ts +++ b/frontend/lib/registry/components/file-upload/types.ts @@ -30,6 +30,9 @@ export interface FileInfo { type?: string; // docType과 동일 uploadedAt?: string; // regdate와 동일 _file?: File; // 로컬 파일 객체 (업로드 전) + + // 대표 이미지 설정 + isRepresentative?: boolean; // 대표 이미지로 설정 여부 } /**