From cbb4c7fe0b94459162ad5e998bc05cd293e0ff96 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 11 Aug 2025 09:02:00 +0000 Subject: (대표님) 입찰, EDP 변경사항 대응, spreadJS 오류 수정, 벤더실사 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form-data/form-data-report-temp-upload-tab.tsx | 53 ++++++++++++++-------- 1 file changed, 34 insertions(+), 19 deletions(-) (limited to 'components/form-data/form-data-report-temp-upload-tab.tsx') diff --git a/components/form-data/form-data-report-temp-upload-tab.tsx b/components/form-data/form-data-report-temp-upload-tab.tsx index 32161e49..39d895a1 100644 --- a/components/form-data/form-data-report-temp-upload-tab.tsx +++ b/components/form-data/form-data-report-temp-upload-tab.tsx @@ -1,6 +1,8 @@ "use client"; import React, { FC, useState } from "react"; +import { useParams } from "next/navigation"; +import { useTranslation } from "@/i18n/client"; import { useToast } from "@/hooks/use-toast"; import { toast as toastMessage } from "sonner"; import prettyBytes from "pretty-bytes"; @@ -43,6 +45,10 @@ export const FormDataReportTempUploadTab: FC< FormDataReportTempUploadTabProps > = ({ packageId, formId, uploaderType }) => { const { toast } = useToast(); + const params = useParams(); + const lng = (params?.lng as string) || "ko"; + const { t } = useTranslation(lng, "engineering"); + const [selectedFiles, setSelectedFiles] = useState([]); const [isUploading, setIsUploading] = useState(false); const [uploadProgress, setUploadProgress] = useState(0); @@ -58,9 +64,9 @@ export const FormDataReportTempUploadTab: FC< fileRejections.forEach((rejection) => { toast({ variant: "destructive", - title: "File Error", + title: t("templateUploadTab.fileError"), description: `${rejection.file.name}: ${ - rejection.errors[0]?.message || "Upload failed" + rejection.errors[0]?.message || t("templateUploadTab.uploadFailed") }`, }); }); @@ -93,12 +99,12 @@ export const FormDataReportTempUploadTab: FC< successCount++; setUploadProgress(Math.round((successCount / totalFiles) * 100)); } - toastMessage.success("Template File 업로드 완료!"); + toastMessage.success(t("templateUploadTab.uploadComplete")); } catch (err) { console.error(err); toast({ - title: "Error", - description: "파일 업로드 중 오류가 발생했습니다.", + title: t("templateUploadTab.error"), + description: t("templateUploadTab.uploadError"), variant: "destructive", }); } finally { @@ -111,7 +117,7 @@ export const FormDataReportTempUploadTab: FC< return (
- +
- 파일을 여기에 드롭하세요 + {t("templateUploadTab.dropFileHere")} - 또는 클릭하여 파일을 선택하세요. 최대 크기:{" "} - {maxSize ? prettyBytes(maxSize) : "무제한"} + {t("templateUploadTab.orClickToSelect", { + maxSize: maxSize ? prettyBytes(maxSize) : t("templateUploadTab.unlimited") + })}
)} @@ -147,24 +154,27 @@ export const FormDataReportTempUploadTab: FC<
- 선택된 파일 ({selectedFiles.length}) + {t("templateUploadTab.selectedFiles", { count: selectedFiles.length })}
- {selectedFiles.length}개 파일 + + {t("templateUploadTab.fileCount", { count: selectedFiles.length })} +
)} - {isUploading && } + {isUploading && }
@@ -175,12 +185,14 @@ interface UploadFileItemProps { selectedFiles: File[]; removeFile: (index: number) => void; isUploading: boolean; + t: (key: string, options?: any) => string; } const UploadFileItem: FC = ({ selectedFiles, removeFile, isUploading, + t, }) => { return ( @@ -199,7 +211,7 @@ const UploadFileItem: FC = ({ disabled={isUploading} > - Remove + {t("templateUploadTab.remove")} @@ -208,14 +220,17 @@ const UploadFileItem: FC = ({ ); }; -const UploadProgressBox: FC<{ uploadProgress: number }> = ({ - uploadProgress, -}) => { +const UploadProgressBox: FC<{ + uploadProgress: number; + t: (key: string, options?: any) => string; +}> = ({ uploadProgress, t }) => { return (
- {uploadProgress}% 업로드 중... + + {t("templateUploadTab.uploadingProgress", { progress: uploadProgress })} +