diff options
Diffstat (limited to 'lib/vendor-document-list/ship')
| -rw-r--r-- | lib/vendor-document-list/ship/send-to-shi-button.tsx | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/vendor-document-list/ship/send-to-shi-button.tsx b/lib/vendor-document-list/ship/send-to-shi-button.tsx index 447b461b..87cc6ff5 100644 --- a/lib/vendor-document-list/ship/send-to-shi-button.tsx +++ b/lib/vendor-document-list/ship/send-to-shi-button.tsx @@ -28,6 +28,7 @@ import { useClientSyncStatus, useTriggerSync, syncUtils } from "@/hooks/use-sync import type { EnhancedDocument } from "@/types/enhanced-documents" import { useParams } from "next/navigation" import { useTranslation } from "@/i18n/client" +import { useSession } from "next-auth/react" interface SendToSHIButtonProps { documents?: EnhancedDocument[] @@ -43,6 +44,7 @@ export function SendToSHIButton({ const [isDialogOpen, setIsDialogOpen] = React.useState(false) const [syncProgress, setSyncProgress] = React.useState(0) const [currentSyncingContract, setCurrentSyncingContract] = React.useState<number | null>(null) + const { data: session } = useSession(); const params = useParams() const lng = (params?.lng as string) || "ko" @@ -60,6 +62,8 @@ export function SendToSHIButton({ return uniqueIds.sort() }, [documents]) + const vendorId = session?.user.companyId + // ✅ 클라이언트 전용 Hook 사용 (서버 사이드 렌더링 호환) const { contractStatuses, totalStats, refetchAll } = useClientSyncStatus( documentsContractIds, @@ -68,20 +72,6 @@ export function SendToSHIButton({ const { triggerSync, isLoading: isSyncing, error: syncError } = useTriggerSync() - // 개발 환경에서 디버깅 정보 - React.useEffect(() => { - if (process.env.NODE_ENV === 'development') { - console.log('SendToSHIButton Debug Info:', { - documentsContractIds, - totalStats, - contractStatuses: contractStatuses.map(({ projectId, syncStatus, error }) => ({ - projectId, - pendingChanges: syncStatus?.pendingChanges, - hasError: !!error - })) - }) - } - }, [documentsContractIds, totalStats, contractStatuses]) // 동기화 실행 함수 const handleSync = async () => { |
