diff --git a/src/app_modules/forum/main/layout.tsx b/src/app_modules/forum/main/layout.tsx
index 39e9266e..798a58e5 100644
--- a/src/app_modules/forum/main/layout.tsx
+++ b/src/app_modules/forum/main/layout.tsx
@@ -26,8 +26,8 @@ import { MODEL_USER } from "@/app_modules/home/model/interface";
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
-import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
-import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
+import LayoutGlobal_UI_Tamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
+import LayoutGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
export default function LayoutForum_Main({
children,
@@ -43,9 +43,9 @@ export default function LayoutForum_Main({
return (
<>
-
{children}
-
+
{/*
-
+
}
>
{children}
-
+
{/*
diff --git a/src/app_modules/forum/report/posting/layout.tsx b/src/app_modules/forum/report/posting/layout.tsx
index 0b9b250b..784e3d60 100644
--- a/src/app_modules/forum/report/posting/layout.tsx
+++ b/src/app_modules/forum/report/posting/layout.tsx
@@ -1,7 +1,7 @@
"use client";
-import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
-import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
+import LayoutGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
+import LayoutGlobal_UI_Tamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
import React from "react";
export default function LayoutForum_ReportPosting({
@@ -11,13 +11,13 @@ export default function LayoutForum_ReportPosting({
}) {
return (
<>
-
+
}
>
{children}
-
+
>
diff --git a/src/app_modules/forum/splash/index.tsx b/src/app_modules/forum/splash/index.tsx
index 195c03db..03f44677 100644
--- a/src/app_modules/forum/splash/index.tsx
+++ b/src/app_modules/forum/splash/index.tsx
@@ -2,7 +2,7 @@
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
import ComponentGlobal_SplashScreen from "@/app_modules/component_global/splash/splash_global";
-import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
+import LayoutGlobal_UI_Tamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
import {
Avatar,
Center,
@@ -20,7 +20,7 @@ export default function Forum_Splash() {
const router = useRouter();
useShallowEffect(() => {
setTimeout(() => {
- router.replace(RouterForum.beranda);
+ router.replace(RouterForum.beranda, { scroll: false });
}, 1000);
}, []);
diff --git a/src/app_modules/home/component/button_header.tsx b/src/app_modules/home/component/button_header.tsx
new file mode 100644
index 00000000..05e5898f
--- /dev/null
+++ b/src/app_modules/home/component/button_header.tsx
@@ -0,0 +1,106 @@
+"use client";
+
+import LayoutGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
+import { ActionIcon, Indicator, Loader, Text } from "@mantine/core";
+import { MODEL_USER } from "../model/interface";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
+import { useState } from "react";
+import { useRouter } from "next/navigation";
+import { RouterUserSearch } from "@/app/lib/router_hipmi/router_user_search";
+import {
+ AccentColor,
+ MainColor,
+} from "@/app_modules/component_global/color/color_pallet";
+import { IconBell, IconUserSearch } from "@tabler/icons-react";
+import { RouterNotifikasi } from "@/app/lib/router_hipmi/router_notifikasi";
+import { useShallowEffect } from "@mantine/hooks";
+import notifikasi_countUserNotifikasi from "@/app_modules/notifikasi/fun/count/fun_count_by_id";
+
+export function ComponentHome_ButtonHeaderLeft({
+ dataUser,
+}: {
+ dataUser: MODEL_USER;
+}) {
+ const router = useRouter();
+ const [isLoadingUS, setIsLoadingUS] = useState(false);
+
+ return (
+ <>
+ {
+ if (dataUser?.Profile === null) {
+ ComponentGlobal_NotifikasiPeringatan("Lengkapi Profile");
+ } else {
+ setIsLoadingUS(true);
+ router.push(RouterUserSearch.main, { scroll: false });
+ }
+ }}
+ >
+ {isLoadingUS ? (
+
+ ) : (
+
+ )}
+
+ >
+ );
+}
+
+export function ComponentHome_ButtonHeaderRight({
+ dataUser,
+ countNotifikasi,
+}: {
+ dataUser: MODEL_USER;
+ countNotifikasi: number;
+}) {
+ const router = useRouter();
+ const [count, setCount] = useState(countNotifikasi);
+ const [isLoadingBell, setIsLoadingBell] = useState(false);
+
+ useShallowEffect(() => {
+ onLoadNotifkasi({
+ onLoad(val) {
+ setCount(val);
+ },
+ });
+ }, []);
+
+ async function onLoadNotifkasi({ onLoad }: { onLoad: (val: any) => void }) {
+ const loadNotifikasi = await notifikasi_countUserNotifikasi();
+ onLoad(loadNotifikasi);
+ }
+
+ return (
+ <>
+ {
+ if (dataUser?.Profile === null) {
+ ComponentGlobal_NotifikasiPeringatan("Lengkapi Profile");
+ } else {
+ router.push(RouterNotifikasi.main, { scroll: false });
+ setIsLoadingBell(true);
+ }
+ }}
+ >
+ {isLoadingBell ? (
+
+ ) : (
+
+ {count > 99 ? "99+" : count}
+
+ }
+ >
+
+
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/home/view.tsx b/src/app_modules/home/component/ui_home.tsx
similarity index 58%
rename from src/app_modules/home/view.tsx
rename to src/app_modules/home/component/ui_home.tsx
index bd984546..935c09fc 100644
--- a/src/app_modules/home/view.tsx
+++ b/src/app_modules/home/component/ui_home.tsx
@@ -1,43 +1,49 @@
"use client";
-import {
- ActionIcon,
- Box,
- Center,
- Group,
- Image,
- Loader,
- LoadingOverlay,
- Overlay,
- Paper,
- SimpleGrid,
- Stack,
- Text,
-} from "@mantine/core";
-
-import {
- IconAffiliate,
- IconBriefcase,
- IconHeartHandshake,
- IconPackageImport,
- IconPresentation,
- IconUserSearch,
-} from "@tabler/icons-react";
-
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import {
+ AccentColor,
+ MainColor,
+} from "@/app_modules/component_global/color/color_pallet";
+import ComponentGlobal_IsEmptyData from "@/app_modules/component_global/is_empty_data";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
+import {
+ Box,
+ Paper,
+ Stack,
+ SimpleGrid,
+ ActionIcon,
+ Loader,
+ Group,
+ Image,
+ Text,
+ Avatar,
+ Center,
+} from "@mantine/core";
+import {
+ IconPresentation,
+ IconAffiliate,
+ IconPackageImport,
+ IconHeartHandshake,
+ IconBriefcase,
+ IconUserSearch,
+ IconMap2,
+ IconMessages,
+ IconShoppingBag,
+ IconUserCircle,
+} from "@tabler/icons-react";
import _ from "lodash";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import { AccentColor, MainColor } from "../component_global/color/color_pallet";
-import ComponentGlobal_IsEmptyData from "../component_global/is_empty_data";
-import { ComponentGlobal_NotifikasiPeringatan } from "../component_global/notif_global/notifikasi_peringatan";
-import { MODEL_JOB } from "../job/model/interface";
-import { MODEL_USER } from "./model/interface";
+import { MODEL_USER } from "../model/interface";
+import { MODEL_JOB } from "@/app_modules/job/model/interface";
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
-export default function HomeView({
+export function Home_UiView({
dataUser,
dataJob,
}: {
@@ -86,7 +92,7 @@ export default function HomeView({
return (
<>
-
+
@@ -230,3 +237,123 @@ export default function HomeView({
>
);
}
+
+const listHalamanFooter = [
+ {
+ id: 1,
+ name: "Forums",
+ icon: ,
+ link: RouterForum.splash,
+ },
+
+ {
+ id: 2,
+ name: "MarketPlace",
+ icon: ,
+ link: "",
+ },
+ {
+ id: 3,
+ name: "Business Maps",
+ icon: ,
+ link: "",
+ },
+];
+
+export function Home_UiFooter({ dataUser }: { dataUser: MODEL_USER }) {
+ const router = useRouter();
+ const [isLoadingProfil, setIsLoadingProfile] = useState(false);
+ const [isLoadingPage, setIsLoadingPage] = useState(false);
+ const [pageId, setPageId] = useState(0);
+ return (
+ <>
+
+
+ {listHalamanFooter.map((e, i) => (
+
+
+ {
+ if (dataUser?.Profile === null) {
+ ComponentGlobal_NotifikasiPeringatan("Lengkapi Profile");
+ } else {
+ e.link === ""
+ ? ComponentGlobal_NotifikasiPeringatan("Cooming Soon")
+ : (router.push(e.link, { scroll: false }),
+ setIsLoadingPage(true),
+ setPageId(e?.id));
+ }
+ }}
+ >
+ {isLoadingPage && e.id === pageId ? (
+
+ ) : (
+ e.icon
+ )}
+
+
+ {e.name}
+
+
+
+ ))}
+
+
+ {
+ setIsLoadingProfile(true);
+ if (dataUser?.Profile === null) {
+ router.push(RouterProfile.create, { scroll: false });
+ } else {
+ router.push(
+ RouterProfile.katalog + `${dataUser?.Profile?.id}`,
+ { scroll: false }
+ );
+ }
+ }}
+ >
+
+ {dataUser?.Profile === null ? (
+
+ ) : isLoadingProfil ? (
+
+ ) : (
+
+ )}
+
+
+ Profile
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/home/index.ts b/src/app_modules/home/index.ts
index 713cdd1b..07785dd4 100644
--- a/src/app_modules/home/index.ts
+++ b/src/app_modules/home/index.ts
@@ -1,5 +1,4 @@
-import HomeView from "./view";
-import HomeLayout from "./layout";
+import HomeView from "./view_home";
import Home_UserNotActive from "./user_non_active";
-export { HomeView, HomeLayout, Home_UserNotActive as Home_UserNonActive };
+export { HomeView, Home_UserNotActive as Home_UserNonActive };
diff --git a/src/app_modules/home/layout.tsx b/src/app_modules/home/layout.tsx
deleted file mode 100644
index ba42b607..00000000
--- a/src/app_modules/home/layout.tsx
+++ /dev/null
@@ -1,310 +0,0 @@
-"use client";
-import {
- ActionIcon,
- AppShell,
- Avatar,
- BackgroundImage,
- Box,
- Center,
- Flex,
- Footer,
- Grid,
- Group,
- Header,
- Indicator,
- Loader,
- Paper,
- ScrollArea,
- SimpleGrid,
- Stack,
- Text,
- ThemeIcon,
- Title,
-} from "@mantine/core";
-import { HomeView } from ".";
-import {
- IconUserSearch,
- IconAward,
- IconQrcode,
- IconUserCircle,
- IconBell,
- IconMessages,
- IconShoppingBag,
- IconMap2,
-} from "@tabler/icons-react";
-import { Logout } from "../auth";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
-import { MODEL_USER } from "./model/interface";
-import React, { useState } from "react";
-import { useRouter } from "next/navigation";
-import { ComponentGlobal_NotifikasiPeringatan } from "../component_global/notif_global/notifikasi_peringatan";
-import { ComponentGlobal_NotifikasiBerhasil } from "../component_global/notif_global/notifikasi_berhasil";
-import { RouterUserSearch } from "@/app/lib/router_hipmi/router_user_search";
-import { RouterNotifikasi } from "@/app/lib/router_hipmi/router_notifikasi";
-import { useShallowEffect } from "@mantine/hooks";
-import notifikasi_countUserNotifikasi from "../notifikasi/fun/count/fun_count_by_id";
-import mqtt_client from "@/util/mqtt_client";
-import { AccentColor, MainColor } from "../component_global/color/color_pallet";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
-
-export default function HomeLayout({
- dataUser,
- children,
- countNotifikasi,
-}: {
- dataUser: MODEL_USER;
- children: React.ReactNode;
- countNotifikasi: number;
-}) {
- const router = useRouter();
- // const [user, setUser] = useState(dataUser);
- const [isLoadingProfil, setIsLoadingProfile] = useState(false);
- const [isLoadingUS, setIsLoadingUS] = useState(false);
- const [isLoadingBell, setIsLoadingBell] = useState(false);
- const [isLoadingPage, setIsLoadingPage] = useState(false);
- const [pageId, setPageId] = useState(0);
-
- const [countNotif, setCountNotif] = useState(countNotifikasi);
-
- const listHalamanFooter = [
- {
- id: 1,
- name: "Forums",
- icon: ,
- link: RouterForum.splash,
- },
-
- {
- id: 2,
- name: "MarketPlace",
- icon: ,
- link: "",
- },
- {
- id: 3,
- name: "Business Maps",
- icon: ,
- link: "",
- },
- ];
-
- useShallowEffect(() => {
- mqtt_client.subscribe("USER");
-
- mqtt_client.on("message", (topic: any, message: any) => {
- // console.log(topic);
- const data = JSON.parse(message.toString());
-
- if (data.userId === dataUser.id) {
- setCountNotif(countNotif + data.count);
- }
- });
-
- onLoadNotifikasi({
- onLoad(val) {
- setCountNotif(val);
- },
- });
- }, [countNotif]);
-
- async function onLoadNotifikasi({ onLoad }: { onLoad: (val: any) => void }) {
- const loadNotif = await notifikasi_countUserNotifikasi();
- onLoad(loadNotif);
- }
-
- return (
- <>
-
- {/* Header */}
-
-
- {
- if (dataUser?.Profile === null) {
- ComponentGlobal_NotifikasiPeringatan("Lengkapi Profile");
- } else {
- setIsLoadingUS(true);
- router.push(RouterUserSearch.main);
- }
- }}
- >
- {isLoadingUS ? (
-
- ) : (
-
- )}
-
-
-
-
- HIPMI
-
-
- {
- if (dataUser?.Profile === null) {
- ComponentGlobal_NotifikasiPeringatan("Lengkapi Profile");
- } else {
- router.push(RouterNotifikasi.main);
- setIsLoadingBell(true);
- }
- }}
- >
- {isLoadingBell ? (
-
- ) : (
-
- {countNotif}
-
- }
- >
-
-
- )}
-
-
-
-
- {/* Children */}
-
-
- {/* {Array(10)
- .fill(0)
- .map((e, i) => (
-
- {i + 1}
-
- ))} */}
- {children}
-
-
-
-
-
- {/* Footer */}
-
-
- {listHalamanFooter.map((e, i) => (
-
-
- {
- if (dataUser?.Profile === null) {
- ComponentGlobal_NotifikasiPeringatan(
- "Lengkapi Profile"
- );
- } else {
- e.link === ""
- ? ComponentGlobal_NotifikasiPeringatan("Cooming Soon")
- : (router.push(e.link),
- setIsLoadingPage(true),
- setPageId(e?.id));
- }
- }}
- >
- {isLoadingPage && e.id === pageId ? (
-
- ) : (
- e.icon
- )}
-
-
- {e.name}
-
-
-
- ))}
-
-
- {
- setIsLoadingProfile(true);
- if (dataUser?.Profile === null) {
- router.push(RouterProfile.create);
- } else {
- router.push(
- RouterProfile.katalog + `${dataUser.Profile.id}`
- );
- }
- }}
- >
-
- {dataUser?.Profile === null ? (
-
- ) : isLoadingProfil ? (
-
- ) : (
-
- )}
-
-
- Profile
-
-
-
-
-
-
- >
- );
-}
diff --git a/src/app_modules/home/view_home.tsx b/src/app_modules/home/view_home.tsx
new file mode 100644
index 00000000..78708e1a
--- /dev/null
+++ b/src/app_modules/home/view_home.tsx
@@ -0,0 +1,43 @@
+import LayoutGlobal_UI_HeaderTamplate from "../component_global/ui/ui_header_tamplate";
+import LayoutGlobal_UI_Tamplate from "../component_global/ui/ui_layout_tamplate";
+import { MODEL_JOB } from "../job/model/interface";
+import {
+ ComponentHome_ButtonHeaderLeft,
+ ComponentHome_ButtonHeaderRight,
+} from "./component/button_header";
+import { Home_UiFooter, Home_UiView } from "./component/ui_home";
+import { MODEL_USER } from "./model/interface";
+
+export default function HomeView({
+ dataUser,
+ dataJob,
+ countNotifikasi,
+}: {
+ dataUser: MODEL_USER;
+ dataJob: MODEL_JOB[];
+ countNotifikasi: number;
+}) {
+ return (
+ <>
+
+ }
+ customButtonRight={
+
+ }
+ />
+ }
+ footer={}
+ >
+
+
+ >
+ );
+}
diff --git a/src/app_modules/job/create/layout.tsx b/src/app_modules/job/create/layout.tsx
index 5b6760db..2909f632 100644
--- a/src/app_modules/job/create/layout.tsx
+++ b/src/app_modules/job/create/layout.tsx
@@ -1,7 +1,7 @@
"use client";
-import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
-import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
+import LayoutGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
+import LayoutGlobal_UI_Tamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
import React from "react";
export default function LayoutJob_Create({
@@ -11,11 +11,11 @@ export default function LayoutJob_Create({
}) {
return (
<>
- }
+ }
>
{children}
-
+
>
);
}
diff --git a/src/app_modules/job/detail/arsip/layout.tsx b/src/app_modules/job/detail/arsip/layout.tsx
index ba6f7284..de2c7329 100644
--- a/src/app_modules/job/detail/arsip/layout.tsx
+++ b/src/app_modules/job/detail/arsip/layout.tsx
@@ -1,7 +1,7 @@
"use client";
-import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
-import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
+import LayoutGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
+import LayoutGlobal_UI_Tamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
import React from "react";
export default function LayoutJob_DetailArsip({
@@ -11,11 +11,11 @@ export default function LayoutJob_DetailArsip({
}) {
return (
<>
- }
+ }
>
{children}
-
+
>
);
}
diff --git a/src/app_modules/job/detail/draft/layout.tsx b/src/app_modules/job/detail/draft/layout.tsx
index 6d8946e2..90dc406a 100644
--- a/src/app_modules/job/detail/draft/layout.tsx
+++ b/src/app_modules/job/detail/draft/layout.tsx
@@ -17,8 +17,8 @@ import ComponentJob_HeaderTamplate from "../../component/header_tamplate";
import { IconDots, IconEdit, IconX } from "@tabler/icons-react";
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
-import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
-import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
+import LayoutGlobal_UI_Tamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
+import LayoutGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
import { useRouter } from "next/navigation";
import { useDisclosure } from "@mantine/hooks";
import {
@@ -48,9 +48,9 @@ export default function LayoutJob_DetailDraft({
return (
<>
- open()}>
@@ -62,7 +62,7 @@ export default function LayoutJob_DetailDraft({
}
>
{children}
-
+
- }
+ }
>
{children}
-
+
>
);
}
diff --git a/src/app_modules/job/detail/publish/layout.tsx b/src/app_modules/job/detail/publish/layout.tsx
index ef1caf7c..2b98cf44 100644
--- a/src/app_modules/job/detail/publish/layout.tsx
+++ b/src/app_modules/job/detail/publish/layout.tsx
@@ -1,7 +1,7 @@
"use client";
-import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
-import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
+import LayoutGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
+import LayoutGlobal_UI_Tamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
import React from "react";
export default function LayoutJob_DetailPublish({
@@ -11,11 +11,11 @@ export default function LayoutJob_DetailPublish({
}) {
return (
<>
- }
+ }
>
{children}
-
+
>
);
}
diff --git a/src/app_modules/job/detail/reject/layout.tsx b/src/app_modules/job/detail/reject/layout.tsx
index e8d3e8b8..42eb63df 100644
--- a/src/app_modules/job/detail/reject/layout.tsx
+++ b/src/app_modules/job/detail/reject/layout.tsx
@@ -5,8 +5,8 @@ import React from "react";
import ComponentJob_HeaderTamplate from "../../component/header_tamplate";
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
-import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
-import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
+import LayoutGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
+import LayoutGlobal_UI_Tamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
import { IconEdit } from "@tabler/icons-react";
export default function LayoutJob_DetailReject({
@@ -16,11 +16,11 @@ export default function LayoutJob_DetailReject({
}) {
return (
<>
- }
+ }
>
{children}
-
+
>
);
}
diff --git a/src/app_modules/job/detail/review/layout.tsx b/src/app_modules/job/detail/review/layout.tsx
index ccf9cc7d..dd7bf43d 100644
--- a/src/app_modules/job/detail/review/layout.tsx
+++ b/src/app_modules/job/detail/review/layout.tsx
@@ -1,7 +1,7 @@
"use client";
-import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
-import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
+import LayoutGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
+import LayoutGlobal_UI_Tamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
import React from "react";
export default function LayoutJob_DetailReview({
@@ -11,11 +11,11 @@ export default function LayoutJob_DetailReview({
}) {
return (
<>
- }
+ }
>
{children}
-
+
>
);
}
diff --git a/src/app_modules/job/edit/layout.tsx b/src/app_modules/job/edit/layout.tsx
index 4d08b611..7b9b8763 100644
--- a/src/app_modules/job/edit/layout.tsx
+++ b/src/app_modules/job/edit/layout.tsx
@@ -1,7 +1,7 @@
"use client";
-import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
-import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
+import LayoutGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
+import LayoutGlobal_UI_Tamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
import React from "react";
export default function LayoutJob_Edit({
@@ -11,11 +11,11 @@ export default function LayoutJob_Edit({
}) {
return (
<>
- }
+ }
>
{children}
-
+
>
);
diff --git a/src/app_modules/job/main/beranda/ui_beranda.tsx b/src/app_modules/job/main/beranda/ui_beranda.tsx
index 0d282dd7..37ffff7f 100644
--- a/src/app_modules/job/main/beranda/ui_beranda.tsx
+++ b/src/app_modules/job/main/beranda/ui_beranda.tsx
@@ -9,6 +9,7 @@ import { ScrollOnly } from "next-scroll-loader";
import ComponentJob_BerandaCardView from "../../component/beranda/card_view";
import { job_getAllListPublish } from "../../fun/get/get_all_publish";
import ComponentJob_CreateButton from "../../component/button/create_button";
+import { IconSearch } from "@tabler/icons-react";
export function Job_UiBeranda({ listData }: { listData: MODEL_JOB[] }) {
const [data, setData] = useState(listData);
@@ -31,12 +32,14 @@ export function Job_UiBeranda({ listData }: { listData: MODEL_JOB[] }) {
}
placeholder="Pekerjaan apa yang anda cari ?"
onChange={(val) => {
onSearch(val.currentTarget.value);
diff --git a/src/app_modules/job/main/layout.tsx b/src/app_modules/job/main/layout.tsx
index 3c65fff7..e7e05fa9 100644
--- a/src/app_modules/job/main/layout.tsx
+++ b/src/app_modules/job/main/layout.tsx
@@ -3,8 +3,8 @@
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
import { MainColor } from "@/app_modules/component_global/color/color_pallet";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
-import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
-import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
+import LayoutGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
+import LayoutGlobal_UI_Tamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
import { ActionIcon, SimpleGrid, Stack, Text } from "@mantine/core";
import { IconHistory, IconHome, IconReservedLine } from "@tabler/icons-react";
import { useAtom } from "jotai";
@@ -46,9 +46,9 @@ export default function LayoutJob_Main({
return (
<>
-
@@ -118,7 +118,7 @@ export default function LayoutJob_Main({
}
>
{children}
-
+
>
);
}
diff --git a/src/app_modules/job/non_user_view/layout.tsx b/src/app_modules/job/non_user_view/layout.tsx
index 24906397..2d32cd54 100644
--- a/src/app_modules/job/non_user_view/layout.tsx
+++ b/src/app_modules/job/non_user_view/layout.tsx
@@ -4,8 +4,8 @@ import { AppShell, Center } from "@mantine/core";
import React from "react";
import ComponentJob_HeaderTamplate from "../component/header_tamplate";
import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
-import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
-import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
+import LayoutGlobal_UI_Tamplate from "@/app_modules/component_global/ui/ui_layout_tamplate";
+import LayoutGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate";
export default function LayoutJob_NonUserView({
children,
@@ -14,11 +14,11 @@ export default function LayoutJob_NonUserView({
}) {
return (
<>
- }
+ }
>
{children}
-
+
>
);
}
diff --git a/src/app_modules/job/splash/ui_splash.tsx b/src/app_modules/job/splash/ui_splash.tsx
index c5f3ac6e..af1322e6 100644
--- a/src/app_modules/job/splash/ui_splash.tsx
+++ b/src/app_modules/job/splash/ui_splash.tsx
@@ -18,7 +18,7 @@ export function Job_UiSplash() {
setTimeout(() => {
setHotMenu(1);
setStatus("Publish");
- router.replace(RouterJob.beranda);
+ router.replace(RouterJob.beranda, { scroll: false });
}, 1000);
}, []);
return (
diff --git a/src/app_modules/notifikasi/component/card_view.tsx b/src/app_modules/notifikasi/component/card_view.tsx
new file mode 100644
index 00000000..7bed821c
--- /dev/null
+++ b/src/app_modules/notifikasi/component/card_view.tsx
@@ -0,0 +1,141 @@
+"use client";
+
+import { Badge, Card, Divider, Group, Stack, Text } from "@mantine/core";
+import { IconCheck, IconChecks } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import notifikasi_funUpdateIsReadById from "../fun/update/fun_update_is_read_by_user_id";
+import { MODEL_NOTIFIKASI } from "../model/interface";
+import { redirectDetailForumPage } from "./path/forum";
+import { redirectJobPage } from "./path/job";
+import {
+ AccentColor,
+ MainColor,
+} from "@/app_modules/component_global/color/color_pallet";
+import notifikasi_getByUserId from "../fun/get/get_notifiaksi_by_id";
+
+export function ComponentNotifiaksi_CardView({
+ data,
+ onLoadData,
+ activePage,
+ onSetJob,
+}: {
+ data: MODEL_NOTIFIKASI;
+ onLoadData: (val: any) => void;
+ activePage: number;
+ onSetJob: (val: any) => void;
+}) {
+ const router = useRouter();
+ return (
+ <>
+ {
+ data?.kategoriApp === "JOB" &&
+ redirectJobPage({
+ data: data,
+ router: router,
+ onSetPage(val) {
+ onSetJob(val);
+ },
+ });
+
+ data?.kategoriApp === "FORUM" &&
+ redirectDetailForumPage({
+ data: data,
+ router: router,
+ });
+
+ const updateIsRead = await notifikasi_funUpdateIsReadById({
+ notifId: data?.id,
+ });
+
+ if (updateIsRead.status === 200) {
+ // console.log(updateIsRead.status);
+ // const loadData = await notifikasi_getByUserId({ page: activePage });
+ // onLoadData(loadData);
+ // console.log("berhasil load")
+ }
+ }}
+ >
+ {/* {JSON.stringify(e, null, 2)} */}
+
+
+
+
+ # {data?.kategoriApp}
+
+ {data?.status ? (
+
+ {data?.status}
+
+ ) : (
+ ""
+ )}
+
+
+
+
+
+
+
+ {data?.title}
+
+ {data.kategoriApp === "FORUM" ? (
+
+ ) : (
+ {data?.pesan}
+ )}
+
+
+
+
+
+ {new Intl.DateTimeFormat("id-ID", {
+ dateStyle: "long",
+ }).format(data?.createdAt)}
+
+
+ {", "}
+ {new Intl.DateTimeFormat("id-ID", {
+ timeStyle: "short",
+ }).format(data?.createdAt)}
+
+
+ {data?.isRead ? (
+
+
+
+ Sudah dilihat
+
+
+ ) : (
+
+
+
+ Belum dilihat
+
+
+ )}
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/notifikasi/component/path/forum.ts b/src/app_modules/notifikasi/component/path/forum.ts
new file mode 100644
index 00000000..e31c9f88
--- /dev/null
+++ b/src/app_modules/notifikasi/component/path/forum.ts
@@ -0,0 +1,26 @@
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
+import { MODEL_NOTIFIKASI } from "../../model/interface";
+
+export function redirectDetailForumPage({
+ data,
+ router,
+}: {
+ data: MODEL_NOTIFIKASI;
+ router: AppRouterInstance;
+}) {
+ if (data.status === null) {
+ const path = RouterForum.main_detail + data.appId;
+ router.push(path, { scroll: false });
+ }
+
+ if (data.status === "Report Komentar") {
+ const path = RouterForum.detail_report_komentar + data.appId;
+ router.push(path, { scroll: false });
+ }
+
+ if (data.status === "Report Posting") {
+ const path = RouterForum.detail_report_posting + data.appId;
+ router.push(path, { scroll: false });
+ }
+}
diff --git a/src/app_modules/notifikasi/component/path/job.ts b/src/app_modules/notifikasi/component/path/job.ts
new file mode 100644
index 00000000..03efdb2b
--- /dev/null
+++ b/src/app_modules/notifikasi/component/path/job.ts
@@ -0,0 +1,31 @@
+import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
+import { MODEL_NOTIFIKASI } from "../../model/interface";
+
+export function redirectJobPage({
+ data,
+ router,
+ onSetPage,
+}: {
+ data: MODEL_NOTIFIKASI;
+ router: AppRouterInstance;
+ onSetPage: (val: any) => void;
+}) {
+ const path = RouterJob.status;
+
+ if (data.status === "Publish") {
+ onSetPage({
+ menuId: 2,
+ status: data.status,
+ });
+ }
+
+ if (data.status === "Reject") {
+ onSetPage({
+ menuId: 2,
+ status: data.status,
+ });
+ }
+
+ router.push(path, {scroll: false});
+}
diff --git a/src/app_modules/notifikasi/component/ui_notifiaksi.tsx b/src/app_modules/notifikasi/component/ui_notifiaksi.tsx
new file mode 100644
index 00000000..827da9c2
--- /dev/null
+++ b/src/app_modules/notifikasi/component/ui_notifiaksi.tsx
@@ -0,0 +1,81 @@
+"use client";
+
+import ComponentGlobal_IsEmptyData from "@/app_modules/component_global/is_empty_data";
+import ComponentGlobal_UI_Loader from "@/app_modules/component_global/ui/ui_loader";
+import { gs_job_hot_menu, gs_job_status } from "@/app_modules/job/global_state";
+import { Box, Center } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useAtom } from "jotai";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useState } from "react";
+import notifikasi_getByUserId from "../fun/get/get_notifiaksi_by_id";
+import { MODEL_NOTIFIKASI } from "../model/interface";
+import { ComponentNotifiaksi_CardView } from "./card_view";
+
+export function Notifikasi_UiView({
+ listNotifikasi,
+}: {
+ listNotifikasi: MODEL_NOTIFIKASI[];
+}) {
+ const [data, setData] = useState(listNotifikasi);
+ const [activePage, setActivePage] = useState(1);
+
+ // JOB
+ const [jobMenuId, setJobMenuId] = useAtom(gs_job_hot_menu);
+ const [jobStatus, setJobStatus] = useAtom(gs_job_status);
+
+ useShallowEffect(() => {
+ onLoadData({
+ onLoad(val) {
+ setData(val);
+ },
+ });
+ }, []);
+
+ async function onLoadData({ onLoad }: { onLoad: (val: any) => void }) {
+ const loadData = await notifikasi_getByUserId({ page: 1 });
+ onLoad(loadData);
+ }
+
+ return (
+ <>
+
+ {_.isEmpty(data) ? (
+
+ ) : (
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData}
+ moreData={async () => {
+ const loadData = await notifikasi_getByUserId({
+ page: activePage + 1,
+ });
+ setActivePage((val) => val + 1);
+
+ return loadData;
+ }}
+ >
+ {(item) => (
+ setData(val)}
+ activePage={activePage}
+ onSetJob={(val) => {
+ setJobMenuId(val.menuId);
+ setJobStatus(val.status);
+ }}
+ />
+ )}
+
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/notifikasi/fun/get/get_notifiaksi_by_id.ts b/src/app_modules/notifikasi/fun/get/get_notifiaksi_by_id.ts
index 9ba18fb9..856710b1 100644
--- a/src/app_modules/notifikasi/fun/get/get_notifiaksi_by_id.ts
+++ b/src/app_modules/notifikasi/fun/get/get_notifiaksi_by_id.ts
@@ -3,10 +3,14 @@
import prisma from "@/app/lib/prisma";
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
-export default async function notifikasi_getByUserId() {
+export default async function notifikasi_getByUserId({page}: {page: number }) {
const userId = await user_getOneUserId();
+ const takeData = 10;
+ const skipData = page * takeData - takeData;
const data = await prisma.notifikasi.findMany({
+ take: takeData,
+ skip: skipData,
orderBy: {
createdAt: "desc",
},
diff --git a/src/app_modules/notifikasi/index.ts b/src/app_modules/notifikasi/index.ts
index a347a8b2..25af39f6 100644
--- a/src/app_modules/notifikasi/index.ts
+++ b/src/app_modules/notifikasi/index.ts
@@ -1,3 +1,3 @@
-import Notifikasi_MainView from "./main";
+import Notifikasi_MainView from "./view_notifikasi";
export { Notifikasi_MainView };
\ No newline at end of file
diff --git a/src/app_modules/notifikasi/main/index.tsx b/src/app_modules/notifikasi/main/index.tsx
deleted file mode 100644
index 8ca7e69a..00000000
--- a/src/app_modules/notifikasi/main/index.tsx
+++ /dev/null
@@ -1,236 +0,0 @@
-"use client";
-
-import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
-import ComponentGlobal_HeaderTamplate from "@/app_modules/component_global/header_tamplate";
-import {
- Badge,
- Card,
- Divider,
- Group,
- Paper,
- SimpleGrid,
- Stack,
- Text,
-} from "@mantine/core";
-import { MODEL_NOTIFIKASI } from "../model/interface";
-import { useState } from "react";
-import adminNotifikasi_countNotifikasi from "@/app_modules/admin/notifikasi/fun/count/count_is_read";
-import adminNotifikasi_getByUserId from "@/app_modules/admin/notifikasi/fun/get/get_notifikasi_by_user_id";
-import adminNotifikasi_funUpdateIsReadById from "@/app_modules/admin/notifikasi/fun/update/fun_update_is_read_by_id";
-import { IconChecks, IconCheck } from "@tabler/icons-react";
-import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
-import { useRouter } from "next/navigation";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
-import notifikasi_funUpdateIsReadById from "../fun/update/fun_update_is_read_by_user_id";
-import { useAtom } from "jotai";
-import { gs_job_hot_menu, gs_job_status } from "@/app_modules/job/global_state";
-import _ from "lodash";
-import ComponentGlobal_IsEmptyData from "@/app_modules/component_global/is_empty_data";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
-import notifikasi_getByUserId from "../fun/get/get_notifiaksi_by_id";
-import { useShallowEffect } from "@mantine/hooks";
-import { data } from "autoprefixer";
-
-export default function Notifikasi_MainView({
- listNotifikasi,
-}: {
- listNotifikasi: any[];
-}) {
- return (
- <>
- }
- >
-
-
- >
- );
-}
-
-function MainView({ listNotifikasi }: { listNotifikasi: MODEL_NOTIFIKASI[] }) {
- const router = useRouter();
- const [data, setData] = useState(listNotifikasi);
-
- // JOB
- const [jobMenuId, setJobMenuId] = useAtom(gs_job_hot_menu);
- const [jobStatus, setJobStatus] = useAtom(gs_job_status);
-
- useShallowEffect(() => {
- onLoadData({
- onLoad(val) {
- setData(val);
- },
- });
- }, []);
-
- async function onLoadData({ onLoad }: { onLoad: (val: any) => void }) {
- const loadData = await notifikasi_getByUserId();
- onLoad(loadData);
- }
-
- if (_.isEmpty(data)) {
- return ;
- }
- return (
- <>
-
- {data.map((e, i) => (
- {
- e?.kategoriApp === "JOB" &&
- redirectJobPage({
- data: e,
- router: router,
- onSetPage(val) {
- setJobMenuId(val.menuId);
- setJobStatus(val.status);
- },
- });
-
- e?.kategoriApp === "FORUM" &&
- redirectDetailForumPage({
- data: e,
- router: router,
- });
-
- const updateIsRead = await notifikasi_funUpdateIsReadById({
- notifId: e?.id,
- });
- if (updateIsRead.status === 200) return null;
- }}
- >
- {/* {JSON.stringify(e, null, 2)} */}
-
-
-
-
- # {e?.kategoriApp}
-
- {e?.status ? {e?.status} : ""}
-
-
-
-
-
-
-
- {e?.title}
-
- {e.kategoriApp === "FORUM" ? (
-
- ) : (
- //
- //
-
- {e?.pesan}
-
- )}
-
-
-
-
-
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "long",
- }).format(e?.createdAt)}
-
-
- {", "}
- {new Intl.DateTimeFormat("id-ID", {
- timeStyle: "short",
- }).format(e?.createdAt)}
-
-
- {e?.isRead ? (
-
-
-
- Sudah dilihat
-
-
- ) : (
-
-
-
- Belum dilihat
-
-
- )}
-
-
-
- ))}
-
- >
- );
-}
-
-function redirectJobPage({
- data,
- router,
- onSetPage,
-}: {
- data: MODEL_NOTIFIKASI;
- router: AppRouterInstance;
- onSetPage: (val: any) => void;
-}) {
- const path = RouterJob.status;
-
- if (data.status === "Publish") {
- onSetPage({
- menuId: 2,
- status: data.status,
- });
- }
-
- if (data.status === "Reject") {
- onSetPage({
- menuId: 2,
- status: data.status,
- });
- }
-
- router.push(path);
-}
-
-function redirectDetailForumPage({
- data,
- router,
-}: {
- data: MODEL_NOTIFIKASI;
- router: AppRouterInstance;
-}) {
- if (data.status === null) {
- const path = RouterForum.main_detail + data.appId;
- router.push(path);
- }
-
- if (data.status === "Report Komentar") {
- const path = RouterForum.detail_report_komentar + data.appId;
- router.push(path);
- }
-
- if (data.status === "Report Posting") {
- const path = RouterForum.detail_report_posting + data.appId;
- router.push(path);
- }
-}
diff --git a/src/app_modules/notifikasi/view_notifikasi.tsx b/src/app_modules/notifikasi/view_notifikasi.tsx
new file mode 100644
index 00000000..2cb64dbf
--- /dev/null
+++ b/src/app_modules/notifikasi/view_notifikasi.tsx
@@ -0,0 +1,19 @@
+import LayoutGlobal_UI_HeaderTamplate from "../component_global/ui/ui_header_tamplate";
+import LayoutGlobal_UI_Tamplate from "../component_global/ui/ui_layout_tamplate";
+import { Notifikasi_UiView } from "./component/ui_notifiaksi";
+
+export default function Notifikasi_MainView({
+ listNotifikasi,
+}: {
+ listNotifikasi: any[];
+}) {
+ return (
+ <>
+ }
+ >
+
+
+ >
+ );
+}
diff --git a/src/app_modules/user_search/component/is_empty_data.tsx b/src/app_modules/user_search/component/is_empty_data.tsx
deleted file mode 100644
index ccfd8217..00000000
--- a/src/app_modules/user_search/component/is_empty_data.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-"use client";
-
-import { Center } from "@mantine/core";
-
-export default function ComponentUserSearch_IsEmptyData({ text }: { text: string }) {
- return (
- <>
-
- {text}
-
- >
- );
-}
diff --git a/src/app_modules/user_search/component/ui_user_search.tsx b/src/app_modules/user_search/component/ui_user_search.tsx
new file mode 100644
index 00000000..7803fb89
--- /dev/null
+++ b/src/app_modules/user_search/component/ui_user_search.tsx
@@ -0,0 +1,310 @@
+"use client";
+
+import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import ComponentGlobal_IsEmptyData from "@/app_modules/component_global/is_empty_data";
+import { MODEL_USER } from "@/app_modules/home/model/interface";
+import {
+ ActionIcon,
+ Avatar,
+ Box,
+ Center,
+ Grid,
+ Group,
+ Loader,
+ Stack,
+ Text,
+ TextInput,
+} from "@mantine/core";
+import { IconChevronRight, IconSearch } from "@tabler/icons-react";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { userSearch_getAllUser } from "../fun/get/get_all_user";
+import { MainColor } from "@/app_modules/component_global/color/color_pallet";
+import ComponentGlobal_UI_Loader from "@/app_modules/component_global/ui/ui_loader";
+
+export function UserSearch_UiView({ listUser }: { listUser: MODEL_USER[] }) {
+ const [data, setData] = useState(listUser);
+ const [activePage, setActivePage] = useState(1);
+ const [isSearch, setIsSearch] = useState("");
+
+ async function onSearch(name: string) {
+ setIsSearch(name);
+ const loadData = await userSearch_getAllUser({
+ page: activePage,
+ search: name,
+ });
+ setData(loadData as any);
+ setActivePage(1);
+ }
+
+ return (
+ <>
+
+ }
+ placeholder="Masukan username "
+ onChange={(val) => onSearch(val.target.value)}
+ />
+
+ {_.isEmpty(data) ? (
+
+ ) : (
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData}
+ moreData={async () => {
+ const loadData = await userSearch_getAllUser({
+ page: activePage + 1,
+ search: isSearch,
+ });
+ setActivePage((val) => val + 1);
+
+ return loadData;
+ }}
+ >
+ {(item) => }
+
+ )}
+
+
+ {/* {JSON.stringify(data, null, 2)} */}
+ >
+ );
+}
+
+function CardView({ data }: { data: MODEL_USER }) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ return (
+ <>
+ {
+ setLoading(true);
+ router.push(RouterProfile.katalog + `${data?.Profile?.id}`);
+ }}
+ >
+
+
+
+
+
+ {data?.username}
+
+
+ +{data?.nomor}
+
+
+
+
+
+
+
+ {loading ? (
+
+ ) : (
+
+ )}
+
+
+
+
+
+ >
+ );
+}
+
+let dataDummy = [
+ {
+ id: "clx8pl7r90005su4mldioo0v1",
+ username: "amalia 1",
+ nomor: "628980185458",
+ active: true,
+ masterUserRoleId: "1",
+ Profile: {
+ id: "clx8ptp7w000esu4ma275qnc8",
+ name: "Amalia Dwi",
+ imagesId: "clx8ptp7m000bsu4mwzbfvd9w",
+ },
+ },
+ {
+ id: "clx8pl7r90005su4mldioo0v1",
+ username: "amalia 2",
+ nomor: "628980185458",
+ active: true,
+ masterUserRoleId: "1",
+ Profile: {
+ id: "clx8ptp7w000esu4ma275qnc8",
+ name: "Amalia Dwi",
+ imagesId: "clx8ptp7m000bsu4mwzbfvd9w",
+ },
+ },
+ {
+ id: "clx8pl7r90005su4mldioo0v1",
+ username: "amalia 1",
+ nomor: "628980185458",
+ active: true,
+ masterUserRoleId: "1",
+ Profile: {
+ id: "clx8ptp7w000esu4ma275qnc8",
+ name: "Amalia Dwi",
+ imagesId: "clx8ptp7m000bsu4mwzbfvd9w",
+ },
+ },
+ {
+ id: "clx8pl7r90005su4mldioo0v1",
+ username: "amalia 2",
+ nomor: "628980185458",
+ active: true,
+ masterUserRoleId: "1",
+ Profile: {
+ id: "clx8ptp7w000esu4ma275qnc8",
+ name: "Amalia Dwi",
+ imagesId: "clx8ptp7m000bsu4mwzbfvd9w",
+ },
+ },
+ {
+ id: "clx8pl7r90005su4mldioo0v1",
+ username: "amalia 1",
+ nomor: "628980185458",
+ active: true,
+ masterUserRoleId: "1",
+ Profile: {
+ id: "clx8ptp7w000esu4ma275qnc8",
+ name: "Amalia Dwi",
+ imagesId: "clx8ptp7m000bsu4mwzbfvd9w",
+ },
+ },
+ {
+ id: "clx8pl7r90005su4mldioo0v1",
+ username: "amalia 2",
+ nomor: "628980185458",
+ active: true,
+ masterUserRoleId: "1",
+ Profile: {
+ id: "clx8ptp7w000esu4ma275qnc8",
+ name: "Amalia Dwi",
+ imagesId: "clx8ptp7m000bsu4mwzbfvd9w",
+ },
+ },
+ {
+ id: "clx8pl7r90005su4mldioo0v1",
+ username: "amalia 1",
+ nomor: "628980185458",
+ active: true,
+ masterUserRoleId: "1",
+ Profile: {
+ id: "clx8ptp7w000esu4ma275qnc8",
+ name: "Amalia Dwi",
+ imagesId: "clx8ptp7m000bsu4mwzbfvd9w",
+ },
+ },
+ {
+ id: "clx8pl7r90005su4mldioo0v1",
+ username: "amalia 2",
+ nomor: "628980185458",
+ active: true,
+ masterUserRoleId: "1",
+ Profile: {
+ id: "clx8ptp7w000esu4ma275qnc8",
+ name: "Amalia Dwi",
+ imagesId: "clx8ptp7m000bsu4mwzbfvd9w",
+ },
+ },
+ {
+ id: "clx8pl7r90005su4mldioo0v1",
+ username: "amalia 1",
+ nomor: "628980185458",
+ active: true,
+ masterUserRoleId: "1",
+ Profile: {
+ id: "clx8ptp7w000esu4ma275qnc8",
+ name: "Amalia Dwi",
+ imagesId: "clx8ptp7m000bsu4mwzbfvd9w",
+ },
+ },
+ {
+ id: "clx8pl7r90005su4mldioo0v1",
+ username: "amalia 2",
+ nomor: "628980185458",
+ active: true,
+ masterUserRoleId: "1",
+ Profile: {
+ id: "clx8ptp7w000esu4ma275qnc8",
+ name: "Amalia Dwi",
+ imagesId: "clx8ptp7m000bsu4mwzbfvd9w",
+ },
+ },
+ {
+ id: "clx8pl7r90005su4mldioo0v1",
+ username: "amalia 1",
+ nomor: "628980185458",
+ active: true,
+ masterUserRoleId: "1",
+ Profile: {
+ id: "clx8ptp7w000esu4ma275qnc8",
+ name: "Amalia Dwi",
+ imagesId: "clx8ptp7m000bsu4mwzbfvd9w",
+ },
+ },
+ {
+ id: "clx8pl7r90005su4mldioo0v1",
+ username: "amalia 2",
+ nomor: "628980185458",
+ active: true,
+ masterUserRoleId: "1",
+ Profile: {
+ id: "clx8ptp7w000esu4ma275qnc8",
+ name: "Amalia Dwi",
+ imagesId: "clx8ptp7m000bsu4mwzbfvd9w",
+ },
+ },
+ {
+ id: "clx8pl7r90005su4mldioo0v1",
+ username: "amalia 1",
+ nomor: "628980185458",
+ active: true,
+ masterUserRoleId: "1",
+ Profile: {
+ id: "clx8ptp7w000esu4ma275qnc8",
+ name: "Amalia Dwi",
+ imagesId: "clx8ptp7m000bsu4mwzbfvd9w",
+ },
+ },
+ {
+ id: "clx8pl7r90005su4mldioo0v1",
+ username: "amalia 2",
+ nomor: "628980185458",
+ active: true,
+ masterUserRoleId: "1",
+ Profile: {
+ id: "clx8ptp7w000esu4ma275qnc8",
+ name: "Amalia Dwi",
+ imagesId: "clx8ptp7m000bsu4mwzbfvd9w",
+ },
+ },
+];
diff --git a/src/app_modules/user_search/fun/get/get_all_user.ts b/src/app_modules/user_search/fun/get/get_all_user.ts
new file mode 100644
index 00000000..0eb2ac43
--- /dev/null
+++ b/src/app_modules/user_search/fun/get/get_all_user.ts
@@ -0,0 +1,58 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
+
+export async function userSearch_getAllUser({
+ page,
+ search,
+}: {
+ page: number;
+ search?: string;
+}) {
+ const userLoginId = await user_getOneUserId();
+ const takeData = 20;
+ const skipData = page * takeData - takeData;
+
+ const data = await prisma.user.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ username: "asc",
+ },
+ where: {
+ active: true,
+ masterUserRoleId: "1",
+ username: {
+ contains: search,
+ mode: "insensitive",
+ },
+ NOT: {
+ Profile: null,
+ },
+ OR: [
+ {
+ NOT: {
+ id: userLoginId,
+ },
+ },
+ ],
+ },
+ select: {
+ id: true,
+ username: true,
+ nomor: true,
+ active: true,
+ masterUserRoleId: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ imagesId: true,
+ },
+ },
+ },
+ });
+
+ return data;
+}
diff --git a/src/app_modules/user_search/fun/get/get_list_user.ts b/src/app_modules/user_search/fun/get/get_list_user.ts
deleted file mode 100644
index 447332b3..00000000
--- a/src/app_modules/user_search/fun/get/get_list_user.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-"use server";
-
-import prisma from "@/app/lib/prisma";
-import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
-
-export async function UserSearch_getListUser({ name }: { name: string }) {
- const userLoginId = await user_getOneUserId();
-
- if (name === "") {
- const data = await prisma.user.findMany({
- where: {
- masterUserRoleId: "1",
- NOT: {
- id: userLoginId,
- },
- },
- select: {
- id: true,
- username: true,
- nomor: true,
- active: true,
- masterUserRoleId: true,
- Profile: {
- select: {
- id: true,
- name: true,
- imagesId: true,
- },
- },
- },
- });
- return data;
- }
-
- const getDataCari = await prisma.user.findMany({
- where: {
- masterUserRoleId: "1",
- Profile: {
- name: {
- contains: name,
- mode: "insensitive",
- },
- },
- NOT: {
- id: userLoginId,
- },
- },
- select: {
- id: true,
- username: true,
- nomor: true,
- active: true,
- masterUserRoleId: true,
- Profile: true,
- },
- });
-
- return getDataCari;
-}
diff --git a/src/app_modules/user_search/fun/search/fun_search_by_name.ts b/src/app_modules/user_search/fun/search/fun_search_by_name.ts
deleted file mode 100644
index cf7ed1fd..00000000
--- a/src/app_modules/user_search/fun/search/fun_search_by_name.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-"use server";
-
-import prisma from "@/app/lib/prisma";
-import { useSearchParams } from "next/navigation";
-import { NextRequest } from "next/server";
-
-export async function UserSearch_searchByName(name: string) {
- const data = await prisma.user.findMany({
- where: {
- Profile: {
- name: {
- contains: name,
- mode: "insensitive",
- },
- },
- },
- select: {
- id: true,
- username: true,
- nomor: true,
- active: true,
- masterUserRoleId: true,
- Profile: true,
- },
- });
-
- return data;
-}
diff --git a/src/app_modules/user_search/index.ts b/src/app_modules/user_search/index.ts
index 06d26ed9..a3b7ce39 100644
--- a/src/app_modules/user_search/index.ts
+++ b/src/app_modules/user_search/index.ts
@@ -1,7 +1,3 @@
-import UserSearch_MainView from "./main";
-import LayoutUserSearch_MainView from "./main/layout";
+import UserSearch_MainView from "./view_user_seach";
-export {
- UserSearch_MainView,
- LayoutUserSearch_MainView,
-}
\ No newline at end of file
+export { UserSearch_MainView };
diff --git a/src/app_modules/user_search/main/index.tsx b/src/app_modules/user_search/main/index.tsx
deleted file mode 100644
index 1ef06bf1..00000000
--- a/src/app_modules/user_search/main/index.tsx
+++ /dev/null
@@ -1,131 +0,0 @@
-"use client";
-
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
-import { MODEL_USER } from "@/app_modules/home/model/interface";
-import {
- ActionIcon,
- Avatar,
- Box,
- Center,
- Divider,
- Grid,
- Paper,
- Stack,
- Text,
- TextInput,
- Title,
-} from "@mantine/core";
-import { IconChevronRight, IconSearch } from "@tabler/icons-react";
-import { useState } from "react";
-import { UserSearch_searchByName } from "../fun/search/fun_search_by_name";
-import { useRouter } from "next/navigation";
-import ComponentGlobal_MaintenanceInformation from "@/app_modules/component_global/maintenance_information";
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
-import { data } from "autoprefixer";
-import { UserSearch_getListUser } from "../fun/get/get_list_user";
-import _ from "lodash";
-import ComponentUserSearch_IsEmptyData from "../component/is_empty_data";
-
-export default function UserSearch_MainView({
- listUser,
-}: {
- listUser: MODEL_USER[];
-}) {
- const router = useRouter();
- const [data, setData] = useState(listUser);
- const [loading, setLoading] = useState(false);
-
- async function onSearch(name: string) {
- await UserSearch_getListUser({ name: name }).then((res) =>
- setData(res as any)
- );
- }
-
- // return (
- // <>
- //
- //
- //
- // >
- // );
-
- if (loading) return ;
-
- return (
- <>
-
-
- }
- placeholder="Masukan nama pegguna"
- onChange={(val) => onSearch(val.target.value)}
- />
-
- {_.isEmpty(data) ? (
-
- ) : (
-
- {data?.map((e, i) =>
- e?.Profile === null ? (
- ""
- ) : (
-
-
-
-
-
-
-
-
-
-
- {e?.Profile?.name}
-
-
- +{e?.nomor}
-
-
-
-
-
- {
- setLoading(true);
- router.push(
- RouterProfile.katalog + `${e?.Profile?.id}`
- );
- }}
- >
-
-
-
-
-
-
-
- )
- )}
-
- )}
-
-
-
- {/* {JSON.stringify(data, null, 2)} */}
- >
- );
-}
diff --git a/src/app_modules/user_search/main/layout.tsx b/src/app_modules/user_search/main/layout.tsx
deleted file mode 100644
index 90a09ba4..00000000
--- a/src/app_modules/user_search/main/layout.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-"use client";
-
-import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate";
-import ComponentGlobal_HeaderTamplate from "@/app_modules/component_global/header_tamplate";
-import { AppShell } from "@mantine/core";
-import React from "react";
-
-export default function LayoutUserSearch_MainView({
- children,
-}: {
- children: React.ReactNode;
-}) {
- return (
- <>
- }
- >
- {children}
-