Fix admin

Deskripsi:
- Ganti status developer jadi super admin
This commit is contained in:
2025-01-04 11:48:22 +08:00
parent d4c4bee2f2
commit c3a05fd6b2
9 changed files with 189 additions and 109 deletions

View File

@@ -14,13 +14,15 @@ import {
import { useShallowEffect } from "@mantine/hooks";
import { redirect, useRouter } from "next/navigation";
import { useState } from "react";
import { ComponentGlobal_CardStyles } from "../_global/component";
import { apiGetACtivationUser } from "../_global/lib/api_user";
import { clientLogger } from "@/util/clientLogger";
import _ from "lodash";
export default function WaitingRoom_View({
activationUser,
userLoginId,
}: {
activationUser: boolean;
userLoginId: string;
userLoginId?: string;
}) {
const router = useRouter();
const [loading, setLoading] = useState(false);
@@ -37,71 +39,61 @@ export default function WaitingRoom_View({
}
}
useShallowEffect(() => {
if (activationUser == true) {
return redirect("/");
}
}, [activationUser]);
const [data, setData] = useState<boolean | null>(null);
const listhHuruf = [
{
huruf: "H",
},
{
huruf: "I",
},
{
huruf: "P",
},
{
huruf: "M",
},
{
huruf: "I",
},
];
const customLOader = (
<Center>
<Group>
{listhHuruf.map((e, i) => (
<Center key={i} h={"100%"}>
<Skeleton height={50} circle radius={"100%"} />
<Text sx={{ position: "absolute" }} c={"gray.5"} fw={"bold"}>
{e.huruf}
</Text>
</Center>
))}
</Group>
</Center>
);
useShallowEffect(() => {
onLoadData();
}, []);
async function onLoadData() {
try {
const respone = await apiGetACtivationUser();
if (respone) {
console.log(respone.data);
setData(respone.data);
}
} catch (error) {
clientLogger.error("Error get cookies user", error);
}
}
return (
<>
<UIGlobal_LayoutDefault>
<Center h={"100vh"}>
<Stack align="center" spacing={50}>
{/* {customLOader} */}
<Stack justify="cneter" h={"90vh"} mt={"xl"}>
<ComponentGlobal_CardStyles>
{_.isNull(data) ? (
<Stack>
{Array.from(new Array(4)).map((e, i) => (
<Skeleton key={i} h={20} w={"100%"} />
))}
</Stack>
) : (
<Stack align="center">
<Stack align="center" spacing={5} fs={"italic"}>
<Text fw={"bold"} c={"white"} align="center">
Permohonan akses Anda sedang dalam proses verifikasi oleh
admin.
</Text>
<Text fw={"bold"} c={"white"} align="center">
Harap tunggu, Anda akan menerima pemberitahuan melalui
Whatsapp setelah disetujui.
</Text>
</Stack>
<Stack align="center" spacing={5}>
<Title order={3} c={"white"}>
Anda telah berhasil mendaftar,
</Title>
<Title order={3} c={"white"}>
Mohon menunggu konfirmansi Admin !
</Title>
</Stack>
<Button
color="red"
loaderPosition="center"
loading={loading}
radius={"xl"}
onClick={() => onClickLogout()}
>
Keluar
</Button>
</Stack>
</Center>
{/* <Button
color="red"
loaderPosition="center"
loading={loading}
radius={"xl"}
onClick={() => onClickLogout()}
>
Keluar
</Button> */}
</Stack>
)}
</ComponentGlobal_CardStyles>
</Stack>
</UIGlobal_LayoutDefault>
</>
);