diff --git a/app/[locale]/(public)/inbox/layout.tsx b/app/[locale]/(public)/inbox/layout.tsx
new file mode 100644
index 00000000..fab820cf
--- /dev/null
+++ b/app/[locale]/(public)/inbox/layout.tsx
@@ -0,0 +1,22 @@
+import LayoutProvider from "@/providers/layout.provider";
+import LayoutContentProvider from "@/providers/content.provider";
+import DashCodeSidebar from "@/components/partials/sidebar";
+import DashCodeFooter from "@/components/partials/footer";
+import ThemeCustomize from "@/components/partials/customizer";
+import DashCodeHeader from "@/components/partials/header";
+
+import { redirect } from "@/components/navigation";
+import Footer from "@/components/landing-page/footer";
+import Navbar from "@/components/landing-page/navbar";
+
+const layout = async ({ children }: { children: React.ReactNode }) => {
+ return (
+ <>
+
+ {children}
+
+ >
+ );
+};
+
+export default layout;
diff --git a/app/[locale]/(public)/inbox/page.tsx b/app/[locale]/(public)/inbox/page.tsx
new file mode 100644
index 00000000..8f330796
--- /dev/null
+++ b/app/[locale]/(public)/inbox/page.tsx
@@ -0,0 +1,151 @@
+"use client";
+
+import { Link, usePathname } from "@/i18n/routing";
+import { getUserNotifications } from "@/service/landing/landing";
+import { getTimestamp } from "@/utils/globals";
+import { Icon } from "@iconify/react/dist/iconify.js";
+import { useSearchParams } from "next/navigation";
+import { useRouter } from "next/navigation";
+import React, { useEffect, useState } from "react";
+
+const InboxSection = () => {
+ const router = useRouter();
+ const pathname = usePathname();
+ const isUpdate = pathname.includes("update");
+ const searchParams = useSearchParams();
+
+ const page: any = searchParams?.get("page");
+
+ const pages = page ? page - 1 : 0;
+
+ const [notifications, setNotifications] = useState([]);
+ const [getTotalData, setGetTotalData] = useState();
+ const [, setGetTotalPage] = useState();
+
+ useEffect(() => {
+ async function getNotif() {
+ const response = await getUserNotifications(page, 2);
+ setNotifications(response?.data?.data?.content);
+ setGetTotalData(response?.data?.data?.totalElements);
+ setGetTotalPage(response?.data?.data?.totalPage);
+ }
+
+ async function getNotifUpdate() {
+ const response = await getUserNotifications(page, 3);
+ setNotifications(response?.data?.data?.content);
+ setGetTotalData(response?.data?.data?.totalElements);
+ setGetTotalPage(response?.data?.data?.totalPage);
+ }
+
+ if (isUpdate) {
+ getNotifUpdate();
+ } else {
+ getNotif();
+ }
+ }, [page]);
+
+ return (
+
+
+
{" "}
+
Pesan Masuk
+
+
+
+
+ );
+};
+
+export default InboxSection;
diff --git a/app/[locale]/(public)/inbox/update/page.tsx b/app/[locale]/(public)/inbox/update/page.tsx
new file mode 100644
index 00000000..1ce6f763
--- /dev/null
+++ b/app/[locale]/(public)/inbox/update/page.tsx
@@ -0,0 +1,151 @@
+"use client";
+
+import { Link, usePathname } from "@/i18n/routing";
+import { getUserNotifications } from "@/service/landing/landing";
+import { getTimestamp } from "@/utils/globals";
+import { Icon } from "@iconify/react/dist/iconify.js";
+import { useSearchParams } from "next/navigation";
+import { useRouter } from "next/navigation";
+import React, { useEffect, useState } from "react";
+
+const UpdateSection = () => {
+ const router = useRouter();
+ const pathname = usePathname();
+ const isUpdate = pathname.includes("update");
+ const searchParams = useSearchParams();
+
+ const page: any = searchParams?.get("page");
+
+ const pages = page ? page - 1 : 0;
+
+ const [notifications, setNotifications] = useState([]);
+ const [getTotalData, setGetTotalData] = useState();
+ const [, setGetTotalPage] = useState();
+
+ useEffect(() => {
+ async function getNotif() {
+ const response = await getUserNotifications(page, 2);
+ setNotifications(response?.data?.data?.content);
+ setGetTotalData(response?.data?.data?.totalElements);
+ setGetTotalPage(response?.data?.data?.totalPage);
+ }
+
+ async function getNotifUpdate() {
+ const response = await getUserNotifications(page, 3);
+ setNotifications(response?.data?.data?.content);
+ setGetTotalData(response?.data?.data?.totalElements);
+ setGetTotalPage(response?.data?.data?.totalPage);
+ }
+
+ if (isUpdate) {
+ getNotifUpdate();
+ } else {
+ getNotif();
+ }
+ }, [page]);
+
+ return (
+
+
+
{" "}
+
Update
+
+
+
+
+
+
+ Pesan Masuk
+
+
Update
+
+
+
+
+
+ );
+};
+
+export default UpdateSection;
diff --git a/components/landing-page/navbar.tsx b/components/landing-page/navbar.tsx
index 180f34ea..4b426162 100644
--- a/components/landing-page/navbar.tsx
+++ b/components/landing-page/navbar.tsx
@@ -20,7 +20,7 @@ import LocalSwitcher from "../partials/header/locale-switcher";
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
import { getUserNotifications, listRole } from "@/service/landing/landing";
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
-import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
+import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
type Detail = {
id: number;
@@ -327,77 +327,96 @@ const Navbar = () => {
-
-
-
- test()}>
- {" "}
-
-
-
-
-
-
-
- setIsMessageActive(true)}
- >
- Pesan Masuk
-
-
-
- setIsMessageActive(false)}
- >
- Update(
- {notificationsUpdate?.length})
-
-
-
-
-
-
-
-
+ */}
+
{/*
{fullName ? (
diff --git a/service/landing/landing.ts b/service/landing/landing.ts
index f2b68e33..96159ff3 100644
--- a/service/landing/landing.ts
+++ b/service/landing/landing.ts
@@ -127,4 +127,4 @@ export async function requestOTP(data: any) {
export async function getUserNotifications(page = 0, typeId: any) {
const url = `notification/public/list?enablePage=1&page=${page}&typeId=${typeId}`;
return httpGetInterceptor(url);
-}
+}
\ No newline at end of file
diff --git a/utils/globals.tsx b/utils/globals.tsx
index 9493c266..55e340de 100644
--- a/utils/globals.tsx
+++ b/utils/globals.tsx
@@ -100,3 +100,9 @@ export function getLocaleTime(d: Date) {
const pad = (n: number, s = 2) => `${new Array(s).fill(0)}${n}`.slice(-s);
return `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
}
+export function getTimestamp(d: Date) {
+ const pad = (n: any, s = 2) => `${new Array(s).fill(0)}${n}`.slice(-s);
+ return `${pad(d.getFullYear(), 4)}-${pad(d.getMonth() + 1)}-${pad(
+ d.getDate()
+ )} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
+}