diff options
Diffstat (limited to 'lib/basic-contract/viewer/SurveyComponent.tsx')
| -rw-r--r-- | lib/basic-contract/viewer/SurveyComponent.tsx | 20 |
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> |
