From 4bad21ef79fdda5f016e2012ba673d6ee6abb5fc Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Wed, 28 May 2025 17:23:13 +0000
Subject: (대표님) lib 파트 개발 0528
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/vendor-document-list/table/send-to-shi-button.tsx | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

(limited to 'lib/vendor-document-list/table/send-to-shi-button.tsx')

diff --git a/lib/vendor-document-list/table/send-to-shi-button.tsx b/lib/vendor-document-list/table/send-to-shi-button.tsx
index e0360144..1a27a794 100644
--- a/lib/vendor-document-list/table/send-to-shi-button.tsx
+++ b/lib/vendor-document-list/table/send-to-shi-button.tsx
@@ -28,22 +28,26 @@ interface SendToSHIButtonProps {
   contractId: number
   documents?: EnhancedDocument[]
   onSyncComplete?: () => void
+  projectType: "ship" | "plant"
 }
 
 export function SendToSHIButton({ 
   contractId, 
   documents = [], 
-  onSyncComplete 
+  onSyncComplete,
+  projectType
 }: SendToSHIButtonProps) {
   const [isDialogOpen, setIsDialogOpen] = React.useState(false)
   const [syncProgress, setSyncProgress] = React.useState(0)
+
+  const targetSystem = projectType === 'ship'?"DOLCE":"SWP"
   
   const { 
     syncStatus, 
     isLoading: statusLoading, 
     error: statusError,
     refetch: refetchStatus 
-  } = useSyncStatus(contractId, 'SHI')
+  } = useSyncStatus(contractId, targetSystem)
 
   const { 
     triggerSync, 
@@ -71,7 +75,7 @@ export function SendToSHIButton({
 
       const result = await triggerSync({ 
         contractId, 
-        targetSystem: 'SHI' 
+        targetSystem 
       })
       
       clearInterval(progressInterval)
@@ -152,10 +156,11 @@ export function SendToSHIButton({
     <>
       <Popover>
         <PopoverTrigger asChild>
+        <div className="flex items-center gap-3">
           <Button
             variant="default"
             size="sm"
-            className="gap-2 relative bg-blue-600 hover:bg-blue-700"
+            className="flex items-center bg-blue-600 hover:bg-blue-700"
             disabled={isSyncing || statusLoading}
           >
             {isSyncing ? (
@@ -167,12 +172,13 @@ export function SendToSHIButton({
             {syncStatus?.pendingChanges > 0 && (
               <Badge 
                 variant="destructive" 
-                className="absolute -top-2 -right-2 h-5 w-5 p-0 text-xs flex items-center justify-center"
+                className="h-5 w-5 p-0 text-xs flex items-center justify-center"
               >
                 {syncStatus.pendingChanges}
               </Badge>
             )}
           </Button>
+        </div>
         </PopoverTrigger>
         
         <PopoverContent className="w-80">
-- 
cgit v1.2.3

