diff --git a/src/components/ExcelFileImport/ExcelFileImport.tsx b/src/components/ExcelFileImport/ExcelFileImport.tsx index 3ade400..e61473c 100644 --- a/src/components/ExcelFileImport/ExcelFileImport.tsx +++ b/src/components/ExcelFileImport/ExcelFileImport.tsx @@ -5,7 +5,7 @@ import { FileUpload } from "@mui/icons-material"; import { Button, Grid, Stack } from "@mui/material"; import React, { ChangeEvent, useCallback } from "react"; import { useTranslation } from "react-i18next"; -import { errorDialogWithContent, successDialog } from "../Swal/CustomAlerts"; +import { errorDialogWithContent, successDialog, successDialogWithContent } from "../Swal/CustomAlerts"; import { importTimesheets } from "@/app/api/timesheets/actions"; interface Props { @@ -37,7 +37,7 @@ const ExcelFileImport: React.FC = async ({ }) => { } if (response === "Import Excel success") { - successDialog(t("Import Success"), t) + successDialogWithContent(t("Import Success"), t(`${response}`), t) } else { errorDialogWithContent(t("Import Fail"), t(`${response}`), t) } diff --git a/src/components/Swal/CustomAlerts.js b/src/components/Swal/CustomAlerts.js index d7cd1f1..440600d 100644 --- a/src/components/Swal/CustomAlerts.js +++ b/src/components/Swal/CustomAlerts.js @@ -33,6 +33,16 @@ export const successDialog = (text, t) => { }) } +export const successDialogWithContent = (title, text, t) => { + return Swal.fire({ + icon: "success", + title: title, + html: text, + confirmButtonText: t("Confirm"), + showConfirmButton: true, + }) +} + export const errorDialog = (text, t) => { return Swal.fire({ icon: "error",