"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, 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 isExecuting = executingBatch === batch.id; const isActive = batch.is_active === 'Y'; return ( {/* 헤더 */}

{batch.batch_name}

{batch.description || '설명 없음'}

{isExecuting ? '실행 중' : isActive ? '활성' : '비활성'}
{/* 정보 */}
{/* 스케줄 정보 */}
스케줄 {batch.cron_schedule}
{/* 생성일 정보 */}
생성일 {new Date(batch.created_date).toLocaleDateString('ko-KR')}
{/* 매핑 정보 */} {batch.batch_mappings && batch.batch_mappings.length > 0 && (
매핑 {batch.batch_mappings.length}개
)}
{/* 실행 중 프로그레스 */} {isExecuting && (
실행 중...
)} {/* 액션 버튼 */}
{/* 실행 버튼 */} {/* 활성화/비활성화 버튼 */} {/* 수정 버튼 */} {/* 삭제 버튼 */}
); }