summaryrefslogtreecommitdiff
path: root/lib/techsales-rfq/table/tech-sales-rfq-attachments-sheet.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/techsales-rfq/table/tech-sales-rfq-attachments-sheet.tsx')
-rw-r--r--lib/techsales-rfq/table/tech-sales-rfq-attachments-sheet.tsx15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/techsales-rfq/table/tech-sales-rfq-attachments-sheet.tsx b/lib/techsales-rfq/table/tech-sales-rfq-attachments-sheet.tsx
index a7b487e1..3b0fd38d 100644
--- a/lib/techsales-rfq/table/tech-sales-rfq-attachments-sheet.tsx
+++ b/lib/techsales-rfq/table/tech-sales-rfq-attachments-sheet.tsx
@@ -49,7 +49,7 @@ import {
import prettyBytes from "pretty-bytes"
import { formatDate } from "@/lib/utils"
-import { processTechSalesRfqAttachments, getTechSalesRfqAttachments } from "@/lib/techsales-rfq/service"
+import { processTechSalesRfqAttachments } from "@/lib/techsales-rfq/service"
const MAX_FILE_SIZE = 6e8 // 600MB
@@ -113,6 +113,8 @@ interface TechSalesRfqAttachmentsSheetProps
rfq: TechSalesRfq | null
/** 첨부파일 타입 */
attachmentType?: "RFQ_COMMON" | "TBE_RESULT" | "CBE_RESULT"
+ /** 읽기 전용 모드 (벤더용) */
+ readOnly?: boolean
/** 업로드/삭제 후 상위 테이블에 attachmentCount 등을 업데이트하기 위한 콜백 */
// onAttachmentsUpdated?: (rfqId: number, newAttachmentCount: number) => void
@@ -123,6 +125,7 @@ export function TechSalesRfqAttachmentsSheet({
// onAttachmentsUpdated,
rfq,
attachmentType = "RFQ_COMMON",
+ readOnly = false,
...props
}: TechSalesRfqAttachmentsSheetProps) {
const [isPending, setIsPending] = React.useState(false)
@@ -135,24 +138,24 @@ export function TechSalesRfqAttachmentsSheet({
title: "TBE 결과 첨부파일",
description: "기술 평가(TBE) 결과 파일을 관리합니다.",
fileTypeLabel: "TBE 결과",
- canEdit: true
+ canEdit: !readOnly
}
case "CBE_RESULT":
return {
title: "CBE 결과 첨부파일",
description: "상업성 평가(CBE) 결과 파일을 관리합니다.",
fileTypeLabel: "CBE 결과",
- canEdit: true
+ canEdit: !readOnly
}
default: // RFQ_COMMON
return {
title: "RFQ 첨부파일",
- description: "RFQ 공통 첨부파일을 관리합니다.",
+ description: readOnly ? "RFQ 공통 첨부파일을 조회합니다." : "RFQ 공통 첨부파일을 관리합니다.",
fileTypeLabel: "공통",
- canEdit: true
+ canEdit: !readOnly
}
}
- }, [attachmentType, rfq?.status])
+ }, [attachmentType, readOnly])
// // RFQ 상태에 따른 편집 가능 여부 결정 (readOnly prop이 true면 항상 false)
// const isEditable = React.useMemo(() => {