Files
sam-react-prod/src/components/process-management/ProcessWorkLogPreviewModal.tsx
유병철 9464a368ba refactor: 모달 Content 컴포넌트 분리 및 파일 입력 UI 공통화
- 모달 컴포넌트에서 Content 분리하여 재사용성 향상
  - EstimateDocumentContent, DirectConstructionContent 등
  - WorkLogContent, QuotePreviewContent, ReceivingReceiptContent
- 파일 입력 공통 UI 컴포넌트 추가
  - file-dropzone, file-input, file-list, image-upload
- 폼 컴포넌트 코드 정리 및 중복 제거 (-4,056줄)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 15:07:17 +09:00

45 lines
1.1 KiB
TypeScript

'use client';
/**
* 공정 작업일지 미리보기 모달
*
* document-system 통합 버전 (2026-01-22)
*/
import { DocumentViewer } from '@/components/document-system';
import type { Process } from '@/types/process';
import { ProcessWorkLogContent } from './ProcessWorkLogContent';
const getDocumentCode = (processName: string): string => {
if (processName.includes('스크린')) return 'WL-SCR';
if (processName.includes('슬랫')) return 'WL-SLT';
if (processName.includes('절곡') || processName.includes('포밍')) return 'WL-BEN';
return 'WL-STK';
};
interface ProcessWorkLogPreviewModalProps {
open: boolean;
onOpenChange: (open: boolean) => void;
process: Process;
}
export function ProcessWorkLogPreviewModal({
open,
onOpenChange,
process
}: ProcessWorkLogPreviewModalProps) {
const documentCode = getDocumentCode(process.processName);
return (
<DocumentViewer
title={`${process.workLogTemplate} 미리보기`}
subtitle={`(${documentCode})`}
preset="inspection"
open={open}
onOpenChange={onOpenChange}
>
<ProcessWorkLogContent data={process} />
</DocumentViewer>
);
}