summaryrefslogtreecommitdiff
path: root/lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-07-15 10:07:09 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-07-15 10:07:09 +0000
commit4eb7532f822c821fb6b69bf103bd075fefba769b (patch)
treeb4bcf6c0bf791d71569f3f35498ed256bf7cfaf3 /lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx
parent660c7888d885badab7af3e96f9c16bd0172ad0f1 (diff)
(대표님) 20250715 협력사 정기평가, spreadJS, roles 서비스에 함수 추가
Diffstat (limited to 'lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx')
-rw-r--r--lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx32
1 files changed, 5 insertions, 27 deletions
diff --git a/lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx b/lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx
index c3b7251c..255b1f9d 100644
--- a/lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx
+++ b/lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx
@@ -19,31 +19,11 @@ interface EnhancedDocTableToolbarActionsProps {
export function EnhancedDocTableToolbarActions({
table,
projectType,
- contractId,
}: EnhancedDocTableToolbarActionsProps) {
const [bulkUploadDialogOpen, setBulkUploadDialogOpen] = React.useState(false)
// 현재 테이블의 모든 데이터 (필터링된 상태)
const allDocuments = table.getFilteredRowModel().rows.map(row => row.original)
-
- // 모든 문서에서 고유한 contractId들 추출
- const contractIds = React.useMemo(() => {
- const ids = new Set(allDocuments.map(doc => doc.contractId))
- return Array.from(ids)
- }, [allDocuments])
-
- // 주요 contractId (가장 많은 문서가 속한 계약)
- const primaryContractId = React.useMemo(() => {
- if (contractId) return contractId
- if (contractIds.length === 0) return undefined
-
- const contractCounts = contractIds.map(id => ({
- id,
- count: allDocuments.filter(doc => doc.contractId === id).length
- }))
-
- return contractCounts.sort((a, b) => b.count - a.count)[0].id
- }, [contractId, contractIds, allDocuments])
const handleSyncComplete = () => {
// 동기화 완료 후 테이블 새로고침
@@ -98,13 +78,11 @@ export function EnhancedDocTableToolbarActions({
</Button>
{/* Send to SHI 버튼 (공통) - 내부 → 외부로 보내기 */}
- {primaryContractId && (
- <SendToSHIButton
- contractId={primaryContractId}
- onSyncComplete={handleSyncComplete}
- projectType={projectType}
- />
- )}
+ <SendToSHIButton
+ documents={allDocuments}
+ onSyncComplete={handleSyncComplete}
+ projectType={projectType}
+ />
</div>