summaryrefslogtreecommitdiff
path: root/lib/basic-contract/viewer/basic-contract-sign-viewer.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/basic-contract/viewer/basic-contract-sign-viewer.tsx')
-rw-r--r--lib/basic-contract/viewer/basic-contract-sign-viewer.tsx71
1 files changed, 29 insertions, 42 deletions
diff --git a/lib/basic-contract/viewer/basic-contract-sign-viewer.tsx b/lib/basic-contract/viewer/basic-contract-sign-viewer.tsx
index 4d98675b..75862506 100644
--- a/lib/basic-contract/viewer/basic-contract-sign-viewer.tsx
+++ b/lib/basic-contract/viewer/basic-contract-sign-viewer.tsx
@@ -1292,39 +1292,27 @@ export function BasicContractSignViewer({
}
};
- // 서명 상태 표시 컴포넌트
+ // 서명 상태 표시 컴포넌트 - 처리 중이거나 오류일 때만 표시
const SignatureFieldsStatus = () => {
- if (!hasSignatureFields && !isAutoSignProcessing && !autoSignError && !hasValidSignature) return null;
-
- const currentInstance = webViewerInstance.current || instance;
+ // 처리 중이거나 오류가 있을 때만 표시 (완료 후에는 자동으로 사라짐)
+ if (!isAutoSignProcessing && !autoSignError) return null;
return (
- <div className="mb-2 flex items-center space-x-2">
- {isAutoSignProcessing ? (
- <Badge variant="secondary" className="text-xs">
- <Loader2 className="h-3 w-3 mr-1 animate-spin" />
- 서명 필드 생성 중...
- </Badge>
- ) : autoSignError ? (
- <Badge variant="destructive" className="text-xs bg-red-50 text-red-700 border-red-200">
- <AlertTriangle className="h-3 w-3 mr-1" />
- 자동 생성 실패
- </Badge>
- ) : hasSignatureFields ? (
- <>
- <Badge variant="outline" className="text-xs bg-blue-50 text-blue-700 border-blue-200">
- <Target className="h-3 w-3 mr-1" />
- {signatureFields.length}개 서명 필드 자동 생성됨 {mode === 'buyer' ? '(왼쪽 하단)' : ''}
+ <div className="sticky top-0 z-50 bg-blue-50 border-b border-blue-200 px-4 py-2 shadow-sm">
+ <div className="flex items-center justify-center space-x-2">
+ {isAutoSignProcessing && (
+ <Badge variant="secondary" className="text-xs">
+ <Loader2 className="h-3 w-3 mr-1 animate-spin" />
+ 서명 필드 생성 중...
</Badge>
- </>
- ) : null}
-
- {hasValidSignature && (
- <Badge variant="outline" className="text-xs bg-green-50 text-green-700 border-green-200">
- <CheckCircle2 className="h-3 w-3 mr-1" />
- 서명 완료됨
- </Badge>
- )}
+ )}
+ {autoSignError && (
+ <Badge variant="destructive" className="text-xs bg-red-50 text-red-700 border-red-200">
+ <AlertTriangle className="h-3 w-3 mr-1" />
+ 자동 생성 실패 - 수동으로 서명해주세요
+ </Badge>
+ )}
+ </div>
</div>
);
};
@@ -1333,11 +1321,13 @@ export function BasicContractSignViewer({
if (!isOpen && !onClose) {
return (
<div className="h-full w-full flex flex-col overflow-hidden">
+ {/* 서명 필드 생성 중 알림 - 상단 고정 */}
+ <SignatureFieldsStatus />
+
{/* 구매자 모드에서는 탭 없이 단일 뷰어만 표시 */}
{allFiles.length > 1 && mode !== 'buyer' ? (
<Tabs value={activeTab} onValueChange={handleTabChange} className="h-full flex flex-col">
<div className="border-b bg-gray-50 px-3 py-2 flex-shrink-0">
- <SignatureFieldsStatus />
<TabsList className="grid w-full h-8" style={{ gridTemplateColumns: `repeat(${allFiles.length}, 1fr)` }}>
{allFiles.map((file, index) => {
let tabId: string;
@@ -1447,9 +1437,6 @@ export function BasicContractSignViewer({
</Tabs>
) : (
<div className="h-full w-full flex flex-col">
- <div className="flex-shrink-0 p-2">
- <SignatureFieldsStatus />
- </div>
<div className="flex-1 min-h-0 overflow-hidden relative">
<div className="absolute inset-0">
<div className="w-full h-full overflow-auto">
@@ -1492,9 +1479,8 @@ export function BasicContractSignViewer({
<Dialog open={showDialog} onOpenChange={handleClose}>
<DialogContent className="w-[90vw] max-w-6xl h-[90vh] flex flex-col p-0">
<DialogHeader className="px-6 py-4 border-b flex-shrink-0">
- <DialogTitle className="flex items-center justify-between">
- <span>{mode === 'buyer' ? '구매자 최종승인' : '기본계약서 서명'}</span>
- <SignatureFieldsStatus />
+ <DialogTitle>
+ {mode === 'buyer' ? '구매자 최종승인' : '기본계약서 서명'}
</DialogTitle>
<DialogDescription>
계약서를 확인하고 {mode === 'buyer' ? '최종승인을' : '서명을'} 진행해주세요.
@@ -1504,7 +1490,7 @@ export function BasicContractSignViewer({
{mode !== 'buyer' && isGTCTemplate && (
<span className="block mt-1 text-blue-600">📋 협의 코멘트를 확인하고 모든 협의가 완료되었는지 확인해주세요.</span>
)}
- {hasSignatureFields && (
+ {hasSignatureFields && !isAutoSignProcessing && (
<span className="block mt-1 text-green-600">
🎯 서명 위치가 자동으로 감지되었습니다{mode === 'buyer' ? ' (왼쪽 하단)' : ''}.
</span>
@@ -1514,11 +1500,6 @@ export function BasicContractSignViewer({
✅ {mode === 'buyer' ? '승인이' : '서명이'} 완료되었습니다.
</span>
)}
- {mode !== 'buyer' && isGTCTemplate && gtcCommentStatus.hasComments && (
- <span className="block mt-1 text-red-600">
- ⚠️ {gtcCommentStatus.commentCount}개의 코멘트가 있어 서명할 수 없습니다.
- </span>
- )}
{mode !== 'buyer' && isGTCTemplate && gtcCommentStatus.hasComments && !gtcCommentStatus.isComplete && (
<span className="block mt-1 text-red-600">
⚠️ {gtcCommentStatus.commentCount}개의 미해결 코멘트가 있어 서명할 수 없습니다.
@@ -1533,6 +1514,9 @@ export function BasicContractSignViewer({
</DialogHeader>
<div className="flex-1 min-h-0 overflow-hidden">
+ {/* 서명 필드 생성 중 알림 - 상단 고정 */}
+ <SignatureFieldsStatus />
+
{/* 구매자 모드에서는 탭 없이 단일 뷰어만 표시 */}
{allFiles.length > 1 && mode !== 'buyer' ? (
<Tabs value={activeTab} onValueChange={handleTabChange} className="h-full flex flex-col">
@@ -1641,6 +1625,9 @@ export function BasicContractSignViewer({
</Tabs>
) : (
<div className="h-full flex flex-col">
+ {/* 서명 필드 생성 중 알림 - 상단 고정 */}
+ <SignatureFieldsStatus />
+
<div className="flex-1 min-h-0 overflow-hidden relative">
<div className="absolute inset-0">
<div className="w-full h-full overflow-auto">