From ef4c533ebacc2cdc97e518f30e9a9350004fcdfb Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 28 Apr 2025 02:13:30 +0000 Subject: ~20250428 작업사항 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/form-data/sedp-components.tsx | 173 +++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 components/form-data/sedp-components.tsx (limited to 'components/form-data/sedp-components.tsx') diff --git a/components/form-data/sedp-components.tsx b/components/form-data/sedp-components.tsx new file mode 100644 index 00000000..4865e23d --- /dev/null +++ b/components/form-data/sedp-components.tsx @@ -0,0 +1,173 @@ +"use client"; + +import * as React from "react"; +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle +} from "@/components/ui/dialog"; +import { Loader, Send, AlertTriangle, CheckCircle } from "lucide-react"; +import { Badge } from "@/components/ui/badge"; +import { Progress } from "@/components/ui/progress"; + +// SEDP Send Confirmation Dialog +export function SEDPConfirmationDialog({ + isOpen, + onClose, + onConfirm, + formName, + tagCount, + isLoading +}: { + isOpen: boolean; + onClose: () => void; + onConfirm: () => void; + formName: string; + tagCount: number; + isLoading: boolean; +}) { + return ( + + + + Send Data to SEDP + + You are about to send form data to the Samsung Engineering Design Platform (SEDP). + + + +
+
+
Form Name:
+
{formName}
+ +
Total Tags:
+
{tagCount}
+
+ +
+ +
+ Data sent to SEDP cannot be easily reverted. Please ensure all information is correct before proceeding. +
+
+
+ + + + + +
+
+ ); +} + +// SEDP Status Dialog - shows the result of the SEDP operation +export function SEDPStatusDialog({ + isOpen, + onClose, + status, + message, + successCount, + errorCount, + totalCount +}: { + isOpen: boolean; + onClose: () => void; + status: 'success' | 'error' | 'partial'; + message: string; + successCount: number; + errorCount: number; + totalCount: number; +}) { + // Calculate percentage for the progress bar + const percentage = Math.round((successCount / totalCount) * 100); + + return ( + + + + + {status === 'success' ? 'Data Sent Successfully' : + status === 'partial' ? 'Partially Successful' : + 'Failed to Send Data'} + + + +
+ {/* Status Icon */} +
+ {status === 'success' ? ( +
+ +
+ ) : status === 'partial' ? ( +
+ +
+ ) : ( +
+ +
+ )} +
+ + {/* Message */} +

{message}

+ + {/* Progress Stats */} +
+
+ Progress + {percentage}% +
+ +
+
+ + {successCount} Successful + +
+ {errorCount > 0 && ( +
+ + {errorCount} Failed + +
+ )} +
+
+
+ + + + +
+
+ ); +} \ No newline at end of file -- cgit v1.2.3