기타 수정사항 적용

This commit is contained in:
hyeonsu
2025-09-11 10:45:16 +09:00
parent fe6c0af5a8
commit 8e64b338a1
4 changed files with 36 additions and 82 deletions

View File

@@ -3,7 +3,6 @@
import { useState, useEffect, useCallback } from "react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Badge } from "@/components/ui/badge";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import {
@@ -26,12 +25,10 @@ import { toast } from "sonner";
import { useAuth } from "@/hooks/useAuth";
interface DataFlowListProps {
onDiagramSelect: (diagram: DataFlowDiagram) => void;
selectedDiagram: DataFlowDiagram | null;
onDesignDiagram: (diagram: DataFlowDiagram | null) => void;
}
export default function DataFlowList({ onDiagramSelect, selectedDiagram, onDesignDiagram }: DataFlowListProps) {
export default function DataFlowList({ onDesignDiagram }: DataFlowListProps) {
const { user } = useAuth();
const [diagrams, setDiagrams] = useState<DataFlowDiagram[]>([]);
const [loading, setLoading] = useState(true);
@@ -88,10 +85,6 @@ export default function DataFlowList({ onDiagramSelect, selectedDiagram, onDesig
loadDiagrams();
}, [loadDiagrams]);
const handleDiagramSelect = (diagram: DataFlowDiagram) => {
onDiagramSelect(diagram);
};
const handleDelete = (diagram: DataFlowDiagram) => {
setSelectedDiagramForAction(diagram);
setShowDeleteModal(true);
@@ -149,38 +142,6 @@ export default function DataFlowList({ onDiagramSelect, selectedDiagram, onDesig
}
};
// 연결 타입에 따른 배지 색상
const getConnectionTypeBadge = (connectionType: string) => {
switch (connectionType) {
case "simple-key":
return (
<Badge variant="outline" className="border-blue-200 bg-blue-50 text-blue-700">
</Badge>
);
case "data-save":
return (
<Badge variant="outline" className="border-green-200 bg-green-50 text-green-700">
</Badge>
);
case "external-call":
return (
<Badge variant="outline" className="border-purple-200 bg-purple-50 text-purple-700">
</Badge>
);
case "json-based":
return (
<Badge variant="outline" className="border-indigo-200 bg-indigo-50 text-indigo-700">
JSON
</Badge>
);
default:
return <Badge variant="outline">{connectionType}</Badge>;
}
};
if (loading) {
return (
<div className="flex items-center justify-center py-8">
@@ -224,7 +185,6 @@ export default function DataFlowList({ onDiagramSelect, selectedDiagram, onDesig
<TableHeader>
<TableRow>
<TableHead></TableHead>
<TableHead> </TableHead>
<TableHead> </TableHead>
<TableHead> </TableHead>
<TableHead> </TableHead>
@@ -234,13 +194,7 @@ export default function DataFlowList({ onDiagramSelect, selectedDiagram, onDesig
</TableHeader>
<TableBody>
{diagrams.map((diagram) => (
<TableRow
key={diagram.diagramId}
className={`cursor-pointer hover:bg-gray-50 ${
selectedDiagram?.diagramId === diagram.diagramId ? "border-blue-200 bg-blue-50" : ""
}`}
onClick={() => handleDiagramSelect(diagram)}
>
<TableRow key={diagram.diagramId} className="hover:bg-gray-50">
<TableCell>
<div>
<div className="flex items-center font-medium text-gray-900">
@@ -253,7 +207,6 @@ export default function DataFlowList({ onDiagramSelect, selectedDiagram, onDesig
</div>
</div>
</TableCell>
<TableCell>{getConnectionTypeBadge(diagram.connectionType)}</TableCell>
<TableCell>{diagram.companyCode || "*"}</TableCell>
<TableCell>
<div className="flex items-center">