summaryrefslogtreecommitdiff
path: root/lib/vendor-document-list/table/send-to-shi-button.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-05-28 17:23:13 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-05-28 17:23:13 +0000
commit4bad21ef79fdda5f016e2012ba673d6ee6abb5fc (patch)
tree4a02504cc1e983d7bacdc01442df44f35865b37d /lib/vendor-document-list/table/send-to-shi-button.tsx
parent36dd60ca6fce7712b35e6d7c1b9602710f442ada (diff)
(대표님) lib 파트 개발 0528
Diffstat (limited to 'lib/vendor-document-list/table/send-to-shi-button.tsx')
-rw-r--r--lib/vendor-document-list/table/send-to-shi-button.tsx16
1 files changed, 11 insertions, 5 deletions
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">