"use client"; import React from "react"; import { Card, CardContent } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { Play, Pause, Edit, Trash2, RefreshCw, Clock, Database, ArrowRight, Globe, Calendar, Activity, Settings } from "lucide-react"; import { BatchConfig } from "@/lib/api/batch"; interface BatchCardProps { batch: BatchConfig; executingBatch: number | null; onExecute: (batchId: number) => void; onToggleStatus: (batchId: number, currentStatus: string) => void; onEdit: (batchId: number) => void; onDelete: (batchId: number, batchName: string) => void; getMappingSummary: (mappings: any[]) => string; } export default function BatchCard({ batch, executingBatch, onExecute, onToggleStatus, onEdit, onDelete, getMappingSummary }: BatchCardProps) { // 상태에 따른 색상 및 스타일 결정 const getStatusColor = () => { if (executingBatch === batch.id) return "bg-blue-50 border-blue-200"; if (batch.is_active === 'Y') return "bg-green-50 border-green-200"; return "bg-gray-50 border-gray-200"; }; const getStatusBadge = () => { if (executingBatch === batch.id) { return 실행 중; } return ( {batch.is_active === 'Y' ? '활성' : '비활성'} ); }; return ( {/* 헤더 섹션 */}

{batch.batch_name}

{getStatusBadge()}

{batch.description || '\u00A0'}

{/* 정보 섹션 */}
{/* 스케줄 정보 */}
{batch.cron_schedule}
{/* 생성일 정보 */}
{new Date(batch.created_date).toLocaleDateString('ko-KR')}
{/* 매핑 정보 섹션 */} {batch.batch_mappings && batch.batch_mappings.length > 0 && (
매핑 ({batch.batch_mappings.length})
{getMappingSummary(batch.batch_mappings)}
)} {/* 액션 버튼 섹션 */}
{/* 실행 버튼 */} {/* 활성화/비활성화 버튼 */} {/* 수정 버튼 */} {/* 삭제 버튼 */}
{/* 실행 중일 때 프로그레스 표시 */} {executingBatch === batch.id && (
실행 중...
)}
); }