Files
vexplor/frontend/components/dataflow/connection/redesigned/LeftPanel/ActionSummaryPanel.tsx
DDD1542 4f10b5e42d refactor: 전체 프론트엔드 하드코딩 색상 → CSS 변수 일괄 치환
447+ 파일, 4500+ 줄 변경:
- gray-* → border/bg-muted/text-foreground/text-muted-foreground
- blue-* → primary/ring
- red-* → destructive
- green-* → emerald (일관성)
- indigo-* → primary
- yellow/orange → amber (통일)
- dark mode 변형도 시맨틱 토큰으로 변환

Made-with: Cursor
2026-03-09 14:31:59 +09:00

116 lines
3.8 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"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<ActionSummaryPanelProps> = ({ 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 (
<Card className="shadow-sm">
<CardHeader className="pb-3">
<CardTitle className="flex items-center gap-2 text-sm">
<Settings className="h-4 w-4" />
{isConfigured ? (
<CheckCircle className="h-4 w-4 text-emerald-600" />
) : (
<AlertCircle className="h-4 w-4 text-amber-500" />
)}
</CardTitle>
</CardHeader>
<CardContent className="space-y-3 px-4 pt-0 pb-4">
{/* 액션 타입 */}
<div className="space-y-2">
<div className="flex items-center justify-between">
<span className="text-xs font-medium"> </span>
{actionType ? (
<Badge variant="outline" className="text-xs">
{actionTypeLabels[actionType]}
</Badge>
) : (
<span className="text-muted-foreground text-xs"></span>
)}
</div>
{actionType && <p className="text-muted-foreground text-xs">{actionTypeDescriptions[actionType]}</p>}
</div>
{/* 실행 조건 */}
{actionType && actionType !== "insert" && (
<div className="space-y-2">
<div className="flex items-center justify-between">
<span className="text-xs font-medium"> </span>
<span className="text-muted-foreground text-xs">
{actionConditions.length > 0 ? `${actionConditions.length}개 조건` : "조건 없음"}
</span>
</div>
{actionConditions.length === 0 && (
<p className="text-xs text-amber-600"> {actionType.toUpperCase()} </p>
)}
</div>
)}
{/* INSERT 액션 안내 */}
{actionType === "insert" && (
<div className="rounded-md border border-emerald-200 bg-emerald-50 p-2">
<p className="text-xs text-emerald-700"> INSERT </p>
</div>
)}
{/* 설정 상태 */}
<div className="border-t pt-2">
<div className="flex items-center gap-2">
{isConfigured ? (
<>
<CheckCircle className="h-3 w-3 text-emerald-600" />
<span className="text-xs font-medium text-emerald-600"> </span>
</>
) : (
<>
<AlertCircle className="h-3 w-3 text-amber-500" />
<span className="text-xs font-medium text-amber-600"> </span>
</>
)}
</div>
</div>
</CardContent>
</Card>
);
};
export default ActionSummaryPanel;