파일 업로드 쪽 수정

This commit is contained in:
dohyeons
2025-11-04 17:32:46 +09:00
parent 36ea8115cb
commit 958aeb2d53
3 changed files with 194 additions and 136 deletions

View File

@@ -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<FileManagerModalProps> = ({
onFileDownload,
onFileDelete,
onFileView,
onSetRepresentative,
config,
isDesignMode = false,
}) => {
@@ -228,14 +231,32 @@ export const FileManagerModal: React.FC<FileManagerModalProps> = ({
{getFileIcon(file.fileExt)}
</div>
<div className="flex-1 min-w-0">
<p className="text-sm font-medium text-gray-900 truncate">
{file.realFileName}
</p>
<div className="flex items-center gap-2">
<span className="text-sm font-medium text-gray-900 truncate">
{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>
</div>
<div className="flex items-center space-x-1">
{onSetRepresentative && (
<Button
variant={file.isRepresentative ? "default" : "ghost"}
size="sm"
className="h-8 w-8 p-0"
onClick={() => onSetRepresentative(file)}
title={file.isRepresentative ? "현재 대표 파일" : "대표 파일로 설정"}
>
<Star className={`w-4 h-4 ${file.isRepresentative ? "fill-white" : ""}`} />
</Button>
)}
<Button
variant="ghost"
size="sm"