summaryrefslogtreecommitdiff
path: root/lib/basic-contract/viewer/SurveyComponent.tsx
diff options
context:
space:
mode:
author0-Zz-ang <s1998319@gmail.com>2025-10-28 14:57:14 +0900
committer0-Zz-ang <s1998319@gmail.com>2025-10-28 14:57:14 +0900
commit5b0994f2af11c77b61ac59df6211ccb20fae4d44 (patch)
tree3cdd7d9039b058d9cde776536e4c38275a720178 /lib/basic-contract/viewer/SurveyComponent.tsx
parent06cf51e5dd14e118fa8dbb8c666d78ace61cbf9b (diff)
(박서영)준법설문 관련요구사항 반영
Diffstat (limited to 'lib/basic-contract/viewer/SurveyComponent.tsx')
-rw-r--r--lib/basic-contract/viewer/SurveyComponent.tsx20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/basic-contract/viewer/SurveyComponent.tsx b/lib/basic-contract/viewer/SurveyComponent.tsx
index 299fe6fa..8662155e 100644
--- a/lib/basic-contract/viewer/SurveyComponent.tsx
+++ b/lib/basic-contract/viewer/SurveyComponent.tsx
@@ -34,6 +34,7 @@ interface SurveyComponentProps {
contractId?: number;
surveyTemplate: SurveyTemplateWithQuestions | null;
surveyLoading: boolean;
+ surveyLoadAttempted?: boolean; // 로드 시도 여부 추가
conditionalHandler: ConditionalSurveyHandler | null;
onSurveyComplete?: () => void;
onSurveyDataUpdate: (data: any) => void;
@@ -45,6 +46,7 @@ export const SurveyComponent: React.FC<SurveyComponentProps> = ({
contractId,
surveyTemplate,
surveyLoading,
+ surveyLoadAttempted = false,
conditionalHandler,
onSurveyComplete,
onSurveyDataUpdate,
@@ -487,7 +489,21 @@ export const SurveyComponent: React.FC<SurveyComponentProps> = ({
);
}
+
if (!surveyTemplate) {
+ if (!surveyLoadAttempted) {
+ return (
+ <div className="h-full w-full">
+ <Card className="h-full">
+ <CardContent className="flex flex-col items-center justify-center h-full py-12">
+ <Loader2 className="h-8 w-8 text-blue-500 animate-spin mb-4" />
+ <p className="text-sm text-muted-foreground">설문조사를 준비하는 중...</p>
+ </CardContent>
+ </Card>
+ </div>
+ );
+ }
+
return (
<div className="h-full w-full">
<Card className="h-full">
@@ -836,8 +852,8 @@ export const SurveyComponent: React.FC<SurveyComponentProps> = ({
{uploadedFiles[question.id].map((file, index) => (
<div key={index} className="flex items-center space-x-2 text-sm">
<FileText className="h-4 w-4 text-blue-500" />
- <span>{file.fileName}</span>
- <span className="text-gray-500">({(file.fileSize / 1024).toFixed(1)} KB)</span>
+ <span>{file.name || file.fileName}</span>
+ <span className="text-gray-500">({((file.size || file.fileSize || 0) / 1024).toFixed(1)} KB)</span>
</div>
))}
</div>