summaryrefslogtreecommitdiff
path: root/components/form-data/sedp-components.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'components/form-data/sedp-components.tsx')
-rw-r--r--components/form-data/sedp-components.tsx50
1 files changed, 35 insertions, 15 deletions
diff --git a/components/form-data/sedp-components.tsx b/components/form-data/sedp-components.tsx
index 4865e23d..869f730c 100644
--- a/components/form-data/sedp-components.tsx
+++ b/components/form-data/sedp-components.tsx
@@ -1,6 +1,8 @@
"use client";
import * as React from "react";
+import { useParams } from "next/navigation";
+import { useTranslation } from "@/i18n/client";
import { Button } from "@/components/ui/button";
import {
Dialog,
@@ -30,36 +32,40 @@ export function SEDPConfirmationDialog({
tagCount: number;
isLoading: boolean;
}) {
+ const params = useParams();
+ const lng = (params?.lng as string) || "ko";
+ const { t } = useTranslation(lng, "engineering");
+
return (
<Dialog open={isOpen} onOpenChange={onClose}>
<DialogContent className="sm:max-w-md">
<DialogHeader>
- <DialogTitle>Send Data to SEDP</DialogTitle>
+ <DialogTitle>{t("sedp.sendDataTitle")}</DialogTitle>
<DialogDescription>
- You are about to send form data to the Samsung Engineering Design Platform (SEDP).
+ {t("sedp.sendDataDescription")}
</DialogDescription>
</DialogHeader>
<div className="py-4">
<div className="grid grid-cols-2 gap-4 mb-4">
- <div className="text-muted-foreground">Form Name:</div>
+ <div className="text-muted-foreground">{t("sedp.formName")}:</div>
<div className="font-medium">{formName}</div>
- <div className="text-muted-foreground">Total Tags:</div>
+ <div className="text-muted-foreground">{t("sedp.totalTags")}:</div>
<div className="font-medium">{tagCount}</div>
</div>
<div className="bg-amber-50 p-3 rounded-md border border-amber-200 flex items-start gap-2">
<AlertTriangle className="h-5 w-5 text-amber-500 mt-0.5 flex-shrink-0" />
<div className="text-sm text-amber-800">
- Data sent to SEDP cannot be easily reverted. Please ensure all information is correct before proceeding.
+ {t("sedp.warningMessage")}
</div>
</div>
</div>
<DialogFooter className="gap-2 sm:gap-0">
<Button variant="outline" onClick={onClose} disabled={isLoading}>
- Cancel
+ {t("buttons.cancel")}
</Button>
<Button
variant="samsung"
@@ -70,12 +76,12 @@ export function SEDPConfirmationDialog({
{isLoading ? (
<>
<Loader className="h-4 w-4 animate-spin" />
- Sending...
+ {t("sedp.sending")}
</>
) : (
<>
<Send className="h-4 w-4" />
- Send to SEDP
+ {t("sedp.sendToSEDP")}
</>
)}
</Button>
@@ -103,17 +109,31 @@ export function SEDPStatusDialog({
errorCount: number;
totalCount: number;
}) {
+ const params = useParams();
+ const lng = (params?.lng as string) || "ko";
+ const { t } = useTranslation(lng, "engineering");
+
// Calculate percentage for the progress bar
const percentage = Math.round((successCount / totalCount) * 100);
+ const getStatusTitle = () => {
+ switch (status) {
+ case 'success':
+ return t("sedp.dataSentSuccessfully");
+ case 'partial':
+ return t("sedp.partiallySuccessful");
+ case 'error':
+ default:
+ return t("sedp.failedToSendData");
+ }
+ };
+
return (
<Dialog open={isOpen} onOpenChange={onClose}>
<DialogContent className="sm:max-w-md">
<DialogHeader>
<DialogTitle>
- {status === 'success' ? 'Data Sent Successfully' :
- status === 'partial' ? 'Partially Successful' :
- 'Failed to Send Data'}
+ {getStatusTitle()}
</DialogTitle>
</DialogHeader>
@@ -141,20 +161,20 @@ export function SEDPStatusDialog({
{/* Progress Stats */}
<div className="space-y-2 mb-4">
<div className="flex justify-between text-sm">
- <span>Progress</span>
+ <span>{t("sedp.progress")}</span>
<span>{percentage}%</span>
</div>
<Progress value={percentage} className="h-2" />
<div className="flex justify-between text-sm pt-1">
<div>
<Badge variant="outline" className="bg-green-50 text-green-700 hover:bg-green-50">
- {successCount} Successful
+ {t("sedp.successfulCount", { count: successCount })}
</Badge>
</div>
{errorCount > 0 && (
<div>
<Badge variant="outline" className="bg-red-50 text-red-700 hover:bg-red-50">
- {errorCount} Failed
+ {t("sedp.failedCount", { count: errorCount })}
</Badge>
</div>
)}
@@ -164,7 +184,7 @@ export function SEDPStatusDialog({
<DialogFooter>
<Button onClick={onClose}>
- Close
+ {t("buttons.close")}
</Button>
</DialogFooter>
</DialogContent>