"use client"; import React from "react"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Settings, CheckCircle, AlertCircle } from "lucide-react"; // νƒ€μž… import import { DataConnectionState } from "../types/redesigned"; interface ActionSummaryPanelProps { state: DataConnectionState; } /** * πŸ“‹ μ•‘μ…˜ μ„€μ • μš”μ•½ νŒ¨λ„ * - μ•‘μ…˜ νƒ€μž… ν‘œμ‹œ * - μ‹€ν–‰ 쑰건 μš”μ•½ * - μ„€μ • μ™„λ£Œ μƒνƒœ */ const ActionSummaryPanel: React.FC = ({ state }) => { const { actionType, actionConditions } = state; const isConfigured = actionType && (actionType === "insert" || actionConditions.length > 0); const actionTypeLabels = { insert: "INSERT", update: "UPDATE", delete: "DELETE", upsert: "UPSERT", }; const actionTypeDescriptions = { insert: "μƒˆ 데이터 μ‚½μž…", update: "κΈ°μ‘΄ 데이터 μˆ˜μ •", delete: "데이터 μ‚­μ œ", upsert: "있으면 μˆ˜μ •, μ—†μœΌλ©΄ μ‚½μž…", }; return ( μ•‘μ…˜ μ„€μ • {isConfigured ? ( ) : ( )} {/* μ•‘μ…˜ νƒ€μž… */}
μ•‘μ…˜ νƒ€μž… {actionType ? ( {actionTypeLabels[actionType]} ) : ( λ―Έμ„€μ • )}
{actionType &&

{actionTypeDescriptions[actionType]}

}
{/* μ‹€ν–‰ 쑰건 */} {actionType && actionType !== "insert" && (
μ‹€ν–‰ 쑰건 {actionConditions.length > 0 ? `${actionConditions.length}개 쑰건` : "쑰건 μ—†μŒ"}
{actionConditions.length === 0 && (

⚠️ {actionType.toUpperCase()} μ•‘μ…˜μ€ μ‹€ν–‰ 쑰건이 ν•„μš”ν•©λ‹ˆλ‹€

)}
)} {/* INSERT μ•‘μ…˜ μ•ˆλ‚΄ */} {actionType === "insert" && (

βœ… INSERT μ•‘μ…˜μ€ 별도 쑰건 없이 λͺ¨λ“  λ§€ν•‘λœ 데이터λ₯Ό μ‚½μž…ν•©λ‹ˆλ‹€

)} {/* μ„€μ • μƒνƒœ */}
{isConfigured ? ( <> μ„€μ • μ™„λ£Œ ) : ( <> μ„€μ • ν•„μš” )}
); }; export default ActionSummaryPanel;