diff --git a/components/form/login.tsx b/components/form/login.tsx index f42f0ce..37c68ee 100644 --- a/components/form/login.tsx +++ b/components/form/login.tsx @@ -72,14 +72,15 @@ export default function Login() { // login dengan otp loading(); const response: any = await emailValidation(data); + if (response?.data?.messages[0]?.includes("Suspended")) { + close(); + error( + "Untuk sementara akun Polda/Polres Anda di tangguhkan, silahkan hubungi Admin Mabes untuk konfirmasi, Terima Kasih" + ); + return false; + } if (response?.error) { console.log("error", response); - if (response?.message?.messages[0]?.includes("suspended")) { - error( - "Untuk sementara akun Polda/Polres Anda di tangguhkan, silahkan hubungi Admin Mabes untuk konfirmasi, Terima Kasih" - ); - return false; - } if (response?.message?.messages[0]?.includes("failed to send mail")) { error("Gagal Mengirim OTP"); diff --git a/components/icons.tsx b/components/icons.tsx index 1a3b799..756204d 100644 --- a/components/icons.tsx +++ b/components/icons.tsx @@ -1421,14 +1421,16 @@ export const Checklist = ({ size = 24, width, height, + fill = "currentColor", + ...props }: IconSvgProps) => (
- {user?.isSuspend ? "Suspend" : "Active"} + {user?.isSuspended ? "Suspend" : "Active"}
); @@ -200,15 +208,25 @@ export default function MasterUserTable() { handleSuspend(user.id, !user?.isSuspend)} + onClick={() => handleSuspend(user.id, !user?.isSuspended)} > - - Suspend + {user?.isSuspended ? ( + + ) : ( + + )} + + {user?.isSuspended ? "Unsuspend" : "Suspend"}