From 008f824e4f549695274678122435a524fe6fae9c Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Thu, 23 Oct 2025 06:11:55 +0000
Subject: (임수민) 데이터룸 워터마크, 텍스트 파일 타입 뷰 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/file-manager/FileManager.tsx | 9 +++++++++
 1 file changed, 9 insertions(+)

(limited to 'components/file-manager/FileManager.tsx')

diff --git a/components/file-manager/FileManager.tsx b/components/file-manager/FileManager.tsx
index 1af29e74..11f58980 100644
--- a/components/file-manager/FileManager.tsx
+++ b/components/file-manager/FileManager.tsx
@@ -852,6 +852,15 @@ export function FileManager({ projectId }: FileManagerProps) {
   // View file with PDFTron
   const viewFile = async (file: FileItem) => {
     try {
+      const mimeType = file.mimeType || '';
+      const fileName = file.name.toLowerCase();
+
+      if (mimeType.startsWith('text/') ||
+        mimeType.endsWith('.txt')) {
+          window.open(`/api/files/${file.filePath}`, `_blank`);
+          return;
+        }
+      
       setViewerFileUrl(file.filePath || '');
       setSelectedFile(file);
       setViewerDialogOpen(true);
-- 
cgit v1.2.3

