'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { List, Edit, Wrench } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { PageLayout } from '@/components/organisms/PageLayout'; import { ProcessWorkLogPreviewModal } from './ProcessWorkLogPreviewModal'; import type { Process } from '@/types/process'; interface ProcessDetailProps { process: Process; } export function ProcessDetail({ process }: ProcessDetailProps) { const router = useRouter(); const [workLogModalOpen, setWorkLogModalOpen] = useState(false); const handleEdit = () => { router.push(`/ko/master-data/process-management/${process.id}/edit`); }; const handleList = () => { router.push('/ko/master-data/process-management'); }; const handleViewWorkLog = () => { setWorkLogModalOpen(true); }; return ( {/* 헤더 */}

공정 상세

{/* 기본 정보 */} 기본 정보
공정코드
{process.processCode}
공정명
{process.processName}
공정구분
{process.processType}
담당부서
{process.department}
작업일지 양식
{process.workLogTemplate || '-'} {process.workLogTemplate && ( )}
{/* 등록 정보 */} 등록 정보
등록일
{process.createdAt}
최종수정일
{process.updatedAt}
{/* 자동 분류 규칙 */} 자동 분류 규칙 {process.classificationRules.length === 0 ? (

등록된 자동 분류 규칙이 없습니다

) : (
{process.classificationRules.map((rule) => (
{rule.isActive ? '활성' : '비활성'}
{rule.ruleType} - "{rule.conditionValue}"
{rule.description && (
{rule.description}
)}
우선순위: {rule.priority}
))}
)}
{/* 세부 작업단계 */} 세부 작업단계 {process.workSteps.length > 0 ? (
{process.workSteps.map((step, index) => (
{index + 1} {step} {index < process.workSteps.length - 1 && ( {'>'} )}
))}
) : (
-
)}
{/* 작업 정보 */} 작업 정보
필요인원
{process.requiredWorkers}명
{process.equipmentInfo && (
설비정보
{process.equipmentInfo}
)}
설명
{process.description || '-'}
{/* 작업일지 양식 미리보기 모달 */}
); }