("gs_coba_chat", []);
\ No newline at end of file
diff --git a/src/app/makuro/page.tsx b/src/app/makuro/page.tsx
index 07482089..b75f7da5 100644
--- a/src/app/makuro/page.tsx
+++ b/src/app/makuro/page.tsx
@@ -1,8 +1,58 @@
-import { Text } from "@mantine/core";
+"use client";
+
+import { Box, Paper, SimpleGrid, Stack, Text, TextInput } from "@mantine/core";
import ViewMakuro from "./_server/makuro_view";
+import mqtt_client from "@/util/mqtt_client";
+import { useState } from "react";
+import { useAtom } from "jotai";
+import { gs_coba_chat } from "./gs_coba";
export default function Page() {
- return <>
-
+ const [data1, setData1] = useState("");
+ const [data2, setData2] = useState("");
+
+ const [msg, setMsg] = useAtom(gs_coba_chat);
+
+ return (
+ <>
+
+
+ setData1(val.currentTarget.value)}
+ />
+
+
+
+ setData2(val.currentTarget.value)}
+ />
+
+
+
+
+
+ {msg}
+
+
+ {/* */}
>
-}
\ No newline at end of file
+ );
+}
diff --git a/src/app/zCoba/page.tsx b/src/app/zCoba/page.tsx
index 5778dd02..7246f4be 100644
--- a/src/app/zCoba/page.tsx
+++ b/src/app/zCoba/page.tsx
@@ -1,19 +1,51 @@
"use client";
-import { NotifPeringatan } from "@/app_modules/donasi/component/notifikasi/notif_peringatan";
-import { Box, Button, Group } from "@mantine/core";
-import { notifications } from "@mantine/notifications";
+import {
+ Box,
+ Center,
+ Group,
+ LoadingOverlay,
+ Paper,
+ Skeleton,
+ Text,
+} from "@mantine/core";
+
+export default function ComponentCobaCoba_LoadingPage() {
+ const listhHuruf = [
+ {
+ huruf: "H",
+ },
+ {
+ huruf: "I",
+ },
+ {
+ huruf: "P",
+ },
+ {
+ huruf: "M",
+ },
+ {
+ huruf: "I",
+ },
+ ];
+ const customLOader = (
+
+
+ {listhHuruf.map((e, i) => (
+
+
+
+ {e.huruf}
+
+
+ ))}
+
+
+ );
-export default function Coba() {
return (
<>
-
-
-
-
-
+
>
);
}
diff --git a/src/app_modules/admin/component/loading_admin_page.tsx b/src/app_modules/admin/component/loading_admin_page.tsx
new file mode 100644
index 00000000..6febf957
--- /dev/null
+++ b/src/app_modules/admin/component/loading_admin_page.tsx
@@ -0,0 +1,50 @@
+"use client";
+
+import {
+ Box,
+ Center,
+ Group,
+ LoadingOverlay,
+ Skeleton,
+ Text,
+} from "@mantine/core";
+
+export default function ComponentAdminGlobal_LoadingPage() {
+ const listhHuruf = [
+ {
+ huruf: "H",
+ },
+ {
+ huruf: "I",
+ },
+ {
+ huruf: "P",
+ },
+ {
+ huruf: "M",
+ },
+ {
+ huruf: "I",
+ },
+ ];
+ const customLOader = (
+
+
+ {listhHuruf.map((e, i) => (
+
+
+
+ {e.huruf}
+
+
+ ))}
+
+
+ );
+
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/forum/child/publish/index.tsx b/src/app_modules/admin/forum/child/publish/index.tsx
new file mode 100644
index 00000000..c63b9d9d
--- /dev/null
+++ b/src/app_modules/admin/forum/child/publish/index.tsx
@@ -0,0 +1,288 @@
+"use client";
+
+import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum";
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
+import { MODEL_FORUM_POSTING } from "@/app_modules/forum/model/interface";
+import {
+ Badge,
+ Box,
+ Button,
+ Center,
+ Group,
+ Modal,
+ ScrollArea,
+ Spoiler,
+ Stack,
+ Table,
+ Text,
+ Title,
+} from "@mantine/core";
+import { IconMessageCircle } from "@tabler/icons-react";
+import { IconFlag3 } from "@tabler/icons-react";
+import { IconEyeCheck, IconTrash } from "@tabler/icons-react";
+import _ from "lodash";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { adminForum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+import { useDisclosure } from "@mantine/hooks";
+
+export default function AdminForum_TablePublish({
+ listPublish,
+}: {
+ listPublish: MODEL_FORUM_POSTING[];
+}) {
+ return (
+ <>
+
+
+
+ {/* {JSON.stringify(listPublish, null, 2)} */}
+
+ >
+ );
+}
+
+function TablePublish({ listPublish }: { listPublish: MODEL_FORUM_POSTING[] }) {
+ const router = useRouter();
+ // const [data, setData] = useState(listPublish);
+
+ const TableRows = listPublish?.map((e, i) => (
+
+ |
+
+ {e?.Author?.Profile?.name}
+
+ |
+
+
+
+ {e?.ForumMaster_StatusPosting?.status}
+
+
+ |
+
+
+
+
+
+
+ |
+
+
+
+ {new Intl.DateTimeFormat(["id-ID"], { dateStyle: "medium" }).format(
+ e.createdAt
+ )}
+
+
+ |
+
+
+
+ {e?.Forum_Komentar.length}
+
+
+ |
+
+
+ = 3 ? "red" : "black"}
+ fw={"bold"}
+ fz={"lg"}
+ >
+ {e?.Forum_ReportPosting.length}
+
+
+ |
+
+
+
+
+
+ |
+
+ ));
+
+ return (
+ <>
+
+
+
+ POSTING
+
+
+
+
+
+
+ |
+ Author
+ |
+
+ Status
+ |
+
+ Postingan
+ |
+
+ Tanggal Publish
+ |
+
+ Komentar Aktif
+ |
+
+ Total Report Posting
+ |
+
+ Aksi
+ |
+
+
+ {TableRows}
+
+
+
+
+ {_.isEmpty(TableRows) ? (
+
+ Tidak Ada Data
+
+ ) : (
+ ""
+ )}
+
+
+ >
+ );
+}
+
+function ButtonAction({ postingId }: { postingId: string }) {
+ const router = useRouter();
+ const [loadingKomentar, setLoadingKomentar] = useState(false);
+ const [loadingReport, setLoadingReport] = useState(false);
+
+ return (
+ <>
+ }
+ onClick={() => {
+ setLoadingKomentar(true);
+ router.push(RouterAdminForum.semua_komentar + postingId);
+ }}
+ >
+ Lihat Komentar
+
+ }
+ onClick={() => {
+ setLoadingReport(true);
+ router.push(RouterAdminForum.hasil_report_posting + postingId);
+ }}
+ >
+ Hasil Report
+
+ >
+ );
+}
+
+function ButtonDeletePosting({ postingId }: { postingId: string }) {
+ const [opened, { open, close }] = useDisclosure(false);
+ const [loadingDel, setLoadingDel] = useState(false);
+ const [loadingDel2, setLoadingDel2] = useState(false);
+
+ async function onDelete() {
+ await adminForum_funDeletePostingById(postingId).then((res) => {
+ if (res.status === 200) {
+ setLoadingDel2(false);
+ setLoadingDel(false);
+ close();
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+ return (
+ <>
+
+
+ Anda yakin menghapus posting ini
+
+
+
+
+
+
+ }
+ onClick={() => {
+ // onDelete();
+ open();
+ setLoadingDel(true);
+ }}
+ >
+ Hapus Posting
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/forum/child/report_komentar/index.tsx b/src/app_modules/admin/forum/child/report_komentar/index.tsx
new file mode 100644
index 00000000..714ec270
--- /dev/null
+++ b/src/app_modules/admin/forum/child/report_komentar/index.tsx
@@ -0,0 +1,11 @@
+"use client";
+
+import { Stack } from "@mantine/core";
+
+export default function AdminForum_TableReportKomentar() {
+ return (
+ <>
+ ini rep komen
+ >
+ );
+}
diff --git a/src/app_modules/admin/forum/child/report_posting/index.tsx b/src/app_modules/admin/forum/child/report_posting/index.tsx
new file mode 100644
index 00000000..d9a9c9f1
--- /dev/null
+++ b/src/app_modules/admin/forum/child/report_posting/index.tsx
@@ -0,0 +1,11 @@
+"use client";
+
+import { Stack } from "@mantine/core";
+
+export default function AdminForum_TableReportPosting() {
+ return (
+ <>
+ ini rep pos
+ >
+ );
+}
diff --git a/src/app_modules/admin/forum/children/semua_komentar/index.tsx b/src/app_modules/admin/forum/children/semua_komentar/index.tsx
new file mode 100644
index 00000000..7a91f6ea
--- /dev/null
+++ b/src/app_modules/admin/forum/children/semua_komentar/index.tsx
@@ -0,0 +1,291 @@
+"use client";
+
+import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum";
+import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
+import ComponentAdminDonasi_TombolKembali from "@/app_modules/admin/donasi/component/tombol_kembali";
+import {
+ MODEL_FORUM_KOMENTAR,
+ MODEL_FORUM_POSTING,
+} from "@/app_modules/forum/model/interface";
+import {
+ Badge,
+ Box,
+ Button,
+ Center,
+ Grid,
+ Group,
+ Modal,
+ Paper,
+ ScrollArea,
+ Spoiler,
+ Stack,
+ Table,
+ Text,
+ Title,
+} from "@mantine/core";
+import { IconTrash } from "@tabler/icons-react";
+import { IconFlag3 } from "@tabler/icons-react";
+import _ from "lodash";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { adminForum_funDeleteKomentarById } from "../../fun/delete/fun_delete_komentar_by_id";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+import { useDisclosure } from "@mantine/hooks";
+
+export default function AdminForum_LihatSemuaKomentar({
+ listKomentar,
+ dataPosting,
+}: {
+ listKomentar: MODEL_FORUM_KOMENTAR[];
+ dataPosting: MODEL_FORUM_POSTING;
+}) {
+ return (
+ <>
+ {/* {JSON.stringify(listKomentar, null, 2)} */}
+
+
+
+
+
+
+ >
+ );
+}
+
+function DataPosting({ dataPosting }: { dataPosting: MODEL_FORUM_POSTING }) {
+ return (
+ <>
+
+
+
+
+ POSTING
+
+
+
+
+
+
+ Author :
+
+
+
+ {dataPosting?.Author?.Profile?.name}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+function TableKomentar({
+ listKomentar,
+}: {
+ listKomentar: MODEL_FORUM_KOMENTAR[];
+}) {
+ const router = useRouter();
+ // const [data, setData] = useState(listKomentar);
+
+ const TableRows = listKomentar?.map((e, i) => (
+
+ |
+
+ {e?.Author?.Profile?.name}
+
+ |
+
+
+
+
+
+
+ |
+
+
+
+ {new Intl.DateTimeFormat(["id-ID"], { dateStyle: "medium" }).format(
+ e.createdAt
+ )}
+
+
+ |
+
+
+ = 3 ? "red" : "black"}
+ fw={"bold"}
+ fz={"lg"}
+ >
+ {e?.Forum_ReportKomentar.length}
+
+
+ |
+
+
+
+ }
+ onClick={() =>
+ router.push(RouterAdminForum.hasil_report_komentar + e?.id)
+ }
+ >
+ Hasil Report
+
+
+
+ |
+
+ ));
+
+ return (
+ <>
+
+
+
+ KOMENTAR
+
+
+
+
+
+
+ |
+ Author
+ |
+
+ Komentar
+ |
+
+ Tanggal Komentar
+ |
+
+ Total Report Komentar
+ |
+
+ Aksi
+ |
+
+
+ {TableRows}
+
+
+
+
+ {_.isEmpty(TableRows) ? (
+
+ Tidak Ada Data
+
+ ) : (
+ ""
+ )}
+
+
+ >
+ );
+}
+
+function ButtonDeleteKomentar({ komentarId }: { komentarId: string }) {
+ const router = useRouter();
+ const [opened, { open, close }] = useDisclosure(false);
+ const [loadindDel, setLoadingDel] = useState(false);
+ const [loadingDel2, setLoadingDel2] = useState(false);
+
+ async function onDelete() {
+ await adminForum_funDeleteKomentarById(komentarId).then((res) => {
+ if (res.status === 200) {
+ setLoadingDel(false);
+ setLoadingDel2(false);
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ close();
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+ return (
+ <>
+
+
+ Anda yakin menghapus komentar ini ?
+
+
+
+
+
+
+
+ }
+ onClick={() => {
+ open();
+ setLoadingDel(true);
+ }}
+ >
+ Hapus Komentar
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/forum/fun/count/fun_count_laporan_komentar.ts b/src/app_modules/admin/forum/fun/count/fun_count_laporan_komentar.ts
new file mode 100644
index 00000000..9402b709
--- /dev/null
+++ b/src/app_modules/admin/forum/fun/count/fun_count_laporan_komentar.ts
@@ -0,0 +1,13 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+
+export async function adminForum_countLaporanKomentar() {
+ const count = await prisma.forum_ReportKomentar.count({
+ where: {
+ isActive: true,
+ },
+ });
+
+ return count;
+}
diff --git a/src/app_modules/admin/forum/fun/count/fun_count_laporan_posting.ts b/src/app_modules/admin/forum/fun/count/fun_count_laporan_posting.ts
new file mode 100644
index 00000000..fa673c48
--- /dev/null
+++ b/src/app_modules/admin/forum/fun/count/fun_count_laporan_posting.ts
@@ -0,0 +1,13 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+
+export async function adminForum_countLaporanPosting() {
+ const count = await prisma.forum_ReportPosting.count({
+ where: {
+ isActive: true,
+ },
+ });
+
+ return count;
+}
diff --git a/src/app_modules/admin/forum/fun/count/fun_count_publish.ts b/src/app_modules/admin/forum/fun/count/fun_count_publish.ts
new file mode 100644
index 00000000..c5fde5de
--- /dev/null
+++ b/src/app_modules/admin/forum/fun/count/fun_count_publish.ts
@@ -0,0 +1,13 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+
+export async function adminForum_countPublish() {
+ const count = await prisma.forum_Posting.count({
+ where: {
+ isActive: true,
+ },
+ });
+
+ return count;
+}
diff --git a/src/app_modules/admin/forum/fun/delete/fun_delete_komentar_by_id.ts b/src/app_modules/admin/forum/fun/delete/fun_delete_komentar_by_id.ts
new file mode 100644
index 00000000..796be1cf
--- /dev/null
+++ b/src/app_modules/admin/forum/fun/delete/fun_delete_komentar_by_id.ts
@@ -0,0 +1,19 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { revalidatePath } from "next/cache";
+
+export async function adminForum_funDeleteKomentarById(komentarId: string) {
+ const delTemporary = await prisma.forum_Komentar.update({
+ where: {
+ id: komentarId,
+ },
+ data: {
+ isActive: false,
+ },
+ });
+
+ if (!delTemporary) return { status: 400, message: "Gagal Dihapus" };
+ revalidatePath("/dev/admin/forum/children/semua-komentar");
+ return { status: 200, message: "Berhasil Dihapus" };
+}
diff --git a/src/app_modules/admin/forum/fun/delete/fun_delete_posting_by_id.ts b/src/app_modules/admin/forum/fun/delete/fun_delete_posting_by_id.ts
new file mode 100644
index 00000000..33c4226d
--- /dev/null
+++ b/src/app_modules/admin/forum/fun/delete/fun_delete_posting_by_id.ts
@@ -0,0 +1,19 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { revalidatePath } from "next/cache";
+
+export async function adminForum_funDeletePostingById(postingId: string) {
+ const delTemporary = await prisma.forum_Posting.update({
+ where: {
+ id: postingId,
+ },
+ data: {
+ isActive: false,
+ },
+ });
+
+ if (!delTemporary) return { status: 400, message: "Gagal Dihapus" };
+ revalidatePath("/dev/admin/forum/child/publish");
+ return { status: 200, message: "Berhasil Dihapus" };
+}
diff --git a/src/app_modules/admin/forum/fun/get/get_list_komentar_by_id.ts b/src/app_modules/admin/forum/fun/get/get_list_komentar_by_id.ts
new file mode 100644
index 00000000..d2a76ad7
--- /dev/null
+++ b/src/app_modules/admin/forum/fun/get/get_list_komentar_by_id.ts
@@ -0,0 +1,36 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+
+export async function adminForum_getListKomentarById(postingId: string) {
+ const data = await prisma.forum_Komentar.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ forum_PostingId: postingId,
+ isActive: true,
+ },
+ select: {
+ id: true,
+ isActive: true,
+ komentar: true,
+ createdAt: true,
+ authorId: true,
+ Author: {
+ select: {
+ id: true,
+ Profile: {
+ select: {
+ name: true,
+ imagesId: true,
+ },
+ },
+ },
+ },
+ Forum_ReportKomentar: true
+ },
+ });
+
+ return data;
+}
diff --git a/src/app_modules/admin/forum/fun/get/get_list_publish.tsx b/src/app_modules/admin/forum/fun/get/get_list_publish.tsx
new file mode 100644
index 00000000..028019d2
--- /dev/null
+++ b/src/app_modules/admin/forum/fun/get/get_list_publish.tsx
@@ -0,0 +1,36 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+
+export async function adminForum_getListPublish() {
+ const data = await prisma.forum_Posting.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ isActive: true,
+ },
+ select: {
+ id: true,
+ diskusi: true,
+ isActive: true,
+ createdAt: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: true,
+ },
+ },
+ Forum_ReportPosting: true,
+ Forum_Komentar: {
+ where: {
+ isActive: true
+ }
+ },
+ ForumMaster_StatusPosting: true
+ },
+ });
+
+ return data;
+}
diff --git a/src/app_modules/admin/forum/fun/get/get_list_report_komentar_by_id.ts b/src/app_modules/admin/forum/fun/get/get_list_report_komentar_by_id.ts
new file mode 100644
index 00000000..8f479e14
--- /dev/null
+++ b/src/app_modules/admin/forum/fun/get/get_list_report_komentar_by_id.ts
@@ -0,0 +1,30 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+
+export async function adminForum_getListReportKomentarbyId(komentarId: string) {
+ const data = await prisma.forum_ReportKomentar.findMany({
+ where: {
+ forum_KomentarId: komentarId,
+ },
+ select: {
+ id: true,
+ isActive: true,
+ createdAt: true,
+ deskripsi: true,
+ ForumMaster_KategoriReport: true,
+ User: {
+ select: {
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ },
+ });
+
+ return data;
+}
diff --git a/src/app_modules/admin/forum/fun/get/get_list_report_posting_by_id.ts b/src/app_modules/admin/forum/fun/get/get_list_report_posting_by_id.ts
new file mode 100644
index 00000000..033515a5
--- /dev/null
+++ b/src/app_modules/admin/forum/fun/get/get_list_report_posting_by_id.ts
@@ -0,0 +1,34 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+
+export async function adminForum_getListReportPostingById(postingId: string) {
+ const data = await prisma.forum_ReportPosting.findMany({
+ where: {
+ forum_PostingId: postingId,
+ },
+ select: {
+ id: true,
+ deskripsi: true,
+ createdAt: true,
+ User: {
+ select: {
+ Profile: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ ForumMaster_KategoriReport: {
+ select: {
+ id: true,
+ title: true,
+ deskripsi: true,
+ },
+ },
+ },
+ });
+
+ return data;
+}
diff --git a/src/app_modules/admin/forum/fun/get/get_one_posting_by_id.ts b/src/app_modules/admin/forum/fun/get/get_one_posting_by_id.ts
new file mode 100644
index 00000000..234f9f21
--- /dev/null
+++ b/src/app_modules/admin/forum/fun/get/get_one_posting_by_id.ts
@@ -0,0 +1,28 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+
+export async function adminForum_getOnePostingById(postingId: string) {
+ const data = await prisma.forum_Posting.findFirst({
+ where: {
+ id: postingId,
+ },
+ select: {
+ id: true,
+ diskusi: true,
+ Author: {
+ select: {
+ Profile: {
+ select: {
+ name: true
+ },
+ },
+ },
+ },
+ },
+ });
+
+// console.log(data);
+
+ return data;
+}
diff --git a/src/app_modules/admin/forum/hasil_report/komentar/index.tsx b/src/app_modules/admin/forum/hasil_report/komentar/index.tsx
new file mode 100644
index 00000000..f30cb47f
--- /dev/null
+++ b/src/app_modules/admin/forum/hasil_report/komentar/index.tsx
@@ -0,0 +1,219 @@
+"use client";
+
+import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum";
+import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
+import ComponentAdminDonasi_TombolKembali from "@/app_modules/admin/donasi/component/tombol_kembali";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+import {
+ MODEL_FORUM_MASTER_REPORT,
+ MODEL_FORUM_REPORT,
+} from "@/app_modules/forum/model/interface";
+import {
+ Badge,
+ Box,
+ Button,
+ Center,
+ Group,
+ Modal,
+ ScrollArea,
+ Spoiler,
+ Stack,
+ Table,
+ Text,
+ Title,
+} from "@mantine/core";
+import { IconMessageCircle, IconFlag3, IconTrash } from "@tabler/icons-react";
+import _ from "lodash";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { adminForum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
+import { adminForum_funDeleteKomentarById } from "../../fun/delete/fun_delete_komentar_by_id";
+import { useDisclosure } from "@mantine/hooks";
+
+export default function AdminForum_HasilReportKomentar({
+ komentarId,
+ listReport,
+}: {
+ komentarId: string;
+ listReport: any[];
+}) {
+ return (
+ <>
+
+
+
+
+
+
+
+ {/* {JSON.stringify(listReport, null, 2)} */}
+
+ >
+ );
+}
+
+function ButtonDeleteKomentar({ komentarId }: { komentarId: string }) {
+ const router = useRouter();
+ const [opened, { open, close }] = useDisclosure(false);
+ const [loadindDel, setLoadingDel] = useState(false);
+ const [loadingDel2, setLoadingDel2] = useState(false);
+
+ async function onDelete() {
+ await adminForum_funDeleteKomentarById(komentarId).then((res) => {
+ if (res.status === 200) {
+ setLoadingDel(false);
+ setLoadingDel2(false);
+ close();
+ router.back();
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+ return (
+ <>
+
+
+ Anda yakin menghapus komentar ini ?
+
+
+
+
+
+
+
+ }
+ onClick={() => {
+ open();
+ setLoadingDel(true);
+ }}
+ >
+ Hapus Komentar
+
+ >
+ );
+}
+
+function HasilReportPosting({
+ listReport,
+}: {
+ listReport: MODEL_FORUM_REPORT[];
+}) {
+ const router = useRouter();
+ const [data, setData] = useState(listReport);
+
+ const TableRows = data?.map((e, i) => (
+
+ |
+
+ {e?.User?.Profile?.name}
+
+ |
+
+
+
+ {e?.ForumMaster_KategoriReport?.title
+ ? e?.ForumMaster_KategoriReport?.title
+ : "-"}
+
+
+ |
+
+
+
+
+ {e?.ForumMaster_KategoriReport?.deskripsi ? (
+ {e?.ForumMaster_KategoriReport?.deskripsi}
+ ) : (
+ -
+ )}
+
+
+ |
+
+
+
+
+ {e?.deskripsi ? {e?.deskripsi} : -}
+
+
+ |
+
+ ));
+
+ return (
+ <>
+
+
+
+ REPORT KOMENTAR
+
+
+
+
+
+
+ |
+ Author
+ |
+
+ Title
+ |
+
+ Deskripsi
+ |
+
+ Deskripsi Lainnya
+ |
+
+
+ {TableRows}
+
+
+
+
+ {_.isEmpty(TableRows) ? (
+
+ Tidak Ada Data
+
+ ) : (
+ ""
+ )}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/forum/hasil_report/posting/index.tsx b/src/app_modules/admin/forum/hasil_report/posting/index.tsx
new file mode 100644
index 00000000..c89610c8
--- /dev/null
+++ b/src/app_modules/admin/forum/hasil_report/posting/index.tsx
@@ -0,0 +1,222 @@
+"use client";
+
+import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum";
+import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component/header_tamplate";
+import ComponentAdminDonasi_TombolKembali from "@/app_modules/admin/donasi/component/tombol_kembali";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+import {
+ MODEL_FORUM_MASTER_REPORT,
+ MODEL_FORUM_REPORT,
+} from "@/app_modules/forum/model/interface";
+import {
+ Badge,
+ Box,
+ Button,
+ Center,
+ Group,
+ Modal,
+ ScrollArea,
+ Spoiler,
+ Stack,
+ Table,
+ Text,
+ Title,
+} from "@mantine/core";
+import { IconMessageCircle, IconFlag3, IconTrash } from "@tabler/icons-react";
+import _ from "lodash";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { adminForum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
+import { useDisclosure } from "@mantine/hooks";
+
+export default function AdminForum_HasilReportPosting({
+ postingId,
+ listReport,
+}: {
+ postingId: string;
+ listReport: any[];
+}) {
+ return (
+ <>
+
+
+
+
+
+
+
+ {/* {JSON.stringify(listReport, null, 2)} */}
+
+ >
+ );
+}
+
+function ButtonDeletePosting({ postingId }: { postingId: string }) {
+ const router = useRouter();
+ const [opened, { open, close }] = useDisclosure(false);
+ const [loadingDel, setLoadingDel] = useState(false);
+ const [loadingDel2, setLoadingDel2] = useState(false);
+
+ async function onDelete() {
+ await adminForum_funDeletePostingById(postingId).then((res) => {
+ if (res.status === 200) {
+ setLoadingDel2(false);
+ setLoadingDel(false);
+ close();
+ router.back();
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+ return (
+ <>
+
+
+ Anda yakin menghapus posting ini
+
+
+
+
+
+
+ }
+ onClick={() => {
+ // onDelete();
+ open();
+ setLoadingDel(true);
+ }}
+ >
+ Hapus Posting
+
+ >
+ );
+}
+
+function HasilReportPosting({
+ listReport,
+}: {
+ listReport: MODEL_FORUM_REPORT[];
+}) {
+ const router = useRouter();
+ const [data, setData] = useState(listReport);
+
+ const TableRows = data?.map((e, i) => (
+
+ |
+
+ {e?.User?.Profile?.name}
+
+ |
+
+
+
+ {e?.ForumMaster_KategoriReport?.title
+ ? e?.ForumMaster_KategoriReport?.title
+ : "-"}
+
+
+ |
+
+
+
+
+ {e?.ForumMaster_KategoriReport?.deskripsi ? (
+ {e?.ForumMaster_KategoriReport?.deskripsi}
+ ) : (
+ -
+ )}
+
+
+ |
+
+
+
+
+ {e?.deskripsi ? {e?.deskripsi} : -}
+
+
+ |
+
+ ));
+
+ return (
+ <>
+
+
+
+ REPORT POSTING
+
+
+
+
+
+
+ |
+ Author
+ |
+
+ Title
+ |
+
+ Deskripsi
+ |
+
+ Deskripsi Lainnya
+ |
+
+
+ {TableRows}
+
+
+
+
+ {_.isEmpty(TableRows) ? (
+
+ Tidak Ada Data
+
+ ) : (
+ ""
+ )}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/forum/index.tsx b/src/app_modules/admin/forum/index.tsx
new file mode 100644
index 00000000..595b747a
--- /dev/null
+++ b/src/app_modules/admin/forum/index.tsx
@@ -0,0 +1,17 @@
+import AdminForum_Main from "./main";
+import AdminForum_TablePublish from "./child/publish";
+import AdminForum_TableReportKomentar from "./child/report_komentar";
+import AdminForum_TableReportPosting from "./child/report_posting";
+import AdminForum_LihatSemuaKomentar from "./children/semua_komentar";
+import AdminForum_HasilReportPosting from "./hasil_report/posting";
+import AdminForum_HasilReportKomentar from "./hasil_report/komentar";
+
+export {
+ AdminForum_Main,
+ AdminForum_TablePublish,
+ AdminForum_TableReportKomentar,
+ AdminForum_TableReportPosting,
+ AdminForum_LihatSemuaKomentar,
+ AdminForum_HasilReportPosting,
+ AdminForum_HasilReportKomentar,
+};
diff --git a/src/app_modules/admin/forum/main/index.tsx b/src/app_modules/admin/forum/main/index.tsx
new file mode 100644
index 00000000..9ab092f7
--- /dev/null
+++ b/src/app_modules/admin/forum/main/index.tsx
@@ -0,0 +1,91 @@
+"use client";
+
+import { Group, Paper, SimpleGrid, Stack, Text, Title } from "@mantine/core";
+import ComponentAdminGlobal_HeaderTamplate from "../../component/header_tamplate";
+import ComponentAdminGlobal_LoadingPage from "../../component/loading_admin_page";
+
+export default function AdminForum_Main({
+ countPublish,
+ countLaporanPosting,
+ countLaporanKomentar,
+}: {
+ countPublish: number;
+ countLaporanPosting: number;
+ countLaporanKomentar: number;
+}) {
+ return (
+ <>
+
+
+
+
+ {/* */}
+ >
+ );
+}
+
+function ForumMain({
+ countPublish,
+ countLaporanPosting,
+ countLaporanKomentar,
+}: {
+ countPublish: number;
+ countLaporanPosting: number;
+ countLaporanKomentar: number;
+}) {
+ const listBox = [
+ {
+ id: 1,
+ name: "Publish",
+ jumlah: countPublish,
+ color: "green",
+ },
+ {
+ id: 2,
+ name: "Laporan Posting",
+ jumlah: countLaporanPosting,
+ color: "orange",
+ },
+ {
+ id: 3,
+ name: "Laporan Komentar",
+ jumlah: countLaporanKomentar,
+ color: "red",
+ },
+ ];
+ return (
+ <>
+
+ {listBox.map((e, i) => (
+
+
+
+ {e.name}
+ {e.jumlah ? e.jumlah : 0}
+
+
+
+ ))}
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/global_state/index.ts b/src/app_modules/admin/global_state/index.ts
index 32e642b8..689ebfa2 100644
--- a/src/app_modules/admin/global_state/index.ts
+++ b/src/app_modules/admin/global_state/index.ts
@@ -5,6 +5,6 @@ import { atomWithStorage } from "jotai/utils";
* @type number
* @
*/
-export const gs_admin_hotMenu = atomWithStorage("gs_admin_hotMenu", 0)
+export const gs_admin_hotMenu = atomWithStorage("gs_admin_hotMenu", 1)
export const gs_admin_subMenu = atomWithStorage("gs_admin_subMenu",null)
\ No newline at end of file
diff --git a/src/app_modules/admin/layout.tsx b/src/app_modules/admin/layout.tsx
index cda67e17..ab809327 100644
--- a/src/app_modules/admin/layout.tsx
+++ b/src/app_modules/admin/layout.tsx
@@ -11,6 +11,7 @@ import {
Footer,
Group,
Header,
+ Loader,
MediaQuery,
NavLink,
Navbar,
@@ -22,7 +23,13 @@ import {
import React, { useState } from "react";
import ComponentGlobal_HeaderTamplate from "../component_global/header_tamplate";
import { useDisclosure } from "@mantine/hooks";
-import { IconCircleDot, IconCircleDotFilled, IconHome, IconLetterH, IconLogout } from "@tabler/icons-react";
+import {
+ IconCircleDot,
+ IconCircleDotFilled,
+ IconHome,
+ IconLetterH,
+ IconLogout,
+} from "@tabler/icons-react";
import {
RouterAdminAward,
RouterAdminDashboard,
@@ -51,8 +58,7 @@ export default function AdminLayout({
const router = useRouter();
const [active, setActive] = useAtom(gs_admin_hotMenu);
const [activeChild, setActiveChild] = useAtom(gs_admin_subMenu);
-
-
+ const [loading, setLoading] = useState(false);
const navbarItems = listAdminPage.map((e, i) => (
@@ -63,9 +69,13 @@ export default function AdminLayout({
},
}}
fw={active === e.id ? "bold" : "normal"}
- icon={e.icon}
+ icon={
+ // active === e.id ? loading ? : e.icon : e.icon
+ e.icon
+ }
label={{e.name}}
onClick={() => {
+ setLoading(true);
setActive(e.id);
setActiveChild(null);
e.path === "" ? router.push(e.child[0].path) : router.push(e.path);
@@ -86,7 +96,13 @@ export default function AdminLayout({
}}
fw={activeChild === v.id ? "bold" : "normal"}
label={{v.name}}
- icon={activeChild === v.id ? : }
+ icon={
+ activeChild === v.id ? (
+
+ ) : (
+
+ )
+ }
onClick={() => {
setActive(e.id);
setActiveChild(v.id);
@@ -107,7 +123,6 @@ export default function AdminLayout({
padding="md"
navbarOffsetBreakpoint="md"
asideOffsetBreakpoint="sm"
-
navbar={
,
+ child: [
+ {
+ id: 71,
+ name: "Dashboard",
+ path: RouterAdminForum.main,
+ },
+ {
+ id: 72,
+ name: "Table Posting",
+ path: RouterAdminForum.publish,
+ },
+ // {
+ // id: 73,
+ // name: "Laporan Posting",
+ // path: RouterAdminForum.report_posting,
+ // },
+ // {
+ // id: 74,
+ // name: "Laporan Komentar",
+ // path: RouterAdminForum.report_komentar,
+ // },
+ ],
+ },
];
diff --git a/src/app_modules/auth/fun/fun_edit_aktivasi_kode_otp_by_id.ts b/src/app_modules/auth/fun/fun_edit_aktivasi_kode_otp_by_id.ts
new file mode 100644
index 00000000..5a533f04
--- /dev/null
+++ b/src/app_modules/auth/fun/fun_edit_aktivasi_kode_otp_by_id.ts
@@ -0,0 +1,18 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+
+export async function auth_funEditAktivasiKodeOtpById(otpId: string) {
+ console.log(otpId);
+ const updt = await prisma.kodeOtp.update({
+ where: {
+ id: otpId,
+ },
+ data: {
+ isActive: false,
+ },
+ });
+
+ if (!updt) return { status: 400, message: "Gagal Update Aktivasi Kode OTP" };
+ return { status: 200, message: "Berhasil Update Aktivasi Kode OTP" };
+}
diff --git a/src/app_modules/auth/fun/fun_login.ts b/src/app_modules/auth/fun/fun_login.ts
new file mode 100644
index 00000000..ae9d2526
--- /dev/null
+++ b/src/app_modules/auth/fun/fun_login.ts
@@ -0,0 +1,35 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { randomOTP } from "./rondom_otp";
+
+export async function auth_funLogin(nomor: string) {
+ const codeOtp = randomOTP();
+
+ try {
+ const res = await fetch(
+ `https://wa.wibudev.com/code?nom=${nomor}&text=Masukan Kode OTP:${codeOtp}`
+ );
+
+ const sendWa = await res.json();
+ if (sendWa.status !== "success")
+ return { status: 400, message: "WA Tidak Terdaftar" };
+
+ const createOtpId = await prisma.kodeOtp.create({
+ data: {
+ nomor: nomor,
+ otp: codeOtp,
+ },
+ });
+
+ if (!createOtpId) return { status: 400, message: "Gagal Membuat Kode OTP" };
+
+ return {
+ status: 200,
+ message: "Kode Verifikasi Dikirim",
+ kodeOtpId: createOtpId.id,
+ };
+ } catch (error) {
+ return { status: 500, message: "Server Error !!!" };
+ }
+}
diff --git a/src/app_modules/auth/fun/fun_logout.ts b/src/app_modules/auth/fun/fun_logout.ts
new file mode 100644
index 00000000..6312472b
--- /dev/null
+++ b/src/app_modules/auth/fun/fun_logout.ts
@@ -0,0 +1,26 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { revalidatePath } from "next/cache";
+import { cookies } from "next/headers";
+
+export async function auth_Logout(kodeId: string) {
+ cookies().set({
+ name: "ssn",
+ value: "",
+ maxAge: 0,
+ });
+
+ const c = cookies().get("ssn");
+ if (c?.value !== "") return { status: 400, message: "Gagal Logout" };
+
+ const del = await prisma.kodeOtp.delete({
+ where: {
+ id: kodeId,
+ },
+ });
+
+ if (!del) return { status: 400, message: "Gagal Hapus Kode OTP Id"};
+ revalidatePath("/dev/katalog")
+ return { status: 200, message: "Logout Berhasil" };
+}
diff --git a/src/app_modules/auth/fun/fun_register.ts b/src/app_modules/auth/fun/fun_register.ts
new file mode 100644
index 00000000..5d7df13b
--- /dev/null
+++ b/src/app_modules/auth/fun/fun_register.ts
@@ -0,0 +1,49 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { sealData } from "iron-session";
+import { cookies } from "next/headers";
+
+import fs from "fs";
+import yaml from "yaml";
+const config = yaml.parse(fs.readFileSync("config.yaml").toString());
+
+export async function Auth_funRegister(data: any) {
+ const cekUsername = await prisma.user.findUnique({
+ where: {
+ username: data.username,
+ },
+ });
+
+ if (cekUsername != null)
+ return {
+ status: 400,
+ message: "Username sudah terdaftar",
+ };
+
+ const create = await prisma.user.create({
+ data: {
+ username: data.username,
+ nomor: data.nomor,
+ },
+ });
+ if (!create) return { status: 400, message: "Gagal Mendaftar" };
+
+ const seal = await sealData(
+ JSON.stringify({
+ id: create.id,
+ username: create.username,
+ }),
+ {
+ password: await config.server.password,
+ }
+ );
+
+ cookies().set({
+ name: "ssn",
+ value: seal,
+ maxAge: 60 * 60 * 24 * 7,
+ });
+
+ return { status: 200, message: "Berhasil Mendaftar" };
+}
diff --git a/src/app_modules/auth/fun/fun_validasi.ts b/src/app_modules/auth/fun/fun_validasi.ts
new file mode 100644
index 00000000..3a4c5bd6
--- /dev/null
+++ b/src/app_modules/auth/fun/fun_validasi.ts
@@ -0,0 +1,46 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { sealData } from "iron-session";
+import fs from "fs";
+import yaml from "yaml";
+import { cookies } from "next/headers";
+import { revalidatePath } from "next/cache";
+import { RouterHome } from "@/app/lib/router_hipmi/router_home";
+const config = yaml.parse(fs.readFileSync("config.yaml").toString());
+
+export async function auth_funValidasi(nomor: string) {
+ const cek = await prisma.user.findUnique({
+ where: {
+ nomor: nomor,
+ },
+ select: {
+ id: true,
+ nomor: true,
+ username: true,
+ },
+ });
+
+ if (cek === null) return { status: 400, message: "Nomor Belum Terdaftar" };
+ if (cek) {
+ const res = await sealData(
+ JSON.stringify({
+ id: cek.id,
+ username: cek.username,
+ }),
+ {
+ password: await config.server.password,
+ }
+ );
+
+ cookies().set({
+ name: "ssn",
+ value: res,
+ maxAge: 60 * 60 * 24 * 7,
+ });
+
+ revalidatePath(RouterHome.main_home);
+ }
+
+ return { status: 200, message: "Nomor Terverivikasi" };
+}
diff --git a/src/app_modules/auth/fun/get_kode_otp_by_id.ts b/src/app_modules/auth/fun/get_kode_otp_by_id.ts
new file mode 100644
index 00000000..8b0849ae
--- /dev/null
+++ b/src/app_modules/auth/fun/get_kode_otp_by_id.ts
@@ -0,0 +1,13 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+
+export async function auth_getKodeOtpById(otpId: string) {
+ const data = await prisma.kodeOtp.findFirst({
+ where: {
+ id: otpId,
+ },
+ });
+
+ return data
+}
diff --git a/src/app/fun/rondom_otp.ts b/src/app_modules/auth/fun/rondom_otp.ts
similarity index 100%
rename from src/app/fun/rondom_otp.ts
rename to src/app_modules/auth/fun/rondom_otp.ts
diff --git a/src/app_modules/auth/index.ts b/src/app_modules/auth/index.ts
index ccb5b9fb..04c1a5f0 100644
--- a/src/app_modules/auth/index.ts
+++ b/src/app_modules/auth/index.ts
@@ -4,5 +4,14 @@ import Validasi from "./validasi/view";
import LayoutValidasi from "./validasi/layout";
import Register from "./register/view";
import User_Logout from "./logout/view";
+import LayoutLogin from "./login/layout";
-export { SplashScreen, Login, Validasi, Register, User_Logout as Logout, LayoutValidasi };
+export {
+ SplashScreen,
+ Login,
+ Validasi,
+ Register,
+ User_Logout as Logout,
+ LayoutValidasi,
+ LayoutLogin,
+};
diff --git a/src/app_modules/auth/login/layout.tsx b/src/app_modules/auth/login/layout.tsx
new file mode 100644
index 00000000..2bc4c164
--- /dev/null
+++ b/src/app_modules/auth/login/layout.tsx
@@ -0,0 +1,43 @@
+"use client";
+
+import {
+ AppShell,
+ Center,
+ Footer,
+ Header,
+ Image,
+ Paper,
+ Text,
+} from "@mantine/core";
+import React from "react";
+
+export default function LayoutLogin({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+
+ //
+ //
+ //
+ //
+ //
+ //
+ // }
+
+ >
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/auth/login/view.tsx b/src/app_modules/auth/login/view.tsx
index 77be0cff..11af4f84 100644
--- a/src/app_modules/auth/login/view.tsx
+++ b/src/app_modules/auth/login/view.tsx
@@ -1,101 +1,144 @@
"use client";
-import { myConsole } from "@/app/fun/my_console";
-import { randomOTP } from "@/app/fun/rondom_otp";
-import { ApiHipmi } from "@/app/lib/api";
-import { Warna } from "@/app/lib/warna";
-import { Button, Center, Flex, Stack, TextInput, Title } from "@mantine/core";
-import { getHotkeyHandler, useFocusTrap, useHotkeys } from "@mantine/hooks";
+import {
+ Box,
+ Button,
+ Center,
+ Flex,
+ Grid,
+ Group,
+ Image,
+ Stack,
+ Text,
+ TextInput,
+ Title,
+} from "@mantine/core";
+import { useFocusTrap } from "@mantine/hooks";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import toast from "react-simple-toasts";
import { useAtom } from "jotai";
-import { gs_otp, gs_nomor } from "../state/state";
-import { IconCircleLetterH } from "@tabler/icons-react";
-import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
-import { NotifBerhasil } from "@/app_modules/donasi/component/notifikasi/notif_berhasil";
-import { NotifGagal } from "@/app_modules/donasi/component/notifikasi/notif_gagal";
+import { gs_kodeId } from "../state/state";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
+import { auth_funLogin } from "@/app_modules/auth/fun/fun_login";
+import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { PhoneInput } from "react-international-phone";
+import "react-international-phone/style.css";
export default function Login() {
const router = useRouter();
- const [nomor, setNomor] = useState("");
- const [inputNumber, setInputNumber] = useAtom(gs_nomor);
- const [code, setCode] = useAtom(gs_otp);
+ const [kodeId, setKodeId] = useAtom(gs_kodeId);
const focusTrapRef = useFocusTrap();
+ const [phone, setPhone] = useState("");
+ const [loading, setLoading] = useState(false);
- const onLogin = async () => {
- const body = {
- nomor: nomor,
- otp: randomOTP(),
- };
+ async function onLogin() {
+ // if (nomor.length < 10)
+ // return ComponentGlobal_NotifikasiPeringatan("Nomor minimal 10 digit");
+ // if (nomor.length > 13)
+ // return ComponentGlobal_NotifikasiPeringatan("Nomor maximal 13 digit");
- if (body.nomor.length < 10) return toast("Nomor minimal 10 digit");
- if (body.nomor.length > 13) return toast("Nomor maximal 13 digit");
+ const nomorHp = phone.substring(1);
- await fetch(ApiHipmi.login, {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify(body),
- })
- .then((res) => res.json())
- .then((val) => {
- // console.log(val);
- if (val.success === true) {
- router.push(RouterAdminDashboard.splash_admin);
- } else {
- if (val.status == 200) {
- setCode(val.body.otp);
- setInputNumber(val.body.nomor);
- router.push("/dev/auth/validasi");
- return NotifBerhasil("Nomor OTP terkirim");
- } else {
- NotifGagal(val.message);
- }
- }
- });
- };
+ await auth_funLogin(nomorHp).then((res) => {
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ setKodeId(res.kodeOtpId);
+ router.push(RouterAuth.validasi + res.kodeOtpId);
+ } else {
+ ComponentGlobal_NotifikasiPeringatan(res.message);
+ }
+ });
+
+ // await fetch(ApiHipmi.login, {
+ // method: "POST",
+ // headers: {
+ // "Content-Type": "application/json",
+ // },
+ // body: JSON.stringify(body),
+ // })
+ // .then((res) => res.json())
+ // .then((val) => {
+ // // console.log(val);
+ // if (val.success === true) {
+ // router.push(RouterAdminDashboard.splash_admin);
+ // } else {
+ // if (val.status == 200) {
+ // setCode(val.body.otp);
+ // setInputNumber(val.body.nomor);
+ // router.push("/dev/auth/validasi");
+ // return NotifBerhasil("Nomor OTP terkirim");
+ // } else {
+ // NotifGagal(val.message);
+ // }
+ // }
+ // });
+ }
return (
<>
-
-
- Login
+
+
+
+
+
+
+ Selamat Datang di HIPMI App
+
+ Silahkan masukan nomor telepon anda untuk masuk !
+
+
- {
- setNomor(val.target.value);
- }}
- />
+ {/*
+
+
+ +62
+
+
+
+ {
+ setNomor(62 + val.target.value);
+ }}
+ />
+
+ */}
-
-
+ {
+ setPhone(val);
+ }}
+ />
+
+
+
+
>
);
}
diff --git a/src/app_modules/auth/logout/view.tsx b/src/app_modules/auth/logout/view.tsx
index 58ffe935..51524892 100644
--- a/src/app_modules/auth/logout/view.tsx
+++ b/src/app_modules/auth/logout/view.tsx
@@ -1,35 +1,38 @@
"use client";
-import { myConsole } from "@/app/fun/my_console";
-import { ApiHipmi } from "@/app/lib/api";
+
import { ActionIcon, Button, Group, Modal, Stack, Title } from "@mantine/core";
import { useRouter } from "next/navigation";
import { useAtom } from "jotai";
-import { gs_nomor, gs_otp } from "../state/state";
+import { gs_kodeId, gs_nomor, gs_otp } from "../state/state";
import { IconLogout } from "@tabler/icons-react";
import { Warna } from "@/app/lib/warna";
import { useDisclosure } from "@mantine/hooks";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { auth_Logout } from "../fun/fun_logout";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
+import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
+import { useState } from "react";
export default function User_Logout() {
const router = useRouter();
- const [nomor, setnomor] = useAtom(gs_nomor);
- const [code, setCode] = useAtom(gs_otp);
-
const [opened, { toggle }] = useDisclosure(false);
+ const [kodeId, setKodeId] = useAtom(gs_kodeId);
+ const [loading, setLoading] = useState(false);
+ const [loading2, setLoading2] = useState(false);
- const onLogout = async () => {
- await fetch(ApiHipmi.logout)
- .then((res) => res.json())
- .then((val) => {
- if (val.status == 200) {
- setnomor(null);
- setCode(null);
-
- ComponentGlobal_NotifikasiBerhasil("Anda Berhasil Logout")
- return router.push("/dev/auth/login");
- }
- });
- };
+ async function onClickLogout() {
+ // await auth_Logout(kodeId).then((res) => {
+ // ComponentGlobal_NotifikasiBerhasil("Berhasil Logout");
+ // });
+ await auth_Logout(kodeId).then((res) => {
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ setKodeId("");
+ } else {
+ ComponentGlobal_NotifikasiPeringatan(res.message);
+ }
+ });
+ }
return (
<>
@@ -37,15 +40,25 @@ export default function User_Logout() {
Anda yakin ingin keluar ?
-
+
+
+
+
+ Yakin menghapus proyek ini ?
+
+ }
+ onClick={close}
+ >
+ Batal
+
+ }
+ color="red"
+ onClick={() => onDelete()}
+ >
+ Hapus
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/colab/detail/status/reject/layout.tsx b/src/app_modules/colab/detail/status/reject/layout.tsx
new file mode 100644
index 00000000..be4b7d92
--- /dev/null
+++ b/src/app_modules/colab/detail/status/reject/layout.tsx
@@ -0,0 +1,29 @@
+"use client";
+
+import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import ComponentColab_HeaderTamplate from "@/app_modules/colab/component/header_tamplate";
+import { AppShell } from "@mantine/core";
+import { IconEdit } from "@tabler/icons-react";
+import React from "react";
+
+export default function LayoutColab_DetailStatusReject({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ }
+ route2={RouterColab.edit + 1}
+ />
+ }
+ >
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/colab/detail/status/review/index.tsx b/src/app_modules/colab/detail/status/review/index.tsx
new file mode 100644
index 00000000..4988f91f
--- /dev/null
+++ b/src/app_modules/colab/detail/status/review/index.tsx
@@ -0,0 +1,39 @@
+"use client";
+
+import ComponentColab_DetailData from "@/app_modules/colab/component/detail/detail_data";
+import ComponentColab_AuthorNameOnHeader from "@/app_modules/colab/component/header_author_name";
+import { gs_colab_status } from "@/app_modules/colab/global_state";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { Button, Stack } from "@mantine/core";
+import { useAtom } from "jotai";
+import { useRouter } from "next/navigation";
+
+export default function Colab_DetailStatusReview() {
+ return (
+ <>
+
+
+
+
+ >
+ );
+}
+
+function ButtonAction() {
+ const router = useRouter();
+ const [tabsStatus, setTabsStatus] = useAtom(gs_colab_status);
+
+ async function onClick() {
+ setTabsStatus("Reject");
+ router.back();
+ ComponentGlobal_NotifikasiBerhasil("Berhasil Dibatalkan");
+ }
+
+ return (
+ <>
+ onClick()}>
+ Batalkan Review
+
+ >
+ );
+}
diff --git a/src/app_modules/colab/detail/status/review/layout.tsx b/src/app_modules/colab/detail/status/review/layout.tsx
new file mode 100644
index 00000000..40b05ab6
--- /dev/null
+++ b/src/app_modules/colab/detail/status/review/layout.tsx
@@ -0,0 +1,21 @@
+"use client";
+
+import ComponentColab_HeaderTamplate from "@/app_modules/colab/component/header_tamplate";
+import { AppShell } from "@mantine/core";
+import React from "react";
+
+export default function LayoutColab_DetailStatusReview({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ }
+ >
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/colab/edit/index.tsx b/src/app_modules/colab/edit/index.tsx
new file mode 100644
index 00000000..35cea4f1
--- /dev/null
+++ b/src/app_modules/colab/edit/index.tsx
@@ -0,0 +1,74 @@
+"use client"
+
+import { Stack, TextInput, Select, Textarea, Button } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+
+export default function Colab_Edit() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+function ButtonAction() {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ async function onUpdate() {
+ setLoading(true);
+ router.back();
+ }
+
+ return (
+ <>
+ onUpdate()}
+ >
+ Update
+
+ >
+ );
+}
diff --git a/src/app_modules/colab/edit/layout.tsx b/src/app_modules/colab/edit/layout.tsx
new file mode 100644
index 00000000..58ec809e
--- /dev/null
+++ b/src/app_modules/colab/edit/layout.tsx
@@ -0,0 +1,19 @@
+"use client";
+
+import { AppShell } from "@mantine/core";
+import React from "react";
+import ComponentColab_HeaderTamplate from "../component/header_tamplate";
+
+export default function LayoutColab_Edit({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ }>
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/colab/global_state/index.tsx b/src/app_modules/colab/global_state/index.tsx
new file mode 100644
index 00000000..c467eb0b
--- /dev/null
+++ b/src/app_modules/colab/global_state/index.tsx
@@ -0,0 +1,18 @@
+import { atomWithStorage } from "jotai/utils";
+
+export const gs_colab_hot_menu = atomWithStorage(
+ "gs_colab_hot_menu",
+ 1
+);
+export const gs_colab_status = atomWithStorage(
+ "gs_colab_status",
+ "Publish"
+);
+export const gs_colab_proyek = atomWithStorage(
+ "gs_colab_proyek",
+ "Partisipasi"
+);
+export const gs_colab_pesan = atomWithStorage(
+ "gs_colab_pesan",
+ ""
+);
diff --git a/src/app_modules/colab/index.ts b/src/app_modules/colab/index.ts
new file mode 100644
index 00000000..fda21c0d
--- /dev/null
+++ b/src/app_modules/colab/index.ts
@@ -0,0 +1,47 @@
+import Colab_Beranda from "./main/beranda";
+import LayoutColab_Main from "./main/layout";
+import Colab_Splash from "./splash";
+import Colab_Create from "./create";
+import LayoutColab_Create from "./create/layout";
+import Colab_Status from "./main/status";
+import Colab_MainDetail from "./detail/main_detail";
+import LayoutColab_MainDetail from "./detail/main_detail/layout";
+import Colab_DetailStatusReview from "./detail/status/review";
+import LayoutColab_DetailStatusReview from "./detail/status/review/layout";
+import Colab_DetailStatusReject from "./detail/status/reject";
+import LayoutColab_DetailStatusReject from "./detail/status/reject/layout";
+import Colab_Proyek from "./main/proyek";
+import Colab_DetailStatusPublish from "./detail/status/publish";
+import LayoutColab_DetailStatusPublish from "./detail/status/publish/layout";
+import Colab_Edit from "./edit";
+import LayoutColab_Edit from "./edit/layout";
+import Colab_DetailPartisipasiProyek from "./detail/proyek/partisipasi";
+import LayoutColab_DetailPartisipasiProyek from "./detail/proyek/partisipasi/layout";
+import Colab_GrupDiskus from "./main/grup";
+import Colab_DetailGrupDiskusi from "./detail/grup";
+import LayoutColab_DetailGrupDiskusi from "./detail/grup/layout";
+
+export {
+ Colab_Beranda,
+ LayoutColab_Main,
+ Colab_Splash,
+ Colab_Create,
+ LayoutColab_Create,
+ Colab_Status,
+ Colab_MainDetail,
+ LayoutColab_MainDetail,
+ Colab_DetailStatusReview,
+ LayoutColab_DetailStatusReview,
+ Colab_DetailStatusReject,
+ LayoutColab_DetailStatusReject,
+ Colab_Proyek,
+ Colab_DetailStatusPublish,
+ LayoutColab_DetailStatusPublish,
+ Colab_Edit,
+ LayoutColab_Edit,
+ Colab_DetailPartisipasiProyek,
+ LayoutColab_DetailPartisipasiProyek,
+ Colab_GrupDiskus,
+ Colab_DetailGrupDiskusi,
+ LayoutColab_DetailGrupDiskusi,
+};
diff --git a/src/app_modules/colab/main/beranda.tsx b/src/app_modules/colab/main/beranda.tsx
new file mode 100644
index 00000000..57a24126
--- /dev/null
+++ b/src/app_modules/colab/main/beranda.tsx
@@ -0,0 +1,68 @@
+"use client";
+
+import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
+import {
+ ActionIcon,
+ Affix,
+ Card,
+ Center,
+ Grid,
+ Paper,
+ Stack,
+ Text,
+ Textarea,
+ Title,
+ rem,
+} from "@mantine/core";
+import { useWindowScroll } from "@mantine/hooks";
+import { IconPencilPlus } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import ComponentColab_CardSectionData from "../component/card_view/card_section_data";
+import ComponentColab_SectionHeaderAuthorName from "../component/card_view/card_section_header_author_name";
+import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
+import ComponentColab_CardSectionHeaderAuthorName from "../component/card_view/card_section_header_author_name";
+
+export default function Colab_Beranda() {
+ const router = useRouter();
+ const [scroll, scrollTo] = useWindowScroll();
+ const [loadingCreate, setLoadingCreate] = useState(false);
+
+ return (
+ <>
+
+ 0 ? 0.5 : ""}
+ style={{
+ transition: "0.5s",
+ }}
+ size={"xl"}
+ radius={"xl"}
+ variant="transparent"
+ bg={"blue"}
+ onClick={() => {
+ setLoadingCreate(true);
+ router.push(RouterColab.create);
+ }}
+ >
+
+
+
+
+ {Array(5)
+ .fill(0)
+ .map((e, i) => (
+
+
+
+
+ ))}
+ >
+ );
+}
diff --git a/src/app_modules/colab/main/grup/index.tsx b/src/app_modules/colab/main/grup/index.tsx
new file mode 100644
index 00000000..b6e2f35b
--- /dev/null
+++ b/src/app_modules/colab/main/grup/index.tsx
@@ -0,0 +1,41 @@
+"use client";
+
+import { Center, Grid, Group, Paper, Stack, Text, Title } from "@mantine/core";
+import ComponentColab_AuthorNameOnHeader from "../../component/header_author_name";
+import { IconChevronCompactRight, IconChevronRight } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+
+export default function Colab_GrupDiskus() {
+ const router = useRouter();
+ return (
+ <>
+
+ {Array(10)
+ .fill(0)
+ .map((e, i) => (
+ {
+ router.push(RouterColab.detail_grup + i);
+ }}
+ >
+
+
+ Nama Grup Diskusi
+
+
+
+
+
+
+
+
+ ))}
+
+ >
+ );
+}
diff --git a/src/app_modules/colab/main/layout.tsx b/src/app_modules/colab/main/layout.tsx
new file mode 100644
index 00000000..9d62f0e6
--- /dev/null
+++ b/src/app_modules/colab/main/layout.tsx
@@ -0,0 +1,114 @@
+"use client";
+
+import {
+ ActionIcon,
+ AppShell,
+ Center,
+ Footer,
+ Grid,
+ Stack,
+ Text,
+} from "@mantine/core";
+import React, { useState } from "react";
+import ComponentColab_HeaderTamplate from "../component/header_tamplate";
+import router from "next/router";
+import {
+ IconHistory,
+ IconHome,
+ IconMessages,
+ IconReservedLine,
+ IconUsersGroup,
+} from "@tabler/icons-react";
+import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { useRouter } from "next/navigation";
+import { useAtom } from "jotai";
+import { gs_colab_hot_menu } from "../global_state";
+import { RouterHome } from "@/app/lib/router_hipmi/router_home";
+
+export default function LayoutColab_Main({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ const router = useRouter();
+ const [hotMenu, setHotMenu] = useAtom(gs_colab_hot_menu);
+ const [loading, setLoading] = useState(false);
+
+ const listFooter = [
+ {
+ id: 1,
+ name: "Beranda",
+ path: RouterColab.beranda,
+ icon: ,
+ },
+
+ {
+ id: 2,
+ name: "Status",
+ path: RouterColab.status,
+ icon: ,
+ },
+
+ {
+ id: 3,
+ name: "Partisipasi",
+ path: RouterColab.proyek,
+ icon: ,
+ },
+
+ {
+ id: 4,
+ name: "Grup Diskusi",
+ path: RouterColab.grup_diskusi,
+ icon: ,
+ },
+ ];
+
+ return (
+ <>
+ }
+ // route2={RouterColab.proyek}
+ />
+ }
+ footer={
+
+ }
+ >
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/colab/main/proyek/index.tsx b/src/app_modules/colab/main/proyek/index.tsx
new file mode 100644
index 00000000..926a71ce
--- /dev/null
+++ b/src/app_modules/colab/main/proyek/index.tsx
@@ -0,0 +1,58 @@
+"use client";
+
+import { Stack, Tabs, Text } from "@mantine/core";
+import { IconBrandOffice, IconUsersGroup, IconUser } from "@tabler/icons-react";
+import { useState } from "react";
+import Colab_ProyekSaya from "./saya";
+import Colab_PartisipasiProyek from "./partisipasi";
+import { useAtom } from "jotai";
+import { gs_colab_proyek } from "../../global_state";
+
+export default function Colab_Proyek() {
+ const [activeTab, setActiveTab] = useAtom(gs_colab_proyek);
+
+ const listTabs = [
+ {
+ id: 1,
+ icon: ,
+ label: "Partisipasi Proyek",
+ value: "Partisipasi",
+ path: ,
+ },
+ {
+ id: 2,
+ icon: ,
+ label: "Proyek Saya",
+ value: "Saya",
+ path: ,
+ },
+ ];
+
+ return (
+
+
+
+ {listTabs.map((e) => (
+
+
+ {e.icon}
+ {e.label}
+
+
+ ))}
+
+
+ {listTabs.map((e) => (
+
+ {e.path}
+
+ ))}
+
+
+ );
+}
diff --git a/src/app_modules/colab/main/proyek/partisipasi.tsx b/src/app_modules/colab/main/proyek/partisipasi.tsx
new file mode 100644
index 00000000..1b107d22
--- /dev/null
+++ b/src/app_modules/colab/main/proyek/partisipasi.tsx
@@ -0,0 +1,34 @@
+"use client";
+
+import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { Card } from "@mantine/core";
+import ComponentColab_CardSectionData from "../../component/card_view/card_section_data";
+import ComponentColab_CardSectionHeaderAuthorName from "../../component/card_view/card_section_header_author_name";
+
+export default function Colab_PartisipasiProyek() {
+ return (
+ <>
+ {Array(5)
+ .fill(0)
+ .map((e, i) => (
+
+
+
+
+ ))}
+ >
+ );
+}
diff --git a/src/app_modules/colab/main/proyek/saya.tsx b/src/app_modules/colab/main/proyek/saya.tsx
new file mode 100644
index 00000000..1cc9b7d6
--- /dev/null
+++ b/src/app_modules/colab/main/proyek/saya.tsx
@@ -0,0 +1,34 @@
+"use client";
+
+import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { Card, Stack } from "@mantine/core";
+import ComponentColab_CardSectionData from "../../component/card_view/card_section_data";
+import ComponentColab_CardSectionHeaderAuthorName from "../../component/card_view/card_section_header_author_name";
+import ComponentColab_JumlahPartisipan from "../../component/card_view/jumlah_partisipan";
+
+export default function Colab_ProyekSaya() {
+ return (
+ <>
+ {Array(5)
+ .fill(0)
+ .map((e, i) => (
+
+
+
+
+
+
+ ))}
+ >
+ );
+}
diff --git a/src/app_modules/colab/main/status/index.tsx b/src/app_modules/colab/main/status/index.tsx
new file mode 100644
index 00000000..b07e2021
--- /dev/null
+++ b/src/app_modules/colab/main/status/index.tsx
@@ -0,0 +1,78 @@
+"use client";
+
+import { Tabs, Stack, Paper } from "@mantine/core";
+import { useState } from "react";
+import Colab_StatusPublish from "./publish";
+import Colab_StatusReject from "./reject";
+import Colab_StatusReview from "./review";
+import { useAtom } from "jotai";
+import { gs_colab_status } from "../../global_state";
+
+export default function Colab_Status() {
+ const [tabsStatus, setTabsStatus] = useAtom(gs_colab_status);
+ const [colorTab, setColorTab] = useState("");
+
+ const listTabs = [
+ {
+ id: 1,
+ path: ,
+ value: "Publish",
+ bg: "green",
+ },
+ {
+ id: 2,
+ path: ,
+ value: "Review",
+ bg: "orange",
+ },
+ {
+ id: 3,
+ path: ,
+ value: "Reject",
+ bg: "red",
+ },
+ ];
+
+ return (
+ <>
+ {
+ setTabsStatus(val);
+ // setColorTab(val);
+ }}
+ >
+
+
+ {listTabs.map((e) => (
+
+ {e.value}
+
+ ))}
+
+ {listTabs.map((e) => (
+
+ {e.path}
+
+ ))}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/colab/main/status/publish.tsx b/src/app_modules/colab/main/status/publish.tsx
new file mode 100644
index 00000000..929a8607
--- /dev/null
+++ b/src/app_modules/colab/main/status/publish.tsx
@@ -0,0 +1,37 @@
+"use client";
+
+import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
+import { Card, Stack, Grid, Text, Divider, Center, Box } from "@mantine/core";
+import ComponentColab_CardSectionData from "../../component/card_view/card_section_data";
+import ComponentColab_AuthorNameOnHeader from "../../component/header_author_name";
+import ComponentColab_CardSectionHeaderAuthorName from "../../component/card_view/card_section_header_author_name";
+import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import ComponentColab_JumlahPartisipan from "../../component/card_view/jumlah_partisipan";
+
+export default function Colab_StatusPublish() {
+ return (
+ <>
+ {Array(5)
+ .fill(0)
+ .map((e, i) => (
+
+
+
+
+
+
+ ))}
+ >
+ );
+}
diff --git a/src/app_modules/colab/main/status/reject.tsx b/src/app_modules/colab/main/status/reject.tsx
new file mode 100644
index 00000000..049979a3
--- /dev/null
+++ b/src/app_modules/colab/main/status/reject.tsx
@@ -0,0 +1,31 @@
+"use client";
+
+import { Card } from "@mantine/core";
+import ComponentColab_CardSectionData from "../../component/card_view/card_section_data";
+import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+
+export default function Colab_StatusReject() {
+ return (
+ <>
+ {Array(5)
+ .fill(0)
+ .map((e, i) => (
+
+
+
+ ))}
+ >
+ );
+}
diff --git a/src/app_modules/colab/main/status/review.tsx b/src/app_modules/colab/main/status/review.tsx
new file mode 100644
index 00000000..e3e48053
--- /dev/null
+++ b/src/app_modules/colab/main/status/review.tsx
@@ -0,0 +1,27 @@
+"use client";
+
+import { Card } from "@mantine/core";
+import ComponentColab_CardSectionData from "../../component/card_view/card_section_data";
+import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+
+export default function Colab_StatusReview() {
+ return (
+ <>
+ {Array(5)
+ .fill(0)
+ .map((e, i) => (
+
+
+
+ ))}
+ >
+ );
+}
diff --git a/src/app_modules/colab/splash/index.tsx b/src/app_modules/colab/splash/index.tsx
new file mode 100644
index 00000000..6ad2d3f3
--- /dev/null
+++ b/src/app_modules/colab/splash/index.tsx
@@ -0,0 +1,31 @@
+"use client";
+
+import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { Center, Image, Paper } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useAtom } from "jotai";
+import { useRouter } from "next/navigation";
+import { gs_colab_hot_menu } from "../global_state";
+
+export default function Colab_Splash() {
+ const router = useRouter();
+ const [hotMenu, setHotMenu] = useAtom(gs_colab_hot_menu);
+
+ useShallowEffect(() => {
+ setTimeout(() => {
+ setHotMenu(1);
+ // setStatus("Publish");
+ router.replace(RouterColab.beranda);
+ }, 2000);
+ }, []);
+
+ return (
+ <>
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/component_global/author_name_on_header.tsx b/src/app_modules/component_global/author_name_on_header.tsx
index a6a42a24..995b429c 100644
--- a/src/app_modules/component_global/author_name_on_header.tsx
+++ b/src/app_modules/component_global/author_name_on_header.tsx
@@ -1,20 +1,26 @@
"use client";
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
-import { Stack, Grid, Avatar, Divider, Text } from "@mantine/core";
+import { Stack, Grid, Avatar, Divider, Text, Group } from "@mantine/core";
import { useRouter } from "next/navigation";
import { ComponentGlobal_NotifikasiPeringatan } from "./notif_global/notifikasi_peringatan";
+import moment from "moment";
export default function ComponentGlobal_AuthorNameOnHeader({
profileId,
imagesId,
authorName,
+ tglPublish,
+ isPembatas,
}: {
profileId?: string;
imagesId?: string;
authorName?: string;
+ tglPublish?: Date;
+ isPembatas?: boolean;
}) {
const router = useRouter();
+ const skrng = new Date();
return (
<>
@@ -43,13 +49,28 @@ export default function ComponentGlobal_AuthorNameOnHeader({
-
- {authorName ? authorName : "Nama author"}
-
+
+
+
+ {authorName ? authorName : "Nama author"}
+
+
+
+ {tglPublish ? (
+
+ {skrng.toLocaleDateString(["id-ID"], {
+ dateStyle: "medium",
+ })}
+
+ ) : (
+ ""
+ )}
+
+
-
+ {isPembatas ? : ""}
>
);
diff --git a/src/app_modules/component_global/loading_page_v2.tsx b/src/app_modules/component_global/loading_page_v2.tsx
new file mode 100644
index 00000000..d05c5d3d
--- /dev/null
+++ b/src/app_modules/component_global/loading_page_v2.tsx
@@ -0,0 +1,43 @@
+"use client";
+
+import { Box, Center, Group, LoadingOverlay, Skeleton, Text } from "@mantine/core";
+
+export default function ComponentGlobal_V2_LoadingPage() {
+const listhHuruf = [
+ {
+ huruf: "H",
+ },
+ {
+ huruf: "I",
+ },
+ {
+ huruf: "P",
+ },
+ {
+ huruf: "M",
+ },
+ {
+ huruf: "I",
+ },
+];
+const customLOader = (
+
+
+ {listhHuruf.map((e, i) => (
+
+
+
+ {e.huruf}
+
+
+ ))}
+
+
+);
+
+return (
+ <>
+
+ >
+);
+}
diff --git a/src/app_modules/component_global/notif_global/notifikasi_berhasil.tsx b/src/app_modules/component_global/notif_global/notifikasi_berhasil.tsx
index e60f1099..92b8c785 100644
--- a/src/app_modules/component_global/notif_global/notifikasi_berhasil.tsx
+++ b/src/app_modules/component_global/notif_global/notifikasi_berhasil.tsx
@@ -26,7 +26,7 @@ export async function ComponentGlobal_NotifikasiBerhasil(
),
color: "green",
radius: "md",
- autoClose: durasi ? durasi : 1000,
+ autoClose: durasi ? durasi : 2000,
icon: ,
withCloseButton: false,
diff --git a/src/app_modules/component_global/notif_global/notifikasi_gagal.tsx b/src/app_modules/component_global/notif_global/notifikasi_gagal.tsx
index ff35ac52..64e97ead 100644
--- a/src/app_modules/component_global/notif_global/notifikasi_gagal.tsx
+++ b/src/app_modules/component_global/notif_global/notifikasi_gagal.tsx
@@ -17,7 +17,7 @@ export async function ComponentGlobal_NotifikasiGagal(text: string) {
),
color: "red",
radius: "md",
- autoClose: 1000,
+ autoClose: 2000,
icon: ,
withCloseButton: false,
diff --git a/src/app_modules/component_global/notif_global/notifikasi_peringatan.tsx b/src/app_modules/component_global/notif_global/notifikasi_peringatan.tsx
index 6c00859b..73783e33 100644
--- a/src/app_modules/component_global/notif_global/notifikasi_peringatan.tsx
+++ b/src/app_modules/component_global/notif_global/notifikasi_peringatan.tsx
@@ -20,7 +20,7 @@ export async function ComponentGlobal_NotifikasiPeringatan(
),
color: "yellow.1",
radius: "md",
- autoClose: durasi ? durasi : 1000,
+ autoClose: durasi ? durasi : 2000,
style: {
borderWidth: "0.5px",
borderStyle: "solid",
diff --git a/src/app_modules/forum/component/header/detail_author_header_name.tsx b/src/app_modules/forum/component/header/detail_author_header_name.tsx
new file mode 100644
index 00000000..b5bbfeb2
--- /dev/null
+++ b/src/app_modules/forum/component/header/detail_author_header_name.tsx
@@ -0,0 +1,103 @@
+"use client";
+
+import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import {
+ Stack,
+ Grid,
+ Avatar,
+ Divider,
+ Text,
+ Group,
+ ThemeIcon,
+ ActionIcon,
+ Badge,
+} from "@mantine/core";
+import { useRouter } from "next/navigation";
+import moment from "moment";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import {
+ IconCircleFilled,
+ IconDots,
+ IconMessageCircle,
+} from "@tabler/icons-react";
+import { IconCircle } from "@tabler/icons-react";
+import ComponentForum_PostingButtonMore from "../more_button/posting_button_more";
+import ComponentForum_DetailMoreButton from "../more_button/detail_more_button";
+
+export default function ComponentForum_DetailOnHeaderAuthorName({
+ authorId,
+ postingId,
+ imagesId,
+ authorName,
+ username,
+ isPembatas,
+ userLoginId,
+ statusId,
+}: {
+ authorId?: string;
+ postingId?: string;
+ imagesId?: string;
+ authorName?: string;
+ username?: string;
+ tglPublish?: Date;
+ isPembatas?: boolean;
+ statusId: string;
+ userLoginId: string;
+}) {
+ const router = useRouter();
+
+ return (
+ <>
+
+
+ {
+ if (authorId) {
+ router.push(RouterForum.forumku + authorId);
+ } else {
+ ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
+ }
+ }}
+ >
+
+
+
+
+
+ {authorName ? authorName : "Nama author "}
+
+
+ {(statusId as any) === 1 ? "Open" : "Close"}
+
+
+
+
+
+
+
+ {isPembatas ? : ""}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/component/header/header_rata_kiri.tsx b/src/app_modules/forum/component/header/header_rata_kiri.tsx
new file mode 100644
index 00000000..d99b6f8e
--- /dev/null
+++ b/src/app_modules/forum/component/header/header_rata_kiri.tsx
@@ -0,0 +1,30 @@
+"use client";
+
+import { ActionIcon, Group, Header, Title } from "@mantine/core";
+import { IconX } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+
+export default function ComponentForum_HeaderRataKiri({
+ title,
+}: {
+ title: string;
+}) {
+ const router = useRouter();
+ return (
+ <>
+
+
+ {
+ router.back();
+ }}
+ >
+
+
+ {title}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/component/header/header_tamplate.tsx b/src/app_modules/forum/component/header/header_tamplate.tsx
new file mode 100644
index 00000000..3307395d
--- /dev/null
+++ b/src/app_modules/forum/component/header/header_tamplate.tsx
@@ -0,0 +1,82 @@
+"use client";
+
+import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
+import {
+ Header,
+ Group,
+ ActionIcon,
+ Text,
+ Title,
+ Center,
+ Loader,
+} from "@mantine/core";
+import { IconArrowLeft, IconChevronLeft } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+
+export default function ComponentForum_HeaderTamplate({
+ hideBack,
+ changeIconBack,
+ route,
+ route2,
+ title,
+ icon,
+ bg,
+}: {
+ hideBack?: boolean;
+ changeIconBack?: any;
+ route?: any;
+ route2?: any;
+ title: string;
+ icon?: any;
+ bg?: any;
+}) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+ if (loading) return ;
+
+ return (
+ <>
+
+
+ {hideBack ? (
+
+ ) : (
+ {
+ setLoading(true);
+ if (route === null || route === undefined) {
+ return router.back();
+ } else {
+ return router.push(route);
+ }
+ }}
+ >
+ {changeIconBack ? changeIconBack : }
+
+ )}
+ {title}
+ {(() => {
+ if (route2 === null || route2 === undefined) {
+ return ;
+ } else {
+ return (
+ router.push(route2)}
+ >
+ {icon}
+
+ );
+ }
+ })()}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/component/header/komentar_author_header_name.tsx b/src/app_modules/forum/component/header/komentar_author_header_name.tsx
new file mode 100644
index 00000000..afc468a1
--- /dev/null
+++ b/src/app_modules/forum/component/header/komentar_author_header_name.tsx
@@ -0,0 +1,135 @@
+"use client";
+
+import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import { Stack, Grid, Avatar, Divider, Text, Group } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import moment from "moment";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import {
+ IconCircleFilled,
+ IconDots,
+ IconEdit,
+ IconFlag3,
+ IconMessageCircle,
+ IconTrash,
+} from "@tabler/icons-react";
+import { IconCircle } from "@tabler/icons-react";
+import { IoIosMore } from "react-icons/io";
+import { useDisclosure } from "@mantine/hooks";
+import { useState } from "react";
+import ComponentForum_PostingButtonMore from "../more_button/posting_button_more";
+import ComponentForum_KomentarButtonMore from "../more_button/komentar_button_more";
+
+export default function ComponentForum_KomentarAuthorNameOnHeader({
+ userId,
+ komentarId,
+ imagesId,
+ authorName,
+ tglPublish,
+ isPembatas,
+ isMoreButton,
+ setKomentar,
+ postingId,
+ userLoginId,
+}: {
+ userId?: string;
+ komentarId?: string;
+ imagesId?: string;
+ authorName?: string;
+ tglPublish?: Date;
+ isPembatas?: boolean;
+ isMoreButton?: boolean;
+ setKomentar?: any;
+ postingId?: string;
+ userLoginId: string
+}) {
+ const router = useRouter();
+
+ return (
+ <>
+
+
+ {
+ if (userId) {
+ router.push(RouterForum.forumku + userId);
+ } else {
+ ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
+ }
+ }}
+ >
+
+
+
+
+
+
+
+ {authorName
+ ? authorName
+ : "Nama author coba di berikan panjang "}
+
+
+ {/*
+
+ {username ? username : "@username "}
+
+ */}
+
+
+
+
+
+
+
+
+ {tglPublish
+ ? tglPublish.toLocaleDateString(["id-ID"], {
+ day: "numeric",
+ month: "short",
+ })
+ : new Date().toLocaleDateString(["id-ID"], {
+ day: "numeric",
+ month: "short",
+ })}
+
+
+
+
+ {isMoreButton ? (
+
+
+
+ ) : (
+ ""
+ )}
+
+
+
+ {isPembatas ? : ""}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/component/header/posting_author_header_name.tsx b/src/app_modules/forum/component/header/posting_author_header_name.tsx
new file mode 100644
index 00000000..f605c91e
--- /dev/null
+++ b/src/app_modules/forum/component/header/posting_author_header_name.tsx
@@ -0,0 +1,150 @@
+"use client";
+
+import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import {
+ Stack,
+ Grid,
+ Avatar,
+ Divider,
+ Text,
+ Group,
+ Badge,
+ Loader,
+} from "@mantine/core";
+import { useRouter } from "next/navigation";
+import moment from "moment";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import {
+ IconCircleFilled,
+ IconDots,
+ IconEdit,
+ IconFlag3,
+ IconMessageCircle,
+ IconTrash,
+} from "@tabler/icons-react";
+import { IconCircle } from "@tabler/icons-react";
+import { IoIosMore } from "react-icons/io";
+import { useDisclosure } from "@mantine/hooks";
+import { useState } from "react";
+import ComponentForum_PostingButtonMore from "../more_button/posting_button_more";
+import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
+
+export default function ComponentForum_PostingAuthorNameOnHeader({
+ authorId,
+ postingId,
+ imagesId,
+ authorName,
+ tglPublish,
+ isPembatas,
+ isMoreButton,
+ statusId,
+ userLoginId,
+}: {
+ authorId?: string;
+ postingId?: string;
+ imagesId?: string;
+ authorName?: string;
+ tglPublish?: Date;
+ isPembatas?: boolean;
+ isMoreButton?: boolean;
+ statusId?: string;
+ userLoginId: string;
+}) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ return (
+ <>
+
+
+ {
+ if (authorId) {
+ setLoading(true);
+ router.push(RouterForum.forumku + authorId);
+ } else {
+ ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
+ }
+ }}
+ >
+ {loading ? (
+
+ ) : (
+
+ )}
+
+
+
+
+
+
+
+ {authorName ? authorName : "Nama author "}
+
+
+
+
+
+
+ {(statusId as any) === 1 ? "Open" : "Close"}
+
+
+
+
+
+
+
+
+
+ {tglPublish
+ ? tglPublish.toLocaleDateString(["id-ID"], {
+ day: "numeric",
+ month: "short",
+ })
+ : new Date().toLocaleDateString(["id-ID"], {
+ day: "numeric",
+ month: "short",
+ })}
+
+
+
+ {isMoreButton ? (
+
+
+
+ ) : (
+ ""
+ )}
+
+
+
+ {isPembatas ? : ""}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/component/loading_drawer.tsx b/src/app_modules/forum/component/loading_drawer.tsx
new file mode 100644
index 00000000..3a1a53ac
--- /dev/null
+++ b/src/app_modules/forum/component/loading_drawer.tsx
@@ -0,0 +1,22 @@
+"use client";
+
+import { Center, Group, LoadingOverlay, Skeleton } from "@mantine/core";
+
+export default function ComponentForum_LoadingDrawer() {
+ const customLoad = (
+
+
+ {Array(3)
+ .fill(0)
+ .map((e, i) => (
+
+ ))}
+
+
+ );
+ return (
+ <>
+ {customLoad}
+ >
+ );
+}
diff --git a/src/app_modules/forum/component/main_card_view.tsx b/src/app_modules/forum/component/main_card_view.tsx
new file mode 100644
index 00000000..a9bcbc49
--- /dev/null
+++ b/src/app_modules/forum/component/main_card_view.tsx
@@ -0,0 +1,94 @@
+"use client";
+
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { Stack, Card, Group, ActionIcon, Divider, Text } from "@mantine/core";
+import { IconMessageCircle, IconMessageCircleOff } from "@tabler/icons-react";
+
+import ComponentForum_PostingAuthorNameOnHeader from "./header/posting_author_header_name";
+import { MODEL_FORUM_POSTING } from "../model/interface";
+import { useState } from "react";
+import { useShallowEffect } from "@mantine/hooks";
+import { useRouter } from "next/navigation";
+import { useAtom } from "jotai";
+import { gs_forum_total_komentar } from "../global_state";
+import { forum_countOneTotalKomentarById } from "../fun/count/count_one_total_komentar_by_id";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
+import { IconMessageCircleX } from "@tabler/icons-react";
+
+export default function ComponentForum_MainCardView({
+ data,
+ setLoadingKomen,
+ setLoadingDetail,
+ userLoginId,
+}: {
+ data: MODEL_FORUM_POSTING[];
+ setLoadingKomen: any;
+ setLoadingDetail: any;
+ userLoginId: any
+}) {
+ const router = useRouter();
+ return (
+ <>
+
+ {data.map((e, i) => (
+
+
+ {/* {JSON.stringify( typeof e.ForumMaster_StatusPosting.id)} */}
+
+
+ {
+ // console.log("halaman forum");
+ setLoadingDetail(true);
+ router.push(RouterForum.main_detail + e.id);
+ }}
+ >
+
+
+
+
+
+
+
+ {
+ (e?.ForumMaster_StatusPosting.id as any) === 1
+ ? (router.push(RouterForum.komentar + e?.id),
+ setLoadingKomen(true))
+ : router.push(RouterForum.main_detail + e?.id);
+ }}
+ >
+ {(e?.ForumMaster_StatusPosting?.id as any) === 1 ? (
+
+ ) : (
+
+ )}
+
+
+ {/* */}
+
+ {e?._count}
+
+
+
+
+
+ ))}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/component/more_button/detail_more_button.tsx b/src/app_modules/forum/component/more_button/detail_more_button.tsx
new file mode 100644
index 00000000..297f1f09
--- /dev/null
+++ b/src/app_modules/forum/component/more_button/detail_more_button.tsx
@@ -0,0 +1,322 @@
+"use client";
+
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import {
+ Drawer,
+ Stack,
+ Grid,
+ Button,
+ Modal,
+ Title,
+ Group,
+ ActionIcon,
+ Text,
+ Box,
+ Center,
+ Loader,
+} from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import {
+ IconTrash,
+ IconEdit,
+ IconFlag3,
+ IconDots,
+ IconSquareRoundedX,
+} from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+
+import { createStyles } from "@mantine/core";
+import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
+import { useAtom } from "jotai";
+import { gs_forum_loading_edit_posting } from "../../global_state";
+import ComponentForum_LoadingDrawer from "../loading_drawer";
+import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
+import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+import { IconSquareCheck } from "@tabler/icons-react";
+import { forum_funEditStatusPostingById } from "../../fun/edit/fun_edit_status_posting_by_id";
+
+export default function ComponentForum_DetailMoreButton({
+ authorId,
+ postingId,
+ statusId,
+ userLoginId,
+}: {
+ authorId: any;
+ postingId?: any;
+ statusId: any;
+ userLoginId: any;
+}) {
+ const router = useRouter();
+ const [opened, { open, close }] = useDisclosure(false);
+ const [openDel, setOpenDel] = useState(false);
+ const [openStatusClose, setOpenStatusClose] = useState(false);
+
+ // loading
+ const [loadingEdit, setLoadingEdit] = useState(false);
+ const [loadingReport, setLoadingReport] = useState(false);
+
+ // if (loadingEdit) return ;
+
+ return (
+ <>
+
+
+ {userLoginId != authorId ? (
+ ""
+ ) : (
+
+ {
+ close();
+ setOpenStatusClose(true);
+ }}
+ >
+
+ {statusId === 1 ? (
+
+ ) : (
+
+ )}
+
+
+ {statusId === 1 ? (
+ Tutup forum
+ ) : (
+ Buka forum
+ )}
+
+
+
+ {
+ close();
+ setOpenDel(true);
+ }}
+ >
+
+
+
+
+ Hapus
+
+
+
+ {
+ setLoadingEdit(true);
+ router.push(RouterForum.edit_posting + postingId);
+ }}
+ >
+
+
+
+
+
+ Edit posting{" "}
+ {loadingEdit ? : ""}
+
+
+
+
+ )}
+
+ {userLoginId == authorId ? (
+ ""
+ ) : (
+ {
+ setLoadingReport(true);
+ router.push(RouterForum.report_posting + postingId);
+ }}
+ >
+
+
+
+
+
+
+ Laporkan posting
+ {" "}
+ {loadingReport ? : ""}
+
+
+
+ )}
+
+
+ Batal
+
+
+
+
+ {
+ setOpenDel(false);
+ }}
+ centered
+ withCloseButton={false}
+ >
+
+
+
+ setOpenStatusClose(false)}
+ centered
+ withCloseButton={false}
+ >
+
+
+
+ open()}>
+
+
+ >
+ );
+}
+
+function ButtonDelete({
+ postingId,
+ setOpenDel,
+}: {
+ postingId?: string;
+ setOpenDel: any;
+}) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ if (loading) return ;
+
+ async function onDelete() {
+ setOpenDel(false);
+ await forum_funDeletePostingById(postingId as any).then((res) => {
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(`Postingan Terhapus`, 2000);
+ setLoading(true);
+ router.back();
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+ return (
+ <>
+
+ Yakin menghapus posting ini ?
+
+ setOpenDel(false)}>
+ Batal
+
+ {
+ onDelete();
+ }}
+ >
+ Hapus
+
+
+
+ >
+ );
+}
+
+function ButtonStatus({
+ postingId,
+ setOpenStatus,
+ statusId,
+}: {
+ postingId?: string;
+ setOpenStatus: any;
+ statusId?: any;
+}) {
+ const [loading, setLoading] = useState(false);
+
+ async function onTutupForum() {
+ setOpenStatus(false);
+
+ await forum_funEditStatusPostingById(postingId as any, 2).then((res) => {
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(`Forum Ditutup`, 2000);
+ setLoading(true);
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+
+ async function onBukaForum() {
+ setOpenStatus(false);
+
+ await forum_funEditStatusPostingById(postingId as any, 1).then((res) => {
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(`Forum Dibuka`, 2000);
+ setLoading(true);
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+
+ return (
+ <>
+
+ {statusId === 1 ? (
+ Yakin menutup forum ini ?
+ ) : (
+ Yakin membuka forum ini ?
+ )}
+
+ setOpenStatus(false)}>
+ Batal
+
+
+ {statusId === 1 ? (
+ {
+ onTutupForum();
+ }}
+ >
+ Tutup
+
+ ) : (
+ {
+ onBukaForum();
+ }}
+ >
+ Buka
+
+ )}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/component/more_button/komentar_button_more.tsx b/src/app_modules/forum/component/more_button/komentar_button_more.tsx
new file mode 100644
index 00000000..4e9d7ca8
--- /dev/null
+++ b/src/app_modules/forum/component/more_button/komentar_button_more.tsx
@@ -0,0 +1,223 @@
+"use client";
+
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import {
+ Drawer,
+ Stack,
+ Grid,
+ Button,
+ Modal,
+ Title,
+ Group,
+ ActionIcon,
+ Text,
+ Box,
+ Center,
+ Loader,
+} from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { IconTrash, IconEdit, IconFlag3, IconDots } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+
+import { createStyles } from "@mantine/core";
+import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
+import { useAtom } from "jotai";
+import { gs_forum_loading_edit_posting } from "../../global_state";
+import ComponentForum_LoadingDrawer from "../loading_drawer";
+import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
+import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+import { forum_funDeleteKomentarById } from "../../fun/delete/fun_delete_komentar_by_id";
+import { forum_getKomentarById } from "../../fun/get/get_komentar_by_id";
+
+export default function ComponentForum_KomentarButtonMore({
+ userId,
+ komentarId,
+ setKomentar,
+ postingId,
+ userLoginId,
+}: {
+ userId: any;
+ komentarId: any;
+ setKomentar?: any;
+ postingId?: string;
+ userLoginId: string
+}) {
+ const router = useRouter();
+ const [opened, { open, close }] = useDisclosure(false);
+ const [openDel, setOpenDel] = useState(false);
+
+ // loading
+ const [loadingEdit, setLoadingEdit] = useState(false);
+ const [loadingReport, setLoadingReport] = useState(false);
+
+ // if (loadingEdit) return ;
+
+
+
+ return (
+ <>
+
+
+ {userLoginId != userId ? (
+ ""
+ ) : (
+
+ {
+ close();
+ setOpenDel(true);
+ }}
+ >
+
+
+
+
+ Hapus
+
+
+
+ {/* {
+ setLoadingEdit(true);
+ router.push(RouterForum.edit_komentar + komentarId);
+ }}
+ >
+
+
+
+
+
+
+ Edit komentar
+ {" "}
+ {loadingEdit ? : ""}
+
+
+ */}
+
+ )}
+
+ {userLoginId == userId ? (
+ ""
+ ) : (
+ {
+ setLoadingReport(true);
+ router.push(RouterForum.report_komentar + komentarId);
+ }}
+ >
+
+
+
+
+
+
+ Laporkan komentar
+ {" "}
+ {loadingReport ? : ""}
+
+
+
+ )}
+
+
+ Batal
+
+
+
+
+ {
+ setOpenDel(false);
+ }}
+ centered
+ withCloseButton={false}
+ >
+
+
+
+ open()}>
+
+
+ >
+ );
+}
+
+function ButtonDelete({
+ komentarId,
+ setOpenDel,
+ setKomentar,
+ postingId,
+}: {
+ komentarId?: string;
+ setOpenDel: any;
+ setKomentar?: any;
+ postingId?: string;
+}) {
+ const [loading, setLoading] = useState(false);
+
+ if (loading) return ;
+
+ async function onDelete() {
+ await forum_funDeleteKomentarById(komentarId as any).then(async (res) => {
+ if (res.status === 200) {
+ await forum_getKomentarById(postingId as any).then((val) => {
+ setKomentar(val);
+ setOpenDel(false);
+ setLoading(true);
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ });
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+
+ // await forum_funDeletePostingById(komentarId as any).then((res) => {
+ // if (res.status === 200) {
+ // ComponentGlobal_NotifikasiBerhasil(`Postingan Terhapus`, 2000);
+ // } else {
+ // ComponentGlobal_NotifikasiGagal(res.message);
+ // }
+ // });
+ }
+ return (
+ <>
+
+ Yakin menghapus komentar ini ?
+
+ setOpenDel(false)}>
+ Batal
+
+ {
+ onDelete();
+ }}
+ >
+ Hapus
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/component/more_button/posting_button_more.tsx b/src/app_modules/forum/component/more_button/posting_button_more.tsx
new file mode 100644
index 00000000..a552fc17
--- /dev/null
+++ b/src/app_modules/forum/component/more_button/posting_button_more.tsx
@@ -0,0 +1,320 @@
+"use client";
+
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import {
+ Drawer,
+ Stack,
+ Grid,
+ Button,
+ Modal,
+ Title,
+ Group,
+ ActionIcon,
+ Text,
+ Box,
+ Center,
+ Loader,
+} from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import {
+ IconTrash,
+ IconEdit,
+ IconFlag3,
+ IconDots,
+ IconSquareRoundedX,
+ IconSquareCheck,
+} from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+
+import { createStyles } from "@mantine/core";
+import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
+import { useAtom } from "jotai";
+import { gs_forum_loading_edit_posting } from "../../global_state";
+import ComponentForum_LoadingDrawer from "../loading_drawer";
+import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
+import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+import { forum_funEditStatusPostingById } from "../../fun/edit/fun_edit_status_posting_by_id";
+
+export default function ComponentForum_PostingButtonMore({
+ authorId,
+ postingId,
+ statusId,
+ userLoginId,
+}: {
+ authorId: any;
+ postingId?: any;
+ statusId?: any;
+ userLoginId: any;
+}) {
+ const router = useRouter();
+
+ // modal & drawer
+ const [opened, { open, close }] = useDisclosure(false);
+ const [openDel, setOpenDel] = useState(false);
+ const [openStatusClose, setOpenStatusClose] = useState(false);
+
+ // loading
+ const [loadingEdit, setLoadingEdit] = useState(false);
+ const [loadingReport, setLoadingReport] = useState(false);
+
+ // if (loadingEdit) return ;
+
+ return (
+ <>
+
+
+ {userLoginId != authorId ? (
+ ""
+ ) : (
+
+ {
+ close();
+ setOpenStatusClose(true);
+ }}
+ >
+
+ {statusId === 1 ? (
+
+ ) : (
+
+ )}
+
+
+ {statusId === 1 ? (
+ Tutup forum
+ ) : (
+ Buka forum
+ )}
+
+
+
+ {
+ close();
+ setOpenDel(true);
+ }}
+ >
+
+
+
+
+ Hapus
+
+
+
+ {
+ setLoadingEdit(true);
+ router.push(RouterForum.edit_posting + postingId);
+ }}
+ >
+
+
+
+
+
+ Edit posting{" "}
+ {loadingEdit ? : ""}
+
+
+
+
+ )}
+
+ {userLoginId == authorId ? (
+ ""
+ ) : (
+ {
+ setLoadingReport(true);
+ router.push(RouterForum.report_posting + postingId);
+ }}
+ >
+
+
+
+
+
+
+ Laporkan posting
+ {" "}
+ {loadingReport ? : ""}
+
+
+
+ )}
+
+
+ Batal
+
+
+
+
+ {
+ setOpenDel(false);
+ }}
+ centered
+ withCloseButton={false}
+ >
+
+
+
+ setOpenStatusClose(false)}
+ centered
+ withCloseButton={false}
+ >
+
+
+
+ open()}>
+
+
+ >
+ );
+}
+
+function ButtonDelete({
+ postingId,
+ setOpenDel,
+}: {
+ postingId?: string;
+ setOpenDel: any;
+}) {
+ const [loading, setLoading] = useState(false);
+
+ async function onDelete() {
+ setOpenDel(false);
+ await forum_funDeletePostingById(postingId as any).then((res) => {
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(`Postingan Terhapus`, 2000);
+ setLoading(true);
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+ return (
+ <>
+
+ Yakin menghapus posting ini ?
+
+ setOpenDel(false)}>
+ Batal
+
+ {
+ onDelete();
+ }}
+ >
+ Hapus
+
+
+
+ >
+ );
+}
+
+function ButtonStatus({
+ postingId,
+ setOpenStatus,
+ statusId,
+}: {
+ postingId?: string;
+ setOpenStatus: any;
+ statusId?: any;
+}) {
+ const [loading, setLoading] = useState(false);
+
+ async function onTutupForum() {
+ setOpenStatus(false);
+
+ await forum_funEditStatusPostingById(postingId as any, 2).then((res) => {
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(`Forum Ditutup`, 2000);
+ setLoading(true);
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+
+ async function onBukaForum() {
+ setOpenStatus(false);
+
+ await forum_funEditStatusPostingById(postingId as any, 1).then((res) => {
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(`Forum Dibuka`, 2000);
+ setLoading(true);
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+
+ return (
+ <>
+
+ {statusId === 1 ? (
+ Yakin menutup forum ini ?
+ ) : (
+ Yakin membuka forum ini ?
+ )}
+
+ setOpenStatus(false)}>
+ Batal
+
+
+ {statusId === 1 ? (
+ {
+ onTutupForum();
+ }}
+ >
+ Tutup
+
+ ) : (
+ {
+ onBukaForum();
+ }}
+ >
+ Buka
+
+ )}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/create/index.tsx b/src/app_modules/forum/create/index.tsx
new file mode 100644
index 00000000..786918ba
--- /dev/null
+++ b/src/app_modules/forum/create/index.tsx
@@ -0,0 +1,103 @@
+"use client";
+
+import {
+ ActionIcon,
+ Button,
+ Center,
+ Group,
+ Loader,
+ Paper,
+ Stack,
+} from "@mantine/core";
+import "react-quill/dist/quill.snow.css";
+import "react-quill/dist/quill.bubble.css";
+import { IconPhotoUp } from "@tabler/icons-react";
+import { useShallowEffect } from "@mantine/hooks";
+import { useRouter } from "next/navigation";
+import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
+
+import dynamic from "next/dynamic";
+import React, { useState } from "react";
+import { forum_funCreate } from "../fun/create/fun_create";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+const ReactQuill = dynamic(
+ () => {
+ return import("react-quill");
+ },
+ { ssr: false }
+);
+
+export default function Forum_Create() {
+ const [value, setValue] = useState("");
+ const [maxForum, setMaxForum] = useState(0);
+ const [reload, setReload] = useState(false);
+ useShallowEffect(() => {
+ if (window && window.document) setReload(true);
+ }, []);
+
+ if (!reload)
+ return (
+ <>
+
+ >
+ );
+
+ return (
+ <>
+
+
+ {
+ // if (val.length > 300) {
+ // setMaxForum(val.length);
+ // }
+ setValue(val);
+ }}
+ />
+
+
+ {/*
+
+ */}
+
+
+
+ {/* */}
+ >
+ );
+}
+
+function ButtonAction({ value }: { value: string }) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ async function onCreate() {
+ await forum_funCreate(value).then((res) => {
+ if (res.status === 201) {
+ setLoading(true);
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ setTimeout(() => router.back(), 1000);
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+ return (
+ <>
+ onCreate()}
+ >
+ Posting
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/create/layout.tsx b/src/app_modules/forum/create/layout.tsx
new file mode 100644
index 00000000..2a82a5b0
--- /dev/null
+++ b/src/app_modules/forum/create/layout.tsx
@@ -0,0 +1,19 @@
+"use client";
+
+import { AppShell } from "@mantine/core";
+import React from "react";
+import ComponentForum_HeaderTamplate from "../component/header/header_tamplate";
+
+export default function LayoutForum_Create({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ }>
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/detail/index.tsx b/src/app_modules/forum/detail/index.tsx
new file mode 100644
index 00000000..5cadc5a0
--- /dev/null
+++ b/src/app_modules/forum/detail/index.tsx
@@ -0,0 +1,269 @@
+"use client";
+
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import {
+ ActionIcon,
+ Box,
+ Button,
+ Card,
+ Center,
+ Divider,
+ Group,
+ Paper,
+ Stack,
+ Text,
+} from "@mantine/core";
+import { IconMessageCircle } from "@tabler/icons-react";
+import ComponentForum_PostingAuthorNameOnHeader from "../component/header/posting_author_header_name";
+import ComponentForum_DetailOnHeaderAuthorName from "../component/header/detail_author_header_name";
+import { useRouter } from "next/navigation";
+import { MODEL_FORUM_KOMENTAR, MODEL_FORUM_POSTING } from "../model/interface";
+import ComponentForum_KomentarAuthorNameOnHeader from "../component/header/komentar_author_header_name";
+import _ from "lodash";
+
+import dynamic from "next/dynamic";
+import React, { useState } from "react";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+import { forum_funCreateKomentar } from "../fun/create/fun_create_komentar";
+const ReactQuill = dynamic(
+ () => {
+ return import("react-quill");
+ },
+ { ssr: false }
+);
+import "react-quill/dist/quill.bubble.css";
+import { forum_getKomentarById } from "../fun/get/get_komentar_by_id";
+
+export default function Forum_Detail({
+ dataPosting,
+ listKomentar,
+ totalKomentar,
+ userLoginId,
+}: {
+ dataPosting: MODEL_FORUM_POSTING;
+ listKomentar: MODEL_FORUM_KOMENTAR[];
+ totalKomentar: number;
+ userLoginId: string;
+}) {
+ const [komentar, setKomentar] = useState(listKomentar);
+
+ return (
+ <>
+
+
+ {(dataPosting?.ForumMaster_StatusPosting?.id as any) === 1 ? (
+
+ ) : (
+ ""
+ )}
+
+
+ >
+ );
+}
+
+function ForumView({
+ dataPosting,
+ totalKomentar,
+ userLoginId,
+}: {
+ dataPosting: MODEL_FORUM_POSTING;
+ totalKomentar: number;
+ userLoginId: string;
+}) {
+ return (
+ <>
+
+
+ {/* {JSON.stringify(dataPosting, null, 2)} */}
+
+
+
+
+
+ {dataPosting?.diskusi ? (
+
+ ) : (
+ ""
+ )}
+
+
+
+
+
+
+
+ {/* {
+ router.push(RouterForum.komentar + dataPosting.id);
+ }}
+ >
+ */}
+
+ {totalKomentar}
+
+
+
+ {new Date(dataPosting?.createdAt).toLocaleTimeString()}
+ {/* {new Intl.RelativeTimeFormat("id", {style: "short"}).format(-1,"day")} */}
+
+
+ {dataPosting?.createdAt
+ ? dataPosting?.createdAt.toLocaleDateString(["id-ID"], {
+ dateStyle: "medium",
+ })
+ : new Date().toLocaleDateString(["id-ID"], {
+ dateStyle: "medium",
+ })}
+
+
+
+
+
+
+
+ >
+ );
+}
+
+function CreateKomentar({
+ postingId,
+ setKomentar,
+}: {
+ postingId: string;
+ setKomentar: any;
+}) {
+ const router = useRouter();
+ const [value, setValue] = useState("");
+ const [loading, setLoading] = useState(false);
+
+ async function onComment() {
+ await forum_funCreateKomentar(postingId, value).then(async (res) => {
+ if (res.status === 201) {
+ await forum_getKomentarById(postingId).then((val) => {
+ setKomentar(val);
+ // setLoading(true);
+ setValue("");
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ });
+ // router.replace(RouterForum.main_detail + postingId, { scroll: false });
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+
+ return (
+ <>
+
+
+ {
+ setValue(val);
+ }}
+ />
+
+
+ onComment()}
+ >
+ Balas
+
+
+
+
+ >
+ );
+}
+
+function KomentarView({
+ listKomentar,
+ setKomentar,
+ postingId,
+ userLoginId,
+}: {
+ listKomentar: MODEL_FORUM_KOMENTAR[];
+ setKomentar: any;
+ postingId: string;
+ userLoginId: string;
+}) {
+ return (
+ <>
+
+ {_.isEmpty(listKomentar) ? (
+
+
+ Belum ada komentar
+
+
+ ) : (
+ listKomentar.map((e, i) => (
+
+
+
+
+
+
+
+ {e.komentar ? (
+
+ ) : (
+ ""
+ )}
+
+
+
+
+
+
+
+
+
+ ))
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/detail/layout.tsx b/src/app_modules/forum/detail/layout.tsx
new file mode 100644
index 00000000..2f259a0b
--- /dev/null
+++ b/src/app_modules/forum/detail/layout.tsx
@@ -0,0 +1,48 @@
+"use client";
+
+import { ActionIcon, AppShell, Group, Header, Title } from "@mantine/core";
+import React, { useState } from "react";
+import ComponentForum_HeaderTamplate from "../component/header/header_tamplate";
+import { useRouter } from "next/navigation";
+import { IconChevronLeft } from "@tabler/icons-react";
+import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
+import { revalidatePath } from "next/cache";
+
+export const dynamic = "force-dynamic";
+export default function LayoutForum_Detail({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ if (loading) return ;
+
+ return (
+ <>
+
+
+ {
+ setLoading(true);
+ // revalidatePath("/dev/forum/main");
+ router.back();
+ }}
+ >
+
+
+ Postingan
+
+
+ }
+ >
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/edit/komentar/index.tsx b/src/app_modules/forum/edit/komentar/index.tsx
new file mode 100644
index 00000000..e97c6cdc
--- /dev/null
+++ b/src/app_modules/forum/edit/komentar/index.tsx
@@ -0,0 +1,84 @@
+"use client"
+
+import {
+ ActionIcon,
+ Button,
+ Center,
+ Group,
+ Loader,
+ Paper,
+ Stack,
+} from "@mantine/core";
+import "react-quill/dist/quill.snow.css";
+import "react-quill/dist/quill.bubble.css";
+import { IconPhotoUp } from "@tabler/icons-react";
+import { useShallowEffect } from "@mantine/hooks";
+import { useRouter } from "next/navigation";
+import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
+
+
+import dynamic from "next/dynamic";
+import React, { useState } from "react";
+import { useAtom } from "jotai";
+import { gs_forum_loading_edit_posting } from "../../global_state";
+const ReactQuill = dynamic(
+ () => {
+ return import("react-quill");
+ },
+ { ssr: false }
+);
+
+export default function Forum_EditKomentar() {
+ const [value, setValue] = useState("");
+ const [reload, setReload] = useState(false);
+ useShallowEffect(() => {
+ if (window && window.document) setReload(true);
+ }, []);
+
+ if (!reload)
+ return (
+ <>
+
+ >
+ );
+
+ return (
+ <>
+
+
+ {
+ setValue(val);
+ }}
+ />
+
+
+ {/*
+
+ */}
+
+
+
+
+ >
+ );
+}
+
+function ButtonAction() {
+ const router = useRouter();
+ const [loadingEdit, setLoadingEdit] = useAtom(gs_forum_loading_edit_posting);
+
+ return (
+ <>
+ {
+ router.back()
+
+ }}>
+ Update
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/edit/komentar/layout.tsx b/src/app_modules/forum/edit/komentar/layout.tsx
new file mode 100644
index 00000000..f153d9a1
--- /dev/null
+++ b/src/app_modules/forum/edit/komentar/layout.tsx
@@ -0,0 +1,21 @@
+"use client";
+
+import { AppShell } from "@mantine/core";
+import React from "react";
+import ComponentForum_HeaderTamplate from "../../component/header/header_tamplate";
+
+export default function LayoutForum_EditKomentar({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ }
+ >
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/edit/posting/index.tsx b/src/app_modules/forum/edit/posting/index.tsx
new file mode 100644
index 00000000..a42275fa
--- /dev/null
+++ b/src/app_modules/forum/edit/posting/index.tsx
@@ -0,0 +1,117 @@
+"use client";
+
+import {
+ ActionIcon,
+ Button,
+ Center,
+ Group,
+ Loader,
+ Paper,
+ Stack,
+} from "@mantine/core";
+import "react-quill/dist/quill.snow.css";
+import "react-quill/dist/quill.bubble.css";
+import { IconPhotoUp } from "@tabler/icons-react";
+import { useShallowEffect } from "@mantine/hooks";
+import { useRouter } from "next/navigation";
+import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
+
+import dynamic from "next/dynamic";
+import React, { useState } from "react";
+import { useAtom } from "jotai";
+import { gs_forum_loading_edit_posting } from "../../global_state";
+import { MODEL_FORUM_POSTING } from "../../model/interface";
+import { forum_funEditPostingById } from "../../fun/edit/fun_edit_posting_by_id";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+const ReactQuill = dynamic(
+ () => {
+ return import("react-quill");
+ },
+ { ssr: false }
+);
+
+export default function Forum_EditPosting({
+ dataPosting,
+}: {
+ dataPosting: MODEL_FORUM_POSTING;
+}) {
+ const [value, setValue] = useState(dataPosting);
+ const [reload, setReload] = useState(false);
+ useShallowEffect(() => {
+ if (window && window.document) setReload(true);
+ }, []);
+
+ if (!reload)
+ return (
+ <>
+
+ >
+ );
+
+ return (
+ <>
+
+
+ {
+ setValue({
+ ...value,
+ diskusi: val,
+ });
+ }}
+ />
+
+
+ {/*
+
+ */}
+
+
+
+ {/* */}
+ >
+ );
+}
+
+function ButtonAction({
+ postingId,
+ diskusi,
+}: {
+ postingId: string;
+ diskusi: string;
+}) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ async function onUpdate() {
+ await forum_funEditPostingById(postingId, diskusi).then((res) => {
+ if (res.status === 200) {
+ setLoading(true);
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ setTimeout(() => router.back(), 1000)
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+
+ return (
+ <>
+ {
+ onUpdate();
+ }}
+ >
+ Update
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/edit/posting/layout.tsx b/src/app_modules/forum/edit/posting/layout.tsx
new file mode 100644
index 00000000..94e0f885
--- /dev/null
+++ b/src/app_modules/forum/edit/posting/layout.tsx
@@ -0,0 +1,21 @@
+"use client";
+
+import { AppShell } from "@mantine/core";
+import React from "react";
+import ComponentForum_HeaderTamplate from "../../component/header/header_tamplate";
+
+export default function LayoutForum_EditPosting({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ }
+ >
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/forumku/index.tsx b/src/app_modules/forum/forumku/index.tsx
new file mode 100644
index 00000000..9313a12b
--- /dev/null
+++ b/src/app_modules/forum/forumku/index.tsx
@@ -0,0 +1,243 @@
+"use client";
+
+import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
+import { MODEL_USER } from "@/app_modules/home/model/interface";
+import {
+ ActionIcon,
+ Affix,
+ Avatar,
+ Button,
+ Card,
+ Center,
+ Divider,
+ Grid,
+ Group,
+ Stack,
+ Text,
+ rem,
+} from "@mantine/core";
+import {
+ IconCircleFilled,
+ IconMessageCircle,
+ IconPencilPlus,
+} from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import ComponentForum_PostingAuthorNameOnHeader from "../component/header/posting_author_header_name";
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { useState } from "react";
+import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
+import { MODEL_FORUM_POSTING } from "../model/interface";
+import ComponentForum_MainCardView from "../component/main_card_view";
+import { useWindowScroll } from "@mantine/hooks";
+import _ from "lodash";
+
+export default function Forum_Forumku({
+ auhtorSelectedData,
+ dataPosting,
+ totalPosting,
+ userLoginId,
+}: {
+ auhtorSelectedData: MODEL_USER;
+ dataPosting: MODEL_FORUM_POSTING[];
+ totalPosting: number;
+ userLoginId: string;
+}) {
+ const router = useRouter();
+ const [scroll, scrollTo] = useWindowScroll();
+ const [loadingCreate, setLoadingCreate] = useState(false);
+
+ return (
+ <>
+ {userLoginId === auhtorSelectedData.id ? (
+
+ 0 ? 0.5 : ""}
+ style={{
+ transition: "0.5s",
+ }}
+ size={"xl"}
+ radius={"xl"}
+ variant="transparent"
+ bg={"blue"}
+ onClick={() => {
+ setLoadingCreate(true);
+ router.push(RouterForum.create);
+ }}
+ >
+
+
+
+ ) : (
+ ""
+ )}
+
+
+
+ {_.isEmpty(dataPosting) ? (
+
+
+ Belum ada posting
+
+
+ ) : (
+
+ )}
+
+ >
+ );
+}
+
+function ForumProfile({
+ auhtorSelectedData,
+ totalPosting,
+}: {
+ auhtorSelectedData: MODEL_USER;
+ totalPosting: number;
+}) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ // if (loading) return ;
+
+ return (
+ <>
+
+
+
+
+
+
+
+ {auhtorSelectedData?.Profile?.name}
+
+
+
+
+ {totalPosting} Posting
+
+
+
+
+ @{auhtorSelectedData?.username}
+ {""}
+
+
+
+
+
+
+
+ {
+ setLoading(true);
+ router.push(
+ RouterProfile.katalog + auhtorSelectedData?.Profile?.id
+ );
+ }}
+ >
+ Kunjungi Profile
+
+
+
+
+
+
+ >
+ );
+}
+
+function ForumPosting({
+ dataPosting,
+ userLoginId,
+}: {
+ dataPosting: MODEL_FORUM_POSTING[];
+ userLoginId: any;
+}) {
+ const router = useRouter();
+
+ const [loadingDetail, setLoadingDetail] = useState(false);
+ const [loadingKomen, setLoadingKomen] = useState(false);
+
+ if (loadingDetail) return ;
+ if (loadingKomen) return ;
+ return (
+ <>
+
+
+ {/*
+ {dataPosting.map((e, i) => (
+
+
+
+
+ {
+ // console.log("halaman forum");
+ setLoadingDetail(true);
+ router.push(RouterForum.main_detail + i);
+ }}
+ >
+
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad,
+ vitae. Quisquam aspernatur, eius consequatur dicta repellendus
+ facere vero recusandae deleniti voluptas quod architecto,
+ tenetur totam excepturi rem nam iusto earum.
+
+
+
+
+
+
+ {
+ setLoadingKomen(true);
+ router.push(RouterForum.komentar + i);
+ }}
+ >
+
+
+ 1
+
+
+
+
+
+ ))}
+ */}
+ >
+ );
+}
diff --git a/src/app_modules/forum/forumku/layout.tsx b/src/app_modules/forum/forumku/layout.tsx
new file mode 100644
index 00000000..258b5fe4
--- /dev/null
+++ b/src/app_modules/forum/forumku/layout.tsx
@@ -0,0 +1,25 @@
+"use client";
+
+import { AppShell } from "@mantine/core";
+import React from "react";
+import ComponentForum_HeaderTamplate from "../component/header/header_tamplate";
+import { MODEL_USER } from "@/app_modules/home/model/interface";
+import { IconX } from "@tabler/icons-react";
+
+export default function LayoutForum_Forumku({
+ children,
+ username,
+}: {
+ children: React.ReactNode;
+ username: string;
+}) {
+ return (
+ <>
+ }/>}
+ >
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/fun/count/count_one_total_komentar_by_id.ts b/src/app_modules/forum/fun/count/count_one_total_komentar_by_id.ts
new file mode 100644
index 00000000..1ae8a3b9
--- /dev/null
+++ b/src/app_modules/forum/fun/count/count_one_total_komentar_by_id.ts
@@ -0,0 +1,15 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { revalidatePath } from "next/cache";
+
+export async function forum_countOneTotalKomentarById(postingId: any) {
+ const data = await prisma.forum_Komentar.count({
+ where: {
+ forum_PostingId: postingId,
+ isActive: true,
+ },
+ });
+
+ return data
+}
diff --git a/src/app_modules/forum/fun/count/count_posting_by_author_id.ts b/src/app_modules/forum/fun/count/count_posting_by_author_id.ts
new file mode 100644
index 00000000..0320d0d5
--- /dev/null
+++ b/src/app_modules/forum/fun/count/count_posting_by_author_id.ts
@@ -0,0 +1,17 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
+
+export async function forum_countPostingByAuthorId(authorId: string) {
+
+
+ const data = await prisma.forum_Posting.count({
+ where: {
+ authorId: authorId,
+ isActive: true
+ },
+ });
+
+ return data
+}
diff --git a/src/app_modules/forum/fun/count/count_total_komentar_by_id.ts b/src/app_modules/forum/fun/count/count_total_komentar_by_id.ts
new file mode 100644
index 00000000..3dbf6ce9
--- /dev/null
+++ b/src/app_modules/forum/fun/count/count_total_komentar_by_id.ts
@@ -0,0 +1,32 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+
+
+// PERCOBAAN
+export async function forum_countTotalKomenById(postingId: any[]) {
+ // console.log(postingId)
+
+ const data = postingId.map(async (e) => {
+ const get = await prisma.forum_Komentar.count({
+ where: {
+ forum_PostingId: e,
+ isActive: true,
+ },
+ select: {
+ forum_PostingId: true,
+
+ },
+ });
+ console.log(get);
+ });
+
+ // const data = await prisma.forum_Komentar.count({
+ // where: {
+ // forum_PostingId: postingId,
+ // isActive: true,
+ // },
+ // });
+
+ // return data;
+}
diff --git a/src/app_modules/forum/fun/create/fun_create.tsx b/src/app_modules/forum/fun/create/fun_create.tsx
new file mode 100644
index 00000000..de51a52c
--- /dev/null
+++ b/src/app_modules/forum/fun/create/fun_create.tsx
@@ -0,0 +1,21 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
+import { revalidatePath } from "next/cache";
+
+export async function forum_funCreate(value: string) {
+ const AuthorId = await User_getUserId();
+
+ const create = await prisma.forum_Posting.create({
+ data: {
+ diskusi: value,
+ authorId: AuthorId,
+ forumMaster_StatusPostingId: 1
+ },
+ });
+
+ if (!create) return { status: 400, message: "Gagal menambahkan postingan" };
+ revalidatePath("/dev/forum/main");
+ return { status: 201, message: "Berhasil menambahkan postingan" };
+}
diff --git a/src/app_modules/forum/fun/create/fun_create_komentar.tsx b/src/app_modules/forum/fun/create/fun_create_komentar.tsx
new file mode 100644
index 00000000..89df69f9
--- /dev/null
+++ b/src/app_modules/forum/fun/create/fun_create_komentar.tsx
@@ -0,0 +1,24 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
+import { revalidatePath } from "next/cache";
+
+export async function forum_funCreateKomentar(
+ postingId: string,
+ komentar: string
+) {
+ const authorId = await User_getUserId();
+
+ const create = await prisma.forum_Komentar.create({
+ data: {
+ komentar: komentar,
+ forum_PostingId: postingId,
+ authorId: authorId,
+ },
+ });
+
+ if (!create) return { status: 400, message: "Gagal menambahkan komentar" };
+ revalidatePath("/dev/forum/detail");
+ return { status: 201, message: "Berhasil menambahkan komentar" };
+}
diff --git a/src/app_modules/forum/fun/create/fun_create_report_komentar.ts b/src/app_modules/forum/fun/create/fun_create_report_komentar.ts
new file mode 100644
index 00000000..bac02b0c
--- /dev/null
+++ b/src/app_modules/forum/fun/create/fun_create_report_komentar.ts
@@ -0,0 +1,29 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
+
+export async function forum_funCreateReportKomentar(
+ komentarId: string,
+ value: string
+) {
+ const authorId = await User_getUserId();
+
+ const cekId = await prisma.forumMaster_KategoriReport.findFirst({
+ where: {
+ title: value,
+ },
+ });
+
+ const createReport = await prisma.forum_ReportKomentar.create({
+ data: {
+ userId: authorId,
+ forumMaster_KategoriReportId: cekId?.id,
+ forum_KomentarId: komentarId,
+ },
+ });
+
+ if (!createReport)
+ return { status: 400, message: "Gagal menambahkan report komentar !" };
+ return { status: 201, message: "Berhasil me-report komentar !" };
+}
diff --git a/src/app_modules/forum/fun/create/fun_create_report_komentar_lainnya.ts b/src/app_modules/forum/fun/create/fun_create_report_komentar_lainnya.ts
new file mode 100644
index 00000000..7498bcf6
--- /dev/null
+++ b/src/app_modules/forum/fun/create/fun_create_report_komentar_lainnya.ts
@@ -0,0 +1,21 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
+
+export async function forum_funCreateReportKomentarLainnya(
+ komentarId: string,
+ deskripsi: string
+) {
+ const authorId = await User_getUserId();
+ const create = await prisma.forum_ReportKomentar.create({
+ data: {
+ forum_KomentarId: komentarId,
+ deskripsi: deskripsi,
+ userId: authorId,
+ },
+ });
+
+ if (!create) return { status: 400, message: "Gagal menambah report !" };
+ return { status: 201, message: "Berhasil menambah report !" };
+}
diff --git a/src/app_modules/forum/fun/create/fun_create_report_posting.ts b/src/app_modules/forum/fun/create/fun_create_report_posting.ts
new file mode 100644
index 00000000..dc9d9b98
--- /dev/null
+++ b/src/app_modules/forum/fun/create/fun_create_report_posting.ts
@@ -0,0 +1,29 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
+import { revalidatePath } from "next/cache";
+
+export async function forum_funCreateReportPosting(
+ postingId: string,
+ value: string,
+) {
+ const authorId = await User_getUserId();
+ const cekId = await prisma.forumMaster_KategoriReport.findFirst({
+ where: {
+ title: value,
+ },
+ });
+
+ const createReport = await prisma.forum_ReportPosting.create({
+ data: {
+ userId: authorId,
+ forum_PostingId: postingId,
+ forumMaster_KategoriReportId: cekId?.id,
+ },
+ });
+
+ if (!createReport)
+ return { status: 400, message: "Gagal menambahkan report posting!" };
+ return { status: 201, message: "Berhasil me-report posting!" };
+}
diff --git a/src/app_modules/forum/fun/create/fun_create_report_posting_lainnya.ts b/src/app_modules/forum/fun/create/fun_create_report_posting_lainnya.ts
new file mode 100644
index 00000000..cd29d0d7
--- /dev/null
+++ b/src/app_modules/forum/fun/create/fun_create_report_posting_lainnya.ts
@@ -0,0 +1,21 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
+
+export async function forum_funCreateReportPostingLainnya(
+ postingId: string,
+ deskripsi: string
+) {
+ const authorId = await User_getUserId();
+ const create = await prisma.forum_ReportPosting.create({
+ data: {
+ forum_PostingId: postingId,
+ deskripsi: deskripsi,
+ userId: authorId,
+ },
+ });
+
+ if (!create) return { status: 400, message: "Gagal menambah report !" };
+ return { status: 201, message: "Berhasil menambah report !" };
+}
diff --git a/src/app_modules/forum/fun/delete/fun_delete_komentar_by_id.ts b/src/app_modules/forum/fun/delete/fun_delete_komentar_by_id.ts
new file mode 100644
index 00000000..d7da0b55
--- /dev/null
+++ b/src/app_modules/forum/fun/delete/fun_delete_komentar_by_id.ts
@@ -0,0 +1,19 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { revalidatePath } from "next/cache";
+
+export async function forum_funDeleteKomentarById(komentarId: string) {
+ const del = await prisma.forum_Komentar.update({
+ where: {
+ id: komentarId,
+ },
+ data: {
+ isActive: false,
+ },
+ });
+
+ if (!del) return { status: 400, message: "Gagal Dihapus" };
+ revalidatePath("/dev/forum/detail");
+ return { status: 200, message: "Berhasil Dihapus" };
+}
diff --git a/src/app_modules/forum/fun/delete/fun_delete_posting_by_id.ts b/src/app_modules/forum/fun/delete/fun_delete_posting_by_id.ts
new file mode 100644
index 00000000..f002e727
--- /dev/null
+++ b/src/app_modules/forum/fun/delete/fun_delete_posting_by_id.ts
@@ -0,0 +1,19 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { revalidatePath } from "next/cache";
+
+export async function forum_funDeletePostingById(forumId: string) {
+ const del = await prisma.forum_Posting.update({
+ where: {
+ id: forumId,
+ },
+ data: {
+ isActive: false,
+ },
+ });
+
+ if (!del) return { status: 400, message: "Gagal dihapus" };
+ revalidatePath("/dev/forum/main");
+ return { status: 200, message: "Berhasil dihapus" };
+}
diff --git a/src/app_modules/forum/fun/edit/fun_edit_posting_by_id.ts b/src/app_modules/forum/fun/edit/fun_edit_posting_by_id.ts
new file mode 100644
index 00000000..90341f54
--- /dev/null
+++ b/src/app_modules/forum/fun/edit/fun_edit_posting_by_id.ts
@@ -0,0 +1,22 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { revalidatePath } from "next/cache";
+
+export async function forum_funEditPostingById(
+ postingId: string,
+ diskusi: string
+) {
+ const updt = await prisma.forum_Posting.update({
+ where: {
+ id: postingId,
+ },
+ data: {
+ diskusi: diskusi,
+ },
+ });
+
+ if (!updt) return { status: 400, message: "Gagal update" };
+ revalidatePath("/dev/forum/main");
+ return { status: 200, message: "Berhasil update" };
+}
diff --git a/src/app_modules/forum/fun/edit/fun_edit_status_posting_by_id.ts b/src/app_modules/forum/fun/edit/fun_edit_status_posting_by_id.ts
new file mode 100644
index 00000000..38645743
--- /dev/null
+++ b/src/app_modules/forum/fun/edit/fun_edit_status_posting_by_id.ts
@@ -0,0 +1,24 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { revalidatePath } from "next/cache";
+
+export async function forum_funEditStatusPostingById(
+ postingId: string,
+ statusId: number
+) {
+ const updt = await prisma.forum_Posting.update({
+ where: {
+ id: postingId,
+ },
+ data: {
+ forumMaster_StatusPostingId: statusId,
+ },
+ });
+
+ if (!updt) return { status: 400, message: "Gagal update posting" };
+ revalidatePath("/dev/forum/main");
+ revalidatePath("/dev/forum/detail");
+ revalidatePath("/dev/forum/forumku");
+ return { status: 200, message: "Berhasil update posting" };
+}
diff --git a/src/app_modules/forum/fun/get/get_komentar_by_id.ts b/src/app_modules/forum/fun/get/get_komentar_by_id.ts
new file mode 100644
index 00000000..c60c6440
--- /dev/null
+++ b/src/app_modules/forum/fun/get/get_komentar_by_id.ts
@@ -0,0 +1,35 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+
+export async function forum_getKomentarById(postingId: string) {
+ const data = await prisma.forum_Komentar.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ forum_PostingId: postingId,
+ isActive: true,
+ },
+ select: {
+ id: true,
+ isActive: true,
+ komentar: true,
+ createdAt: true,
+ Author: {
+ select: {
+ id: true,
+ Profile: {
+ select: {
+ name: true,
+ imagesId: true,
+ },
+ },
+ },
+ },
+ authorId: true,
+ },
+ });
+
+ return data;
+}
diff --git a/src/app_modules/forum/fun/get/get_list_all_posting.ts b/src/app_modules/forum/fun/get/get_list_all_posting.ts
new file mode 100644
index 00000000..ef74e498
--- /dev/null
+++ b/src/app_modules/forum/fun/get/get_list_all_posting.ts
@@ -0,0 +1,54 @@
+"use server";
+
+import _ from "lodash";
+import prisma from "@/app/lib/prisma";
+import { forum_countOneTotalKomentarById } from "../count/count_one_total_komentar_by_id";
+import { forum_countTotalKomenById } from "../count/count_total_komentar_by_id";
+
+export async function forum_getListAllPosting() {
+ const get = await prisma.forum_Posting.findMany({
+ orderBy: [
+ // {
+ // forumMaster_StatusPostingId: "asc",
+ // },
+ {
+ createdAt: "desc",
+ },
+ ],
+ where: {
+ isActive: true,
+ // forumMaster_StatusPostingId: 1
+ },
+ select: {
+ id: true,
+ diskusi: true,
+ createdAt: true,
+ isActive: true,
+ authorId: true,
+ Author: {
+ select: {
+ id: true,
+ Profile: true,
+ },
+ },
+ Forum_Komentar: {
+ where: {
+ isActive: true,
+ },
+ },
+ ForumMaster_StatusPosting: true,
+ // _count: {
+ // select: {
+ // Forum_Komentar: true,
+ // },
+ // },
+ },
+ });
+
+ const data = get.map((val) => ({
+ ..._.omit(val, ["Forum_Komentar"]),
+ _count: val.Forum_Komentar.length,
+ }));
+
+ return data;
+}
diff --git a/src/app_modules/forum/fun/get/get_list_posting_by_author_id.ts b/src/app_modules/forum/fun/get/get_list_posting_by_author_id.ts
new file mode 100644
index 00000000..938c6699
--- /dev/null
+++ b/src/app_modules/forum/fun/get/get_list_posting_by_author_id.ts
@@ -0,0 +1,43 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
+import _ from "lodash";
+
+export async function forum_getListPostingByAuhtorId(authorId: string) {
+ const get = await prisma.forum_Posting.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ authorId: authorId,
+ isActive: true,
+ },
+ select: {
+ id: true,
+ diskusi: true,
+ createdAt: true,
+ isActive: true,
+ authorId: true,
+ Author: {
+ select: {
+ id: true,
+ Profile: true,
+ },
+ },
+ Forum_Komentar: {
+ where: {
+ isActive: true,
+ },
+ },
+ ForumMaster_StatusPosting: true
+ },
+ });
+
+ const data = get.map((val) => ({
+ ..._.omit(val, ["Forum_Komentar"]),
+ _count: val.Forum_Komentar.length,
+ }));
+
+ return data;
+}
diff --git a/src/app_modules/forum/fun/get/get_one_posting_by_id.ts b/src/app_modules/forum/fun/get/get_one_posting_by_id.ts
new file mode 100644
index 00000000..b71a649d
--- /dev/null
+++ b/src/app_modules/forum/fun/get/get_one_posting_by_id.ts
@@ -0,0 +1,34 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+
+export async function forum_getOnePostingById(postingId: string) {
+ const data = await prisma.forum_Posting.findFirst({
+ where: {
+ id: postingId,
+ },
+ select: {
+ id: true,
+ diskusi: true,
+ isActive: true,
+ createdAt: true,
+ authorId: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: true,
+ },
+ },
+ _count: {
+ select: {
+ Forum_Komentar: true,
+ },
+ },
+ ForumMaster_StatusPosting: true
+
+ },
+ });
+
+ return data;
+}
diff --git a/src/app_modules/forum/fun/master/get_master_kategori_report.ts b/src/app_modules/forum/fun/master/get_master_kategori_report.ts
new file mode 100644
index 00000000..50c0acc7
--- /dev/null
+++ b/src/app_modules/forum/fun/master/get_master_kategori_report.ts
@@ -0,0 +1,11 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+
+export async function forum_getMasterKategoriReport() {
+ const data = await prisma.forumMaster_KategoriReport.findMany({});
+
+ const changeType = JSON.stringify(data, null,2)
+
+ return data;
+}
diff --git a/src/app_modules/forum/fun/search/fun_search_list_posting.ts b/src/app_modules/forum/fun/search/fun_search_list_posting.ts
new file mode 100644
index 00000000..42a2e4da
--- /dev/null
+++ b/src/app_modules/forum/fun/search/fun_search_list_posting.ts
@@ -0,0 +1,50 @@
+"use server"
+
+import prisma from "@/app/lib/prisma";
+import _ from "lodash"
+
+export async function forum_funSearchListPosting(text:string) {
+ const get = await prisma.forum_Posting.findMany({
+ orderBy: [
+ // {
+ // forumMaster_StatusPostingId: "asc",
+ // },
+ {
+ createdAt: "desc",
+ },
+ ],
+ take: 10,
+ where: {
+ diskusi: {
+ contains: text,
+ mode: "insensitive",
+ },
+ },
+ select: {
+ id: true,
+ diskusi: true,
+ createdAt: true,
+ isActive: true,
+ authorId: true,
+ Author: {
+ select: {
+ id: true,
+ Profile: true,
+ },
+ },
+ Forum_Komentar: {
+ where: {
+ isActive: true,
+ },
+ },
+ ForumMaster_StatusPosting: true,
+ },
+ });
+
+ const data = get.map((val) => ({
+ ..._.omit(val, ["Forum_Komentar"]),
+ _count: val.Forum_Komentar.length,
+ }));
+
+ return data;
+}
\ No newline at end of file
diff --git a/src/app_modules/forum/global_state/index.tsx b/src/app_modules/forum/global_state/index.tsx
new file mode 100644
index 00000000..21fb9bad
--- /dev/null
+++ b/src/app_modules/forum/global_state/index.tsx
@@ -0,0 +1,4 @@
+import { atomWithStorage } from "jotai/utils";
+
+export const gs_forum_loading_edit_posting = atomWithStorage("gs_forum_loading_edit_posting", false)
+export const gs_forum_total_komentar = atomWithStorage("gs_forum_total_komentar", 0);
\ No newline at end of file
diff --git a/src/app_modules/forum/index.ts b/src/app_modules/forum/index.ts
new file mode 100644
index 00000000..45d85403
--- /dev/null
+++ b/src/app_modules/forum/index.ts
@@ -0,0 +1,45 @@
+import Forum_Splash from "./splash";
+import Forum_Beranda from "./main/beranda";
+import LayoutForum_Main from "./main/layout";
+import Forum_Forumku from "./forumku";
+import Forum_Create from "./create";
+import LayoutForum_Create from "./create/layout";
+import LayoutForum_Forumku from "./forumku/layout";
+import Forum_Detail from "./detail";
+import LayoutForum_Detail from "./detail/layout";
+import Forum_Komentar from "./komentar";
+import LayoutForum_Komentar from "./komentar/layout";
+import Forum_EditPosting from "./edit/posting";
+import LayoutForum_EditPosting from "./edit/posting/layout";
+import Forum_ReportPosting from "./report/posting";
+import LayoutForum_ReportPosting from "./report/posting/layout";
+import Forum_EditKomentar from "./edit/komentar";
+import LayoutForum_EditKomentar from "./edit/komentar/layout";
+import Forum_ReportKomentar from "./report/komentar";
+import LayoutForum_ReportKomentar from "./report/komentar/layout";
+import Forum_ReportPostingLainnya from "./report/posting/lainnya";
+import Forum_ReportKomentarLainnya from "./report/komentar/lainnya";
+
+export {
+ Forum_Splash,
+ Forum_Beranda,
+ LayoutForum_Main,
+ Forum_Forumku,
+ Forum_Create,
+ LayoutForum_Create,
+ LayoutForum_Forumku,
+ Forum_Detail,
+ LayoutForum_Detail,
+ Forum_Komentar,
+ LayoutForum_Komentar,
+ Forum_EditPosting,
+ LayoutForum_EditPosting,
+ Forum_ReportPosting,
+ LayoutForum_ReportPosting,
+ Forum_EditKomentar,
+ LayoutForum_EditKomentar as LaoyoutForum_EditKomentar,
+ Forum_ReportKomentar,
+ LayoutForum_ReportKomentar,
+ Forum_ReportPostingLainnya,
+ Forum_ReportKomentarLainnya,
+};
diff --git a/src/app_modules/forum/komentar/index.tsx b/src/app_modules/forum/komentar/index.tsx
new file mode 100644
index 00000000..53de8108
--- /dev/null
+++ b/src/app_modules/forum/komentar/index.tsx
@@ -0,0 +1,118 @@
+"use client";
+
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import {
+ ActionIcon,
+ Button,
+ Card,
+ Group,
+ Paper,
+ Stack,
+ Text,
+} from "@mantine/core";
+import ComponentForum_PostingAuthorNameOnHeader from "../component/header/posting_author_header_name";
+
+import dynamic from "next/dynamic";
+import React, { useState } from "react";
+const ReactQuill = dynamic(
+ () => {
+ return import("react-quill");
+ },
+ { ssr: false }
+);
+import "react-quill/dist/quill.bubble.css";
+import { IconPhotoUp } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { MODEL_FORUM_POSTING } from "../model/interface";
+import { forum_funCreateKomentar } from "../fun/create/fun_create_komentar";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+
+export default function Forum_Komentar({
+ dataPosting,
+ userLoginId,
+}: {
+ dataPosting: MODEL_FORUM_POSTING;
+ userLoginId: any
+}) {
+ return (
+ <>
+
+
+
+ {/* {JSON.stringify(dataPosting, null, 2)} */}
+
+
+
+
+
+ {dataPosting?.diskusi ? (
+
+ ) : (
+ ""
+ )}
+
+
+
+
+
+
+ >
+ );
+}
+
+function CreateKomentar({ postingId }: { postingId: string }) {
+ const router = useRouter();
+ const [value, setValue] = useState("");
+ const [loading, setLoading] = useState(false);
+
+ async function onComment() {
+ await forum_funCreateKomentar(postingId, value).then((res) => {
+ if (res.status === 201) {
+ setLoading(true);
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ router.replace(RouterForum.main_detail + postingId, { scroll: false });
+ router.refresh();
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+
+ return (
+ <>
+
+
+ {
+ setValue(val);
+ }}
+ />
+
+
+ onComment()}
+ >
+ Balas
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/komentar/layout.tsx b/src/app_modules/forum/komentar/layout.tsx
new file mode 100644
index 00000000..082fcc62
--- /dev/null
+++ b/src/app_modules/forum/komentar/layout.tsx
@@ -0,0 +1,46 @@
+"use client";
+
+import {
+ ActionIcon,
+ AppShell,
+ Button,
+ Group,
+ Header,
+ Title,
+} from "@mantine/core";
+import { IconChevronLeft } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import React from "react";
+import ComponentForum_HeaderTamplate from "../component/header/header_tamplate";
+
+export default function LayoutForum_Komentar({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ const router = useRouter();
+ return (
+ <>
+
+
+ {
+ router.back();
+ }}
+ >
+
+
+ Komentar
+
+
+ }
+ // header={}
+ >
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/main/beranda.tsx b/src/app_modules/forum/main/beranda.tsx
new file mode 100644
index 00000000..ce1d6cc6
--- /dev/null
+++ b/src/app_modules/forum/main/beranda.tsx
@@ -0,0 +1,118 @@
+"use client";
+
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
+import {
+ Affix,
+ rem,
+ ActionIcon,
+ Card,
+ CardSection,
+ Text,
+ Stack,
+ Divider,
+ Group,
+ Box,
+ TextInput,
+ Center,
+} from "@mantine/core";
+import { useShallowEffect, useTimeout, useWindowScroll } from "@mantine/hooks";
+import {
+ IconCirclePlus,
+ IconMessageCircle,
+ IconPencilPlus,
+ IconSearch,
+ IconSearchOff,
+} from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import ComponentForum_PostingAuthorNameOnHeader from "../component/header/posting_author_header_name";
+import { useState } from "react";
+import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
+import { useAtom } from "jotai";
+import { gs_forum_loading_edit_posting } from "../global_state";
+import { MODEL_FORUM_POSTING } from "../model/interface";
+import ComponentForum_MainCardView from "../component/main_card_view";
+import { forum_getListAllPosting } from "../fun/get/get_list_all_posting";
+import { forum_funSearchListPosting } from "../fun/search/fun_search_list_posting";
+import _ from "lodash";
+
+export default function Forum_Beranda({
+ listForum,
+ userLoginId,
+}: {
+ listForum: MODEL_FORUM_POSTING[];
+ userLoginId: string;
+}) {
+ const router = useRouter();
+ const [data, setData] = useState(listForum);
+ const [scroll, scrollTo] = useWindowScroll();
+
+ const [loadingCreate, setLoadingCreate] = useState(false);
+ const [loadingKomen, setLoadingKomen] = useState(false);
+ const [loadingDetail, setLoadingDetail] = useState(false);
+
+ if (loadingDetail) return ;
+ if (loadingKomen) return ;
+
+ async function onSearch(text: string) {
+ await forum_funSearchListPosting(text).then((res: any) => {
+ setData(res);
+ });
+ }
+
+ return (
+ <>
+ {/* {JSON.stringify(listForum, null, 2)} */}
+
+ 0 ? 0.5 : ""}
+ style={{
+ transition: "0.5s",
+ }}
+ size={"xl"}
+ radius={"xl"}
+ variant="transparent"
+ bg={"blue"}
+ onClick={() => {
+ setLoadingCreate(true);
+ router.push(RouterForum.create);
+ }}
+ >
+
+
+
+
+
+ {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ {_.isEmpty(data) ? (
+
+
+
+
+ Forum tidak ditemukan
+
+
+ Coba masukan kata yang bebeda
+
+
+
+ ) : (
+
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/main/layout.tsx b/src/app_modules/forum/main/layout.tsx
new file mode 100644
index 00000000..1bddab02
--- /dev/null
+++ b/src/app_modules/forum/main/layout.tsx
@@ -0,0 +1,137 @@
+"use client";
+
+import {
+ ActionIcon,
+ AppShell,
+ Avatar,
+ Center,
+ Footer,
+ Grid,
+ Group,
+ Header,
+ Stack,
+ Text,
+ Title,
+} from "@mantine/core";
+import React, { useState } from "react";
+import ComponentForum_HeaderTamplate from "../component/header/header_tamplate";
+import { RouterHome } from "@/app/lib/router_hipmi/router_home";
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { IconChevronLeft, IconCircle, IconHome } from "@tabler/icons-react";
+import router from "next/router";
+import { useRouter } from "next/navigation";
+import { title } from "process";
+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";
+
+export default function LayoutForum_Main({
+ children,
+ dataAuthor,
+}: {
+ children: React.ReactNode;
+ dataAuthor: MODEL_USER;
+}) {
+ const router = useRouter();
+ const [hotMenu, setHotMenu] = useState(1);
+ const [loading, setLoading] = useState(false);
+
+ if (loading) return ;
+
+ const listFooter = [
+ {
+ id: 1,
+ name: "Beranda",
+ path: RouterForum.beranda,
+ icon: ,
+ },
+
+ {
+ id: 2,
+ name: "ForumKu",
+ path: RouterForum.forumku,
+ icon: ,
+ },
+ ];
+
+ return (
+ <>
+
+
+ {
+ setLoading(true);
+ return router.push(RouterHome.main_home);
+ }}
+ >
+
+
+
+ Forum
+ {
+ setLoading(true);
+ router.push(RouterForum.forumku + dataAuthor?.id);
+ }}
+ >
+
+
+
+
+ }
+
+ // footer={
+ //
+ // }
+ >
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/model/interface.tsx b/src/app_modules/forum/model/interface.tsx
new file mode 100644
index 00000000..530d7d67
--- /dev/null
+++ b/src/app_modules/forum/model/interface.tsx
@@ -0,0 +1,56 @@
+import { MODEL_USER } from "@/app_modules/home/model/interface";
+
+export interface MODEL_FORUM_POSTING {
+ id: string;
+ isActive: boolean;
+ createdAt: Date;
+ updatedAt: Date;
+ publishAt: Date;
+ diskusi: string;
+ authorId: string;
+ Author: MODEL_USER;
+ _count: number;
+ Forum_Komentar: MODEL_FORUM_KOMENTAR[];
+ Forum_ReportPosting: MODEL_FORUM_MASTER_REPORT[];
+ ForumMaster_StatusPosting: MODEL_FORUM_MASTER_STATUS;
+}
+
+export interface MODEL_FORUM_KOMENTAR {
+ id: string;
+ isActive: boolean;
+ createdAt: Date;
+ updatedAt: Date;
+ komentar: string;
+ forum_PostingId: string;
+ authorId: string;
+ Author: MODEL_USER;
+ Forum_ReportKomentar: MODEL_FORUM_MASTER_REPORT[];
+}
+
+export interface MODEL_FORUM_MASTER_REPORT {
+ id: string;
+ isActive: boolean;
+ createdAt: Date;
+ updatedAt: Date;
+ title: string;
+ deskripsi: string;
+}
+
+export interface MODEL_FORUM_MASTER_STATUS {
+ id: string;
+ isActive: boolean;
+ createdAt: Date;
+ updatedAt: Date;
+ status: string;
+}
+
+export interface MODEL_FORUM_REPORT {
+ id: string;
+ isActive: boolean;
+ createdAt: Date;
+ updatedAt: Date;
+ deskripsi: string;
+ ForumMaster_KategoriReport: MODEL_FORUM_MASTER_REPORT;
+ forumMaster_KategoriReportId: string;
+ User: MODEL_USER;
+}
diff --git a/src/app_modules/forum/report/komentar/index.tsx b/src/app_modules/forum/report/komentar/index.tsx
new file mode 100644
index 00000000..2cc2fe7d
--- /dev/null
+++ b/src/app_modules/forum/report/komentar/index.tsx
@@ -0,0 +1,88 @@
+"use client";
+
+import { Box, Button, Paper, Radio, Stack, Text, Title } from "@mantine/core";
+import { MODEL_FORUM_MASTER_REPORT } from "../../model/interface";
+import { useState } from "react";
+import { forum_funCreateReportPosting } from "../../fun/create/fun_create_report_posting";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { useRouter } from "next/navigation";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { forum_funCreateReportKomentar } from "../../fun/create/fun_create_report_komentar";
+
+export default function Forum_ReportKomentar({
+ komentarId,
+ listReport,
+}: {
+ komentarId: string;
+ listReport: MODEL_FORUM_MASTER_REPORT[];
+}) {
+ const [reportValue, setReportValue] = useState("Kebencian");
+
+ return (
+ <>
+
+
+
+ {listReport.map((e) => (
+
+ {e.title}}
+ />
+ {e.deskripsi}
+
+ ))}
+
+
+
+
+ >
+ );
+}
+
+function ButtonAction({
+ value,
+ komentarId,
+}: {
+ value: string;
+ komentarId: string;
+}) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ async function onReport() {
+ await forum_funCreateReportKomentar(komentarId, value).then((res) => {
+ if (res.status === 201) {
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ setLoading(true);
+ router.back();
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+ return (
+ <>
+
+
+ router.replace(RouterForum.report_komentar_lainnya + komentarId)
+ }
+ >
+ Lainnya
+
+ onReport()}
+ >
+ Report
+
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/report/komentar/lainnya.tsx b/src/app_modules/forum/report/komentar/lainnya.tsx
new file mode 100644
index 00000000..a25ae24f
--- /dev/null
+++ b/src/app_modules/forum/report/komentar/lainnya.tsx
@@ -0,0 +1,70 @@
+"use client";
+
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { Button, Group, Stack, Textarea } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { forum_funCreateReportPosting } from "../../fun/create/fun_create_report_posting";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+import { forum_funCreateReportPostingLainnya } from "../../fun/create/fun_create_report_posting_lainnya";
+import { forum_funCreateReportKomentarLainnya } from "../../fun/create/fun_create_report_komentar_lainnya";
+
+export default function Forum_ReportKomentarLainnya({ komentarId }: { komentarId: string }) {
+ const [deskripsi, setDeskripsi] = useState("");
+ return (
+ <>
+
+
+ >
+ );
+}
+
+function ButtonAction({
+ komentarId,
+ deskripsi,
+}: {
+ komentarId: string;
+ deskripsi: string;
+}) {
+ const router = useRouter();
+
+ async function onReport() {
+ await forum_funCreateReportKomentarLainnya(komentarId, deskripsi).then(
+ (res) => {
+ if (res.status === 201) {
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ router.back();
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ }
+ );
+ }
+ return (
+ <>
+
+
+ router.replace(RouterForum.report_komentar + komentarId)
+ }
+ >
+ Batal
+
+ onReport()}>
+ Report
+
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/report/komentar/layout.tsx b/src/app_modules/forum/report/komentar/layout.tsx
new file mode 100644
index 00000000..2a9c3d91
--- /dev/null
+++ b/src/app_modules/forum/report/komentar/layout.tsx
@@ -0,0 +1,26 @@
+"use client";
+
+import { ActionIcon, AppShell, Group, Header, Title } from "@mantine/core";
+import React from "react";
+import ComponentForum_HeaderTamplate from "../../component/header/header_tamplate";
+import { IconChevronLeft, IconX } from "@tabler/icons-react";
+import router from "next/router";
+import ComponentForum_HeaderRataKiri from "../../component/header/header_rata_kiri";
+
+export default function LayoutForum_ReportKomentar({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+
+ }
+ >
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/report/posting/index.tsx b/src/app_modules/forum/report/posting/index.tsx
new file mode 100644
index 00000000..03c6fcf6
--- /dev/null
+++ b/src/app_modules/forum/report/posting/index.tsx
@@ -0,0 +1,85 @@
+"use client";
+
+import { Box, Button, Paper, Radio, Stack, Text, Title } from "@mantine/core";
+import { MODEL_FORUM_MASTER_REPORT } from "../../model/interface";
+import { useState } from "react";
+import { forum_funCreateReportPosting } from "../../fun/create/fun_create_report_posting";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { useRouter } from "next/navigation";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+
+export default function Forum_ReportPosting({
+ postingId,
+ listReport,
+}: {
+ postingId: string;
+ listReport: MODEL_FORUM_MASTER_REPORT[];
+}) {
+ const [reportValue, setReportValue] = useState("Kebencian");
+
+ return (
+ <>
+
+
+
+ {listReport.map((e) => (
+
+ {e.title}}
+ />
+ {e.deskripsi}
+
+ ))}
+
+
+
+
+ >
+ );
+}
+
+function ButtonAction({
+ value,
+ postingId,
+}: {
+ value: string;
+ postingId: string;
+}) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ async function onReport() {
+ await forum_funCreateReportPosting(postingId, value).then((res) => {
+ if (res.status === 201) {
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ setLoading(true);
+ router.back();
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+ return (
+ <>
+
+ router.replace(RouterForum.report_posting_lainnya + postingId)}
+ >
+ Lainnya
+
+ onReport()}
+ >
+ Report
+
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/report/posting/lainnya.tsx b/src/app_modules/forum/report/posting/lainnya.tsx
new file mode 100644
index 00000000..edf02177
--- /dev/null
+++ b/src/app_modules/forum/report/posting/lainnya.tsx
@@ -0,0 +1,71 @@
+"use client";
+
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { Button, Group, Stack, Textarea } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { forum_funCreateReportPosting } from "../../fun/create/fun_create_report_posting";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+import { forum_funCreateReportPostingLainnya } from "../../fun/create/fun_create_report_posting_lainnya";
+
+export default function Forum_ReportPostingLainnya({
+ postingIg,
+}: {
+ postingIg: string;
+}) {
+ const [deskripsi, setDeskripsi] = useState("");
+ return (
+ <>
+
+
+ >
+ );
+}
+
+function ButtonAction({
+ postingIg,
+ deskripsi,
+}: {
+ postingIg: string;
+ deskripsi: string;
+}) {
+ const router = useRouter();
+
+ async function onReport() {
+ await forum_funCreateReportPostingLainnya(postingIg, deskripsi).then(
+ (res) => {
+ if (res.status === 201) {
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ router.back();
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ }
+ );
+ }
+ return (
+ <>
+
+ router.replace(RouterForum.report_posting + postingIg)}
+ >
+ Batal
+
+ onReport()}>
+ Report
+
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/report/posting/layout.tsx b/src/app_modules/forum/report/posting/layout.tsx
new file mode 100644
index 00000000..f970ce98
--- /dev/null
+++ b/src/app_modules/forum/report/posting/layout.tsx
@@ -0,0 +1,26 @@
+"use client";
+
+import { ActionIcon, AppShell, Group, Header, Title } from "@mantine/core";
+import React from "react";
+import ComponentForum_HeaderTamplate from "../../component/header/header_tamplate";
+import { IconChevronLeft, IconX } from "@tabler/icons-react";
+import router from "next/router";
+import ComponentForum_HeaderRataKiri from "../../component/header/header_rata_kiri";
+
+export default function LayoutForum_ReportPosting({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+
+ }
+ >
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/splash/index.tsx b/src/app_modules/forum/splash/index.tsx
new file mode 100644
index 00000000..2d9e1281
--- /dev/null
+++ b/src/app_modules/forum/splash/index.tsx
@@ -0,0 +1,27 @@
+"use client";
+
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { Center, Image, Paper } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useRouter } from "next/navigation";
+
+export default function Forum_Splash() {
+const router = useRouter()
+ useShallowEffect(() => {
+ setTimeout(() => {
+ // setHotMenu(1);
+ // setStatus("Publish");
+ router.replace(RouterForum.beranda);
+ }, 2000);
+ }, []);
+
+ return (
+ <>
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/fun_global/get_user_token.ts b/src/app_modules/fun_global/get_user_token.ts
index ed8e890f..82f54dd1 100644
--- a/src/app_modules/fun_global/get_user_token.ts
+++ b/src/app_modules/fun_global/get_user_token.ts
@@ -5,11 +5,13 @@ import yaml from "yaml";
import fs from "fs";
import { unsealData } from "iron-session";
import { redirect } from "next/navigation";
+import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
export async function User_getUserId() {
const c = cookies().get("ssn");
- if (!c?.value) return redirect("/dev/auth/login");
+ if (!c?.value || c.value === "") return redirect(RouterAuth.login);
+
const token = JSON.parse(
await unsealData(c?.value as string, {
diff --git a/src/app_modules/home/fun/get/get_one_user_by_id.ts b/src/app_modules/home/fun/get/get_one_user_by_id.ts
index 1ceddd3a..132fb4a0 100644
--- a/src/app_modules/home/fun/get/get_one_user_by_id.ts
+++ b/src/app_modules/home/fun/get/get_one_user_by_id.ts
@@ -2,13 +2,14 @@
import prisma from "@/app/lib/prisma";
-export async function User_getOneById(userId: string) {
+export async function user_getOneById(userId: string) {
const data = await prisma.user.findFirst({
where: {
id: userId,
},
select: {
id: true,
+ username: true,
Profile: true,
},
});
diff --git a/src/app_modules/home/layout.tsx b/src/app_modules/home/layout.tsx
index 0ad27c8c..e0ab35e9 100644
--- a/src/app_modules/home/layout.tsx
+++ b/src/app_modules/home/layout.tsx
@@ -9,6 +9,7 @@ import {
Grid,
Group,
Header,
+ Loader,
SimpleGrid,
Stack,
Text,
@@ -39,6 +40,8 @@ export default function HomeLayout({
}) {
const router = useRouter();
const [user, setUser] = useState(dataUser);
+ const [loading, setLoading] = useState(false);
+ const [loadingUS, setLoadingUS] = useState(false);
const listFooter = [
{
id: 1,
@@ -68,6 +71,7 @@ export default function HomeLayout({
HIPMI
+ {/* */}
{/*
@@ -85,23 +89,31 @@ export default function HomeLayout({
if (user?.Profile === null) {
ComponentGlobal_NotifikasiPeringatan("Lengkapi Profile");
} else {
+ setLoadingUS(true);
// router.push(RouterProfile.katalog + `${user.Profile.id}`);
router.push(RouterUserSearch.main);
}
}}
>
-
-
-
-
-
- Temukan pengguna
-
-
+ {loadingUS ? (
+
+
+
+ ) : (
+
+
+
+
+
+ Temukan pengguna
+
+
+ )}
{
+ setLoading(true);
if (user?.Profile === null) {
router.push(RouterProfile.create + `${user.id}`);
} else {
@@ -109,30 +121,36 @@ export default function HomeLayout({
}
}}
>
-
-
- {user?.Profile === null ? (
-
- ) : (
-
- )}
-
-
- Profile
-
-
+ {loading ? (
+
+
+
+ ) : (
+
+
+ {user?.Profile === null ? (
+
+ ) : (
+
+ )}
+
+
+ Profile
+
+
+ )}
diff --git a/src/app_modules/home/view.tsx b/src/app_modules/home/view.tsx
index ac100e7d..43f3bba8 100644
--- a/src/app_modules/home/view.tsx
+++ b/src/app_modules/home/view.tsx
@@ -7,6 +7,7 @@ import {
Flex,
Image,
Loader,
+ LoadingOverlay,
Paper,
SimpleGrid,
Text,
@@ -35,18 +36,26 @@ import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
import { MODEL_USER } from "./model/interface";
import { ComponentGlobal_NotifikasiPeringatan } from "../component_global/notif_global/notifikasi_peringatan";
import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { useState } from "react";
+import { useDisclosure } from "@mantine/hooks";
+import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import ComponentGlobal_V2_LoadingPage from "../component_global/loading_page_v2";
+import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
export default function HomeView({ dataUser }: { dataUser: MODEL_USER }) {
const router = useRouter();
// const [stateUser, setStateUser] = useState(user);
+ const [loading, setLoading] = useState(false);
+ const [visible, { toggle }] = useDisclosure(false);
const listHalaman = [
{
id: 1,
- name: "Crowd Funding",
- icon: ,
- link: `/dev/crowd/splash`,
+ name: "Forums",
+ icon: ,
+ link: RouterForum.splash,
},
+
{
id: 2,
name: "Event",
@@ -55,48 +64,50 @@ export default function HomeView({ dataUser }: { dataUser: MODEL_USER }) {
},
{
id: 3,
+ name: "Business Maps",
+ icon: ,
+ link: "",
+ },
+ {
+ id: 4,
name: "Voting",
icon: ,
link: RouterVote.splash,
},
{
- id: 4,
+ id: 5,
+ name: "Project Collaboration",
+ icon: ,
+ link: RouterColab.splash,
+ },
+ {
+ id: 6,
+ name: "Crowd Funding",
+ icon: ,
+ link: `/dev/crowd/splash`,
+ },
+ {
+ id: 7,
name: "Job Vacancy",
icon: ,
link: RouterJob.spalsh,
},
{
- id: 5,
- name: "Forums",
- icon: ,
- link: "",
- },
- {
- id: 6,
+ id: 8,
name: "Marketplace",
icon: ,
link: "",
},
- {
- id: 7,
- name: "Project Collaboration",
- icon: ,
- link: "",
- },
- {
- id: 8,
- name: "Business Maps",
- icon: ,
- link: "",
- },
];
return (
<>
+ {visible ? : ""}
+
-
+
{/* {JSON.stringify(stateUser, null, 2)} */}
@@ -127,6 +138,7 @@ export default function HomeView({ dataUser }: { dataUser: MODEL_USER }) {
"Cooming Soon !!"
);
} else {
+ toggle();
return router.push(e.link);
}
}
diff --git a/src/app_modules/katalog/portofolio/fun/fun_create_portofolio.ts b/src/app_modules/katalog/portofolio/fun/fun_create_portofolio.ts
index 2706f4c5..fab639b5 100644
--- a/src/app_modules/katalog/portofolio/fun/fun_create_portofolio.ts
+++ b/src/app_modules/katalog/portofolio/fun/fun_create_portofolio.ts
@@ -37,6 +37,7 @@ export default async function funCreatePortofolio(
const createProto = await prisma.portofolio.create({
data: {
profileId: profileId,
+ id_Portofolio: "Porto" + Date.now().toString(),
namaBisnis: data.namaBisnis,
deskripsi: data.deskripsi,
tlpn: data.tlpn,
diff --git a/src/app_modules/katalog/profile/create/layout.tsx b/src/app_modules/katalog/profile/create/layout.tsx
index 548ac59d..658adcf6 100644
--- a/src/app_modules/katalog/profile/create/layout.tsx
+++ b/src/app_modules/katalog/profile/create/layout.tsx
@@ -1,5 +1,6 @@
"use client";
+import ComponentGlobal_HeaderTamplate from "@/app_modules/component_global/header_tamplate";
import {
ActionIcon,
AppShell,
@@ -18,15 +19,16 @@ export default function ProfileLayout({ children }: { children: any }) {
-
- router.push("/dev/home")}>
-
-
- Create Profile
-
-
-
+ //
+ //
+ // router.push("/dev/home")}>
+ //
+ //
+ // Create Profile
+ //
+ //
+ //
+
}
>
{children}
diff --git a/src/app_modules/katalog/profile/create/view.tsx b/src/app_modules/katalog/profile/create/view.tsx
index c3e0ef02..e68ddd6c 100644
--- a/src/app_modules/katalog/profile/create/view.tsx
+++ b/src/app_modules/katalog/profile/create/view.tsx
@@ -14,6 +14,7 @@ import {
Paper,
Select,
Stack,
+ Text,
TextInput,
} from "@mantine/core";
import { useAtom } from "jotai";
@@ -22,7 +23,7 @@ import { useRouter } from "next/navigation";
import { useState } from "react";
import toast from "react-simple-toasts";
import funCreateNewProfile from "../fun/fun_create_profile";
-import { IconCamera } from "@tabler/icons-react";
+import { IconAt, IconCamera, IconUpload } from "@tabler/icons-react";
import ComponentKatalog_NotedBox from "../../component/noted_box";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
import { MODEL_PROFILE } from "../model/interface";
@@ -31,9 +32,9 @@ import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_glob
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
+import { useForm } from "@mantine/form";
export default function CreateProfile({ userId }: { userId: any }) {
- const router = useRouter();
const [filePP, setFilePP] = useState(null);
const [imgPP, setImgPP] = useState();
const [fileBG, setFileBG] = useState(null);
@@ -53,16 +54,32 @@ export default function CreateProfile({ userId }: { userId: any }) {
-
+ {imgPP ? (
+
+
+
+ ) : (
+
+
+
+ )}
1000000) {
+ ComponentGlobal_NotifikasiPeringatan(
+ "Maaf, Ukuran file terlalu besar, maximum 1mb",
+ 3000
+ );
+ } else {
+ setImgPP(buffer);
+ setFilePP(files);
+ }
// console.log(buffer, "ini buffer");
// console.log(files, " ini file");
- setImgPP(buffer);
- setFilePP(files);
} catch (error) {
console.log(error);
}
@@ -104,13 +128,25 @@ export default function CreateProfile({ userId }: { userId: any }) {
-
+ {imgBG ? (
+
+ ) : (
+
+
+
+ Upload Background
+
+
+ )}
@@ -121,10 +157,17 @@ export default function CreateProfile({ userId }: { userId: any }) {
const buffer = URL.createObjectURL(
new Blob([new Uint8Array(await files.arrayBuffer())])
);
+ if (files.size > 1000000) {
+ ComponentGlobal_NotifikasiPeringatan(
+ "Maaf, Ukuran file terlalu besar, maximum 1mb",
+ 3000
+ );
+ } else {
+ setImgBG(buffer);
+ setFileBG(files);
+ }
// console.log(buffer, "ini buffer");
// console.log(files, " ini file");
- setImgBG(buffer);
- setFileBG(files);
} catch (error) {
console.log(error);
}
@@ -148,96 +191,139 @@ export default function CreateProfile({ userId }: { userId: any }) {
- {
- setValue({
- ...value,
- name: val.target.value,
- });
- }}
- />
- {
- setValue({
- ...value,
- email: val.target.value,
- });
- }}
- />
- {
- setValue({
- ...value,
- alamat: val.target.value,
- });
- }}
- />
-
>
);
}
-async function onSubmit(
- router: AppRouterInstance,
- value: MODEL_PROFILE,
- userId: string,
- filePP: FormData,
- fileBg: FormData
-) {
- const body = {
- userId: userId,
- name: value.name,
- email: value.email,
- alamat: value.alamat,
- jenisKelamin: value.jenisKelamin,
- };
- if(_.values(body).includes("")) return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data")
+function ButtonAction({
+ value,
+ userId,
+ filePP,
+ fileBg,
+}: {
+ value: MODEL_PROFILE;
+ userId: string;
+ filePP: FormData;
+ fileBg: FormData;
+}) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
- const gambarPP = new FormData();
- gambarPP.append("filePP", filePP as any);
+ async function onSubmit() {
+ const body = {
+ userId: userId,
+ name: value.name,
+ email: value.email,
+ alamat: value.alamat,
+ jenisKelamin: value.jenisKelamin,
+ };
+ if (_.values(body).includes(""))
+ return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
+ if (!body.email.includes("@"))
+ return ComponentGlobal_NotifikasiPeringatan("Invalid Email");
- const gambarBG = new FormData();
- gambarBG.append("fileBG", fileBg as any);
+ const gambarPP = new FormData();
+ gambarPP.append("filePP", filePP as any);
-
- if(!gambarPP) return ComponentGlobal_NotifikasiPeringatan("Lengkapi foto profile")
- if(!gambarBG) return ComponentGlobal_NotifikasiPeringatan("Lengkapi background profile")
-
-
- await funCreateNewProfile(body as any, gambarPP, gambarBG).then((res) => {
- if (res.status === 201) {
- ComponentGlobal_NotifikasiBerhasil("Berhasil Membuat Profile")
- router.push(RouterHome.main_home);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
+ const gambarBG = new FormData();
+ gambarBG.append("fileBG", fileBg as any);
+ if (!gambarPP)
+ return ComponentGlobal_NotifikasiPeringatan("Lengkapi foto profile");
+ if (!gambarBG)
+ return ComponentGlobal_NotifikasiPeringatan(
+ "Lengkapi background profile"
+ );
+
+ await funCreateNewProfile(body as any, gambarPP, gambarBG).then((res) => {
+ if (res.status === 201) {
+ setLoading(true);
+ ComponentGlobal_NotifikasiBerhasil("Berhasil Membuat Profile", 3000);
+ router.push(RouterHome.main_home);
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ }
+
+ return (
+ <>
+ {
+ onSubmit();
+ }}
+ >
+ Simpan
+
+ >
+ );
}
diff --git a/src/app_modules/katalog/profile/edit/view.tsx b/src/app_modules/katalog/profile/edit/view.tsx
index 164489fd..599262e0 100644
--- a/src/app_modules/katalog/profile/edit/view.tsx
+++ b/src/app_modules/katalog/profile/edit/view.tsx
@@ -23,15 +23,19 @@ export default function EditProfile({ data }: { data: MODEL_PROFILE }) {
//Get data profile
const [dataProfile, setDataProfile] = useState(data);
+ const [loading, setLoading] = useState(false);
async function onUpdate() {
const body = dataProfile;
+
+ // console.log(body)
if (_.values(body).includes("")) return toast("Lengkapi data");
await Profile_funEditById(body).then((res) => {
if (res.status === 200) {
+ setLoading(true);
ComponentGlobal_NotifikasiBerhasil(res.message);
- setTimeout(() => router.back(), 1000)
+ setTimeout(() => router.back(), 1000);
} else {
ComponentGlobal_NotifikasiGagal(res.message);
}
@@ -47,18 +51,42 @@ export default function EditProfile({ data }: { data: MODEL_PROFILE }) {
return (
<>
+ {/* {JSON.stringify(dataProfile, null, 2)} */}
-
{
+ // const dataUsername = _.clone(dataProfile)
+
+ setDataProfile({
+ ...(dataProfile as any),
+ User: {
+ username: val.target.value,
+ },
+ });
+ }}
+ />
+
+ {
setDataProfile({
...dataProfile,
@@ -68,9 +96,15 @@ export default function EditProfile({ data }: { data: MODEL_PROFILE }) {
/>
0 && !dataProfile?.email.includes("@")
+ ? "Invalid email"
+ : ""
+ }
+ value={dataProfile?.email}
onChange={(val) => {
setDataProfile({
...dataProfile,
@@ -80,6 +114,7 @@ export default function EditProfile({ data }: { data: MODEL_PROFILE }) {
/>
{
setDataProfile({
...dataProfile,
- jenisKelamin: val
+ jenisKelamin: val,
});
}}
/>
@@ -111,6 +147,8 @@ export default function EditProfile({ data }: { data: MODEL_PROFILE }) {
radius={50}
bg={Warna.biru}
color="cyan"
+ loading={loading ? true : false}
+ loaderPosition="center"
onClick={() => onUpdate()}
>
Update
diff --git a/src/app_modules/katalog/profile/fun/update/fun_edit_profile_by_id.ts b/src/app_modules/katalog/profile/fun/update/fun_edit_profile_by_id.ts
index 146c7f82..5118eae1 100644
--- a/src/app_modules/katalog/profile/fun/update/fun_edit_profile_by_id.ts
+++ b/src/app_modules/katalog/profile/fun/update/fun_edit_profile_by_id.ts
@@ -5,6 +5,17 @@ import { MODEL_PROFILE } from "../../model/interface";
import { revalidatePath } from "next/cache";
export async function Profile_funEditById(data: MODEL_PROFILE) {
+ // console.log(data);
+
+ const cekEmail = await prisma.profile.findUnique({
+ where: {
+ email: data.email,
+ },
+ });
+
+ if (cekEmail && cekEmail.id != data.id)
+ return { status: 400, message: "Email sudah digunakan" };
+
const updt = await prisma.profile.update({
where: {
id: data.id,
diff --git a/src/app_modules/katalog/profile/fun/update/fun_update_background.ts b/src/app_modules/katalog/profile/fun/update/fun_update_background.ts
index 201d8219..aa01c47f 100644
--- a/src/app_modules/katalog/profile/fun/update/fun_update_background.ts
+++ b/src/app_modules/katalog/profile/fun/update/fun_update_background.ts
@@ -6,35 +6,18 @@ import _ from "lodash";
import { v4 } from "uuid";
import { revalidatePath } from "next/cache";
-export async function Profile_funUpdateBackground(profileId: string, file: FormData) {
- const findProfile = await prisma.profile.findFirst({
- where: {
- id: profileId,
- },
- });
-
- const findBackground = await prisma.imagesBackground.findFirst({
- where: {
- id: findProfile?.imagesBackgroundId as string,
- },
- select: {
- url: true,
- },
- });
- if (!findBackground) return { status: 400, message: "Foto tidak ditemukan" };
- if (findBackground) fs.unlinkSync(`./public/profile/background/${findBackground.url}`);
-
+export async function Profile_funUpdateBackground(
+ profileId: string,
+ file: FormData
+) {
const gambarBackground: any = file.get("file");
const fileName = gambarBackground.name;
const fileExtension = _.lowerCase(gambarBackground.name.split(".").pop());
- const randomName = v4(fileName) + "." + fileExtension;
+ const fRandomName = v4(fileName) + "." + fileExtension;
- const uploadBG = await prisma.imagesBackground.update({
- where: {
- id: findProfile?.imagesBackgroundId as string,
- },
+ const uploadBG = await prisma.imagesBackground.create({
data: {
- url: randomName,
+ url: fRandomName,
label: "PROFILE_BACKGROUND",
},
select: {
@@ -43,13 +26,77 @@ export async function Profile_funUpdateBackground(profileId: string, file: FormD
},
});
- if (!uploadBG) return { status: 400, message: "Gagal upload foto background" };
- const uploadPP_Folder = Buffer.from(await gambarBackground.arrayBuffer());
- fs.writeFileSync(`./public/profile/background/${uploadBG.url}`, uploadPP_Folder);
+ if (!uploadBG)
+ return { status: 400, message: "Gagal upload gambar background" };
+ const uploadBG_Folder = Buffer.from(await gambarBackground.arrayBuffer());
+ fs.writeFileSync(
+ `./public/profile/background/${uploadBG.url}`,
+ uploadBG_Folder
+ );
+
+ revalidatePath("/dev/katalog");
+
+ const updateBackground = await prisma.profile.update({
+ where: {
+ id: profileId,
+ },
+ data: {
+ imagesBackgroundId: uploadBG.id,
+ },
+ });
+
+ if (!updateBackground)
+ return { status: 400, message: "Gagal update gambar background" };
revalidatePath("/dev/katalog");
return {
status: 200,
message: "Update berhasil",
};
+
+ // const findProfile = await prisma.profile.findFirst({
+ // where: {
+ // id: profileId,
+ // },
+ // });
+
+ // const findBackground = await prisma.imagesBackground.findFirst({
+ // where: {
+ // id: findProfile?.imagesBackgroundId as string,
+ // },
+ // select: {
+ // url: true,
+ // },
+ // });
+ // if (!findBackground) return { status: 400, message: "Foto tidak ditemukan" };
+ // if (findBackground) fs.unlinkSync(`./public/profile/background/${findBackground.url}`);
+
+ // const gambarBackground: any = file.get("file");
+ // const fileName = gambarBackground.name;
+ // const fileExtension = _.lowerCase(gambarBackground.name.split(".").pop());
+ // const randomName = v4(fileName) + "." + fileExtension;
+
+ // const uploadBG = await prisma.imagesBackground.update({
+ // where: {
+ // id: findProfile?.imagesBackgroundId as string,
+ // },
+ // data: {
+ // url: randomName,
+ // label: "PROFILE_BACKGROUND",
+ // },
+ // select: {
+ // id: true,
+ // url: true,
+ // },
+ // });
+
+ // if (!uploadBG) return { status: 400, message: "Gagal upload foto background" };
+ // const uploadBG_Folder = Buffer.from(await gambarBackground.arrayBuffer());
+ // fs.writeFileSync(`./public/profile/background/${uploadBG.url}`, uploadBG_Folder);
+ // revalidatePath("/dev/katalog");
+
+ // return {
+ // status: 200,
+ // message: "Update berhasil",
+ // };
}
diff --git a/src/app_modules/katalog/profile/fun/update/fun_update_foto_profile.ts b/src/app_modules/katalog/profile/fun/update/fun_update_foto_profile.ts
index d4a3be44..04241158 100644
--- a/src/app_modules/katalog/profile/fun/update/fun_update_foto_profile.ts
+++ b/src/app_modules/katalog/profile/fun/update/fun_update_foto_profile.ts
@@ -7,34 +7,14 @@ import { v4 } from "uuid";
import { revalidatePath } from "next/cache";
export async function Profile_funUpdateFoto(profileId: string, file: FormData) {
- const findProfile = await prisma.profile.findFirst({
- where: {
- id: profileId,
- },
- });
-
- const findFoto = await prisma.images.findFirst({
- where: {
- id: findProfile?.imagesId as string,
- },
- select: {
- url: true,
- },
- });
- if (!findFoto) return { status: 400, message: "Foto tidak ditemukan" };
- if (findFoto) fs.unlinkSync(`./public/profile/foto/${findFoto.url}`);
-
const gambarProfile: any = file.get("file");
const fileName = gambarProfile.name;
const fileExtension = _.lowerCase(gambarProfile.name.split(".").pop());
- const randomName = v4(fileName) + "." + fileExtension;
+ const fRandomName = v4(fileName) + "." + fileExtension;
- const uploadPP = await prisma.images.update({
- where: {
- id: findProfile?.imagesId as string,
- },
+ const uploadPP = await prisma.images.create({
data: {
- url: randomName,
+ url: fRandomName,
label: "PROFILE_FOTO",
},
select: {
@@ -46,10 +26,69 @@ export async function Profile_funUpdateFoto(profileId: string, file: FormData) {
if (!uploadPP) return { status: 400, message: "Gagal upload foto profile" };
const uploadPP_Folder = Buffer.from(await gambarProfile.arrayBuffer());
fs.writeFileSync(`./public/profile/foto/${uploadPP.url}`, uploadPP_Folder);
+
+ const updateProfile = await prisma.profile.update({
+ where: {
+ id: profileId,
+ },
+ data: {
+ imagesId: uploadPP.id,
+ },
+ });
+
+ if (!updateProfile) return { status: 400, message: "Gagal update foto" };
revalidatePath("/dev/katalog");
return {
status: 200,
message: "Update berhasil",
};
+
+
+
+ // const findProfile = await prisma.profile.findFirst({
+ // where: {
+ // id: profileId,
+ // },
+ // });
+
+ // const findFoto = await prisma.images.findFirst({
+ // where: {
+ // id: findProfile?.imagesId as string,
+ // },
+ // select: {
+ // url: true,
+ // },
+ // });
+ // if (!findFoto) return { status: 400, message: "Foto tidak ditemukan" };
+ // if (findFoto) fs.unlinkSync(`./public/profile/foto/${findFoto.url}`);
+
+ // const gambarProfile: any = file.get("file");
+ // const fileName = gambarProfile.name;
+ // const fileExtension = _.lowerCase(gambarProfile.name.split(".").pop());
+ // const randomName = v4(fileName) + "." + fileExtension;
+
+ // const uploadPP = await prisma.images.update({
+ // where: {
+ // id: findProfile?.imagesId as string,
+ // },
+ // data: {
+ // url: randomName,
+ // label: "PROFILE_FOTO",
+ // },
+ // select: {
+ // id: true,
+ // url: true,
+ // },
+ // });
+
+ // if (!uploadPP) return { status: 400, message: "Gagal upload foto profile" };
+ // const uploadPP_Folder = Buffer.from(await gambarProfile.arrayBuffer());
+ // fs.writeFileSync(`./public/profile/foto/${uploadPP.url}`, uploadPP_Folder);
+ // revalidatePath("/dev/katalog");
+
+ // return {
+ // status: 200,
+ // message: "Update berhasil",
+ // };
}
diff --git a/src/app_modules/katalog/profile/index.ts b/src/app_modules/katalog/profile/index.ts
index fe911642..2590cf5e 100644
--- a/src/app_modules/katalog/profile/index.ts
+++ b/src/app_modules/katalog/profile/index.ts
@@ -2,7 +2,7 @@ import ProfileLayout from "./create/layout";
import CreateProfile from "./create/view";
import EditProfileLayout from "./edit/layout";
import EditProfileView from "./edit/view";
-import UploadFotoProfile from "./upload/foto_profile/view";
+import UploadFotoProfile from "./upload/foto_profile";
import UploadFotoProfileLayout from "./upload/foto_profile/layout"
import ProfileView from "./main/view";
import Profile_UpdateFotoBackground from "./upload/foto_background";
diff --git a/src/app_modules/katalog/profile/main/view.tsx b/src/app_modules/katalog/profile/main/view.tsx
index 7d128d9f..0a25fdf7 100644
--- a/src/app_modules/katalog/profile/main/view.tsx
+++ b/src/app_modules/katalog/profile/main/view.tsx
@@ -40,6 +40,10 @@ export default function ProfileView({
userLoginId: string;
}) {
const router = useRouter();
+ const [loadingPP, setLoadingPP] = useState(false);
+ const [loadingBG, setLoadingBG] = useState(false);
+ const [loadingEdit, setLoadingEdit] = useState(false);
+
// const [data, setData] = useState(profile);
// useShallowEffect(() => {
// funGetUserProfile(user.id ?? "").then(setProfile as any);
@@ -49,7 +53,7 @@ export default function ProfileView({
return (
<>
{/* {JSON.stringify(profile, null,2)} */}
-
+
{/* Background dan foto */}
{/* Upload Background Profile */}
@@ -57,12 +61,14 @@ export default function ProfileView({
@@ -72,19 +78,21 @@ export default function ProfileView({
{profile?.User.id === userLoginId ? (
+ onClick={() => {
+ setLoadingBG(true);
router.push(
RouterProfile.update_foto_background + `${profile.id}`
- )
- }
+ );
+ }}
sx={{
position: "relative",
- // zIndex: 2,
+ color: "gray",
border: "1px",
borderStyle: "solid",
}}
@@ -110,10 +118,15 @@ export default function ProfileView({
bg={"gray.2"}
sx={{
borderStyle: "solid",
- borderColor: "black",
- borderWidth: "1px",
+ borderColor: "gray",
+ borderWidth: "0.5px",
}}
- src={RouterProfile.api_url_foto + `${profile?.ImageProfile.url}`}
+ src={
+ profile?.ImageProfile?.url
+ ? RouterProfile.api_url_foto +
+ `${profile?.ImageProfile.url}`
+ : "/aset/global/avatar.png"
+ }
size={100}
radius={"100%"}
/>
@@ -124,16 +137,18 @@ export default function ProfileView({
{profile?.User.id === userLoginId ? (
+ onClick={() => {
+ setLoadingPP(true);
router.push(
RouterProfile.update_foto_profile + `${profile.id}`
- )
- }
+ );
+ }}
sx={{
position: "relative",
border: "1px",
@@ -150,30 +165,47 @@ export default function ProfileView({
{/* Username dan Nama */}
-
-
-
-
- {profile?.name}
-
- @{profile?.User?.username}
-
- {profile?.User.id === userLoginId ? (
- {
- router.push(RouterProfile.edit + `${profile.id}`);
- }}
- >
-
-
- ) : (
- ""
- )}
-
+
+
+
+
+ {profile?.name}
+
+
+ @{profile?.User?.username}
+
+
+
+
+ {profile?.User.id === userLoginId ? (
+ {
+ setLoadingEdit(true);
+ router.push(RouterProfile.edit + `${profile.id}`);
+ }}
+ >
+
+
+ ) : (
+ ""
+ )}
+
+
+
+ {/*
+
+ */}
{/* Info user: nomor, email dll */}
-
+
diff --git a/src/app_modules/katalog/profile/upload/foto_background/index.tsx b/src/app_modules/katalog/profile/upload/foto_background/index.tsx
index 8604a884..c237b461 100644
--- a/src/app_modules/katalog/profile/upload/foto_background/index.tsx
+++ b/src/app_modules/katalog/profile/upload/foto_background/index.tsx
@@ -33,6 +33,7 @@ export default function Profile_UpdateFotoBackground({
const [profile, setProfile] = useState(dataProfile);
const [file, setFile] = useState(null);
const [image, setImage] = useState(null);
+ const [loading, setLoading] = useState(false);
return (
<>
@@ -57,10 +58,15 @@ export default function Profile_UpdateFotoBackground({
const buffer = URL.createObjectURL(
new Blob([new Uint8Array(await files.arrayBuffer())])
);
- // console.log(buffer, "ini buffer");
- // console.log(files, " ini file");
- setImage(buffer);
- setFile(files);
+ if (files.size > 1000000) {
+ ComponentGlobal_NotifikasiPeringatan(
+ "Maaf, Ukuran file terlalu besar, maximum 1mb",
+ 3000
+ );
+ } else {
+ setImage(buffer);
+ setFile(files);
+ }
} catch (error) {
console.log(error);
}
@@ -85,10 +91,13 @@ export default function Profile_UpdateFotoBackground({
onUpdate(router, profile.id, file as any)}
+ onClick={() => onUpdate(router, profile.id, file as any, setLoading)}
>
- Simpan
+ Update
>
@@ -98,13 +107,15 @@ export default function Profile_UpdateFotoBackground({
async function onUpdate(
router: AppRouterInstance,
profileId: string,
- file: FormData
+ file: FormData,
+ setLoading: any
) {
const gambar = new FormData();
gambar.append("file", file as any);
await Profile_funUpdateBackground(profileId, gambar).then((res) => {
if (res.status === 200) {
+ setLoading(true);
ComponentGlobal_NotifikasiBerhasil(res.message);
router.back();
} else {
diff --git a/src/app_modules/katalog/profile/upload/foto_profile/view.tsx b/src/app_modules/katalog/profile/upload/foto_profile/index.tsx
similarity index 77%
rename from src/app_modules/katalog/profile/upload/foto_profile/view.tsx
rename to src/app_modules/katalog/profile/upload/foto_profile/index.tsx
index 091c2e45..cdb7da04 100644
--- a/src/app_modules/katalog/profile/upload/foto_profile/view.tsx
+++ b/src/app_modules/katalog/profile/upload/foto_profile/index.tsx
@@ -19,6 +19,7 @@ import { useRouter } from "next/navigation";
import { Profile_funUpdateFoto } from "../../fun/update/fun_update_foto_profile";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
export default function UploadFotoProfile({
dataProfile,
@@ -29,6 +30,7 @@ export default function UploadFotoProfile({
const [profile, setProfile] = useState(dataProfile);
const [file, setFile] = useState(null);
const [image, setImage] = useState(null);
+ const [loading, setLoading] = useState(false);
return (
<>
@@ -52,10 +54,15 @@ export default function UploadFotoProfile({
const buffer = URL.createObjectURL(
new Blob([new Uint8Array(await files.arrayBuffer())])
);
- // console.log(buffer, "ini buffer");
- // console.log(files, " ini file");
- setImage(buffer);
- setFile(files);
+ if (files.size > 1000000) {
+ ComponentGlobal_NotifikasiPeringatan(
+ "Maaf, Ukuran file terlalu besar, maximum 1mb",
+ 3000
+ );
+ } else {
+ setImage(buffer);
+ setFile(files);
+ }
} catch (error) {
console.log(error);
}
@@ -80,10 +87,15 @@ export default function UploadFotoProfile({
onUpdate(router, profile.id, file as any)}
+ onClick={() => {
+ onUpdate(router, profile.id, file as any, setLoading);
+ }}
>
- Simpan
+ Update
>
@@ -93,13 +105,15 @@ export default function UploadFotoProfile({
async function onUpdate(
router: AppRouterInstance,
profileId: string,
- file: FormData
+ file: FormData,
+ setLoading: any
) {
const gambar = new FormData();
gambar.append("file", file as any);
await Profile_funUpdateFoto(profileId, gambar).then((res) => {
if (res.status === 200) {
+ setLoading(true);
ComponentGlobal_NotifikasiBerhasil(res.message);
router.back();
} else {
diff --git a/src/app_modules/user_search/main/index.tsx b/src/app_modules/user_search/main/index.tsx
index fdba4914..3e396b69 100644
--- a/src/app_modules/user_search/main/index.tsx
+++ b/src/app_modules/user_search/main/index.tsx
@@ -20,6 +20,7 @@ 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";
export default function UserSearch_MainView({
listUser,
@@ -28,6 +29,7 @@ export default function UserSearch_MainView({
}) {
const router = useRouter();
const [user, setUser] = useState(listUser);
+ const [loading, setLoading] = useState(false);
async function onSearch(name: string) {
await UserSearch_searchByName(name).then((res) => setUser(res as any));
@@ -41,6 +43,8 @@ export default function UserSearch_MainView({
// >
// );
+ if(loading) return
+
return (
<>
@@ -60,11 +64,11 @@ export default function UserSearch_MainView({
""
) : (
-
+
-
+
{e?.Profile?.name}
@@ -88,11 +92,12 @@ export default function UserSearch_MainView({
+ onClick={() => {
+ setLoading(true);
router.push(
RouterProfile.katalog + `${e?.Profile?.id}`
- )
- }
+ );
+ }}
>
diff --git a/src/bin/seeder/forum/master_report.json b/src/bin/seeder/forum/master_report.json
new file mode 100644
index 00000000..07084431
--- /dev/null
+++ b/src/bin/seeder/forum/master_report.json
@@ -0,0 +1,32 @@
+[
+ {
+ "id": 1,
+ "title": "Kebencian",
+ "deskripsi": "Cercaan, Stereotip rasis atau seksis, Dehumanisasi, Menyulut ketakutan atau diskriminasi, Referensi kebencian, Simbol & logo kebencian"
+ },
+ {
+ "id": 2,
+ "title": "Penghinaan & Pelecehan secara Online",
+ "deskripsi": "Penghinaan, Konten Seksual yang Tidak Diinginkan, Penyangkalan Peristiwa Kekerasan, Pelecehan Bertarget dan Memprovokasi Pelecehan"
+ },
+ {
+ "id": 3,
+ "title": "Tutur Kekerasan",
+ "deskripsi": "Ancaman Kekerasan, Berharap Terjadinya Celaka, Mengagungkan Kekerasan, Penghasutan Kekerasan, Penghasutan Kekerasan dengan Kode"
+ },
+ {
+ "id": 4,
+ "title": "Keselamatan Anak",
+ "deskripsi": "Eksploitasi seks anak di bawah umur, grooming, kekerasan fisik terhadap anak, pengguna di bawah umur"
+ },
+ {
+ "id": 5,
+ "title": "Privasi",
+ "deskripsi": "Membagikan informasi pribadi, mengancam akan membagikan/menyebarkan informasi pribadi, membagikan gambar intim tanpa persetujuan, membagikan gambar saya yang tidak saya kehendaki di platform ini"
+ },
+ {
+ "id": 6,
+ "title": "Spam",
+ "deskripsi": "Akun palsu, penipuan keuangan, memposting tautan berbahaya, menyalahgunakan hashtag, keterlibatan palsu, balasan berulang, Posting Ulang, atau Direct Message"
+ }
+]
diff --git a/src/bin/seeder/forum/master_status.json b/src/bin/seeder/forum/master_status.json
new file mode 100644
index 00000000..98615e77
--- /dev/null
+++ b/src/bin/seeder/forum/master_status.json
@@ -0,0 +1,10 @@
+[
+ {
+ "id": 1,
+ "status": "Open"
+ },
+ {
+ "id": 2,
+ "status": "Close"
+ }
+]
diff --git a/src/util/mqtt_client.ts b/src/util/mqtt_client.ts
new file mode 100644
index 00000000..5164f0da
--- /dev/null
+++ b/src/util/mqtt_client.ts
@@ -0,0 +1,10 @@
+import mqtt from "mqtt";
+
+declare global {
+ var mqtt_client: mqtt.MqttClient;
+}
+
+const mqtt_client =
+ globalThis.mqtt_client || mqtt.connect("wss://io.wibudev.com");
+
+export default mqtt_client;
diff --git a/src/util/mqtt_loader.tsx b/src/util/mqtt_loader.tsx
new file mode 100644
index 00000000..389b7e0f
--- /dev/null
+++ b/src/util/mqtt_loader.tsx
@@ -0,0 +1,22 @@
+"use client";
+
+import { useEffect } from "react";
+import mqtt_client from "./mqtt_client";
+import { useAtom } from "jotai";
+import { gs_coba_chat } from "@/app/makuro/gs_coba";
+
+export default function MqttLoader() {
+ const [msg, setMsg] = useAtom(gs_coba_chat);
+ useEffect(() => {
+ mqtt_client.on("connect", () => {
+ console.log("connected");
+ mqtt_client.subscribe("example_hipmi");
+ });
+
+ mqtt_client.on("message", (apa, message) => {
+ console.log(message.toLocaleString());
+ setMsg(message.toLocaleString() as any);
+ });
+ }, [setMsg]);
+ return null;
+}
diff --git a/yarn.lock b/yarn.lock
index a89549ba..a780a13e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -53,6 +53,13 @@
dependencies:
regenerator-runtime "^0.14.0"
+"@babel/runtime@^7.23.8", "@babel/runtime@^7.24.1":
+ version "7.24.1"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.1.tgz#431f9a794d173b53720e69a6464abc6f0e2a5c57"
+ integrity sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ==
+ dependencies:
+ regenerator-runtime "^0.14.0"
+
"@babel/types@^7.22.15":
version "7.23.9"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.9.tgz#1dd7b59a9a2b5c87f8b41e52770b5ecbf492e002"
@@ -322,6 +329,14 @@
dependencies:
react-dropzone-esm "15.0.1"
+"@mantine/form@^7.6.1":
+ version "7.6.1"
+ resolved "https://registry.yarnpkg.com/@mantine/form/-/form-7.6.1.tgz#b98307c91ae8fe5559590d2eefe6c60c22868330"
+ integrity sha512-S0pdvFohRX3ahzhrCGM+d2sBaSHH88UkQhbzyOAGJ7xqNjPJ11Bh/xb4Mc+NXXxaq9MjPrRVe6fgpKJtXszBpQ==
+ dependencies:
+ fast-deep-equal "^3.1.3"
+ klona "^2.0.6"
+
"@mantine/hooks@^6.0.17":
version "6.0.21"
resolved "https://registry.yarnpkg.com/@mantine/hooks/-/hooks-6.0.21.tgz#bc009d8380ad18455b90f3ddaf484de16a13da95"
@@ -1035,6 +1050,14 @@
"@types/scheduler" "*"
csstype "^3.0.2"
+"@types/readable-stream@^4.0.0", "@types/readable-stream@^4.0.5":
+ version "4.0.11"
+ resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-4.0.11.tgz#684f1e947c90cb6a8ad3904523d650bb66cdbb84"
+ integrity sha512-R3eUMUTTKoIoaz7UpYLxvZCrOmCRPRbAmoDDHKcimTEySltaJhF8hLzj4+EzyDifiX5eK6oDQGSfmNnXjxZzYQ==
+ dependencies:
+ "@types/node" "*"
+ safe-buffer "~5.1.1"
+
"@types/scheduler@*":
version "0.16.8"
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.8.tgz#ce5ace04cfeabe7ef87c0091e50752e36707deff"
@@ -1067,6 +1090,13 @@
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.8.tgz#7545ba4fc3c003d6c756f651f3bf163d8f0f29ba"
integrity sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==
+"@types/ws@^8.5.9":
+ version "8.5.10"
+ resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.10.tgz#4acfb517970853fa6574a3a6886791d04a396787"
+ integrity sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==
+ dependencies:
+ "@types/node" "*"
+
"@typescript-eslint/parser@^5.42.0":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.62.0.tgz#1b63d082d849a2fcae8a569248fbe2ee1b8a56c7"
@@ -1111,6 +1141,13 @@
"@typescript-eslint/types" "5.62.0"
eslint-visitor-keys "^3.3.0"
+abort-controller@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392"
+ integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==
+ dependencies:
+ event-target-shim "^5.0.0"
+
acorn-jsx@^5.3.2:
version "5.3.2"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
@@ -1371,6 +1408,16 @@ binary-extensions@^2.0.0:
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
+bl@^6.0.8:
+ version "6.0.12"
+ resolved "https://registry.yarnpkg.com/bl/-/bl-6.0.12.tgz#77c35b96e13aeff028496c798b75389ddee9c7f8"
+ integrity sha512-EnEYHilP93oaOa2MnmNEjAcovPS3JlQZOyzGXi3EyEpPhm9qWvdDp7BmAVEVusGzp8LlwQK56Av+OkDoRjzE0w==
+ dependencies:
+ "@types/readable-stream" "^4.0.0"
+ buffer "^6.0.3"
+ inherits "^2.0.4"
+ readable-stream "^4.2.0"
+
brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
@@ -1403,12 +1450,17 @@ browserslist@^4.21.5:
node-releases "^2.0.14"
update-browserslist-db "^1.0.13"
+buffer-from@^1.0.0:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"
+ integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==
+
buffer-from@~0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-0.1.2.tgz#15f4b9bcef012044df31142c14333caf6e0260d0"
integrity sha512-RiWIenusJsmI2KcvqQABB83tLxCByE3upSP8QU3rJDMVFGPWLvPQJt/O1Su9moRWeH7d+Q2HYb68f6+v+tw2vg==
-buffer@^6:
+buffer@^6, buffer@^6.0.3:
version "6.0.3"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6"
integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==
@@ -1540,11 +1592,26 @@ commander@^4.0.0:
resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==
+commist@^3.2.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/commist/-/commist-3.2.0.tgz#da9c8e5f245ac21510badc4b10c46b5bcc9b56cd"
+ integrity sha512-4PIMoPniho+LqXmpS5d3NuGYncG6XWlkBSVGiWycL22dd42OYdUGil2CWuzklaJoNxyxUSpO4MKIBU94viWNAw==
+
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
+concat-stream@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-2.0.0.tgz#414cf5af790a48c60ab9be4527d56d5e41133cb1"
+ integrity sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==
+ dependencies:
+ buffer-from "^1.0.0"
+ inherits "^2.0.3"
+ readable-stream "^3.0.2"
+ typedarray "^0.0.6"
+
convert-source-map@^1.5.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f"
@@ -2185,11 +2252,21 @@ esutils@^2.0.2:
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
+event-target-shim@^5.0.0:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789"
+ integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==
+
eventemitter3@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-2.0.3.tgz#b5e1079b59fb5e1ba2771c0a993be060a58c99ba"
integrity sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==
+events@^3.3.0:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400"
+ integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==
+
extend@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
@@ -2226,6 +2303,14 @@ fast-levenshtein@^2.0.6:
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==
+fast-unique-numbers@^8.0.13:
+ version "8.0.13"
+ resolved "https://registry.yarnpkg.com/fast-unique-numbers/-/fast-unique-numbers-8.0.13.tgz#3c87232061ff5f408a216e1f0121232f76f695d7"
+ integrity sha512-7OnTFAVPefgw2eBJ1xj2PGGR9FwYzSUso9decayHgCDX4sJkHLdcsYTytTg+tYv+wKF3U8gJuSBz2jJpQV4u/g==
+ dependencies:
+ "@babel/runtime" "^7.23.8"
+ tslib "^2.6.2"
+
fastq@^1.6.0:
version "1.17.1"
resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47"
@@ -2504,6 +2589,11 @@ hasown@^2.0.0, hasown@^2.0.1:
dependencies:
function-bind "^1.1.2"
+help-me@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/help-me/-/help-me-5.0.0.tgz#b1ebe63b967b74060027c2ac61f9be12d354a6f6"
+ integrity sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==
+
hoist-non-react-statics@^3.3.1:
version "3.3.2"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
@@ -2581,7 +2671,7 @@ inflight@^1.0.4:
once "^1.3.0"
wrappy "1"
-inherits@2, inherits@~2.0.1, inherits@~2.0.3:
+inherits@2, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
@@ -2884,6 +2974,11 @@ jotai@^2.4.3:
resolved "https://registry.yarnpkg.com/jotai/-/jotai-2.6.4.tgz#a68a76f0e5cd2b614afae7112cfc52a77dbfe038"
integrity sha512-RniwQPX4893YlNR1muOtyUGHYaTD1fhEN4qnOuZJSrDHj6xdEMrqlRSN/hCm2fshwk78ruecB/P2l+NCVWe6TQ==
+js-sdsl@4.3.0:
+ version "4.3.0"
+ resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.3.0.tgz#aeefe32a451f7af88425b11fdb5f58c90ae1d711"
+ integrity sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==
+
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
@@ -2940,6 +3035,11 @@ keyv@^4.5.3:
dependencies:
json-buffer "3.0.1"
+klona@^2.0.6:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.6.tgz#85bffbf819c03b2f53270412420a4555ef882e22"
+ integrity sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==
+
language-subtag-registry@^0.3.20:
version "0.3.22"
resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz#2e1500861b2e457eba7e7ae86877cbd08fa1fd1d"
@@ -3011,6 +3111,11 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
dependencies:
js-tokens "^3.0.0 || ^4.0.0"
+lru-cache@^10.0.1, "lru-cache@^9.1.1 || ^10.0.0":
+ version "10.2.0"
+ resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.0.tgz#0bd445ca57363465900f4d1f9bd8db343a4d95c3"
+ integrity sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==
+
lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
@@ -3018,11 +3123,6 @@ lru-cache@^6.0.0:
dependencies:
yallist "^4.0.0"
-"lru-cache@^9.1.1 || ^10.0.0":
- version "10.2.0"
- resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.0.tgz#0bd445ca57363465900f4d1f9bd8db343a4d95c3"
- integrity sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==
-
make-error@^1.3.6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
@@ -3080,7 +3180,7 @@ minimatch@^9.0.1:
dependencies:
brace-expansion "^2.0.1"
-minimist@^1.2.0, minimist@^1.2.6, minimist@~1.2.5:
+minimist@^1.2.0, minimist@^1.2.6, minimist@^1.2.8, minimist@~1.2.5:
version "1.2.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
@@ -3095,6 +3195,38 @@ moment@^2.29.4:
resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae"
integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==
+mqtt-packet@^9.0.0:
+ version "9.0.0"
+ resolved "https://registry.yarnpkg.com/mqtt-packet/-/mqtt-packet-9.0.0.tgz#fd841854d8c0f1f5211b00de388c4ced45b59216"
+ integrity sha512-8v+HkX+fwbodsWAZIZTI074XIoxVBOmPeggQuDFCGg1SqNcC+uoRMWu7J6QlJPqIUIJXmjNYYHxBBLr1Y/Df4w==
+ dependencies:
+ bl "^6.0.8"
+ debug "^4.3.4"
+ process-nextick-args "^2.0.1"
+
+mqtt@^5.2.0, mqtt@^5.5.0:
+ version "5.5.0"
+ resolved "https://registry.yarnpkg.com/mqtt/-/mqtt-5.5.0.tgz#a1c76592f47ce348fca8d11f0240824c829213d9"
+ integrity sha512-8WGQpjEzABcCh/UwLj7XaEoLsSLHJrJK3YLu57fJoLUBdz6zPGFdxWK3i1YYdPqKDu0sU6YHt+tly/qdLsLiyg==
+ dependencies:
+ "@types/readable-stream" "^4.0.5"
+ "@types/ws" "^8.5.9"
+ commist "^3.2.0"
+ concat-stream "^2.0.0"
+ debug "^4.3.4"
+ help-me "^5.0.0"
+ lru-cache "^10.0.1"
+ minimist "^1.2.8"
+ mqtt "^5.2.0"
+ mqtt-packet "^9.0.0"
+ number-allocator "^1.0.14"
+ readable-stream "^4.4.2"
+ reinterval "^1.1.0"
+ rfdc "^1.3.0"
+ split2 "^4.2.0"
+ worker-timers "^7.1.4"
+ ws "^8.14.2"
+
ms@2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
@@ -3170,6 +3302,14 @@ normalize-range@^0.1.2:
resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942"
integrity sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==
+number-allocator@^1.0.14:
+ version "1.0.14"
+ resolved "https://registry.yarnpkg.com/number-allocator/-/number-allocator-1.0.14.tgz#1f2e32855498a7740dcc8c78bed54592d930ee4d"
+ integrity sha512-OrL44UTVAvkKdOdRQZIJpLkAdjXGTRda052sN4sO77bKEzYYqWKMBjQvrJFzqygI99gL6Z4u2xctPW1tB8ErvA==
+ dependencies:
+ debug "^4.3.1"
+ js-sdsl "4.3.0"
+
object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
@@ -3467,11 +3607,16 @@ prelude-ls@^1.2.1:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
-process-nextick-args@~2.0.0:
+process-nextick-args@^2.0.1, process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
+process@^0.11.10:
+ version "0.11.10"
+ resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
+ integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==
+
prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
@@ -3717,6 +3862,16 @@ react-fast-marquee@^1.6.4:
resolved "https://registry.yarnpkg.com/react-fast-marquee/-/react-fast-marquee-1.6.4.tgz#ac0bed0faee63e4d97e9b8cd03f3bea9f242fab3"
integrity sha512-LAgvhRmHdqaUQ8R5jCUwzEGFUIjnCCt3T3W8X7j7wF6DWe0SATlpP0JX1V0pp2qX3DYUezmn1Iz5AtRFdL2EWQ==
+react-icons@^5.0.1:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-5.0.1.tgz#1694e11bfa2a2888cab47dcc30154ce90485feee"
+ integrity sha512-WqLZJ4bLzlhmsvme6iFdgO8gfZP17rfjYEJ2m9RsZjZ+cc4k1hTzknEz63YS1MeT50kVzoa1Nz36f4BEx+Wigw==
+
+react-international-phone@^4.2.6:
+ version "4.2.6"
+ resolved "https://registry.yarnpkg.com/react-international-phone/-/react-international-phone-4.2.6.tgz#a92518b66b44015f5e32c96b646e0355056ae809"
+ integrity sha512-El/ZVYmov5uGuk07nrfxe7M3/4Y8HhA9c3aCpAwilbPU8DekISwNSZMplqxzvxS+TIavIh28ZMDDx1u/4GqULg==
+
react-is@^16.13.1, react-is@^16.7.0:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
@@ -3831,6 +3986,26 @@ readable-stream@^2.0.2:
string_decoder "~1.1.1"
util-deprecate "~1.0.1"
+readable-stream@^3.0.2:
+ version "3.6.2"
+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967"
+ integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
+ dependencies:
+ inherits "^2.0.3"
+ string_decoder "^1.1.1"
+ util-deprecate "^1.0.1"
+
+readable-stream@^4.2.0, readable-stream@^4.4.2:
+ version "4.5.2"
+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-4.5.2.tgz#9e7fc4c45099baeed934bff6eb97ba6cf2729e09"
+ integrity sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==
+ dependencies:
+ abort-controller "^3.0.0"
+ buffer "^6.0.3"
+ events "^3.3.0"
+ process "^0.11.10"
+ string_decoder "^1.3.0"
+
readable-stream@~1.0.17, readable-stream@~1.0.27-1:
version "1.0.34"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c"
@@ -3876,6 +4051,11 @@ regexp.prototype.flags@^1.5.0, regexp.prototype.flags@^1.5.1, regexp.prototype.f
es-errors "^1.3.0"
set-function-name "^2.0.1"
+reinterval@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/reinterval/-/reinterval-1.1.0.tgz#3361ecfa3ca6c18283380dd0bb9546f390f5ece7"
+ integrity sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ==
+
resolve-from@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
@@ -3909,6 +4089,11 @@ reusify@^1.0.4:
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
+rfdc@^1.3.0:
+ version "1.3.1"
+ resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.1.tgz#2b6d4df52dffe8bb346992a10ea9451f24373a8f"
+ integrity sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==
+
rimraf@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
@@ -3943,6 +4128,11 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1:
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
+safe-buffer@~5.2.0:
+ version "5.2.1"
+ resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
+ integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
+
safe-regex-test@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.3.tgz#a5b4c0f06e0ab50ea2c395c14d8371232924c377"
@@ -4058,6 +4248,11 @@ source-map@^0.5.7:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==
+split2@^4.2.0:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4"
+ integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==
+
streamsearch@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764"
@@ -4124,6 +4319,13 @@ string.prototype.trimstart@^1.0.7:
define-properties "^1.2.0"
es-abstract "^1.22.1"
+string_decoder@^1.1.1, string_decoder@^1.3.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e"
+ integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==
+ dependencies:
+ safe-buffer "~5.2.0"
+
string_decoder@~0.10.x:
version "0.10.31"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
@@ -4410,6 +4612,11 @@ typed-array-length@^1.0.4:
is-typed-array "^1.1.13"
possible-typed-array-names "^1.0.0"
+typedarray@^0.0.6:
+ version "0.0.6"
+ resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
+ integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==
+
typescript@5.1.6:
version "5.1.6"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274"
@@ -4482,7 +4689,7 @@ use-sidecar@^1.1.2:
detect-node-es "^1.1.0"
tslib "^2.0.0"
-util-deprecate@^1.0.2, util-deprecate@~1.0.1:
+util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
@@ -4573,6 +4780,34 @@ which@^2.0.1:
dependencies:
isexe "^2.0.0"
+worker-timers-broker@^6.1.5:
+ version "6.1.5"
+ resolved "https://registry.yarnpkg.com/worker-timers-broker/-/worker-timers-broker-6.1.5.tgz#0477aad2e9aa4cb98e2cf4eb6337748c06797604"
+ integrity sha512-DZfLypD1f1AyiItRNJZwMGEjGZpx3clwifPFO+x1UwosjbXvEVXrrQn/RwMuNO8BEEUBs/n5CNFwavG9U4Ai6g==
+ dependencies:
+ "@babel/runtime" "^7.24.1"
+ fast-unique-numbers "^8.0.13"
+ tslib "^2.6.2"
+ worker-timers-worker "^7.0.68"
+
+worker-timers-worker@^7.0.68:
+ version "7.0.68"
+ resolved "https://registry.yarnpkg.com/worker-timers-worker/-/worker-timers-worker-7.0.68.tgz#7ccfe56c9639151abe2493a0295f74c8f421f815"
+ integrity sha512-Ts3hYhX6GqVRHZzW8+9WIi9FOeL29madwSvdVytF/tRpTxcNgPxa7KHC1ryj8U5ZDlpjnw/p7+wsm1KOJHG4cA==
+ dependencies:
+ "@babel/runtime" "^7.24.1"
+ tslib "^2.6.2"
+
+worker-timers@^7.1.4:
+ version "7.1.5"
+ resolved "https://registry.yarnpkg.com/worker-timers/-/worker-timers-7.1.5.tgz#a9c77bf050159702b1642dc8370ad0c919337138"
+ integrity sha512-uRtPgMB1oTgKGv9dh45gmALk4z1l7EXqs/uaUfqY0SmkXvWMhvoT6u7UIPHKBXQSOZdm7nXSI2HrvP8NLzAR7g==
+ dependencies:
+ "@babel/runtime" "^7.24.1"
+ tslib "^2.6.2"
+ worker-timers-broker "^6.1.5"
+ worker-timers-worker "^7.0.68"
+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
@@ -4596,6 +4831,11 @@ wrappy@1:
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
+ws@^8.14.2:
+ version "8.16.0"
+ resolved "https://registry.yarnpkg.com/ws/-/ws-8.16.0.tgz#d1cd774f36fbc07165066a60e40323eab6446fd4"
+ integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==
+
ws@~8.11.0:
version "8.11.0"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143"