diff --git a/.eslintrc.mjs b/.eslintrc.mjs
new file mode 100644
index 00000000..3dc37837
--- /dev/null
+++ b/.eslintrc.mjs
@@ -0,0 +1,15 @@
+import { FlatCompat } from "@eslint/eslintrc";
+import path from "node:path";
+import { fileURLToPath } from "node:url";
+
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
+
+const compat = new FlatCompat({
+ baseDirectory: __dirname,
+});
+
+const config = compat.extends("next/core-web-vitals", "next/typescript");
+console.log(config); // Cek output di terminal
+
+export default Array.isArray(config) ? config : [config];
diff --git a/.gitignore b/.gitignore
index 61b4bc33..98970e2d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,21 +21,48 @@
# debug
npm-debug.log*
-
-rn-debug.log*
+yarn-debug.log*
yarn-error.log*
# local env files
.env*.local
+# build env files
+.env*.build
+
# env here
.env
# vercel
.vercel
+# logs - mengabaikan isi logs tetapi menyimpan struktur folder
+logs/*
+!logs/.gitkeep
+!logs/backend/
+!logs/frontend/
+logs/backend/*
+!logs/backend/.gitkeep
+logs/frontend/*
+!logs/frontend/.gitkeep
+
# typescript
*.tsbuildinfo
next-env.d.ts
-certificates
\ No newline at end of file
+# certificates
+certificates/
+**/certificates/
+*.cert
+*.key
+*.pem
+
+# IDE and editor files
+.idea/
+.vscode/
+*.swp
+*.swo
+*.swn
+.DS_Store
+Thumbs.db
+.qodo
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index 35412482..00000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "WillLuke.nextjs.addTypesOnSave": true,
- "WillLuke.nextjs.hasPrompted": true
-}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d0a26813..16d8e305 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,429 @@
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
+## [1.4.28](https://github.com/bipproduction/hipmi/compare/v1.4.27...v1.4.28) (2025-06-16)
+
+## [1.4.27](https://github.com/bipproduction/hipmi/compare/v1.4.26...v1.4.27) (2025-06-16)
+
+
+### Bug Fixes
+
+* dynamic error ([86bfbcb](https://github.com/bipproduction/hipmi/commit/86bfbcb60e225adcba6504869cf8548370fc6750))
+
+## [1.4.26](https://github.com/bipproduction/hipmi/compare/v1.4.25...v1.4.26) (2025-06-13)
+
+
+### Bug Fixes
+
+* admin donasi ([6ccdbf9](https://github.com/bipproduction/hipmi/commit/6ccdbf9763c1ce8443a6a691b24817d6b80265c6))
+* super admin ([5bc70ba](https://github.com/bipproduction/hipmi/commit/5bc70baf96e792e1e1492027747f8352f2f80313))
+
+## [1.4.25](https://github.com/bipproduction/hipmi/compare/v1.4.24...v1.4.25) (2025-06-12)
+
+## [1.4.24](https://github.com/bipproduction/hipmi/compare/v1.4.23...v1.4.24) (2025-06-12)
+
+
+### Bug Fixes
+
+* admin collaboration ([039ffc5](https://github.com/bipproduction/hipmi/commit/039ffc57b18d24968d854d06cd62fff13b769a6f))
+* admin forum ([aba2585](https://github.com/bipproduction/hipmi/commit/aba258517db277fd85d043c3aa4df279a5ec232d))
+* forum admin ([4b8316c](https://github.com/bipproduction/hipmi/commit/4b8316cc1311eb88840c029f1dfdb6a43e3a7f4f))
+
+## [1.4.23](https://github.com/bipproduction/hipmi/compare/v1.4.22...v1.4.23) (2025-06-11)
+
+## [1.4.22](https://github.com/bipproduction/hipmi/compare/v1.4.21...v1.4.22) (2025-06-11)
+
+
+### Bug Fixes
+
+* donasi ([f2c6940](https://github.com/bipproduction/hipmi/commit/f2c694022e510ea99726cfffaf06b6cfffb808c1))
+* donasi ([1f1cca3](https://github.com/bipproduction/hipmi/commit/1f1cca3520ff22b878e945383a580b32a3054a3d))
+* donasi ([e94090e](https://github.com/bipproduction/hipmi/commit/e94090eb30c2f34af08816b3c4ad8ac4cbd360e8))
+* donasi ([bb65042](https://github.com/bipproduction/hipmi/commit/bb650429b323670c85adc582eda8ff522bd4dd60))
+* donasi ([886d9f3](https://github.com/bipproduction/hipmi/commit/886d9f37f4636576b8a89020537e13708f582431))
+
+## [1.4.21](https://github.com/bipproduction/hipmi/compare/v1.4.20...v1.4.21) (2025-06-10)
+
+
+### Bug Fixes
+
+* donasi ([709de95](https://github.com/bipproduction/hipmi/commit/709de95b10650ae1472b75d73bdd0bf20306633e))
+* donasi ([9c5f005](https://github.com/bipproduction/hipmi/commit/9c5f0053b6b834c67f170767e28dd9e04c5614a4))
+* donasi ([4fdfb6f](https://github.com/bipproduction/hipmi/commit/4fdfb6f4b0548d78a712443ac24e37e933665d41))
+* donasi ([1b23c50](https://github.com/bipproduction/hipmi/commit/1b23c50ff08f2bbb46ecfeec9d0c02c03f9230c1))
+* donasi ([0e4dda5](https://github.com/bipproduction/hipmi/commit/0e4dda5356df96f4dc749c5a7d5613e378eb6096))
+
+## [1.4.20](https://github.com/bipproduction/hipmi/compare/v1.4.19...v1.4.20) (2025-06-05)
+
+
+### Bug Fixes
+
+* investasi ([69c0abe](https://github.com/bipproduction/hipmi/commit/69c0abed75cb7b777c7072969e8826663dd32fdc))
+
+## [1.4.19](https://github.com/bipproduction/hipmi/compare/v1.4.18...v1.4.19) (2025-06-04)
+
+
+### Bug Fixes
+
+* forum ([0de70b0](https://github.com/bipproduction/hipmi/commit/0de70b038429a63be25b669ef6d8732e2312fd9d))
+* forum ([42cfe65](https://github.com/bipproduction/hipmi/commit/42cfe650b565c02eb7ebf639ecef41c188ad4449))
+* investasi ([7a95395](https://github.com/bipproduction/hipmi/commit/7a95395fe9861997527d76f08073db8de4ba48aa))
+* investasi: ([5c3fe55](https://github.com/bipproduction/hipmi/commit/5c3fe551aeb57bdd24ad616f9cbe37c2d417efca))
+
+## [1.4.18](https://github.com/bipproduction/hipmi/compare/v1.4.17...v1.4.18) (2025-06-03)
+
+
+### Bug Fixes
+
+* forum ([512d170](https://github.com/bipproduction/hipmi/commit/512d170c3e047848c9b26144533e50720e04950b))
+
+## [1.4.17](https://github.com/bipproduction/hipmi/compare/v1.4.16...v1.4.17) (2025-06-02)
+
+## [1.4.16](https://github.com/bipproduction/hipmi/compare/v1.4.15...v1.4.16) (2025-06-02)
+
+
+### Bug Fixes
+
+* event ([6f686b6](https://github.com/bipproduction/hipmi/commit/6f686b6abf4ba6201df632938e4024004fe749b3))
+* voting ([c057f20](https://github.com/bipproduction/hipmi/commit/c057f20963df70f4ce2ac071007541678c6ff854))
+
+## [1.4.15](https://github.com/bipproduction/hipmi/compare/v1.4.14...v1.4.15) (2025-05-30)
+
+
+### Bug Fixes
+
+* collaboration ([5030253](https://github.com/bipproduction/hipmi/commit/5030253b07c1264229d066d18732d81e2636c5a6))
+* collaboration ([740ae44](https://github.com/bipproduction/hipmi/commit/740ae447340ce48d168e0e8e7c14079b3cf61817))
+
+## [1.4.14](https://github.com/bipproduction/hipmi/compare/v1.4.13...v1.4.14) (2025-05-27)
+
+
+### Bug Fixes
+
+* collaboration ([bdff760](https://github.com/bipproduction/hipmi/commit/bdff760f7021c624f8338da3af2d46c911b1dcff))
+
+## [1.4.13](https://github.com/bipproduction/hipmi/compare/v1.4.12...v1.4.13) (2025-05-26)
+
+
+### Bug Fixes
+
+* collaboration ([5007827](https://github.com/bipproduction/hipmi/commit/5007827d51117105b879bf18f06da60db8c48ff4))
+
+## [1.4.12](https://github.com/bipproduction/hipmi/compare/v1.4.11...v1.4.12) (2025-05-26)
+
+
+### Bug Fixes
+
+* Map ([f23defd](https://github.com/bipproduction/hipmi/commit/f23defd972fbd276fee546677dc5e9565651b4f4))
+
+## [1.4.11](https://github.com/bipproduction/hipmi/compare/v1.4.10...v1.4.11) (2025-05-26)
+
+## [1.4.10](https://github.com/bipproduction/hipmi/compare/v1.4.9...v1.4.10) (2025-05-23)
+
+## [1.4.9](https://github.com/bipproduction/hipmi/compare/v1.4.8...v1.4.9) (2025-05-23)
+
+
+### Bug Fixes
+
+* nested layout ([c202cc8](https://github.com/bipproduction/hipmi/commit/c202cc8ea08ce8cdb351136a47c2afe10afb14c9))
+
+## [1.4.8](https://github.com/bipproduction/hipmi/compare/v1.4.7...v1.4.8) (2025-05-22)
+
+## [1.4.7](https://github.com/bipproduction/hipmi/compare/v1.4.6...v1.4.7) (2025-05-22)
+
+## [1.4.6](https://github.com/bipproduction/hipmi/compare/v1.4.5...v1.4.6) (2025-05-21)
+
+## [1.4.5](https://github.com/bipproduction/hipmi/compare/v1.4.4...v1.4.5) (2025-05-21)
+
+## [1.4.4](https://github.com/bipproduction/hipmi/compare/v1.4.3...v1.4.4) (2025-05-20)
+
+
+### Bug Fixes
+
+* button sticker ([3743008](https://github.com/bipproduction/hipmi/commit/37430081d8718b4b2b06f5c3c09f13935bf413c4))
+* event ([02bbdfd](https://github.com/bipproduction/hipmi/commit/02bbdfd5f6a2d299b8d527b9211f7b6ff598602f))
+
+## [1.4.3](https://github.com/bipproduction/hipmi/compare/v1.4.2...v1.4.3) (2025-05-20)
+
+## [1.4.2](https://github.com/bipproduction/hipmi/compare/v1.4.1...v1.4.2) (2025-05-19)
+
+
+### Bug Fixes
+
+* admin app info ([117dbe6](https://github.com/bipproduction/hipmi/commit/117dbe6157fbb74d359db1c8baffe3c4985fab4a))
+* admin app info ([0cbcee8](https://github.com/bipproduction/hipmi/commit/0cbcee87bd52f6a7b596e260841deef9d4615016))
+
+## [1.4.1](https://github.com/bipproduction/hipmi/compare/v1.4.0...v1.4.1) (2025-05-19)
+
+## [1.4.0](https://github.com/bipproduction/hipmi/compare/v1.3.1...v1.4.0) (2025-05-16)
+
+
+### Features
+
+* admin sticker ([2a8c79f](https://github.com/bipproduction/hipmi/commit/2a8c79fd09c3f7fd7ee58ac6896b17802dfe0147))
+* admin stiker ([e7858a2](https://github.com/bipproduction/hipmi/commit/e7858a281223a81037219afec58e5f6b9e04be15))
+
+## [1.3.1](https://github.com/bipproduction/hipmi/compare/v1.3.0...v1.3.1) (2025-05-16)
+
+## [1.3.0](https://github.com/bipproduction/hipmi/compare/v1.2.126...v1.3.0) (2025-05-15)
+
+
+### Features
+
+* admin app information ([bc10b80](https://github.com/bipproduction/hipmi/commit/bc10b80139833966d3e39b52cabf577930552052))
+* tampilan upload stiker di admin ([fbea35e](https://github.com/bipproduction/hipmi/commit/fbea35eef96a656e1b474959aa3fb8198c7d2b0e))
+
+## [1.2.126](https://github.com/bipproduction/hipmi/compare/v1.2.125...v1.2.126) (2025-05-13)
+
+## [1.2.125](https://github.com/bipproduction/hipmi/compare/v1.2.124...v1.2.125) (2025-05-09)
+
+## [1.2.124](https://github.com/bipproduction/hipmi/compare/v1.2.123...v1.2.124) (2025-05-08)
+
+## [1.2.123](https://github.com/bipproduction/hipmi/compare/v1.2.122...v1.2.123) (2025-05-06)
+
+## [1.2.122](https://github.com/bipproduction/hipmi/compare/v1.2.121...v1.2.122) (2025-05-06)
+
+## [1.2.121](https://github.com/bipproduction/hipmi/compare/v1.2.120...v1.2.121) (2025-05-05)
+
+## [1.2.120](https://github.com/bipproduction/hipmi/compare/v1.2.119...v1.2.120) (2025-05-05)
+
+## [1.2.119](https://github.com/bipproduction/hipmi/compare/v1.2.118...v1.2.119) (2025-05-02)
+
+## [1.2.118](https://github.com/bipproduction/hipmi/compare/v1.2.117...v1.2.118) (2025-04-30)
+
+## [1.2.117](https://github.com/bipproduction/hipmi/compare/v1.2.116...v1.2.117) (2025-04-29)
+
+## [1.2.116](https://github.com/bipproduction/hipmi/compare/v1.2.115...v1.2.116) (2025-04-28)
+
+## [1.2.115](https://github.com/bipproduction/hipmi/compare/v1.2.114...v1.2.115) (2025-04-28)
+
+## [1.2.114](https://github.com/bipproduction/hipmi/compare/v1.2.113...v1.2.114) (2025-04-23)
+
+## [1.2.113](https://github.com/bipproduction/hipmi/compare/v1.2.112...v1.2.113) (2025-04-21)
+
+## [1.2.112](https://github.com/bipproduction/hipmi/compare/v1.2.111...v1.2.112) (2025-04-17)
+
+## [1.2.111](https://github.com/bipproduction/hipmi/compare/v1.2.110...v1.2.111) (2025-04-17)
+
+## [1.2.110](https://github.com/bipproduction/hipmi/compare/v1.2.109...v1.2.110) (2025-04-16)
+
+## [1.2.109](https://github.com/bipproduction/hipmi/compare/v1.2.108...v1.2.109) (2025-04-16)
+
+## [1.2.108](https://github.com/bipproduction/hipmi/compare/v1.2.107...v1.2.108) (2025-04-14)
+
+## [1.2.107](https://github.com/bipproduction/hipmi/compare/v1.2.106...v1.2.107) (2025-04-10)
+
+## [1.2.106](https://github.com/bipproduction/hipmi/compare/v1.2.105...v1.2.106) (2025-04-09)
+
+## [1.2.105](https://github.com/bipproduction/hipmi/compare/v1.2.104...v1.2.105) (2025-04-09)
+
+## [1.2.104](https://github.com/bipproduction/hipmi/compare/v1.2.103...v1.2.104) (2025-04-09)
+
+## [1.2.103](https://github.com/bipproduction/hipmi/compare/v1.2.102...v1.2.103) (2025-04-09)
+
+## [1.2.102](https://github.com/bipproduction/hipmi/compare/v1.2.101...v1.2.102) (2025-04-08)
+
+## [1.2.101](https://github.com/bipproduction/hipmi/compare/v1.2.100...v1.2.101) (2025-04-08)
+
+## [1.2.100](https://github.com/bipproduction/hipmi/compare/v1.2.99...v1.2.100) (2025-04-08)
+
+## [1.2.99](https://github.com/bipproduction/hipmi/compare/v1.2.98...v1.2.99) (2025-04-08)
+
+## [1.2.98](https://github.com/bipproduction/hipmi/compare/v1.2.97...v1.2.98) (2025-04-08)
+
+## [1.2.97](https://github.com/bipproduction/hipmi/compare/v1.2.96...v1.2.97) (2025-04-08)
+
+## [1.2.96](https://github.com/bipproduction/hipmi/compare/v1.2.95...v1.2.96) (2025-04-08)
+
+## [1.2.95](https://github.com/bipproduction/hipmi/compare/v1.2.94...v1.2.95) (2025-04-08)
+
+## [1.2.94](https://github.com/bipproduction/hipmi/compare/v1.2.93...v1.2.94) (2025-04-08)
+
+## [1.2.93](https://github.com/bipproduction/hipmi/compare/v1.2.92...v1.2.93) (2025-04-08)
+
+## [1.2.92](https://github.com/bipproduction/hipmi/compare/v1.2.91...v1.2.92) (2025-04-08)
+
+## [1.2.91](https://github.com/bipproduction/hipmi/compare/v1.2.90...v1.2.91) (2025-04-08)
+
+## [1.2.90](https://github.com/bipproduction/hipmi/compare/v1.2.89...v1.2.90) (2025-04-07)
+
+## [1.2.89](https://github.com/bipproduction/hipmi/compare/v1.2.88...v1.2.89) (2025-04-07)
+
+## [1.2.88](https://github.com/bipproduction/hipmi/compare/v1.2.87...v1.2.88) (2025-04-07)
+
+## [1.2.87](https://github.com/bipproduction/hipmi/compare/v1.2.86...v1.2.87) (2025-03-26)
+
+## [1.2.86](https://github.com/bipproduction/hipmi/compare/v1.2.85...v1.2.86) (2025-03-25)
+
+## [1.2.85](https://github.com/bipproduction/hipmi/compare/v1.2.84...v1.2.85) (2025-03-24)
+
+## [1.2.84](https://github.com/bipproduction/hipmi/compare/v1.2.83...v1.2.84) (2025-03-21)
+
+## [1.2.83](https://github.com/bipproduction/hipmi/compare/v1.2.82...v1.2.83) (2025-03-20)
+
+## [1.2.82](https://github.com/bipproduction/hipmi/compare/v1.2.81...v1.2.82) (2025-03-19)
+
+## [1.2.81](https://github.com/bipproduction/hipmi/compare/v1.2.80...v1.2.81) (2025-03-17)
+
+## [1.2.80](https://github.com/bipproduction/hipmi/compare/v1.2.79...v1.2.80) (2025-03-14)
+
+## [1.2.79](https://github.com/bipproduction/hipmi/compare/v1.2.78...v1.2.79) (2025-03-14)
+
+## [1.2.78](https://github.com/bipproduction/hipmi/compare/v1.2.77...v1.2.78) (2025-03-12)
+
+## [1.2.77](https://github.com/bipproduction/hipmi/compare/v1.2.76...v1.2.77) (2025-03-12)
+
+## [1.2.76](https://github.com/bipproduction/hipmi/compare/v1.2.75...v1.2.76) (2025-03-12)
+
+## [1.2.75](https://github.com/bipproduction/hipmi/compare/v1.2.74...v1.2.75) (2025-03-07)
+
+## [1.2.74](https://github.com/bipproduction/hipmi/compare/v1.2.73...v1.2.74) (2025-03-07)
+
+## [1.2.73](https://github.com/bipproduction/hipmi/compare/v1.2.72...v1.2.73) (2025-03-06)
+
+## [1.2.72](https://github.com/bipproduction/hipmi/compare/v1.2.71...v1.2.72) (2025-03-05)
+
+## [1.2.71](https://github.com/bipproduction/hipmi/compare/v1.2.70...v1.2.71) (2025-03-04)
+
+## [1.2.70](https://github.com/bipproduction/hipmi/compare/v1.2.69...v1.2.70) (2025-03-04)
+
+## [1.2.69](https://github.com/bipproduction/hipmi/compare/v1.2.68...v1.2.69) (2025-02-28)
+
+## [1.2.68](https://github.com/bipproduction/hipmi/compare/v1.2.67...v1.2.68) (2025-02-28)
+
+## [1.2.67](https://github.com/bipproduction/hipmi/compare/v1.2.66...v1.2.67) (2025-02-27)
+
+## [1.2.66](https://github.com/bipproduction/hipmi/compare/v1.2.65...v1.2.66) (2025-02-27)
+
+## [1.2.65](https://github.com/bipproduction/hipmi/compare/v1.2.64...v1.2.65) (2025-02-27)
+
+## [1.2.64](https://github.com/bipproduction/hipmi/compare/v1.2.63...v1.2.64) (2025-02-26)
+
+## [1.2.63](https://github.com/bipproduction/hipmi/compare/v1.2.62...v1.2.63) (2025-02-26)
+
+## [1.2.62](https://github.com/bipproduction/hipmi/compare/v1.2.61...v1.2.62) (2025-02-25)
+
+## [1.2.61](https://github.com/bipproduction/hipmi/compare/v1.2.60...v1.2.61) (2025-02-25)
+
+## [1.2.60](https://github.com/bipproduction/hipmi/compare/v1.2.59...v1.2.60) (2025-02-25)
+
+## [1.2.59](https://github.com/bipproduction/hipmi/compare/v1.2.58...v1.2.59) (2025-02-25)
+
+## [1.2.58](https://github.com/bipproduction/hipmi/compare/v1.2.57...v1.2.58) (2025-02-25)
+
+## [1.2.57](https://github.com/bipproduction/hipmi/compare/v1.2.56...v1.2.57) (2025-02-20)
+
+## [1.2.56](https://github.com/bipproduction/hipmi/compare/v1.2.55...v1.2.56) (2025-02-19)
+
+## [1.2.55](https://github.com/bipproduction/hipmi/compare/v1.2.54...v1.2.55) (2025-02-12)
+
+## [1.2.54](https://github.com/bipproduction/hipmi/compare/v1.2.53...v1.2.54) (2025-02-12)
+
+## [1.2.53](https://github.com/bipproduction/hipmi/compare/v1.2.52...v1.2.53) (2025-02-11)
+
+## [1.2.52](https://github.com/bipproduction/hipmi/compare/v1.2.51...v1.2.52) (2025-02-10)
+
+## [1.2.51](https://github.com/bipproduction/hipmi/compare/v1.2.50...v1.2.51) (2025-02-10)
+
+## [1.2.50](https://github.com/bipproduction/hipmi/compare/v1.2.49...v1.2.50) (2025-02-10)
+
+## [1.2.49](https://github.com/bipproduction/hipmi/compare/v1.2.48...v1.2.49) (2025-02-07)
+
+## [1.2.48](https://github.com/bipproduction/hipmi/compare/v1.2.47...v1.2.48) (2025-02-07)
+
+## [1.2.47](https://github.com/bipproduction/hipmi/compare/v1.2.46...v1.2.47) (2025-02-03)
+
+## [1.2.46](https://github.com/bipproduction/hipmi/compare/v1.2.45...v1.2.46) (2025-02-03)
+
+## [1.2.45](https://github.com/bipproduction/hipmi/compare/v1.2.44...v1.2.45) (2025-02-03)
+
+## [1.2.44](https://github.com/bipproduction/hipmi/compare/v1.2.43...v1.2.44) (2025-02-03)
+
+## [1.2.43](https://github.com/bipproduction/hipmi/compare/v1.2.42...v1.2.43) (2025-02-03)
+
+## [1.2.42](https://github.com/bipproduction/hipmi/compare/v1.2.41...v1.2.42) (2025-01-30)
+
+## [1.2.41](https://github.com/bipproduction/hipmi/compare/v1.2.40...v1.2.41) (2025-01-21)
+
+## [1.2.40](https://github.com/bipproduction/hipmi/compare/v1.2.39...v1.2.40) (2025-01-16)
+
+## [1.2.39](https://github.com/bipproduction/hipmi/compare/v1.2.38...v1.2.39) (2025-01-12)
+
+## [1.2.38](https://github.com/bipproduction/hipmi/compare/v1.2.37...v1.2.38) (2025-01-03)
+
+
+### Bug Fixes
+
+* user ([215accb](https://github.com/bipproduction/hipmi/commit/215accbcaa989e43f43dfc5f400d5411013f4ef3))
+
+## [1.2.37](https://github.com/bipproduction/hipmi/compare/v1.2.36...v1.2.37) (2025-01-02)
+
+## [1.2.36](https://github.com/bipproduction/hipmi/compare/v1.2.35...v1.2.36) (2024-12-30)
+
+## [1.2.35](https://github.com/bipproduction/hipmi/compare/v1.2.34...v1.2.35) (2024-12-27)
+
+## [1.2.34](https://github.com/bipproduction/hipmi/compare/v1.2.33...v1.2.34) (2024-12-24)
+
+## [1.2.33](https://github.com/bipproduction/hipmi/compare/v1.2.32...v1.2.33) (2024-12-22)
+
+## [1.2.32](https://github.com/bipproduction/hipmi/compare/v1.2.31...v1.2.32) (2024-12-19)
+
+
+### Bug Fixes
+
+* donasi ([72b6d23](https://github.com/bipproduction/hipmi/commit/72b6d239fee3e90e812ab24192154e5e8910fccb))
+
+## [1.2.31](https://github.com/bipproduction/hipmi/compare/v1.2.30...v1.2.31) (2024-12-17)
+
+## [1.2.30](https://github.com/bipproduction/hipmi/compare/v1.2.29...v1.2.30) (2024-12-16)
+
+## [1.2.29](https://github.com/bipproduction/hipmi/compare/v1.2.28...v1.2.29) (2024-12-13)
+
+## [1.2.28](https://github.com/bipproduction/hipmi/compare/v1.2.27...v1.2.28) (2024-12-12)
+
+## [1.2.27](https://github.com/bipproduction/hipmi/compare/v1.2.26...v1.2.27) (2024-12-12)
+
+## [1.2.26](https://github.com/bipproduction/hipmi/compare/v1.2.25...v1.2.26) (2024-12-12)
+
+## [1.2.25](https://github.com/bipproduction/hipmi/compare/v1.2.24...v1.2.25) (2024-12-12)
+
+## [1.2.24](https://github.com/bipproduction/hipmi/compare/v1.2.23...v1.2.24) (2024-12-11)
+
+
+### Bug Fixes
+
+* drawer katalog ([eab293d](https://github.com/bipproduction/hipmi/commit/eab293dd35a6f061cfa4675679de1ce68f506c3c))
+* loading button tambah portofolio ([8823a01](https://github.com/bipproduction/hipmi/commit/8823a01b067928cbeea195402f2bb454df8e8bea))
+* pencegahan error ([afe8014](https://github.com/bipproduction/hipmi/commit/afe8014cc8b4ab7266f3c52918a6bc82bb62bc58))
+
+## [1.2.23](https://github.com/bipproduction/hipmi/compare/v1.2.22...v1.2.23) (2024-12-11)
+
+## [1.2.22](https://github.com/bipproduction/hipmi/compare/v1.2.21...v1.2.22) (2024-12-10)
+
+## [1.2.21](https://github.com/bipproduction/hipmi/compare/v1.2.20...v1.2.21) (2024-12-09)
+
+## [1.2.20](https://github.com/bipproduction/hipmi/compare/v1.2.19...v1.2.20) (2024-12-09)
+
+## [1.2.19](https://github.com/bipproduction/hipmi/compare/v1.2.18...v1.2.19) (2024-12-06)
+
+## [1.2.18](https://github.com/bipproduction/hipmi/compare/v1.2.17...v1.2.18) (2024-12-04)
+
+## [1.2.17](https://github.com/bipproduction/hipmi/compare/v1.2.16...v1.2.17) (2024-12-04)
+
+## [1.2.16](https://github.com/bipproduction/hipmi/compare/v1.2.15...v1.2.16) (2024-12-03)
+
+## [1.2.15](https://github.com/bipproduction/hipmi/compare/v1.2.14...v1.2.15) (2024-12-03)
+
+## [1.2.14](https://github.com/bipproduction/hipmi/compare/v1.2.13...v1.2.14) (2024-12-03)
+
+## [1.2.13](https://github.com/bipproduction/hipmi/compare/v1.2.12...v1.2.13) (2024-12-03)
+
+
+### Bug Fixes
+
+* event ([fc38813](https://github.com/bipproduction/hipmi/commit/fc388133a638d4288314dd3faeddfcce61fe7292))
+* version 1.2.12 ([932735f](https://github.com/bipproduction/hipmi/commit/932735f9238db07b331b1b26328624247371c3d6))
+
## [1.2.12](https://github.com/bipproduction/hipmi/compare/v1.2.11...v1.2.12) (2024-12-02)
diff --git a/backup.sql b/backup.sql
new file mode 100644
index 00000000..7fe569dd
--- /dev/null
+++ b/backup.sql
@@ -0,0 +1,3399 @@
+--
+-- PostgreSQL database dump
+--
+
+-- Dumped from database version 14.15 (Homebrew)
+-- Dumped by pg_dump version 14.15 (Homebrew)
+
+SET statement_timeout = 0;
+SET lock_timeout = 0;
+SET idle_in_transaction_session_timeout = 0;
+SET client_encoding = 'UTF8';
+SET standard_conforming_strings = on;
+SELECT pg_catalog.set_config('search_path', '', false);
+SET check_function_bodies = false;
+SET xmloption = content;
+SET client_min_messages = warning;
+SET row_security = off;
+
+SET default_tablespace = '';
+
+SET default_table_access_method = heap;
+
+--
+-- Name: BeritaInvestasi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."BeritaInvestasi" (
+ id text NOT NULL,
+ title text NOT NULL,
+ deskripsi text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "imagesId" text,
+ "investasiId" text NOT NULL,
+ "imageId" text
+);
+
+
+ALTER TABLE public."BeritaInvestasi" OWNER TO bip;
+
+--
+-- Name: BusinessMaps; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."BusinessMaps" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "namePin" text NOT NULL,
+ latitude double precision NOT NULL,
+ longitude double precision NOT NULL,
+ "authorId" text,
+ "portofolioId" text,
+ "imageId" text,
+ "pinId" text
+);
+
+
+ALTER TABLE public."BusinessMaps" OWNER TO bip;
+
+--
+-- Name: DokumenInvestasi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."DokumenInvestasi" (
+ id text NOT NULL,
+ title text NOT NULL,
+ url text,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "investasiId" text,
+ "fileId" text
+);
+
+
+ALTER TABLE public."DokumenInvestasi" OWNER TO bip;
+
+--
+-- Name: Donasi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Donasi" (
+ id text NOT NULL,
+ title text NOT NULL,
+ target text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "publishTime" timestamp(3) without time zone,
+ catatan text,
+ progres text DEFAULT '0'::text,
+ terkumpul text DEFAULT '0'::text,
+ "namaBank" text,
+ rekening text,
+ "akumulasiPencairan" integer DEFAULT 0,
+ "totalPencairan" integer DEFAULT 0,
+ "authorId" text,
+ "imagesId" text,
+ "donasiMaster_KategoriId" text,
+ "donasiMaster_DurasiId" text,
+ "donasiMaster_StatusDonasiId" text DEFAULT '2'::text,
+ "imageId" text
+);
+
+
+ALTER TABLE public."Donasi" OWNER TO bip;
+
+--
+-- Name: DonasiMaster_Bank; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."DonasiMaster_Bank" (
+ id text NOT NULL,
+ name text NOT NULL,
+ norek text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL
+);
+
+
+ALTER TABLE public."DonasiMaster_Bank" OWNER TO bip;
+
+--
+-- Name: DonasiMaster_Durasi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."DonasiMaster_Durasi" (
+ id text NOT NULL,
+ name text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL
+);
+
+
+ALTER TABLE public."DonasiMaster_Durasi" OWNER TO bip;
+
+--
+-- Name: DonasiMaster_Kategori; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."DonasiMaster_Kategori" (
+ id text NOT NULL,
+ name text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL
+);
+
+
+ALTER TABLE public."DonasiMaster_Kategori" OWNER TO bip;
+
+--
+-- Name: DonasiMaster_StatusDonasi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."DonasiMaster_StatusDonasi" (
+ id text NOT NULL,
+ name text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL
+);
+
+
+ALTER TABLE public."DonasiMaster_StatusDonasi" OWNER TO bip;
+
+--
+-- Name: DonasiMaster_StatusInvoice; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."DonasiMaster_StatusInvoice" (
+ id text NOT NULL,
+ name text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL
+);
+
+
+ALTER TABLE public."DonasiMaster_StatusInvoice" OWNER TO bip;
+
+--
+-- Name: Donasi_Cerita; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Donasi_Cerita" (
+ id text NOT NULL,
+ pembukaan text NOT NULL,
+ cerita text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "imagesId" text,
+ "donasiId" text,
+ "imageId" text
+);
+
+
+ALTER TABLE public."Donasi_Cerita" OWNER TO bip;
+
+--
+-- Name: Donasi_Invoice; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Donasi_Invoice" (
+ id text NOT NULL,
+ nominal text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "donasiId" text,
+ "donasiMaster_BankId" text,
+ "donasiMaster_StatusInvoiceId" text DEFAULT '3'::text,
+ "authorId" text,
+ "imagesId" text,
+ "imageId" text
+);
+
+
+ALTER TABLE public."Donasi_Invoice" OWNER TO bip;
+
+--
+-- Name: Donasi_Kabar; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Donasi_Kabar" (
+ id text NOT NULL,
+ title text NOT NULL,
+ deskripsi text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "donasiId" text,
+ "imagesId" text,
+ "imageId" text
+);
+
+
+ALTER TABLE public."Donasi_Kabar" OWNER TO bip;
+
+--
+-- Name: Donasi_Notif; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Donasi_Notif" (
+ id text NOT NULL,
+ "isRead" boolean DEFAULT false NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "userId" text,
+ "donasi_KabarId" text
+);
+
+
+ALTER TABLE public."Donasi_Notif" OWNER TO bip;
+
+--
+-- Name: Donasi_PencairanDana; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Donasi_PencairanDana" (
+ id text NOT NULL,
+ "nominalCair" integer NOT NULL,
+ title text NOT NULL,
+ deskripsi text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "donasiId" text,
+ "imagesId" text,
+ "imageId" text
+);
+
+
+ALTER TABLE public."Donasi_PencairanDana" OWNER TO bip;
+
+--
+-- Name: Donasi_TemporaryCreate; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Donasi_TemporaryCreate" (
+ id text NOT NULL,
+ title text NOT NULL,
+ target text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "imagesId" text,
+ "donasiMaster_KategoriId" text,
+ "donasiMaster_DurasiId" text,
+ "imageId" text
+);
+
+
+ALTER TABLE public."Donasi_TemporaryCreate" OWNER TO bip;
+
+--
+-- Name: Event; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Event" (
+ id text NOT NULL,
+ title text NOT NULL,
+ lokasi text NOT NULL,
+ tanggal timestamp(3) without time zone,
+ deskripsi text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ catatan text,
+ "tanggalSelesai" timestamp(3) without time zone,
+ "isArsip" boolean DEFAULT false,
+ "authorId" text,
+ "eventMaster_StatusId" text DEFAULT '2'::text,
+ "eventMaster_TipeAcaraId" integer
+);
+
+
+ALTER TABLE public."Event" OWNER TO bip;
+
+--
+-- Name: EventMaster_Status; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."EventMaster_Status" (
+ id text NOT NULL,
+ name text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL
+);
+
+
+ALTER TABLE public."EventMaster_Status" OWNER TO bip;
+
+--
+-- Name: EventMaster_TipeAcara; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."EventMaster_TipeAcara" (
+ id integer NOT NULL,
+ name text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL
+);
+
+
+ALTER TABLE public."EventMaster_TipeAcara" OWNER TO bip;
+
+--
+-- Name: EventMaster_TipeAcara_id_seq; Type: SEQUENCE; Schema: public; Owner: bip
+--
+
+CREATE SEQUENCE public."EventMaster_TipeAcara_id_seq"
+ AS integer
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+ALTER TABLE public."EventMaster_TipeAcara_id_seq" OWNER TO bip;
+
+--
+-- Name: EventMaster_TipeAcara_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bip
+--
+
+ALTER SEQUENCE public."EventMaster_TipeAcara_id_seq" OWNED BY public."EventMaster_TipeAcara".id;
+
+
+--
+-- Name: EventSponsor; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."EventSponsor" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ name text NOT NULL,
+ "fileName" text NOT NULL,
+ "fileExt" text,
+ "fileId" text NOT NULL,
+ "auhtorId" text,
+ "eventId" text
+);
+
+
+ALTER TABLE public."EventSponsor" OWNER TO bip;
+
+--
+-- Name: EventTransaksi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."EventTransaksi" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ nominal integer NOT NULL,
+ "masterBankId" text,
+ status text NOT NULL,
+ "transferImageId" text,
+ "authorId" text,
+ "eventId" text,
+ "eventSponsorId" text
+);
+
+
+ALTER TABLE public."EventTransaksi" OWNER TO bip;
+
+--
+-- Name: Event_Peserta; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Event_Peserta" (
+ id text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "isPresent" boolean DEFAULT false NOT NULL,
+ "eventId" text,
+ "userId" text
+);
+
+
+ALTER TABLE public."Event_Peserta" OWNER TO bip;
+
+--
+-- Name: ForumMaster_KategoriReport; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."ForumMaster_KategoriReport" (
+ id integer NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ title text NOT NULL,
+ deskripsi text NOT NULL
+);
+
+
+ALTER TABLE public."ForumMaster_KategoriReport" OWNER TO bip;
+
+--
+-- Name: ForumMaster_KategoriReport_id_seq; Type: SEQUENCE; Schema: public; Owner: bip
+--
+
+CREATE SEQUENCE public."ForumMaster_KategoriReport_id_seq"
+ AS integer
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+ALTER TABLE public."ForumMaster_KategoriReport_id_seq" OWNER TO bip;
+
+--
+-- Name: ForumMaster_KategoriReport_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bip
+--
+
+ALTER SEQUENCE public."ForumMaster_KategoriReport_id_seq" OWNED BY public."ForumMaster_KategoriReport".id;
+
+
+--
+-- Name: ForumMaster_StatusPosting; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."ForumMaster_StatusPosting" (
+ id integer NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ status text NOT NULL
+);
+
+
+ALTER TABLE public."ForumMaster_StatusPosting" OWNER TO bip;
+
+--
+-- Name: ForumMaster_StatusPosting_id_seq; Type: SEQUENCE; Schema: public; Owner: bip
+--
+
+CREATE SEQUENCE public."ForumMaster_StatusPosting_id_seq"
+ AS integer
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+ALTER TABLE public."ForumMaster_StatusPosting_id_seq" OWNER TO bip;
+
+--
+-- Name: ForumMaster_StatusPosting_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bip
+--
+
+ALTER SEQUENCE public."ForumMaster_StatusPosting_id_seq" OWNED BY public."ForumMaster_StatusPosting".id;
+
+
+--
+-- Name: Forum_Komentar; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Forum_Komentar" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ komentar text NOT NULL,
+ "forum_PostingId" text,
+ "authorId" text
+);
+
+
+ALTER TABLE public."Forum_Komentar" OWNER TO bip;
+
+--
+-- Name: Forum_Posting; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Forum_Posting" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "publishAt" timestamp(3) without time zone,
+ diskusi text NOT NULL,
+ "authorId" text,
+ "forumMaster_StatusPostingId" integer
+);
+
+
+ALTER TABLE public."Forum_Posting" OWNER TO bip;
+
+--
+-- Name: Forum_ReportKomentar; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Forum_ReportKomentar" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ deskripsi text,
+ "forumMaster_KategoriReportId" integer,
+ "forum_KomentarId" text,
+ "userId" text
+);
+
+
+ALTER TABLE public."Forum_ReportKomentar" OWNER TO bip;
+
+--
+-- Name: Forum_ReportPosting; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Forum_ReportPosting" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ deskripsi text,
+ "forumMaster_KategoriReportId" integer,
+ "forum_PostingId" text,
+ "userId" text
+);
+
+
+ALTER TABLE public."Forum_ReportPosting" OWNER TO bip;
+
+--
+-- Name: Images; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Images" (
+ id text NOT NULL,
+ url text NOT NULL,
+ label text DEFAULT 'null'::text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
+);
+
+
+ALTER TABLE public."Images" OWNER TO bip;
+
+--
+-- Name: Investasi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Investasi" (
+ id text NOT NULL,
+ title text NOT NULL,
+ "targetDana" text NOT NULL,
+ "hargaLembar" text NOT NULL,
+ "totalLembar" text NOT NULL,
+ roi text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "countDown" timestamp(3) without time zone,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "authorId" text,
+ catatan text,
+ "sisaLembar" text NOT NULL,
+ "lembarTerbeli" text DEFAULT '0'::text,
+ progress text DEFAULT '0'::text,
+ "masterPeriodeDevidenId" text,
+ "masterPembagianDevidenId" text,
+ "masterPencarianInvestorId" text,
+ "imagesId" text,
+ "masterStatusInvestasiId" text DEFAULT '2'::text,
+ "masterProgresInvestasiId" text,
+ "imageId" text,
+ "prospektusFileId" text
+);
+
+
+ALTER TABLE public."Investasi" OWNER TO bip;
+
+--
+-- Name: InvestasiMaster_StatusInvoice; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."InvestasiMaster_StatusInvoice" (
+ id text NOT NULL,
+ name text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL
+);
+
+
+ALTER TABLE public."InvestasiMaster_StatusInvoice" OWNER TO bip;
+
+--
+-- Name: Investasi_Invoice; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Investasi_Invoice" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ nominal text NOT NULL,
+ "lembarTerbeli" text NOT NULL,
+ "investasiId" text,
+ "masterBankId" text,
+ "statusInvoiceId" text,
+ "authorId" text,
+ "imagesId" text,
+ "imageId" text
+);
+
+
+ALTER TABLE public."Investasi_Invoice" OWNER TO bip;
+
+--
+-- Name: Job; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Job" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "isArsip" boolean DEFAULT false NOT NULL,
+ catatan text,
+ title text NOT NULL,
+ content text NOT NULL,
+ deskripsi text NOT NULL,
+ "authorId" text,
+ "masterStatusId" text DEFAULT '2'::text,
+ "imageId" text
+);
+
+
+ALTER TABLE public."Job" OWNER TO bip;
+
+--
+-- Name: KodeOtp; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."KodeOtp" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ nomor text NOT NULL,
+ otp integer NOT NULL
+);
+
+
+ALTER TABLE public."KodeOtp" OWNER TO bip;
+
+--
+-- Name: MasterBank; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."MasterBank" (
+ id text NOT NULL,
+ "namaBank" text NOT NULL,
+ "namaAkun" text NOT NULL,
+ norek text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL
+);
+
+
+ALTER TABLE public."MasterBank" OWNER TO bip;
+
+--
+-- Name: MasterBidangBisnis; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."MasterBidangBisnis" (
+ id text NOT NULL,
+ name text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
+);
+
+
+ALTER TABLE public."MasterBidangBisnis" OWNER TO bip;
+
+--
+-- Name: MasterKategoriApp; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."MasterKategoriApp" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ name text NOT NULL,
+ value text
+);
+
+
+ALTER TABLE public."MasterKategoriApp" OWNER TO bip;
+
+--
+-- Name: MasterPembagianDeviden; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."MasterPembagianDeviden" (
+ id text NOT NULL,
+ name text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
+);
+
+
+ALTER TABLE public."MasterPembagianDeviden" OWNER TO bip;
+
+--
+-- Name: MasterPencarianInvestor; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."MasterPencarianInvestor" (
+ id text NOT NULL,
+ name text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
+);
+
+
+ALTER TABLE public."MasterPencarianInvestor" OWNER TO bip;
+
+--
+-- Name: MasterPeriodeDeviden; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."MasterPeriodeDeviden" (
+ id text NOT NULL,
+ name text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
+);
+
+
+ALTER TABLE public."MasterPeriodeDeviden" OWNER TO bip;
+
+--
+-- Name: MasterProgresInvestasi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."MasterProgresInvestasi" (
+ id text NOT NULL,
+ name text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL
+);
+
+
+ALTER TABLE public."MasterProgresInvestasi" OWNER TO bip;
+
+--
+-- Name: MasterStatus; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."MasterStatus" (
+ id text NOT NULL,
+ name text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL
+);
+
+
+ALTER TABLE public."MasterStatus" OWNER TO bip;
+
+--
+-- Name: MasterStatusInvestasi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."MasterStatusInvestasi" (
+ id text NOT NULL,
+ name text NOT NULL,
+ color text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
+);
+
+
+ALTER TABLE public."MasterStatusInvestasi" OWNER TO bip;
+
+--
+-- Name: MasterStatusTransaksiInvestasi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."MasterStatusTransaksiInvestasi" (
+ id text NOT NULL,
+ name text NOT NULL,
+ color text,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL
+);
+
+
+ALTER TABLE public."MasterStatusTransaksiInvestasi" OWNER TO bip;
+
+--
+-- Name: MasterUserRole; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."MasterUserRole" (
+ id text NOT NULL,
+ name text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" timestamp(3) without time zone
+);
+
+
+ALTER TABLE public."MasterUserRole" OWNER TO bip;
+
+--
+-- Name: NomorAdmin; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."NomorAdmin" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ nomor text NOT NULL
+);
+
+
+ALTER TABLE public."NomorAdmin" OWNER TO bip;
+
+--
+-- Name: Notifikasi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Notifikasi" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "isRead" boolean DEFAULT false NOT NULL,
+ "appId" text NOT NULL,
+ "kategoriApp" text NOT NULL,
+ pesan text NOT NULL,
+ title text,
+ status text,
+ "userRoleId" text NOT NULL,
+ "userId" text,
+ "adminId" text
+);
+
+
+ALTER TABLE public."Notifikasi" OWNER TO bip;
+
+--
+-- Name: Portofolio; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Portofolio" (
+ id text NOT NULL,
+ "id_Portofolio" text NOT NULL,
+ "namaBisnis" text NOT NULL,
+ "alamatKantor" text NOT NULL,
+ tlpn text NOT NULL,
+ deskripsi text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "profileId" text,
+ "masterBidangBisnisId" text NOT NULL,
+ "logoId" text
+);
+
+
+ALTER TABLE public."Portofolio" OWNER TO bip;
+
+--
+-- Name: Portofolio_MediaSosial; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Portofolio_MediaSosial" (
+ id text NOT NULL,
+ facebook text,
+ twitter text,
+ instagram text,
+ tiktok text,
+ youtube text,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "portofolioId" text
+);
+
+
+ALTER TABLE public."Portofolio_MediaSosial" OWNER TO bip;
+
+--
+-- Name: Profile; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Profile" (
+ id text NOT NULL,
+ name text NOT NULL,
+ email text NOT NULL,
+ alamat text NOT NULL,
+ "jenisKelamin" text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "userId" text,
+ "imageId" text,
+ "imageBackgroundId" text
+);
+
+
+ALTER TABLE public."Profile" OWNER TO bip;
+
+--
+-- Name: ProjectCollaboration; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."ProjectCollaboration" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ title text NOT NULL,
+ lokasi text NOT NULL,
+ purpose text NOT NULL,
+ benefit text,
+ "isReject" boolean DEFAULT false,
+ report text,
+ "projectCollaborationMaster_IndustriId" integer,
+ "userId" text,
+ "projectCollaborationMaster_StatusId" integer DEFAULT 1
+);
+
+
+ALTER TABLE public."ProjectCollaboration" OWNER TO bip;
+
+--
+-- Name: ProjectCollaborationMaster_Industri; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."ProjectCollaborationMaster_Industri" (
+ id integer NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ name text NOT NULL
+);
+
+
+ALTER TABLE public."ProjectCollaborationMaster_Industri" OWNER TO bip;
+
+--
+-- Name: ProjectCollaborationMaster_Industri_id_seq; Type: SEQUENCE; Schema: public; Owner: bip
+--
+
+CREATE SEQUENCE public."ProjectCollaborationMaster_Industri_id_seq"
+ AS integer
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+ALTER TABLE public."ProjectCollaborationMaster_Industri_id_seq" OWNER TO bip;
+
+--
+-- Name: ProjectCollaborationMaster_Industri_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bip
+--
+
+ALTER SEQUENCE public."ProjectCollaborationMaster_Industri_id_seq" OWNED BY public."ProjectCollaborationMaster_Industri".id;
+
+
+--
+-- Name: ProjectCollaborationMaster_Status; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."ProjectCollaborationMaster_Status" (
+ id integer NOT NULL,
+ name text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL
+);
+
+
+ALTER TABLE public."ProjectCollaborationMaster_Status" OWNER TO bip;
+
+--
+-- Name: ProjectCollaborationMaster_Status_id_seq; Type: SEQUENCE; Schema: public; Owner: bip
+--
+
+CREATE SEQUENCE public."ProjectCollaborationMaster_Status_id_seq"
+ AS integer
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+ALTER TABLE public."ProjectCollaborationMaster_Status_id_seq" OWNER TO bip;
+
+--
+-- Name: ProjectCollaborationMaster_Status_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bip
+--
+
+ALTER SEQUENCE public."ProjectCollaborationMaster_Status_id_seq" OWNED BY public."ProjectCollaborationMaster_Status".id;
+
+
+--
+-- Name: ProjectCollaboration_AnggotaRoomChat; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."ProjectCollaboration_AnggotaRoomChat" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "userId" text NOT NULL,
+ "projectCollaboration_RoomChatId" text
+);
+
+
+ALTER TABLE public."ProjectCollaboration_AnggotaRoomChat" OWNER TO bip;
+
+--
+-- Name: ProjectCollaboration_Message; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."ProjectCollaboration_Message" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ message text NOT NULL,
+ "isFile" boolean DEFAULT false,
+ "userId" text,
+ "projectCollaboration_RoomChatId" text
+);
+
+
+ALTER TABLE public."ProjectCollaboration_Message" OWNER TO bip;
+
+--
+-- Name: ProjectCollaboration_Notifikasi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."ProjectCollaboration_Notifikasi" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "isRead" boolean DEFAULT false NOT NULL,
+ note text,
+ "projectCollaborationId" text NOT NULL,
+ "adminId" text NOT NULL,
+ "userId" text NOT NULL
+);
+
+
+ALTER TABLE public."ProjectCollaboration_Notifikasi" OWNER TO bip;
+
+--
+-- Name: ProjectCollaboration_Partisipasi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."ProjectCollaboration_Partisipasi" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "userId" text,
+ "projectCollaborationId" text,
+ deskripsi_diri text NOT NULL
+);
+
+
+ALTER TABLE public."ProjectCollaboration_Partisipasi" OWNER TO bip;
+
+--
+-- Name: ProjectCollaboration_RoomChat; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."ProjectCollaboration_RoomChat" (
+ id text NOT NULL,
+ name text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "userId" text,
+ "projectCollaborationId" text
+);
+
+
+ALTER TABLE public."ProjectCollaboration_RoomChat" OWNER TO bip;
+
+--
+-- Name: ProspektusInvestasi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."ProspektusInvestasi" (
+ id text NOT NULL,
+ url text NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "investasiId" text,
+ "fileId" text,
+ title text
+);
+
+
+ALTER TABLE public."ProspektusInvestasi" OWNER TO bip;
+
+--
+-- Name: TransaksiInvestasi; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."TransaksiInvestasi" (
+ id text NOT NULL,
+ "investasiId" text NOT NULL,
+ "authorId" text NOT NULL,
+ "namaBank" text,
+ "nomorRekening" text,
+ token text,
+ redirect_url text,
+ quantity text NOT NULL,
+ price text NOT NULL,
+ gross_amount text NOT NULL,
+ merchant_name text NOT NULL,
+ status_code text,
+ status_message text,
+ transaction_id text,
+ order_id text,
+ payment_type text,
+ transaction_time text,
+ transaction_status text,
+ fraud_status text,
+ pdf_url text,
+ finish_redirect_url text,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "masterStatusTransaksiInvestasiId" text DEFAULT '1'::text
+);
+
+
+ALTER TABLE public."TransaksiInvestasi" OWNER TO bip;
+
+--
+-- Name: User; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."User" (
+ id text NOT NULL,
+ active boolean DEFAULT false NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP,
+ "masterUserRoleId" text DEFAULT '1'::text NOT NULL,
+ nomor text NOT NULL,
+ "updatedAt" timestamp(3) without time zone,
+ username text NOT NULL
+);
+
+
+ALTER TABLE public."User" OWNER TO bip;
+
+--
+-- Name: UserSession; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."UserSession" (
+ id text NOT NULL,
+ token text NOT NULL,
+ expires timestamp(3) without time zone,
+ active boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "userId" text NOT NULL
+);
+
+
+ALTER TABLE public."UserSession" OWNER TO bip;
+
+--
+-- Name: Voting; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Voting" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "isArsip" boolean DEFAULT false NOT NULL,
+ title text NOT NULL,
+ deskripsi text NOT NULL,
+ "awalVote" timestamp(3) without time zone NOT NULL,
+ "akhirVote" timestamp(3) without time zone NOT NULL,
+ catatan text,
+ "authorId" text NOT NULL,
+ "voting_StatusId" text DEFAULT '2'::text
+);
+
+
+ALTER TABLE public."Voting" OWNER TO bip;
+
+--
+-- Name: Voting_DaftarNamaVote; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Voting_DaftarNamaVote" (
+ id text NOT NULL,
+ value text NOT NULL,
+ jumlah integer DEFAULT 0 NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "votingId" text
+);
+
+
+ALTER TABLE public."Voting_DaftarNamaVote" OWNER TO bip;
+
+--
+-- Name: Voting_Kontributor; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Voting_Kontributor" (
+ id text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL,
+ "votingId" text,
+ "authorId" text,
+ "voting_DaftarNamaVoteId" text
+);
+
+
+ALTER TABLE public."Voting_Kontributor" OWNER TO bip;
+
+--
+-- Name: Voting_Status; Type: TABLE; Schema: public; Owner: bip
+--
+
+CREATE TABLE public."Voting_Status" (
+ id text NOT NULL,
+ name text NOT NULL,
+ "isActive" boolean DEFAULT true NOT NULL,
+ "createdAt" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ "updatedAt" timestamp(3) without time zone NOT NULL
+);
+
+
+ALTER TABLE public."Voting_Status" OWNER TO bip;
+
+--
+-- Name: EventMaster_TipeAcara id; Type: DEFAULT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."EventMaster_TipeAcara" ALTER COLUMN id SET DEFAULT nextval('public."EventMaster_TipeAcara_id_seq"'::regclass);
+
+
+--
+-- Name: ForumMaster_KategoriReport id; Type: DEFAULT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ForumMaster_KategoriReport" ALTER COLUMN id SET DEFAULT nextval('public."ForumMaster_KategoriReport_id_seq"'::regclass);
+
+
+--
+-- Name: ForumMaster_StatusPosting id; Type: DEFAULT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ForumMaster_StatusPosting" ALTER COLUMN id SET DEFAULT nextval('public."ForumMaster_StatusPosting_id_seq"'::regclass);
+
+
+--
+-- Name: ProjectCollaborationMaster_Industri id; Type: DEFAULT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaborationMaster_Industri" ALTER COLUMN id SET DEFAULT nextval('public."ProjectCollaborationMaster_Industri_id_seq"'::regclass);
+
+
+--
+-- Name: ProjectCollaborationMaster_Status id; Type: DEFAULT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaborationMaster_Status" ALTER COLUMN id SET DEFAULT nextval('public."ProjectCollaborationMaster_Status_id_seq"'::regclass);
+
+
+--
+-- Data for Name: BeritaInvestasi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."BeritaInvestasi" (id, title, deskripsi, active, "createdAt", "updatedAt", "imagesId", "investasiId", "imageId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: BusinessMaps; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."BusinessMaps" (id, "isActive", "createdAt", "updatedAt", "namePin", latitude, longitude, "authorId", "portofolioId", "imageId", "pinId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: DokumenInvestasi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."DokumenInvestasi" (id, title, url, active, "createdAt", "updatedAt", "investasiId", "fileId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Donasi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Donasi" (id, title, target, active, "createdAt", "updatedAt", "publishTime", catatan, progres, terkumpul, "namaBank", rekening, "akumulasiPencairan", "totalPencairan", "authorId", "imagesId", "donasiMaster_KategoriId", "donasiMaster_DurasiId", "donasiMaster_StatusDonasiId", "imageId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: DonasiMaster_Bank; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."DonasiMaster_Bank" (id, name, norek, active, "createdAt", "updatedAt") FROM stdin;
+1 BRI 9065456754325643 t 2025-01-23 02:59:24.313 2025-01-23 02:59:24.313
+2 BCA 2304235678854332 t 2025-01-23 02:59:24.315 2025-01-23 02:59:24.315
+3 BNI 1104786754324564 t 2025-01-23 02:59:24.316 2025-01-23 02:59:24.316
+4 BSI 7076543567898976 t 2025-01-23 02:59:24.317 2025-01-23 02:59:24.317
+\.
+
+
+--
+-- Data for Name: DonasiMaster_Durasi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."DonasiMaster_Durasi" (id, name, active, "createdAt", "updatedAt") FROM stdin;
+1 30 t 2025-01-23 02:59:24.308 2025-01-23 02:59:24.308
+2 60 t 2025-01-23 02:59:24.311 2025-01-23 02:59:24.311
+3 90 t 2025-01-23 02:59:24.312 2025-01-23 02:59:24.312
+4 120 t 2025-01-23 02:59:24.313 2025-01-23 02:59:24.313
+\.
+
+
+--
+-- Data for Name: DonasiMaster_Kategori; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."DonasiMaster_Kategori" (id, name, active, "createdAt", "updatedAt") FROM stdin;
+1 Medis t 2025-01-23 02:59:24.304 2025-01-23 02:59:24.304
+2 Kegiatan Sosial t 2025-01-23 02:59:24.305 2025-01-23 02:59:24.305
+3 Pendidikan t 2025-01-23 02:59:24.306 2025-01-23 02:59:24.306
+4 Rumah Ibadah t 2025-01-23 02:59:24.307 2025-01-23 02:59:24.307
+5 Bencana Alam t 2025-01-23 02:59:24.307 2025-01-23 02:59:24.307
+\.
+
+
+--
+-- Data for Name: DonasiMaster_StatusDonasi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."DonasiMaster_StatusDonasi" (id, name, active, "createdAt", "updatedAt") FROM stdin;
+1 Publish t 2025-01-23 02:59:24.3 2025-01-23 02:59:24.3
+2 Review t 2025-01-23 02:59:24.302 2025-01-23 02:59:24.302
+3 Draft t 2025-01-23 02:59:24.302 2025-01-23 02:59:24.302
+4 Reject t 2025-01-23 02:59:24.303 2025-01-23 02:59:24.303
+\.
+
+
+--
+-- Data for Name: DonasiMaster_StatusInvoice; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."DonasiMaster_StatusInvoice" (id, name, active, "createdAt", "updatedAt") FROM stdin;
+1 Berhasil t 2025-01-23 02:59:24.318 2025-01-23 02:59:24.318
+2 Proses t 2025-01-23 02:59:24.319 2025-01-23 02:59:24.319
+3 Menunggu t 2025-01-23 02:59:24.32 2025-01-23 02:59:24.32
+4 Gagal t 2025-01-23 02:59:24.32 2025-01-23 02:59:24.32
+\.
+
+
+--
+-- Data for Name: Donasi_Cerita; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Donasi_Cerita" (id, pembukaan, cerita, active, "createdAt", "updatedAt", "imagesId", "donasiId", "imageId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Donasi_Invoice; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Donasi_Invoice" (id, nominal, active, "createdAt", "updatedAt", "donasiId", "donasiMaster_BankId", "donasiMaster_StatusInvoiceId", "authorId", "imagesId", "imageId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Donasi_Kabar; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Donasi_Kabar" (id, title, deskripsi, active, "createdAt", "updatedAt", "donasiId", "imagesId", "imageId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Donasi_Notif; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Donasi_Notif" (id, "isRead", active, "createdAt", "updatedAt", "userId", "donasi_KabarId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Donasi_PencairanDana; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Donasi_PencairanDana" (id, "nominalCair", title, deskripsi, active, "createdAt", "updatedAt", "donasiId", "imagesId", "imageId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Donasi_TemporaryCreate; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Donasi_TemporaryCreate" (id, title, target, active, "createdAt", "updatedAt", "imagesId", "donasiMaster_KategoriId", "donasiMaster_DurasiId", "imageId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Event; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Event" (id, title, lokasi, tanggal, deskripsi, active, "createdAt", "updatedAt", catatan, "tanggalSelesai", "isArsip", "authorId", "eventMaster_StatusId", "eventMaster_TipeAcaraId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: EventMaster_Status; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."EventMaster_Status" (id, name, active, "createdAt", "updatedAt") FROM stdin;
+1 Publish t 2025-01-23 02:59:24.321 2025-01-23 02:59:24.321
+2 Review t 2025-01-23 02:59:24.323 2025-01-23 02:59:24.323
+3 Draft t 2025-01-23 02:59:24.325 2025-01-23 02:59:24.325
+4 Reject t 2025-01-23 02:59:24.326 2025-01-23 02:59:24.326
+\.
+
+
+--
+-- Data for Name: EventMaster_TipeAcara; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."EventMaster_TipeAcara" (id, name, active, "createdAt", "updatedAt") FROM stdin;
+1 Seminar t 2025-01-23 02:59:24.327 2025-01-23 02:59:24.327
+2 Workshop t 2025-01-23 02:59:24.332 2025-01-23 02:59:24.332
+3 Konferensi t 2025-01-23 02:59:24.333 2025-01-23 02:59:24.333
+4 Musyawarah Anggota t 2025-01-23 02:59:24.333 2025-01-23 02:59:24.333
+5 Kegiatan Sosial t 2025-01-23 02:59:24.334 2025-01-23 02:59:24.334
+\.
+
+
+--
+-- Data for Name: EventSponsor; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."EventSponsor" (id, "isActive", "createdAt", "updatedAt", name, "fileName", "fileExt", "fileId", "auhtorId", "eventId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: EventTransaksi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."EventTransaksi" (id, "isActive", "createdAt", "updatedAt", nominal, "masterBankId", status, "transferImageId", "authorId", "eventId", "eventSponsorId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Event_Peserta; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Event_Peserta" (id, active, "createdAt", "updatedAt", "isPresent", "eventId", "userId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: ForumMaster_KategoriReport; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."ForumMaster_KategoriReport" (id, "isActive", "createdAt", "updatedAt", title, deskripsi) FROM stdin;
+1 t 2025-01-23 02:59:24.343 2025-01-23 02:59:24.343 Kebencian Cercaan, Stereotip rasis atau seksis, Dehumanisasi, Menyulut ketakutan atau diskriminasi, Referensi kebencian, Simbol & logo kebencian
+2 t 2025-01-23 02:59:24.352 2025-01-23 02:59:24.352 Penghinaan & Pelecehan secara Online Penghinaan, Konten Seksual yang Tidak Diinginkan, Penyangkalan Peristiwa Kekerasan, Pelecehan Bertarget dan Memprovokasi Pelecehan
+3 t 2025-01-23 02:59:24.353 2025-01-23 02:59:24.353 Tutur Kekerasan Ancaman Kekerasan, Berharap Terjadinya Celaka, Mengagungkan Kekerasan, Penghasutan Kekerasan, Penghasutan Kekerasan dengan Kode
+4 t 2025-01-23 02:59:24.355 2025-01-23 02:59:24.355 Keselamatan Anak Eksploitasi seks anak di bawah umur, grooming, kekerasan fisik terhadap anak, pengguna di bawah umur
+5 t 2025-01-23 02:59:24.356 2025-01-23 02:59:24.356 Privasi Membagikan informasi pribadi, mengancam akan membagikan/menyebarkan informasi pribadi, membagikan gambar intim tanpa persetujuan, membagikan gambar saya yang tidak saya kehendaki di platform ini
+6 t 2025-01-23 02:59:24.357 2025-01-23 02:59:24.357 Spam Akun palsu, penipuan keuangan, memposting tautan berbahaya, menyalahgunakan hashtag, keterlibatan palsu, balasan berulang, Posting Ulang, atau Direct Message
+\.
+
+
+--
+-- Data for Name: ForumMaster_StatusPosting; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."ForumMaster_StatusPosting" (id, "isActive", "createdAt", "updatedAt", status) FROM stdin;
+1 t 2025-01-23 02:59:24.359 2025-01-23 02:59:24.359 Open
+2 t 2025-01-23 02:59:24.362 2025-01-23 02:59:24.362 Closed
+\.
+
+
+--
+-- Data for Name: Forum_Komentar; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Forum_Komentar" (id, "isActive", "createdAt", "updatedAt", komentar, "forum_PostingId", "authorId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Forum_Posting; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Forum_Posting" (id, "isActive", "createdAt", "updatedAt", "publishAt", diskusi, "authorId", "forumMaster_StatusPostingId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Forum_ReportKomentar; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Forum_ReportKomentar" (id, "isActive", "createdAt", "updatedAt", deskripsi, "forumMaster_KategoriReportId", "forum_KomentarId", "userId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Forum_ReportPosting; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Forum_ReportPosting" (id, "isActive", "createdAt", "updatedAt", deskripsi, "forumMaster_KategoriReportId", "forum_PostingId", "userId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Images; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Images" (id, url, label, active, "createdAt", "updatedAt") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Investasi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Investasi" (id, title, "targetDana", "hargaLembar", "totalLembar", roi, active, "countDown", "createdAt", "updatedAt", "authorId", catatan, "sisaLembar", "lembarTerbeli", progress, "masterPeriodeDevidenId", "masterPembagianDevidenId", "masterPencarianInvestorId", "imagesId", "masterStatusInvestasiId", "masterProgresInvestasiId", "imageId", "prospektusFileId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: InvestasiMaster_StatusInvoice; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."InvestasiMaster_StatusInvoice" (id, name, "isActive", "createdAt", "updatedAt") FROM stdin;
+1 Berhasil t 2025-01-23 02:59:24.391 2025-01-23 02:59:24.391
+2 Proses t 2025-01-23 02:59:24.394 2025-01-23 02:59:24.394
+3 Menunggu t 2025-01-23 02:59:24.394 2025-01-23 02:59:24.394
+4 Gagal t 2025-01-23 02:59:24.395 2025-01-23 02:59:24.395
+\.
+
+
+--
+-- Data for Name: Investasi_Invoice; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Investasi_Invoice" (id, "isActive", "createdAt", "updatedAt", nominal, "lembarTerbeli", "investasiId", "masterBankId", "statusInvoiceId", "authorId", "imagesId", "imageId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Job; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Job" (id, "isActive", "createdAt", "updatedAt", "isArsip", catatan, title, content, deskripsi, "authorId", "masterStatusId", "imageId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: KodeOtp; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."KodeOtp" (id, "isActive", "createdAt", "updatedAt", nomor, otp) FROM stdin;
+cm68pm6ko0000wphyvrmd8j3l t 2025-01-23 02:24:18.87 2025-01-23 02:24:18.87 6282340374412 8964
+cm68pzrr2000awphyi0sdyp5v t 2025-01-23 02:34:52.862 2025-01-23 02:34:52.862 628234037441 2520
+cm68qcugj000cwphy2bjuw22r t 2025-01-23 02:45:02.898 2025-01-23 02:45:02.898 628234037441 1673
+cm68qh2pj000ewphy4qs5ismv t 2025-01-23 02:48:20.216 2025-01-23 02:48:20.216 6289647037426 5112
+cm68qrjvk0000bmx164jj6y7q t 2025-01-23 02:56:29.024 2025-01-23 02:56:29.024 6289647037426 3106
+\.
+
+
+--
+-- Data for Name: MasterBank; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."MasterBank" (id, "namaBank", "namaAkun", norek, "isActive", "createdAt", "updatedAt") FROM stdin;
+1 BRI Himpunan Pengusaha Muda Indonesia 9065456754325643 t 2025-01-23 02:59:24.286 2025-01-23 02:59:24.286
+2 BCA Himpunan Pengusaha Muda Indonesia 2304235678854332 t 2025-01-23 02:59:24.288 2025-01-23 02:59:24.288
+3 BNI Himpunan Pengusaha Muda Indonesia 1104786754324564 t 2025-01-23 02:59:24.289 2025-01-23 02:59:24.289
+4 BSI Himpunan Pengusaha Muda Indonesia 7076543567898976 t 2025-01-23 02:59:24.29 2025-01-23 02:59:24.29
+\.
+
+
+--
+-- Data for Name: MasterBidangBisnis; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."MasterBidangBisnis" (id, name, active, "createdAt", "updatedAt") FROM stdin;
+1 Software Developer t 2025-01-23 02:59:24.26 2025-01-23 02:59:24.26
+2 Makanan & Minuman t 2025-01-23 02:59:24.264 2025-01-23 02:59:24.264
+3 Kosmetik t 2025-01-23 02:59:24.265 2025-01-23 02:59:24.265
+4 Mesin Mobil t 2025-01-23 02:59:24.266 2025-01-23 02:59:24.266
+5 Rental Kendaraan t 2025-01-23 02:59:24.267 2025-01-23 02:59:24.267
+6 Kedokteran t 2025-01-23 02:59:24.268 2025-01-23 02:59:24.268
+\.
+
+
+--
+-- Data for Name: MasterKategoriApp; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."MasterKategoriApp" (id, "isActive", "createdAt", "updatedAt", name, value) FROM stdin;
+1 t 2025-01-23 02:59:24.383 2025-01-23 02:59:24.383 Event \N
+2 t 2025-01-23 02:59:24.387 2025-01-23 02:59:24.387 Job \N
+3 t 2025-01-23 02:59:24.387 2025-01-23 02:59:24.387 Voting \N
+4 t 2025-01-23 02:59:24.388 2025-01-23 02:59:24.388 Donasi \N
+5 t 2025-01-23 02:59:24.389 2025-01-23 02:59:24.389 Investasi \N
+6 t 2025-01-23 02:59:24.39 2025-01-23 02:59:24.39 Forum \N
+7 t 2025-01-23 02:59:24.391 2025-01-23 02:59:24.391 Collaboration \N
+\.
+
+
+--
+-- Data for Name: MasterPembagianDeviden; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."MasterPembagianDeviden" (id, name, active, "createdAt", "updatedAt") FROM stdin;
+1 3 t 2025-01-23 02:59:24.275 2025-01-23 02:59:24.275
+2 6 t 2025-01-23 02:59:24.277 2025-01-23 02:59:24.277
+3 9 t 2025-01-23 02:59:24.278 2025-01-23 02:59:24.278
+4 12 t 2025-01-23 02:59:24.279 2025-01-23 02:59:24.279
+\.
+
+
+--
+-- Data for Name: MasterPencarianInvestor; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."MasterPencarianInvestor" (id, name, active, "createdAt", "updatedAt") FROM stdin;
+1 30 t 2025-01-23 02:59:24.269 2025-01-23 02:59:24.269
+2 60 t 2025-01-23 02:59:24.273 2025-01-23 02:59:24.273
+3 90 t 2025-01-23 02:59:24.274 2025-01-23 02:59:24.274
+4 120 t 2025-01-23 02:59:24.274 2025-01-23 02:59:24.274
+\.
+
+
+--
+-- Data for Name: MasterPeriodeDeviden; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."MasterPeriodeDeviden" (id, name, active, "createdAt", "updatedAt") FROM stdin;
+1 Selamanya t 2025-01-23 02:59:24.279 2025-01-23 02:59:24.279
+2 Satu tahun t 2025-01-23 02:59:24.281 2025-01-23 02:59:24.281
+\.
+
+
+--
+-- Data for Name: MasterProgresInvestasi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."MasterProgresInvestasi" (id, name, active, "createdAt", "updatedAt") FROM stdin;
+1 Dalam Proses t 2025-01-23 02:59:24.296 2025-01-23 02:59:24.296
+2 Selesai t 2025-01-23 02:59:24.298 2025-01-23 02:59:24.298
+3 Waktu Habis t 2025-01-23 02:59:24.299 2025-01-23 02:59:24.299
+\.
+
+
+--
+-- Data for Name: MasterStatus; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."MasterStatus" (id, name, "isActive", "createdAt", "updatedAt") FROM stdin;
+1 Publish t 2025-01-23 02:59:24.339 2025-01-23 02:59:24.339
+2 Review t 2025-01-23 02:59:24.341 2025-01-23 02:59:24.341
+3 Draft t 2025-01-23 02:59:24.342 2025-01-23 02:59:24.342
+4 Reject t 2025-01-23 02:59:24.343 2025-01-23 02:59:24.343
+\.
+
+
+--
+-- Data for Name: MasterStatusInvestasi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."MasterStatusInvestasi" (id, name, color, active, "createdAt", "updatedAt") FROM stdin;
+1 Publish green t 2025-01-23 02:59:24.282 2025-01-23 02:59:24.282
+2 Review orange t 2025-01-23 02:59:24.283 2025-01-23 02:59:24.283
+3 Draft yellow t 2025-01-23 02:59:24.284 2025-01-23 02:59:24.284
+4 Reject red t 2025-01-23 02:59:24.285 2025-01-23 02:59:24.285
+\.
+
+
+--
+-- Data for Name: MasterStatusTransaksiInvestasi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."MasterStatusTransaksiInvestasi" (id, name, color, active, "createdAt", "updatedAt") FROM stdin;
+1 Menunggu yellow t 2025-01-23 02:59:24.291 2025-01-23 02:59:24.291
+2 Proses orange t 2025-01-23 02:59:24.294 2025-01-23 02:59:24.294
+3 Berhasil green t 2025-01-23 02:59:24.295 2025-01-23 02:59:24.295
+4 Gagal red t 2025-01-23 02:59:24.295 2025-01-23 02:59:24.295
+\.
+
+
+--
+-- Data for Name: MasterUserRole; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."MasterUserRole" (id, name, active, "createdAt", "updatedAt") FROM stdin;
+1 User t 2025-01-23 02:59:24.231 2025-01-23 02:59:24.231
+2 Admin t 2025-01-23 02:59:24.251 2025-01-23 02:59:24.251
+3 Super Admin t 2025-01-23 02:59:24.254 2025-01-23 02:59:24.254
+\.
+
+
+--
+-- Data for Name: NomorAdmin; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."NomorAdmin" (id, "isActive", "createdAt", "updatedAt", nomor) FROM stdin;
+Nomor-Admin-1234 t 2025-01-23 02:59:24.382 2025-01-23 02:59:24.382 6289697338821
+\.
+
+
+--
+-- Data for Name: Notifikasi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Notifikasi" (id, "isActive", "createdAt", "updatedAt", "isRead", "appId", "kategoriApp", pesan, title, status, "userRoleId", "userId", "adminId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Portofolio; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Portofolio" (id, "id_Portofolio", "namaBisnis", "alamatKantor", tlpn, deskripsi, active, "createdAt", "updatedAt", "profileId", "masterBidangBisnisId", "logoId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Portofolio_MediaSosial; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Portofolio_MediaSosial" (id, facebook, twitter, instagram, tiktok, youtube, active, "createdAt", "updatedAt", "portofolioId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Profile; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Profile" (id, name, email, alamat, "jenisKelamin", active, "createdAt", "updatedAt", "userId", "imageId", "imageBackgroundId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: ProjectCollaboration; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."ProjectCollaboration" (id, "isActive", "createdAt", "updatedAt", title, lokasi, purpose, benefit, "isReject", report, "projectCollaborationMaster_IndustriId", "userId", "projectCollaborationMaster_StatusId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: ProjectCollaborationMaster_Industri; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."ProjectCollaborationMaster_Industri" (id, "isActive", "createdAt", "updatedAt", name) FROM stdin;
+1 t 2025-01-23 02:59:24.363 2025-01-23 02:59:24.363 Software Developer
+2 t 2025-01-23 02:59:24.368 2025-01-23 02:59:24.368 Makanan & Minuman
+3 t 2025-01-23 02:59:24.37 2025-01-23 02:59:24.37 Kosmetik
+4 t 2025-01-23 02:59:24.371 2025-01-23 02:59:24.371 Furniture
+5 t 2025-01-23 02:59:24.373 2025-01-23 02:59:24.373 Kendaraan
+6 t 2025-01-23 02:59:24.374 2025-01-23 02:59:24.374 Kesehatan
+\.
+
+
+--
+-- Data for Name: ProjectCollaborationMaster_Status; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."ProjectCollaborationMaster_Status" (id, name, "isActive", "createdAt", "updatedAt") FROM stdin;
+1 Publish t 2025-01-23 02:59:24.376 2025-01-23 02:59:24.376
+2 Review t 2025-01-23 02:59:24.379 2025-01-23 02:59:24.379
+3 Reject t 2025-01-23 02:59:24.38 2025-01-23 02:59:24.38
+\.
+
+
+--
+-- Data for Name: ProjectCollaboration_AnggotaRoomChat; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."ProjectCollaboration_AnggotaRoomChat" (id, "isActive", "createdAt", "updatedAt", "userId", "projectCollaboration_RoomChatId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: ProjectCollaboration_Message; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."ProjectCollaboration_Message" (id, "isActive", "createdAt", "updatedAt", message, "isFile", "userId", "projectCollaboration_RoomChatId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: ProjectCollaboration_Notifikasi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."ProjectCollaboration_Notifikasi" (id, "isActive", "createdAt", "updatedAt", "isRead", note, "projectCollaborationId", "adminId", "userId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: ProjectCollaboration_Partisipasi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."ProjectCollaboration_Partisipasi" (id, "isActive", "createdAt", "updatedAt", "userId", "projectCollaborationId", deskripsi_diri) FROM stdin;
+\.
+
+
+--
+-- Data for Name: ProjectCollaboration_RoomChat; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."ProjectCollaboration_RoomChat" (id, name, "isActive", "createdAt", "updatedAt", "userId", "projectCollaborationId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: ProspektusInvestasi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."ProspektusInvestasi" (id, url, active, "createdAt", "updatedAt", "investasiId", "fileId", title) FROM stdin;
+\.
+
+
+--
+-- Data for Name: TransaksiInvestasi; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."TransaksiInvestasi" (id, "investasiId", "authorId", "namaBank", "nomorRekening", token, redirect_url, quantity, price, gross_amount, merchant_name, status_code, status_message, transaction_id, order_id, payment_type, transaction_time, transaction_status, fraud_status, pdf_url, finish_redirect_url, active, "createdAt", "updatedAt", "masterStatusTransaksiInvestasiId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: User; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."User" (id, active, "createdAt", "masterUserRoleId", nomor, "updatedAt", username) FROM stdin;
+cm68qvb3300018vfy1n5b0yxd t 2025-01-23 02:59:24.255 3 6282340374412 2025-01-23 02:59:24.255 bagas_admin
+cm68qvb3700038vfy8nucraat t 2025-01-23 02:59:24.259 2 628123833845 2025-01-23 02:59:24.259 fahmi_admin
+cm68qvb3700038vfy8nucraatc t 2025-01-23 02:59:24.259 2 6281238338454 2025-01-23 02:59:24.259 fahmi_adminx
+\.
+
+
+--
+-- Data for Name: UserSession; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."UserSession" (id, token, expires, active, "createdAt", "updatedAt", "userId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Voting; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Voting" (id, "isActive", "createdAt", "updatedAt", "isArsip", title, deskripsi, "awalVote", "akhirVote", catatan, "authorId", "voting_StatusId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Voting_DaftarNamaVote; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Voting_DaftarNamaVote" (id, value, jumlah, "isActive", "createdAt", "updatedAt", "votingId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Voting_Kontributor; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Voting_Kontributor" (id, "isActive", "createdAt", "updatedAt", "votingId", "authorId", "voting_DaftarNamaVoteId") FROM stdin;
+\.
+
+
+--
+-- Data for Name: Voting_Status; Type: TABLE DATA; Schema: public; Owner: bip
+--
+
+COPY public."Voting_Status" (id, name, "isActive", "createdAt", "updatedAt") FROM stdin;
+1 Publish t 2025-01-23 02:59:24.335 2025-01-23 02:59:24.335
+2 Review t 2025-01-23 02:59:24.338 2025-01-23 02:59:24.338
+3 Draft t 2025-01-23 02:59:24.338 2025-01-23 02:59:24.338
+4 Reject t 2025-01-23 02:59:24.339 2025-01-23 02:59:24.339
+\.
+
+
+--
+-- Name: EventMaster_TipeAcara_id_seq; Type: SEQUENCE SET; Schema: public; Owner: bip
+--
+
+SELECT pg_catalog.setval('public."EventMaster_TipeAcara_id_seq"', 1, false);
+
+
+--
+-- Name: ForumMaster_KategoriReport_id_seq; Type: SEQUENCE SET; Schema: public; Owner: bip
+--
+
+SELECT pg_catalog.setval('public."ForumMaster_KategoriReport_id_seq"', 6, true);
+
+
+--
+-- Name: ForumMaster_StatusPosting_id_seq; Type: SEQUENCE SET; Schema: public; Owner: bip
+--
+
+SELECT pg_catalog.setval('public."ForumMaster_StatusPosting_id_seq"', 2, true);
+
+
+--
+-- Name: ProjectCollaborationMaster_Industri_id_seq; Type: SEQUENCE SET; Schema: public; Owner: bip
+--
+
+SELECT pg_catalog.setval('public."ProjectCollaborationMaster_Industri_id_seq"', 6, true);
+
+
+--
+-- Name: ProjectCollaborationMaster_Status_id_seq; Type: SEQUENCE SET; Schema: public; Owner: bip
+--
+
+SELECT pg_catalog.setval('public."ProjectCollaborationMaster_Status_id_seq"', 3, true);
+
+
+--
+-- Name: BeritaInvestasi BeritaInvestasi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."BeritaInvestasi"
+ ADD CONSTRAINT "BeritaInvestasi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: BusinessMaps BusinessMaps_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."BusinessMaps"
+ ADD CONSTRAINT "BusinessMaps_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: DokumenInvestasi DokumenInvestasi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."DokumenInvestasi"
+ ADD CONSTRAINT "DokumenInvestasi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: DonasiMaster_Bank DonasiMaster_Bank_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."DonasiMaster_Bank"
+ ADD CONSTRAINT "DonasiMaster_Bank_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: DonasiMaster_Durasi DonasiMaster_Durasi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."DonasiMaster_Durasi"
+ ADD CONSTRAINT "DonasiMaster_Durasi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: DonasiMaster_Kategori DonasiMaster_Kategori_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."DonasiMaster_Kategori"
+ ADD CONSTRAINT "DonasiMaster_Kategori_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: DonasiMaster_StatusDonasi DonasiMaster_StatusDonasi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."DonasiMaster_StatusDonasi"
+ ADD CONSTRAINT "DonasiMaster_StatusDonasi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: DonasiMaster_StatusInvoice DonasiMaster_StatusInvoice_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."DonasiMaster_StatusInvoice"
+ ADD CONSTRAINT "DonasiMaster_StatusInvoice_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Donasi_Cerita Donasi_Cerita_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Cerita"
+ ADD CONSTRAINT "Donasi_Cerita_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Donasi_Invoice Donasi_Invoice_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Invoice"
+ ADD CONSTRAINT "Donasi_Invoice_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Donasi_Kabar Donasi_Kabar_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Kabar"
+ ADD CONSTRAINT "Donasi_Kabar_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Donasi_Notif Donasi_Notif_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Notif"
+ ADD CONSTRAINT "Donasi_Notif_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Donasi_PencairanDana Donasi_PencairanDana_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_PencairanDana"
+ ADD CONSTRAINT "Donasi_PencairanDana_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Donasi_TemporaryCreate Donasi_TemporaryCreate_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_TemporaryCreate"
+ ADD CONSTRAINT "Donasi_TemporaryCreate_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Donasi Donasi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi"
+ ADD CONSTRAINT "Donasi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: EventMaster_Status EventMaster_Status_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."EventMaster_Status"
+ ADD CONSTRAINT "EventMaster_Status_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: EventMaster_TipeAcara EventMaster_TipeAcara_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."EventMaster_TipeAcara"
+ ADD CONSTRAINT "EventMaster_TipeAcara_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: EventSponsor EventSponsor_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."EventSponsor"
+ ADD CONSTRAINT "EventSponsor_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: EventTransaksi EventTransaksi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."EventTransaksi"
+ ADD CONSTRAINT "EventTransaksi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Event_Peserta Event_Peserta_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Event_Peserta"
+ ADD CONSTRAINT "Event_Peserta_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Event Event_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Event"
+ ADD CONSTRAINT "Event_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: ForumMaster_KategoriReport ForumMaster_KategoriReport_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ForumMaster_KategoriReport"
+ ADD CONSTRAINT "ForumMaster_KategoriReport_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: ForumMaster_StatusPosting ForumMaster_StatusPosting_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ForumMaster_StatusPosting"
+ ADD CONSTRAINT "ForumMaster_StatusPosting_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Forum_Komentar Forum_Komentar_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Forum_Komentar"
+ ADD CONSTRAINT "Forum_Komentar_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Forum_Posting Forum_Posting_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Forum_Posting"
+ ADD CONSTRAINT "Forum_Posting_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Forum_ReportKomentar Forum_ReportKomentar_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Forum_ReportKomentar"
+ ADD CONSTRAINT "Forum_ReportKomentar_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Forum_ReportPosting Forum_ReportPosting_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Forum_ReportPosting"
+ ADD CONSTRAINT "Forum_ReportPosting_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Images Images_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Images"
+ ADD CONSTRAINT "Images_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: InvestasiMaster_StatusInvoice InvestasiMaster_StatusInvoice_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."InvestasiMaster_StatusInvoice"
+ ADD CONSTRAINT "InvestasiMaster_StatusInvoice_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Investasi_Invoice Investasi_Invoice_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Investasi_Invoice"
+ ADD CONSTRAINT "Investasi_Invoice_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Investasi Investasi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Investasi"
+ ADD CONSTRAINT "Investasi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Job Job_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Job"
+ ADD CONSTRAINT "Job_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: KodeOtp KodeOtp_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."KodeOtp"
+ ADD CONSTRAINT "KodeOtp_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: MasterBank MasterBank_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."MasterBank"
+ ADD CONSTRAINT "MasterBank_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: MasterBidangBisnis MasterBidangBisnis_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."MasterBidangBisnis"
+ ADD CONSTRAINT "MasterBidangBisnis_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: MasterKategoriApp MasterKategoriApp_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."MasterKategoriApp"
+ ADD CONSTRAINT "MasterKategoriApp_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: MasterPembagianDeviden MasterPembagianDeviden_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."MasterPembagianDeviden"
+ ADD CONSTRAINT "MasterPembagianDeviden_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: MasterPencarianInvestor MasterPencarianInvestor_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."MasterPencarianInvestor"
+ ADD CONSTRAINT "MasterPencarianInvestor_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: MasterPeriodeDeviden MasterPeriodeDeviden_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."MasterPeriodeDeviden"
+ ADD CONSTRAINT "MasterPeriodeDeviden_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: MasterProgresInvestasi MasterProgresInvestasi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."MasterProgresInvestasi"
+ ADD CONSTRAINT "MasterProgresInvestasi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: MasterStatusInvestasi MasterStatusInvestasi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."MasterStatusInvestasi"
+ ADD CONSTRAINT "MasterStatusInvestasi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: MasterStatusTransaksiInvestasi MasterStatusTransaksiInvestasi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."MasterStatusTransaksiInvestasi"
+ ADD CONSTRAINT "MasterStatusTransaksiInvestasi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: MasterStatus MasterStatus_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."MasterStatus"
+ ADD CONSTRAINT "MasterStatus_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: MasterUserRole MasterUserRole_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."MasterUserRole"
+ ADD CONSTRAINT "MasterUserRole_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: NomorAdmin NomorAdmin_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."NomorAdmin"
+ ADD CONSTRAINT "NomorAdmin_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Notifikasi Notifikasi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Notifikasi"
+ ADD CONSTRAINT "Notifikasi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Portofolio_MediaSosial Portofolio_MediaSosial_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Portofolio_MediaSosial"
+ ADD CONSTRAINT "Portofolio_MediaSosial_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Portofolio Portofolio_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Portofolio"
+ ADD CONSTRAINT "Portofolio_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Profile Profile_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Profile"
+ ADD CONSTRAINT "Profile_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: ProjectCollaborationMaster_Industri ProjectCollaborationMaster_Industri_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaborationMaster_Industri"
+ ADD CONSTRAINT "ProjectCollaborationMaster_Industri_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: ProjectCollaborationMaster_Status ProjectCollaborationMaster_Status_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaborationMaster_Status"
+ ADD CONSTRAINT "ProjectCollaborationMaster_Status_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: ProjectCollaboration_AnggotaRoomChat ProjectCollaboration_AnggotaRoomChat_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_AnggotaRoomChat"
+ ADD CONSTRAINT "ProjectCollaboration_AnggotaRoomChat_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: ProjectCollaboration_Message ProjectCollaboration_Message_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_Message"
+ ADD CONSTRAINT "ProjectCollaboration_Message_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: ProjectCollaboration_Notifikasi ProjectCollaboration_Notifikasi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_Notifikasi"
+ ADD CONSTRAINT "ProjectCollaboration_Notifikasi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: ProjectCollaboration_Partisipasi ProjectCollaboration_Partisipasi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_Partisipasi"
+ ADD CONSTRAINT "ProjectCollaboration_Partisipasi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: ProjectCollaboration_RoomChat ProjectCollaboration_RoomChat_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_RoomChat"
+ ADD CONSTRAINT "ProjectCollaboration_RoomChat_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: ProjectCollaboration ProjectCollaboration_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration"
+ ADD CONSTRAINT "ProjectCollaboration_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: ProspektusInvestasi ProspektusInvestasi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProspektusInvestasi"
+ ADD CONSTRAINT "ProspektusInvestasi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: TransaksiInvestasi TransaksiInvestasi_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."TransaksiInvestasi"
+ ADD CONSTRAINT "TransaksiInvestasi_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: UserSession UserSession_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."UserSession"
+ ADD CONSTRAINT "UserSession_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: User User_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."User"
+ ADD CONSTRAINT "User_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Voting_DaftarNamaVote Voting_DaftarNamaVote_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Voting_DaftarNamaVote"
+ ADD CONSTRAINT "Voting_DaftarNamaVote_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Voting_Kontributor Voting_Kontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Voting_Kontributor"
+ ADD CONSTRAINT "Voting_Kontributor_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Voting_Status Voting_Status_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Voting_Status"
+ ADD CONSTRAINT "Voting_Status_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: Voting Voting_pkey; Type: CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Voting"
+ ADD CONSTRAINT "Voting_pkey" PRIMARY KEY (id);
+
+
+--
+-- Name: BusinessMaps_portofolioId_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "BusinessMaps_portofolioId_key" ON public."BusinessMaps" USING btree ("portofolioId");
+
+
+--
+-- Name: Donasi_Cerita_donasiId_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "Donasi_Cerita_donasiId_key" ON public."Donasi_Cerita" USING btree ("donasiId");
+
+
+--
+-- Name: Donasi_Cerita_imagesId_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "Donasi_Cerita_imagesId_key" ON public."Donasi_Cerita" USING btree ("imagesId");
+
+
+--
+-- Name: Donasi_TemporaryCreate_imagesId_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "Donasi_TemporaryCreate_imagesId_key" ON public."Donasi_TemporaryCreate" USING btree ("imagesId");
+
+
+--
+-- Name: Donasi_imagesId_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "Donasi_imagesId_key" ON public."Donasi" USING btree ("imagesId");
+
+
+--
+-- Name: EventTransaksi_eventSponsorId_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "EventTransaksi_eventSponsorId_key" ON public."EventTransaksi" USING btree ("eventSponsorId");
+
+
+--
+-- Name: Investasi_imagesId_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "Investasi_imagesId_key" ON public."Investasi" USING btree ("imagesId");
+
+
+--
+-- Name: Portofolio_MediaSosial_portofolioId_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "Portofolio_MediaSosial_portofolioId_key" ON public."Portofolio_MediaSosial" USING btree ("portofolioId");
+
+
+--
+-- Name: Portofolio_id_Portofolio_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "Portofolio_id_Portofolio_key" ON public."Portofolio" USING btree ("id_Portofolio");
+
+
+--
+-- Name: Profile_email_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "Profile_email_key" ON public."Profile" USING btree (email);
+
+
+--
+-- Name: Profile_userId_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "Profile_userId_key" ON public."Profile" USING btree ("userId");
+
+
+--
+-- Name: ProspektusInvestasi_investasiId_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "ProspektusInvestasi_investasiId_key" ON public."ProspektusInvestasi" USING btree ("investasiId");
+
+
+--
+-- Name: UserSession_userId_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "UserSession_userId_key" ON public."UserSession" USING btree ("userId");
+
+
+--
+-- Name: User_nomor_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "User_nomor_key" ON public."User" USING btree (nomor);
+
+
+--
+-- Name: User_username_key; Type: INDEX; Schema: public; Owner: bip
+--
+
+CREATE UNIQUE INDEX "User_username_key" ON public."User" USING btree (username);
+
+
+--
+-- Name: ProjectCollaboration_Notifikasi AdminNotifProjectUser; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_Notifikasi"
+ ADD CONSTRAINT "AdminNotifProjectUser" FOREIGN KEY ("adminId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE RESTRICT;
+
+
+--
+-- Name: BeritaInvestasi BeritaInvestasi_imagesId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."BeritaInvestasi"
+ ADD CONSTRAINT "BeritaInvestasi_imagesId_fkey" FOREIGN KEY ("imagesId") REFERENCES public."Images"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: BeritaInvestasi BeritaInvestasi_investasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."BeritaInvestasi"
+ ADD CONSTRAINT "BeritaInvestasi_investasiId_fkey" FOREIGN KEY ("investasiId") REFERENCES public."Investasi"(id) ON UPDATE CASCADE ON DELETE RESTRICT;
+
+
+--
+-- Name: BusinessMaps BusinessMaps_authorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."BusinessMaps"
+ ADD CONSTRAINT "BusinessMaps_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: BusinessMaps BusinessMaps_portofolioId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."BusinessMaps"
+ ADD CONSTRAINT "BusinessMaps_portofolioId_fkey" FOREIGN KEY ("portofolioId") REFERENCES public."Portofolio"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: DokumenInvestasi DokumenInvestasi_investasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."DokumenInvestasi"
+ ADD CONSTRAINT "DokumenInvestasi_investasiId_fkey" FOREIGN KEY ("investasiId") REFERENCES public."Investasi"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_Cerita Donasi_Cerita_donasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Cerita"
+ ADD CONSTRAINT "Donasi_Cerita_donasiId_fkey" FOREIGN KEY ("donasiId") REFERENCES public."Donasi"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_Cerita Donasi_Cerita_imagesId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Cerita"
+ ADD CONSTRAINT "Donasi_Cerita_imagesId_fkey" FOREIGN KEY ("imagesId") REFERENCES public."Images"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_Invoice Donasi_Invoice_authorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Invoice"
+ ADD CONSTRAINT "Donasi_Invoice_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_Invoice Donasi_Invoice_donasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Invoice"
+ ADD CONSTRAINT "Donasi_Invoice_donasiId_fkey" FOREIGN KEY ("donasiId") REFERENCES public."Donasi"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_Invoice Donasi_Invoice_donasiMaster_BankId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Invoice"
+ ADD CONSTRAINT "Donasi_Invoice_donasiMaster_BankId_fkey" FOREIGN KEY ("donasiMaster_BankId") REFERENCES public."DonasiMaster_Bank"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_Invoice Donasi_Invoice_donasiMaster_StatusInvoiceId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Invoice"
+ ADD CONSTRAINT "Donasi_Invoice_donasiMaster_StatusInvoiceId_fkey" FOREIGN KEY ("donasiMaster_StatusInvoiceId") REFERENCES public."DonasiMaster_StatusInvoice"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_Invoice Donasi_Invoice_imagesId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Invoice"
+ ADD CONSTRAINT "Donasi_Invoice_imagesId_fkey" FOREIGN KEY ("imagesId") REFERENCES public."Images"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_Kabar Donasi_Kabar_donasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Kabar"
+ ADD CONSTRAINT "Donasi_Kabar_donasiId_fkey" FOREIGN KEY ("donasiId") REFERENCES public."Donasi"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_Kabar Donasi_Kabar_imagesId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Kabar"
+ ADD CONSTRAINT "Donasi_Kabar_imagesId_fkey" FOREIGN KEY ("imagesId") REFERENCES public."Images"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_Notif Donasi_Notif_donasi_KabarId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Notif"
+ ADD CONSTRAINT "Donasi_Notif_donasi_KabarId_fkey" FOREIGN KEY ("donasi_KabarId") REFERENCES public."Donasi_Kabar"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_Notif Donasi_Notif_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_Notif"
+ ADD CONSTRAINT "Donasi_Notif_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_PencairanDana Donasi_PencairanDana_donasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_PencairanDana"
+ ADD CONSTRAINT "Donasi_PencairanDana_donasiId_fkey" FOREIGN KEY ("donasiId") REFERENCES public."Donasi"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_PencairanDana Donasi_PencairanDana_imagesId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_PencairanDana"
+ ADD CONSTRAINT "Donasi_PencairanDana_imagesId_fkey" FOREIGN KEY ("imagesId") REFERENCES public."Images"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_TemporaryCreate Donasi_TemporaryCreate_donasiMaster_DurasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_TemporaryCreate"
+ ADD CONSTRAINT "Donasi_TemporaryCreate_donasiMaster_DurasiId_fkey" FOREIGN KEY ("donasiMaster_DurasiId") REFERENCES public."DonasiMaster_Durasi"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_TemporaryCreate Donasi_TemporaryCreate_donasiMaster_KategoriId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_TemporaryCreate"
+ ADD CONSTRAINT "Donasi_TemporaryCreate_donasiMaster_KategoriId_fkey" FOREIGN KEY ("donasiMaster_KategoriId") REFERENCES public."DonasiMaster_Kategori"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi_TemporaryCreate Donasi_TemporaryCreate_imagesId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi_TemporaryCreate"
+ ADD CONSTRAINT "Donasi_TemporaryCreate_imagesId_fkey" FOREIGN KEY ("imagesId") REFERENCES public."Images"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi Donasi_authorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi"
+ ADD CONSTRAINT "Donasi_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi Donasi_donasiMaster_DurasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi"
+ ADD CONSTRAINT "Donasi_donasiMaster_DurasiId_fkey" FOREIGN KEY ("donasiMaster_DurasiId") REFERENCES public."DonasiMaster_Durasi"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi Donasi_donasiMaster_KategoriId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi"
+ ADD CONSTRAINT "Donasi_donasiMaster_KategoriId_fkey" FOREIGN KEY ("donasiMaster_KategoriId") REFERENCES public."DonasiMaster_Kategori"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi Donasi_donasiMaster_StatusDonasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi"
+ ADD CONSTRAINT "Donasi_donasiMaster_StatusDonasiId_fkey" FOREIGN KEY ("donasiMaster_StatusDonasiId") REFERENCES public."DonasiMaster_StatusDonasi"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Donasi Donasi_imagesId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Donasi"
+ ADD CONSTRAINT "Donasi_imagesId_fkey" FOREIGN KEY ("imagesId") REFERENCES public."Images"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: EventSponsor EventSponsor_auhtorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."EventSponsor"
+ ADD CONSTRAINT "EventSponsor_auhtorId_fkey" FOREIGN KEY ("auhtorId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: EventSponsor EventSponsor_eventId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."EventSponsor"
+ ADD CONSTRAINT "EventSponsor_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES public."Event"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: EventTransaksi EventTransaksi_authorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."EventTransaksi"
+ ADD CONSTRAINT "EventTransaksi_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: EventTransaksi EventTransaksi_eventId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."EventTransaksi"
+ ADD CONSTRAINT "EventTransaksi_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES public."Event"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: EventTransaksi EventTransaksi_eventSponsorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."EventTransaksi"
+ ADD CONSTRAINT "EventTransaksi_eventSponsorId_fkey" FOREIGN KEY ("eventSponsorId") REFERENCES public."EventSponsor"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: EventTransaksi EventTransaksi_masterBankId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."EventTransaksi"
+ ADD CONSTRAINT "EventTransaksi_masterBankId_fkey" FOREIGN KEY ("masterBankId") REFERENCES public."MasterBank"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Event_Peserta Event_Peserta_eventId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Event_Peserta"
+ ADD CONSTRAINT "Event_Peserta_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES public."Event"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Event_Peserta Event_Peserta_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Event_Peserta"
+ ADD CONSTRAINT "Event_Peserta_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Event Event_authorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Event"
+ ADD CONSTRAINT "Event_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Event Event_eventMaster_StatusId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Event"
+ ADD CONSTRAINT "Event_eventMaster_StatusId_fkey" FOREIGN KEY ("eventMaster_StatusId") REFERENCES public."EventMaster_Status"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Event Event_eventMaster_TipeAcaraId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Event"
+ ADD CONSTRAINT "Event_eventMaster_TipeAcaraId_fkey" FOREIGN KEY ("eventMaster_TipeAcaraId") REFERENCES public."EventMaster_TipeAcara"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Forum_Komentar Forum_Komentar_authorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Forum_Komentar"
+ ADD CONSTRAINT "Forum_Komentar_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Forum_Komentar Forum_Komentar_forum_PostingId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Forum_Komentar"
+ ADD CONSTRAINT "Forum_Komentar_forum_PostingId_fkey" FOREIGN KEY ("forum_PostingId") REFERENCES public."Forum_Posting"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Forum_Posting Forum_Posting_authorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Forum_Posting"
+ ADD CONSTRAINT "Forum_Posting_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Forum_Posting Forum_Posting_forumMaster_StatusPostingId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Forum_Posting"
+ ADD CONSTRAINT "Forum_Posting_forumMaster_StatusPostingId_fkey" FOREIGN KEY ("forumMaster_StatusPostingId") REFERENCES public."ForumMaster_StatusPosting"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Forum_ReportKomentar Forum_ReportKomentar_forumMaster_KategoriReportId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Forum_ReportKomentar"
+ ADD CONSTRAINT "Forum_ReportKomentar_forumMaster_KategoriReportId_fkey" FOREIGN KEY ("forumMaster_KategoriReportId") REFERENCES public."ForumMaster_KategoriReport"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Forum_ReportKomentar Forum_ReportKomentar_forum_KomentarId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Forum_ReportKomentar"
+ ADD CONSTRAINT "Forum_ReportKomentar_forum_KomentarId_fkey" FOREIGN KEY ("forum_KomentarId") REFERENCES public."Forum_Komentar"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Forum_ReportKomentar Forum_ReportKomentar_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Forum_ReportKomentar"
+ ADD CONSTRAINT "Forum_ReportKomentar_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Forum_ReportPosting Forum_ReportPosting_forumMaster_KategoriReportId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Forum_ReportPosting"
+ ADD CONSTRAINT "Forum_ReportPosting_forumMaster_KategoriReportId_fkey" FOREIGN KEY ("forumMaster_KategoriReportId") REFERENCES public."ForumMaster_KategoriReport"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Forum_ReportPosting Forum_ReportPosting_forum_PostingId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Forum_ReportPosting"
+ ADD CONSTRAINT "Forum_ReportPosting_forum_PostingId_fkey" FOREIGN KEY ("forum_PostingId") REFERENCES public."Forum_Posting"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Forum_ReportPosting Forum_ReportPosting_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Forum_ReportPosting"
+ ADD CONSTRAINT "Forum_ReportPosting_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Investasi_Invoice Investasi_Invoice_authorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Investasi_Invoice"
+ ADD CONSTRAINT "Investasi_Invoice_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Investasi_Invoice Investasi_Invoice_imagesId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Investasi_Invoice"
+ ADD CONSTRAINT "Investasi_Invoice_imagesId_fkey" FOREIGN KEY ("imagesId") REFERENCES public."Images"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Investasi_Invoice Investasi_Invoice_investasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Investasi_Invoice"
+ ADD CONSTRAINT "Investasi_Invoice_investasiId_fkey" FOREIGN KEY ("investasiId") REFERENCES public."Investasi"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Investasi_Invoice Investasi_Invoice_masterBankId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Investasi_Invoice"
+ ADD CONSTRAINT "Investasi_Invoice_masterBankId_fkey" FOREIGN KEY ("masterBankId") REFERENCES public."MasterBank"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Investasi_Invoice Investasi_Invoice_statusInvoiceId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Investasi_Invoice"
+ ADD CONSTRAINT "Investasi_Invoice_statusInvoiceId_fkey" FOREIGN KEY ("statusInvoiceId") REFERENCES public."InvestasiMaster_StatusInvoice"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Investasi Investasi_authorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Investasi"
+ ADD CONSTRAINT "Investasi_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Investasi Investasi_imagesId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Investasi"
+ ADD CONSTRAINT "Investasi_imagesId_fkey" FOREIGN KEY ("imagesId") REFERENCES public."Images"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Investasi Investasi_masterPembagianDevidenId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Investasi"
+ ADD CONSTRAINT "Investasi_masterPembagianDevidenId_fkey" FOREIGN KEY ("masterPembagianDevidenId") REFERENCES public."MasterPembagianDeviden"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Investasi Investasi_masterPencarianInvestorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Investasi"
+ ADD CONSTRAINT "Investasi_masterPencarianInvestorId_fkey" FOREIGN KEY ("masterPencarianInvestorId") REFERENCES public."MasterPencarianInvestor"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Investasi Investasi_masterPeriodeDevidenId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Investasi"
+ ADD CONSTRAINT "Investasi_masterPeriodeDevidenId_fkey" FOREIGN KEY ("masterPeriodeDevidenId") REFERENCES public."MasterPeriodeDeviden"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Investasi Investasi_masterProgresInvestasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Investasi"
+ ADD CONSTRAINT "Investasi_masterProgresInvestasiId_fkey" FOREIGN KEY ("masterProgresInvestasiId") REFERENCES public."MasterProgresInvestasi"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Investasi Investasi_masterStatusInvestasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Investasi"
+ ADD CONSTRAINT "Investasi_masterStatusInvestasiId_fkey" FOREIGN KEY ("masterStatusInvestasiId") REFERENCES public."MasterStatusInvestasi"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Job Job_authorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Job"
+ ADD CONSTRAINT "Job_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Job Job_masterStatusId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Job"
+ ADD CONSTRAINT "Job_masterStatusId_fkey" FOREIGN KEY ("masterStatusId") REFERENCES public."MasterStatus"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Notifikasi NotifikasiAdmin; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Notifikasi"
+ ADD CONSTRAINT "NotifikasiAdmin" FOREIGN KEY ("adminId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Notifikasi NotifikasiUser; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Notifikasi"
+ ADD CONSTRAINT "NotifikasiUser" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Notifikasi Notifikasi_userRoleId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Notifikasi"
+ ADD CONSTRAINT "Notifikasi_userRoleId_fkey" FOREIGN KEY ("userRoleId") REFERENCES public."MasterUserRole"(id) ON UPDATE CASCADE ON DELETE RESTRICT;
+
+
+--
+-- Name: Portofolio_MediaSosial Portofolio_MediaSosial_portofolioId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Portofolio_MediaSosial"
+ ADD CONSTRAINT "Portofolio_MediaSosial_portofolioId_fkey" FOREIGN KEY ("portofolioId") REFERENCES public."Portofolio"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Portofolio Portofolio_masterBidangBisnisId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Portofolio"
+ ADD CONSTRAINT "Portofolio_masterBidangBisnisId_fkey" FOREIGN KEY ("masterBidangBisnisId") REFERENCES public."MasterBidangBisnis"(id) ON UPDATE CASCADE ON DELETE RESTRICT;
+
+
+--
+-- Name: Portofolio Portofolio_profileId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Portofolio"
+ ADD CONSTRAINT "Portofolio_profileId_fkey" FOREIGN KEY ("profileId") REFERENCES public."Profile"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Profile Profile_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Profile"
+ ADD CONSTRAINT "Profile_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: ProjectCollaboration_AnggotaRoomChat ProjectCollaboration_AnggotaRoomChat_projectCollaboration__fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_AnggotaRoomChat"
+ ADD CONSTRAINT "ProjectCollaboration_AnggotaRoomChat_projectCollaboration__fkey" FOREIGN KEY ("projectCollaboration_RoomChatId") REFERENCES public."ProjectCollaboration_RoomChat"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: ProjectCollaboration_AnggotaRoomChat ProjectCollaboration_AnggotaRoomChat_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_AnggotaRoomChat"
+ ADD CONSTRAINT "ProjectCollaboration_AnggotaRoomChat_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE RESTRICT;
+
+
+--
+-- Name: ProjectCollaboration_Message ProjectCollaboration_Message_projectCollaboration_RoomChat_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_Message"
+ ADD CONSTRAINT "ProjectCollaboration_Message_projectCollaboration_RoomChat_fkey" FOREIGN KEY ("projectCollaboration_RoomChatId") REFERENCES public."ProjectCollaboration_RoomChat"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: ProjectCollaboration_Message ProjectCollaboration_Message_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_Message"
+ ADD CONSTRAINT "ProjectCollaboration_Message_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: ProjectCollaboration_Notifikasi ProjectCollaboration_Notifikasi_projectCollaborationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_Notifikasi"
+ ADD CONSTRAINT "ProjectCollaboration_Notifikasi_projectCollaborationId_fkey" FOREIGN KEY ("projectCollaborationId") REFERENCES public."ProjectCollaboration"(id) ON UPDATE CASCADE ON DELETE RESTRICT;
+
+
+--
+-- Name: ProjectCollaboration_Partisipasi ProjectCollaboration_Partisipasi_projectCollaborationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_Partisipasi"
+ ADD CONSTRAINT "ProjectCollaboration_Partisipasi_projectCollaborationId_fkey" FOREIGN KEY ("projectCollaborationId") REFERENCES public."ProjectCollaboration"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: ProjectCollaboration_Partisipasi ProjectCollaboration_Partisipasi_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_Partisipasi"
+ ADD CONSTRAINT "ProjectCollaboration_Partisipasi_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: ProjectCollaboration_RoomChat ProjectCollaboration_RoomChat_projectCollaborationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_RoomChat"
+ ADD CONSTRAINT "ProjectCollaboration_RoomChat_projectCollaborationId_fkey" FOREIGN KEY ("projectCollaborationId") REFERENCES public."ProjectCollaboration"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: ProjectCollaboration_RoomChat ProjectCollaboration_RoomChat_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_RoomChat"
+ ADD CONSTRAINT "ProjectCollaboration_RoomChat_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: ProjectCollaboration ProjectCollaboration_projectCollaborationMaster_IndustriId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration"
+ ADD CONSTRAINT "ProjectCollaboration_projectCollaborationMaster_IndustriId_fkey" FOREIGN KEY ("projectCollaborationMaster_IndustriId") REFERENCES public."ProjectCollaborationMaster_Industri"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: ProjectCollaboration ProjectCollaboration_projectCollaborationMaster_StatusId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration"
+ ADD CONSTRAINT "ProjectCollaboration_projectCollaborationMaster_StatusId_fkey" FOREIGN KEY ("projectCollaborationMaster_StatusId") REFERENCES public."ProjectCollaborationMaster_Status"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: ProjectCollaboration ProjectCollaboration_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration"
+ ADD CONSTRAINT "ProjectCollaboration_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: ProspektusInvestasi ProspektusInvestasi_investasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProspektusInvestasi"
+ ADD CONSTRAINT "ProspektusInvestasi_investasiId_fkey" FOREIGN KEY ("investasiId") REFERENCES public."Investasi"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: TransaksiInvestasi TransaksiInvestasi_authorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."TransaksiInvestasi"
+ ADD CONSTRAINT "TransaksiInvestasi_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE RESTRICT;
+
+
+--
+-- Name: TransaksiInvestasi TransaksiInvestasi_investasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."TransaksiInvestasi"
+ ADD CONSTRAINT "TransaksiInvestasi_investasiId_fkey" FOREIGN KEY ("investasiId") REFERENCES public."Investasi"(id) ON UPDATE CASCADE ON DELETE RESTRICT;
+
+
+--
+-- Name: TransaksiInvestasi TransaksiInvestasi_masterStatusTransaksiInvestasiId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."TransaksiInvestasi"
+ ADD CONSTRAINT "TransaksiInvestasi_masterStatusTransaksiInvestasiId_fkey" FOREIGN KEY ("masterStatusTransaksiInvestasiId") REFERENCES public."MasterStatusTransaksiInvestasi"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: ProjectCollaboration_Notifikasi UserNotifProjectUser; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."ProjectCollaboration_Notifikasi"
+ ADD CONSTRAINT "UserNotifProjectUser" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE RESTRICT;
+
+
+--
+-- Name: UserSession UserSession_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."UserSession"
+ ADD CONSTRAINT "UserSession_userId_fkey" FOREIGN KEY ("userId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE RESTRICT;
+
+
+--
+-- Name: User User_masterUserRoleId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."User"
+ ADD CONSTRAINT "User_masterUserRoleId_fkey" FOREIGN KEY ("masterUserRoleId") REFERENCES public."MasterUserRole"(id) ON UPDATE CASCADE ON DELETE RESTRICT;
+
+
+--
+-- Name: Voting_DaftarNamaVote Voting_DaftarNamaVote_votingId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Voting_DaftarNamaVote"
+ ADD CONSTRAINT "Voting_DaftarNamaVote_votingId_fkey" FOREIGN KEY ("votingId") REFERENCES public."Voting"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Voting_Kontributor Voting_Kontributor_authorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Voting_Kontributor"
+ ADD CONSTRAINT "Voting_Kontributor_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Voting_Kontributor Voting_Kontributor_votingId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Voting_Kontributor"
+ ADD CONSTRAINT "Voting_Kontributor_votingId_fkey" FOREIGN KEY ("votingId") REFERENCES public."Voting"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Voting_Kontributor Voting_Kontributor_voting_DaftarNamaVoteId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Voting_Kontributor"
+ ADD CONSTRAINT "Voting_Kontributor_voting_DaftarNamaVoteId_fkey" FOREIGN KEY ("voting_DaftarNamaVoteId") REFERENCES public."Voting_DaftarNamaVote"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- Name: Voting Voting_authorId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Voting"
+ ADD CONSTRAINT "Voting_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES public."User"(id) ON UPDATE CASCADE ON DELETE RESTRICT;
+
+
+--
+-- Name: Voting Voting_voting_StatusId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: bip
+--
+
+ALTER TABLE ONLY public."Voting"
+ ADD CONSTRAINT "Voting_voting_StatusId_fkey" FOREIGN KEY ("voting_StatusId") REFERENCES public."Voting_Status"(id) ON UPDATE CASCADE ON DELETE SET NULL;
+
+
+--
+-- PostgreSQL database dump complete
+--
+
diff --git a/build.wibu b/build.wibu
new file mode 100644
index 00000000..62d352e1
--- /dev/null
+++ b/build.wibu
@@ -0,0 +1,3 @@
+bun --env-file=.env.build prisma db push
+bun --env-file=.env.build prisma db seed
+bun --env-file=.env.build run build
\ No newline at end of file
diff --git a/bun.lock b/bun.lock
new file mode 100644
index 00000000..6a0ca50e
--- /dev/null
+++ b/bun.lock
@@ -0,0 +1,4113 @@
+{
+ "lockfileVersion": 1,
+ "workspaces": {
+ "": {
+ "dependencies": {
+ "@bounceapp/iframe": "^0.3.0",
+ "@cyntler/react-doc-viewer": "^1.16.6",
+ "@emotion/react": "^11.11.1",
+ "@emotion/server": "^11.11.0",
+ "@hookstate/core": "^4.0.1",
+ "@mantine/carousel": "^7.1.5",
+ "@mantine/core": "^6.0.17",
+ "@mantine/dates": "^6.0.17",
+ "@mantine/dropzone": "^7.1.3",
+ "@mantine/form": "^7.6.1",
+ "@mantine/hooks": "^6.0.17",
+ "@mantine/next": "^6.0.17",
+ "@mantine/notifications": "^6.0.17",
+ "@mantine/tiptap": "^7.5.3",
+ "@prisma/client": "^6.3.0",
+ "@react-pdf/renderer": "^3.4.4",
+ "@tabler/icons-react": "^3.31.0",
+ "@tiptap/extension-highlight": "^2.2.3",
+ "@tiptap/extension-image": "^2.11.7",
+ "@tiptap/extension-link": "^2.2.3",
+ "@tiptap/extension-subscript": "^2.2.3",
+ "@tiptap/extension-superscript": "^2.2.3",
+ "@tiptap/extension-text-align": "^2.2.3",
+ "@tiptap/extension-underline": "^2.11.7",
+ "@tiptap/pm": "^2.2.3",
+ "@tiptap/react": "^2.2.3",
+ "@tiptap/starter-kit": "^2.2.3",
+ "@types/bun": "^1.1.14",
+ "@types/lodash": "^4.17.4",
+ "@types/mapbox-gl": "^3.4.0",
+ "@types/node": "20.4.5",
+ "@types/react": "18.2.17",
+ "@types/react-dom": "18.2.7",
+ "@types/uuid": "^9.0.4",
+ "autoprefixer": "10.4.14",
+ "bufferutil": "^4.0.8",
+ "bun": "^1.1.38",
+ "colors": "^1.4.0",
+ "date-fns": "^4.1.0",
+ "dayjs": "^1.11.10",
+ "dotenv": "^16.4.5",
+ "echarts": "^5.4.3",
+ "echarts-for-react": "^3.0.2",
+ "embla-carousel-react": "^8.0.0-rc14",
+ "eslint-config-next": "^13.5.4",
+ "iron-session": "^6.3.1",
+ "jose": "^5.9.2",
+ "jotai": "^2.4.3",
+ "lodash": "^4.17.21",
+ "mapbox-gl": "^3.5.2",
+ "midtrans-client": "^1.3.1",
+ "moment": "^2.29.4",
+ "mqtt": "^5.5.0",
+ "next": "^13.5.4",
+ "next-dev": "^1.1.9",
+ "next-scroll-loader": "^1.0.9",
+ "p-limit": "^6.2.0",
+ "pdf-lib": "^1.17.1",
+ "pdf2pic": "^3.1.3",
+ "pdfjs-dist": "^4.6.82",
+ "postcss": "8.4.27",
+ "prisma": "^6.3.0",
+ "react": "18.2.0",
+ "react-countdown": "^2.3.5",
+ "react-dom": "18.2.0",
+ "react-easy-infinite-scroll-hook": "^2.1.4",
+ "react-fast-marquee": "^1.6.4",
+ "react-iframe": "^1.8.5",
+ "react-infinite-scroll-component": "^6.1.0",
+ "react-international-phone": "^4.2.6",
+ "react-map-gl": "^7.1.7",
+ "react-pdf": "^9.1.0",
+ "react-qr-code": "^2.0.15",
+ "react-quill": "^2.0.0",
+ "react-responsive-carousel": "^3.2.23",
+ "react-toastify": "^9.1.3",
+ "sharp": "^0.33.5",
+ "socket.io-client": "^4.7.2",
+ "swr": "^2.3.0",
+ "tailwindcss": "3.3.3",
+ "ts-node": "^10.9.2",
+ "typescript": "5.1.6",
+ "utf-8-validate": "^6.0.3",
+ "uuid": "^9.0.1",
+ "wibu": "bipproduction/wibu",
+ "wibu-cli": "^1.0.91",
+ "wibu-pkg": "^1.0.3",
+ "winston": "^3.17.0",
+ "winston-daily-rotate-file": "^5.0.0",
+ "yaml": "^2.3.2",
+ },
+ "devDependencies": {
+ "@typescript-eslint/eslint-plugin": "^7.0.0",
+ "@typescript-eslint/parser": "^7.0.0",
+ "eslint": "^8.56.0",
+ },
+ },
+ },
+ "packages": {
+ "@0no-co/graphql.web": ["@0no-co/graphql.web@1.1.1", "", { "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0" }, "optionalPeers": ["graphql"] }, "sha512-F2i3xdycesw78QCOBHmpTn7eaD2iNXGwB2gkfwxcOfBbeauYpr8RBSyJOkDrFtKtVRMclg8Sg3n1ip0ACyUuag=="],
+
+ "@alloc/quick-lru": ["@alloc/quick-lru@5.2.0", "", {}, "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw=="],
+
+ "@ampproject/remapping": ["@ampproject/remapping@2.3.0", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw=="],
+
+ "@assemblyscript/loader": ["@assemblyscript/loader@0.19.23", "", {}, "sha512-ulkCYfFbYj01ie1MDOyxv2F6SpRN1TOj7fQxbP07D6HmeR+gr2JLSmINKjga2emB+b1L2KGrFKBTc+e00p54nw=="],
+
+ "@babel/code-frame": ["@babel/code-frame@7.26.2", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.25.9", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" } }, "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ=="],
+
+ "@babel/compat-data": ["@babel/compat-data@7.26.8", "", {}, "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ=="],
+
+ "@babel/core": ["@babel/core@7.26.9", "", { "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.26.2", "@babel/generator": "^7.26.9", "@babel/helper-compilation-targets": "^7.26.5", "@babel/helper-module-transforms": "^7.26.0", "@babel/helpers": "^7.26.9", "@babel/parser": "^7.26.9", "@babel/template": "^7.26.9", "@babel/traverse": "^7.26.9", "@babel/types": "^7.26.9", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-lWBYIrF7qK5+GjY5Uy+/hEgp8OJWOD/rpy74GplYRhEauvbHDeFB8t5hPOZxCZ0Oxf4Cc36tK51/l3ymJysrKw=="],
+
+ "@babel/generator": ["@babel/generator@7.26.9", "", { "dependencies": { "@babel/parser": "^7.26.9", "@babel/types": "^7.26.9", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" } }, "sha512-kEWdzjOAUMW4hAyrzJ0ZaTOu9OmpyDIQicIh0zg0EEcEkYXZb2TjtBhnHi2ViX7PKwZqF4xwqfAm299/QMP3lg=="],
+
+ "@babel/helper-annotate-as-pure": ["@babel/helper-annotate-as-pure@7.25.9", "", { "dependencies": { "@babel/types": "^7.25.9" } }, "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g=="],
+
+ "@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.26.5", "", { "dependencies": { "@babel/compat-data": "^7.26.5", "@babel/helper-validator-option": "^7.25.9", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA=="],
+
+ "@babel/helper-create-class-features-plugin": ["@babel/helper-create-class-features-plugin@7.26.9", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.25.9", "@babel/helper-member-expression-to-functions": "^7.25.9", "@babel/helper-optimise-call-expression": "^7.25.9", "@babel/helper-replace-supers": "^7.26.5", "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", "@babel/traverse": "^7.26.9", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-ubbUqCofvxPRurw5L8WTsCLSkQiVpov4Qx0WMA+jUN+nXBK8ADPlJO1grkFw5CWKC5+sZSOfuGMdX1aI1iT9Sg=="],
+
+ "@babel/helper-create-regexp-features-plugin": ["@babel/helper-create-regexp-features-plugin@7.26.3", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.25.9", "regexpu-core": "^6.2.0", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-G7ZRb40uUgdKOQqPLjfD12ZmGA54PzqDFUv2BKImnC9QIfGhIHKvVML0oN8IUiDq4iRqpq74ABpvOaerfWdong=="],
+
+ "@babel/helper-define-polyfill-provider": ["@babel/helper-define-polyfill-provider@0.6.3", "", { "dependencies": { "@babel/helper-compilation-targets": "^7.22.6", "@babel/helper-plugin-utils": "^7.22.5", "debug": "^4.1.1", "lodash.debounce": "^4.0.8", "resolve": "^1.14.2" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg=="],
+
+ "@babel/helper-member-expression-to-functions": ["@babel/helper-member-expression-to-functions@7.25.9", "", { "dependencies": { "@babel/traverse": "^7.25.9", "@babel/types": "^7.25.9" } }, "sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ=="],
+
+ "@babel/helper-module-imports": ["@babel/helper-module-imports@7.25.9", "", { "dependencies": { "@babel/traverse": "^7.25.9", "@babel/types": "^7.25.9" } }, "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw=="],
+
+ "@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.26.0", "", { "dependencies": { "@babel/helper-module-imports": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9", "@babel/traverse": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw=="],
+
+ "@babel/helper-optimise-call-expression": ["@babel/helper-optimise-call-expression@7.25.9", "", { "dependencies": { "@babel/types": "^7.25.9" } }, "sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ=="],
+
+ "@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.26.5", "", {}, "sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg=="],
+
+ "@babel/helper-remap-async-to-generator": ["@babel/helper-remap-async-to-generator@7.25.9", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.25.9", "@babel/helper-wrap-function": "^7.25.9", "@babel/traverse": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw=="],
+
+ "@babel/helper-replace-supers": ["@babel/helper-replace-supers@7.26.5", "", { "dependencies": { "@babel/helper-member-expression-to-functions": "^7.25.9", "@babel/helper-optimise-call-expression": "^7.25.9", "@babel/traverse": "^7.26.5" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-bJ6iIVdYX1YooY2X7w1q6VITt+LnUILtNk7zT78ykuwStx8BauCzxvFqFaHjOpW1bVnSUM1PN1f0p5P21wHxvg=="],
+
+ "@babel/helper-skip-transparent-expression-wrappers": ["@babel/helper-skip-transparent-expression-wrappers@7.25.9", "", { "dependencies": { "@babel/traverse": "^7.25.9", "@babel/types": "^7.25.9" } }, "sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA=="],
+
+ "@babel/helper-string-parser": ["@babel/helper-string-parser@7.25.9", "", {}, "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA=="],
+
+ "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.25.9", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
+
+ "@babel/helper-validator-option": ["@babel/helper-validator-option@7.25.9", "", {}, "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw=="],
+
+ "@babel/helper-wrap-function": ["@babel/helper-wrap-function@7.25.9", "", { "dependencies": { "@babel/template": "^7.25.9", "@babel/traverse": "^7.25.9", "@babel/types": "^7.25.9" } }, "sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g=="],
+
+ "@babel/helpers": ["@babel/helpers@7.26.9", "", { "dependencies": { "@babel/template": "^7.26.9", "@babel/types": "^7.26.9" } }, "sha512-Mz/4+y8udxBKdmzt/UjPACs4G3j5SshJJEFFKxlCGPydG4JAHXxjWjAwjd09tf6oINvl1VfMJo+nB7H2YKQ0dA=="],
+
+ "@babel/highlight": ["@babel/highlight@7.25.9", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.25.9", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" } }, "sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw=="],
+
+ "@babel/parser": ["@babel/parser@7.26.9", "", { "dependencies": { "@babel/types": "^7.26.9" }, "bin": "./bin/babel-parser.js" }, "sha512-81NWa1njQblgZbQHxWHpxxCzNsa3ZwvFqpUg7P+NNUU6f3UU2jBEg4OlF/J6rl8+PQGh1q6/zWScd001YwcA5A=="],
+
+ "@babel/plugin-bugfix-firefox-class-in-computed-class-key": ["@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9", "@babel/traverse": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g=="],
+
+ "@babel/plugin-bugfix-safari-class-field-initializer-scope": ["@babel/plugin-bugfix-safari-class-field-initializer-scope@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw=="],
+
+ "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": ["@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug=="],
+
+ "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": ["@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9", "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", "@babel/plugin-transform-optional-chaining": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.13.0" } }, "sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g=="],
+
+ "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": ["@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9", "@babel/traverse": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg=="],
+
+ "@babel/plugin-proposal-class-properties": ["@babel/plugin-proposal-class-properties@7.18.6", "", { "dependencies": { "@babel/helper-create-class-features-plugin": "^7.18.6", "@babel/helper-plugin-utils": "^7.18.6" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ=="],
+
+ "@babel/plugin-proposal-decorators": ["@babel/plugin-proposal-decorators@7.25.9", "", { "dependencies": { "@babel/helper-create-class-features-plugin": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9", "@babel/plugin-syntax-decorators": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-smkNLL/O1ezy9Nhy4CNosc4Va+1wo5w4gzSZeLe6y6dM4mmHfYOCPolXQPHQxonZCF+ZyebxN9vqOolkYrSn5g=="],
+
+ "@babel/plugin-proposal-export-default-from": ["@babel/plugin-proposal-export-default-from@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-ykqgwNfSnNOB+C8fV5X4mG3AVmvu+WVxcaU9xHHtBb7PCrPeweMmPjGsn8eMaeJg6SJuoUuZENeeSWaarWqonQ=="],
+
+ "@babel/plugin-proposal-nullish-coalescing-operator": ["@babel/plugin-proposal-nullish-coalescing-operator@7.18.6", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.18.6", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA=="],
+
+ "@babel/plugin-proposal-optional-chaining": ["@babel/plugin-proposal-optional-chaining@7.21.0", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.20.2", "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", "@babel/plugin-syntax-optional-chaining": "^7.8.3" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA=="],
+
+ "@babel/plugin-proposal-private-property-in-object": ["@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2", "", { "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w=="],
+
+ "@babel/plugin-syntax-async-generators": ["@babel/plugin-syntax-async-generators@7.8.4", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw=="],
+
+ "@babel/plugin-syntax-bigint": ["@babel/plugin-syntax-bigint@7.8.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg=="],
+
+ "@babel/plugin-syntax-class-properties": ["@babel/plugin-syntax-class-properties@7.12.13", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.12.13" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA=="],
+
+ "@babel/plugin-syntax-class-static-block": ["@babel/plugin-syntax-class-static-block@7.14.5", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw=="],
+
+ "@babel/plugin-syntax-decorators": ["@babel/plugin-syntax-decorators@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-ryzI0McXUPJnRCvMo4lumIKZUzhYUO/ScI+Mz4YVaTLt04DHNSjEUjKVvbzQjZFLuod/cYEc07mJWhzl6v4DPg=="],
+
+ "@babel/plugin-syntax-dynamic-import": ["@babel/plugin-syntax-dynamic-import@7.8.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ=="],
+
+ "@babel/plugin-syntax-export-default-from": ["@babel/plugin-syntax-export-default-from@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-9MhJ/SMTsVqsd69GyQg89lYR4o9T+oDGv5F6IsigxxqFVOyR/IflDLYP8WDI1l8fkhNGGktqkvL5qwNCtGEpgQ=="],
+
+ "@babel/plugin-syntax-flow": ["@babel/plugin-syntax-flow@7.26.0", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-B+O2DnPc0iG+YXFqOxv2WNuNU97ToWjOomUQ78DouOENWUaM5sVrmet9mcomUGQFwpJd//gvUagXBSdzO1fRKg=="],
+
+ "@babel/plugin-syntax-import-assertions": ["@babel/plugin-syntax-import-assertions@7.26.0", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg=="],
+
+ "@babel/plugin-syntax-import-attributes": ["@babel/plugin-syntax-import-attributes@7.26.0", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A=="],
+
+ "@babel/plugin-syntax-import-meta": ["@babel/plugin-syntax-import-meta@7.10.4", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g=="],
+
+ "@babel/plugin-syntax-json-strings": ["@babel/plugin-syntax-json-strings@7.8.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA=="],
+
+ "@babel/plugin-syntax-jsx": ["@babel/plugin-syntax-jsx@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA=="],
+
+ "@babel/plugin-syntax-logical-assignment-operators": ["@babel/plugin-syntax-logical-assignment-operators@7.10.4", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig=="],
+
+ "@babel/plugin-syntax-nullish-coalescing-operator": ["@babel/plugin-syntax-nullish-coalescing-operator@7.8.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ=="],
+
+ "@babel/plugin-syntax-numeric-separator": ["@babel/plugin-syntax-numeric-separator@7.10.4", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug=="],
+
+ "@babel/plugin-syntax-object-rest-spread": ["@babel/plugin-syntax-object-rest-spread@7.8.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA=="],
+
+ "@babel/plugin-syntax-optional-catch-binding": ["@babel/plugin-syntax-optional-catch-binding@7.8.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q=="],
+
+ "@babel/plugin-syntax-optional-chaining": ["@babel/plugin-syntax-optional-chaining@7.8.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg=="],
+
+ "@babel/plugin-syntax-private-property-in-object": ["@babel/plugin-syntax-private-property-in-object@7.14.5", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg=="],
+
+ "@babel/plugin-syntax-top-level-await": ["@babel/plugin-syntax-top-level-await@7.14.5", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw=="],
+
+ "@babel/plugin-syntax-typescript": ["@babel/plugin-syntax-typescript@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ=="],
+
+ "@babel/plugin-syntax-unicode-sets-regex": ["@babel/plugin-syntax-unicode-sets-regex@7.18.6", "", { "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.18.6", "@babel/helper-plugin-utils": "^7.18.6" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg=="],
+
+ "@babel/plugin-transform-arrow-functions": ["@babel/plugin-transform-arrow-functions@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg=="],
+
+ "@babel/plugin-transform-async-generator-functions": ["@babel/plugin-transform-async-generator-functions@7.26.8", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.26.5", "@babel/helper-remap-async-to-generator": "^7.25.9", "@babel/traverse": "^7.26.8" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-He9Ej2X7tNf2zdKMAGOsmg2MrFc+hfoAhd3po4cWfo/NWjzEAKa0oQruj1ROVUdl0e6fb6/kE/G3SSxE0lRJOg=="],
+
+ "@babel/plugin-transform-async-to-generator": ["@babel/plugin-transform-async-to-generator@7.25.9", "", { "dependencies": { "@babel/helper-module-imports": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9", "@babel/helper-remap-async-to-generator": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ=="],
+
+ "@babel/plugin-transform-block-scoped-functions": ["@babel/plugin-transform-block-scoped-functions@7.26.5", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.26.5" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-chuTSY+hq09+/f5lMj8ZSYgCFpppV2CbYrhNFJ1BFoXpiWPnnAb7R0MqrafCpN8E1+YRrtM1MXZHJdIx8B6rMQ=="],
+
+ "@babel/plugin-transform-block-scoping": ["@babel/plugin-transform-block-scoping@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg=="],
+
+ "@babel/plugin-transform-class-properties": ["@babel/plugin-transform-class-properties@7.25.9", "", { "dependencies": { "@babel/helper-create-class-features-plugin": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q=="],
+
+ "@babel/plugin-transform-class-static-block": ["@babel/plugin-transform-class-static-block@7.26.0", "", { "dependencies": { "@babel/helper-create-class-features-plugin": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.12.0" } }, "sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ=="],
+
+ "@babel/plugin-transform-classes": ["@babel/plugin-transform-classes@7.25.9", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.25.9", "@babel/helper-compilation-targets": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9", "@babel/helper-replace-supers": "^7.25.9", "@babel/traverse": "^7.25.9", "globals": "^11.1.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg=="],
+
+ "@babel/plugin-transform-computed-properties": ["@babel/plugin-transform-computed-properties@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9", "@babel/template": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA=="],
+
+ "@babel/plugin-transform-destructuring": ["@babel/plugin-transform-destructuring@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ=="],
+
+ "@babel/plugin-transform-dotall-regex": ["@babel/plugin-transform-dotall-regex@7.25.9", "", { "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA=="],
+
+ "@babel/plugin-transform-duplicate-keys": ["@babel/plugin-transform-duplicate-keys@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw=="],
+
+ "@babel/plugin-transform-duplicate-named-capturing-groups-regex": ["@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.25.9", "", { "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog=="],
+
+ "@babel/plugin-transform-dynamic-import": ["@babel/plugin-transform-dynamic-import@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg=="],
+
+ "@babel/plugin-transform-exponentiation-operator": ["@babel/plugin-transform-exponentiation-operator@7.26.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ=="],
+
+ "@babel/plugin-transform-export-namespace-from": ["@babel/plugin-transform-export-namespace-from@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww=="],
+
+ "@babel/plugin-transform-flow-strip-types": ["@babel/plugin-transform-flow-strip-types@7.26.5", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.26.5", "@babel/plugin-syntax-flow": "^7.26.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-eGK26RsbIkYUns3Y8qKl362juDDYK+wEdPGHGrhzUl6CewZFo55VZ7hg+CyMFU4dd5QQakBN86nBMpRsFpRvbQ=="],
+
+ "@babel/plugin-transform-for-of": ["@babel/plugin-transform-for-of@7.26.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.26.5", "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-Hry8AusVm8LW5BVFgiyUReuoGzPUpdHQQqJY5bZnbbf+ngOHWuCuYFKw/BqaaWlvEUrF91HMhDtEaI1hZzNbLg=="],
+
+ "@babel/plugin-transform-function-name": ["@babel/plugin-transform-function-name@7.25.9", "", { "dependencies": { "@babel/helper-compilation-targets": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9", "@babel/traverse": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA=="],
+
+ "@babel/plugin-transform-json-strings": ["@babel/plugin-transform-json-strings@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw=="],
+
+ "@babel/plugin-transform-literals": ["@babel/plugin-transform-literals@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ=="],
+
+ "@babel/plugin-transform-logical-assignment-operators": ["@babel/plugin-transform-logical-assignment-operators@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q=="],
+
+ "@babel/plugin-transform-member-expression-literals": ["@babel/plugin-transform-member-expression-literals@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA=="],
+
+ "@babel/plugin-transform-modules-amd": ["@babel/plugin-transform-modules-amd@7.25.9", "", { "dependencies": { "@babel/helper-module-transforms": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw=="],
+
+ "@babel/plugin-transform-modules-commonjs": ["@babel/plugin-transform-modules-commonjs@7.26.3", "", { "dependencies": { "@babel/helper-module-transforms": "^7.26.0", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ=="],
+
+ "@babel/plugin-transform-modules-systemjs": ["@babel/plugin-transform-modules-systemjs@7.25.9", "", { "dependencies": { "@babel/helper-module-transforms": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9", "@babel/traverse": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA=="],
+
+ "@babel/plugin-transform-modules-umd": ["@babel/plugin-transform-modules-umd@7.25.9", "", { "dependencies": { "@babel/helper-module-transforms": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw=="],
+
+ "@babel/plugin-transform-named-capturing-groups-regex": ["@babel/plugin-transform-named-capturing-groups-regex@7.25.9", "", { "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA=="],
+
+ "@babel/plugin-transform-new-target": ["@babel/plugin-transform-new-target@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ=="],
+
+ "@babel/plugin-transform-nullish-coalescing-operator": ["@babel/plugin-transform-nullish-coalescing-operator@7.26.6", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.26.5" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-CKW8Vu+uUZneQCPtXmSBUC6NCAUdya26hWCElAWh5mVSlSRsmiCPUUDKb3Z0szng1hiAJa098Hkhg9o4SE35Qw=="],
+
+ "@babel/plugin-transform-numeric-separator": ["@babel/plugin-transform-numeric-separator@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q=="],
+
+ "@babel/plugin-transform-object-rest-spread": ["@babel/plugin-transform-object-rest-spread@7.25.9", "", { "dependencies": { "@babel/helper-compilation-targets": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9", "@babel/plugin-transform-parameters": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg=="],
+
+ "@babel/plugin-transform-object-super": ["@babel/plugin-transform-object-super@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9", "@babel/helper-replace-supers": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A=="],
+
+ "@babel/plugin-transform-optional-catch-binding": ["@babel/plugin-transform-optional-catch-binding@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g=="],
+
+ "@babel/plugin-transform-optional-chaining": ["@babel/plugin-transform-optional-chaining@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9", "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A=="],
+
+ "@babel/plugin-transform-parameters": ["@babel/plugin-transform-parameters@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g=="],
+
+ "@babel/plugin-transform-private-methods": ["@babel/plugin-transform-private-methods@7.25.9", "", { "dependencies": { "@babel/helper-create-class-features-plugin": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw=="],
+
+ "@babel/plugin-transform-private-property-in-object": ["@babel/plugin-transform-private-property-in-object@7.25.9", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.25.9", "@babel/helper-create-class-features-plugin": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw=="],
+
+ "@babel/plugin-transform-property-literals": ["@babel/plugin-transform-property-literals@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA=="],
+
+ "@babel/plugin-transform-react-display-name": ["@babel/plugin-transform-react-display-name@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-KJfMlYIUxQB1CJfO3e0+h0ZHWOTLCPP115Awhaz8U0Zpq36Gl/cXlpoyMRnUWlhNUBAzldnCiAZNvCDj7CrKxQ=="],
+
+ "@babel/plugin-transform-react-jsx": ["@babel/plugin-transform-react-jsx@7.25.9", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.25.9", "@babel/helper-module-imports": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9", "@babel/plugin-syntax-jsx": "^7.25.9", "@babel/types": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-s5XwpQYCqGerXl+Pu6VDL3x0j2d82eiV77UJ8a2mDHAW7j9SWRqQ2y1fNo1Z74CdcYipl5Z41zvjj4Nfzq36rw=="],
+
+ "@babel/plugin-transform-react-jsx-development": ["@babel/plugin-transform-react-jsx-development@7.25.9", "", { "dependencies": { "@babel/plugin-transform-react-jsx": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-9mj6rm7XVYs4mdLIpbZnHOYdpW42uoiBCTVowg7sP1thUOiANgMb4UtpRivR0pp5iL+ocvUv7X4mZgFRpJEzGw=="],
+
+ "@babel/plugin-transform-react-jsx-self": ["@babel/plugin-transform-react-jsx-self@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-y8quW6p0WHkEhmErnfe58r7x0A70uKphQm8Sp8cV7tjNQwK56sNVK0M73LK3WuYmsuyrftut4xAkjjgU0twaMg=="],
+
+ "@babel/plugin-transform-react-jsx-source": ["@babel/plugin-transform-react-jsx-source@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-+iqjT8xmXhhYv4/uiYd8FNQsraMFZIfxVSqxxVSZP0WbbSAWvBXAul0m/zu+7Vv4O/3WtApy9pmaTMiumEZgfg=="],
+
+ "@babel/plugin-transform-react-pure-annotations": ["@babel/plugin-transform-react-pure-annotations@7.25.9", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-KQ/Takk3T8Qzj5TppkS1be588lkbTp5uj7w6a0LeQaTMSckU/wK0oJ/pih+T690tkgI5jfmg2TqDJvd41Sj1Cg=="],
+
+ "@babel/plugin-transform-regenerator": ["@babel/plugin-transform-regenerator@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9", "regenerator-transform": "^0.15.2" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg=="],
+
+ "@babel/plugin-transform-regexp-modifiers": ["@babel/plugin-transform-regexp-modifiers@7.26.0", "", { "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw=="],
+
+ "@babel/plugin-transform-reserved-words": ["@babel/plugin-transform-reserved-words@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg=="],
+
+ "@babel/plugin-transform-runtime": ["@babel/plugin-transform-runtime@7.26.9", "", { "dependencies": { "@babel/helper-module-imports": "^7.25.9", "@babel/helper-plugin-utils": "^7.26.5", "babel-plugin-polyfill-corejs2": "^0.4.10", "babel-plugin-polyfill-corejs3": "^0.10.6", "babel-plugin-polyfill-regenerator": "^0.6.1", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-Jf+8y9wXQbbxvVYTM8gO5oEF2POdNji0NMltEkG7FtmzD9PVz7/lxpqSdTvwsjTMU5HIHuDVNf2SOxLkWi+wPQ=="],
+
+ "@babel/plugin-transform-shorthand-properties": ["@babel/plugin-transform-shorthand-properties@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng=="],
+
+ "@babel/plugin-transform-spread": ["@babel/plugin-transform-spread@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9", "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A=="],
+
+ "@babel/plugin-transform-sticky-regex": ["@babel/plugin-transform-sticky-regex@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA=="],
+
+ "@babel/plugin-transform-template-literals": ["@babel/plugin-transform-template-literals@7.26.8", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.26.5" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-OmGDL5/J0CJPJZTHZbi2XpO0tyT2Ia7fzpW5GURwdtp2X3fMmN8au/ej6peC/T33/+CRiIpA8Krse8hFGVmT5Q=="],
+
+ "@babel/plugin-transform-typeof-symbol": ["@babel/plugin-transform-typeof-symbol@7.26.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.26.5" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-jfoTXXZTgGg36BmhqT3cAYK5qkmqvJpvNrPhaK/52Vgjhw4Rq29s9UqpWWV0D6yuRmgiFH/BUVlkl96zJWqnaw=="],
+
+ "@babel/plugin-transform-typescript": ["@babel/plugin-transform-typescript@7.26.8", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.25.9", "@babel/helper-create-class-features-plugin": "^7.25.9", "@babel/helper-plugin-utils": "^7.26.5", "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", "@babel/plugin-syntax-typescript": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-bME5J9AC8ChwA7aEPJ6zym3w7aObZULHhbNLU0bKUhKsAkylkzUdq+0kdymh9rzi8nlNFl2bmldFBCKNJBUpuw=="],
+
+ "@babel/plugin-transform-unicode-escapes": ["@babel/plugin-transform-unicode-escapes@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q=="],
+
+ "@babel/plugin-transform-unicode-property-regex": ["@babel/plugin-transform-unicode-property-regex@7.25.9", "", { "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg=="],
+
+ "@babel/plugin-transform-unicode-regex": ["@babel/plugin-transform-unicode-regex@7.25.9", "", { "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA=="],
+
+ "@babel/plugin-transform-unicode-sets-regex": ["@babel/plugin-transform-unicode-sets-regex@7.25.9", "", { "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.25.9", "@babel/helper-plugin-utils": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ=="],
+
+ "@babel/preset-env": ["@babel/preset-env@7.26.9", "", { "dependencies": { "@babel/compat-data": "^7.26.8", "@babel/helper-compilation-targets": "^7.26.5", "@babel/helper-plugin-utils": "^7.26.5", "@babel/helper-validator-option": "^7.25.9", "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.9", "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.9", "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.25.9", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.25.9", "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.25.9", "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", "@babel/plugin-syntax-import-assertions": "^7.26.0", "@babel/plugin-syntax-import-attributes": "^7.26.0", "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", "@babel/plugin-transform-arrow-functions": "^7.25.9", "@babel/plugin-transform-async-generator-functions": "^7.26.8", "@babel/plugin-transform-async-to-generator": "^7.25.9", "@babel/plugin-transform-block-scoped-functions": "^7.26.5", "@babel/plugin-transform-block-scoping": "^7.25.9", "@babel/plugin-transform-class-properties": "^7.25.9", "@babel/plugin-transform-class-static-block": "^7.26.0", "@babel/plugin-transform-classes": "^7.25.9", "@babel/plugin-transform-computed-properties": "^7.25.9", "@babel/plugin-transform-destructuring": "^7.25.9", "@babel/plugin-transform-dotall-regex": "^7.25.9", "@babel/plugin-transform-duplicate-keys": "^7.25.9", "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.9", "@babel/plugin-transform-dynamic-import": "^7.25.9", "@babel/plugin-transform-exponentiation-operator": "^7.26.3", "@babel/plugin-transform-export-namespace-from": "^7.25.9", "@babel/plugin-transform-for-of": "^7.26.9", "@babel/plugin-transform-function-name": "^7.25.9", "@babel/plugin-transform-json-strings": "^7.25.9", "@babel/plugin-transform-literals": "^7.25.9", "@babel/plugin-transform-logical-assignment-operators": "^7.25.9", "@babel/plugin-transform-member-expression-literals": "^7.25.9", "@babel/plugin-transform-modules-amd": "^7.25.9", "@babel/plugin-transform-modules-commonjs": "^7.26.3", "@babel/plugin-transform-modules-systemjs": "^7.25.9", "@babel/plugin-transform-modules-umd": "^7.25.9", "@babel/plugin-transform-named-capturing-groups-regex": "^7.25.9", "@babel/plugin-transform-new-target": "^7.25.9", "@babel/plugin-transform-nullish-coalescing-operator": "^7.26.6", "@babel/plugin-transform-numeric-separator": "^7.25.9", "@babel/plugin-transform-object-rest-spread": "^7.25.9", "@babel/plugin-transform-object-super": "^7.25.9", "@babel/plugin-transform-optional-catch-binding": "^7.25.9", "@babel/plugin-transform-optional-chaining": "^7.25.9", "@babel/plugin-transform-parameters": "^7.25.9", "@babel/plugin-transform-private-methods": "^7.25.9", "@babel/plugin-transform-private-property-in-object": "^7.25.9", "@babel/plugin-transform-property-literals": "^7.25.9", "@babel/plugin-transform-regenerator": "^7.25.9", "@babel/plugin-transform-regexp-modifiers": "^7.26.0", "@babel/plugin-transform-reserved-words": "^7.25.9", "@babel/plugin-transform-shorthand-properties": "^7.25.9", "@babel/plugin-transform-spread": "^7.25.9", "@babel/plugin-transform-sticky-regex": "^7.25.9", "@babel/plugin-transform-template-literals": "^7.26.8", "@babel/plugin-transform-typeof-symbol": "^7.26.7", "@babel/plugin-transform-unicode-escapes": "^7.25.9", "@babel/plugin-transform-unicode-property-regex": "^7.25.9", "@babel/plugin-transform-unicode-regex": "^7.25.9", "@babel/plugin-transform-unicode-sets-regex": "^7.25.9", "@babel/preset-modules": "0.1.6-no-external-plugins", "babel-plugin-polyfill-corejs2": "^0.4.10", "babel-plugin-polyfill-corejs3": "^0.11.0", "babel-plugin-polyfill-regenerator": "^0.6.1", "core-js-compat": "^3.40.0", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-vX3qPGE8sEKEAZCWk05k3cpTAE3/nOYca++JA+Rd0z2NCNzabmYvEiSShKzm10zdquOIAVXsy2Ei/DTW34KlKQ=="],
+
+ "@babel/preset-flow": ["@babel/preset-flow@7.25.9", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9", "@babel/helper-validator-option": "^7.25.9", "@babel/plugin-transform-flow-strip-types": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-EASHsAhE+SSlEzJ4bzfusnXSHiU+JfAYzj+jbw2vgQKgq5HrUr8qs+vgtiEL5dOH6sEweI+PNt2D7AqrDSHyqQ=="],
+
+ "@babel/preset-modules": ["@babel/preset-modules@0.1.6-no-external-plugins", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/types": "^7.4.4", "esutils": "^2.0.2" }, "peerDependencies": { "@babel/core": "^7.0.0-0 || ^8.0.0-0 <8.0.0" } }, "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA=="],
+
+ "@babel/preset-react": ["@babel/preset-react@7.26.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9", "@babel/helper-validator-option": "^7.25.9", "@babel/plugin-transform-react-display-name": "^7.25.9", "@babel/plugin-transform-react-jsx": "^7.25.9", "@babel/plugin-transform-react-jsx-development": "^7.25.9", "@babel/plugin-transform-react-pure-annotations": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-Nl03d6T9ky516DGK2YMxrTqvnpUW63TnJMOMonj+Zae0JiPC5BC9xPMSL6L8fiSpA5vP88qfygavVQvnLp+6Cw=="],
+
+ "@babel/preset-typescript": ["@babel/preset-typescript@7.26.0", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.25.9", "@babel/helper-validator-option": "^7.25.9", "@babel/plugin-syntax-jsx": "^7.25.9", "@babel/plugin-transform-modules-commonjs": "^7.25.9", "@babel/plugin-transform-typescript": "^7.25.9" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-NMk1IGZ5I/oHhoXEElcm+xUnL/szL6xflkFZmoEU9xj1qSJXpiS7rsspYo92B4DRCDvZn2erT5LdsCeXAKNCkg=="],
+
+ "@babel/register": ["@babel/register@7.25.9", "", { "dependencies": { "clone-deep": "^4.0.1", "find-cache-dir": "^2.0.0", "make-dir": "^2.1.0", "pirates": "^4.0.6", "source-map-support": "^0.5.16" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-8D43jXtGsYmEeDvm4MWHYUpWf8iiXgWYx3fW7E7Wb7Oe6FWqJPl5K6TuFW0dOwNZzEE5rjlaSJYH9JjrUKJszA=="],
+
+ "@babel/runtime": ["@babel/runtime@7.26.9", "", { "dependencies": { "regenerator-runtime": "^0.14.0" } }, "sha512-aA63XwOkcl4xxQa3HjPMqOP6LiK0ZDv3mUPYEFXkpHbaFjtGggE1A61FjFzJnB+p7/oy2gA8E+rcBNl/zC1tMg=="],
+
+ "@babel/template": ["@babel/template@7.26.9", "", { "dependencies": { "@babel/code-frame": "^7.26.2", "@babel/parser": "^7.26.9", "@babel/types": "^7.26.9" } }, "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA=="],
+
+ "@babel/traverse": ["@babel/traverse@7.26.9", "", { "dependencies": { "@babel/code-frame": "^7.26.2", "@babel/generator": "^7.26.9", "@babel/parser": "^7.26.9", "@babel/template": "^7.26.9", "@babel/types": "^7.26.9", "debug": "^4.3.1", "globals": "^11.1.0" } }, "sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg=="],
+
+ "@babel/traverse--for-generate-function-map": ["@babel/traverse@7.26.9", "", { "dependencies": { "@babel/code-frame": "^7.26.2", "@babel/generator": "^7.26.9", "@babel/parser": "^7.26.9", "@babel/template": "^7.26.9", "@babel/types": "^7.26.9", "debug": "^4.3.1", "globals": "^11.1.0" } }, "sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg=="],
+
+ "@babel/types": ["@babel/types@7.26.9", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw=="],
+
+ "@bounceapp/iframe": ["@bounceapp/iframe@0.3.0", "", { "peerDependencies": { "expo": "*", "react": "*", "react-dom": "*", "react-native": "*", "react-native-web": "*", "react-native-webview": "*" } }, "sha512-7GVM6nCWS01yWuZtVYataziRhrPKqs4JG/7Q+Mf4ZCxuIN7u+qXLXnz4w9f4xF0WxsioL1VkScNRxweC2yBc3g=="],
+
+ "@colors/colors": ["@colors/colors@1.6.0", "", {}, "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA=="],
+
+ "@cspotcode/source-map-support": ["@cspotcode/source-map-support@0.8.1", "", { "dependencies": { "@jridgewell/trace-mapping": "0.3.9" } }, "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw=="],
+
+ "@cyntler/react-doc-viewer": ["@cyntler/react-doc-viewer@1.17.0", "", { "dependencies": { "@types/mustache": "^4.2.5", "@types/papaparse": "^5.3.14", "ajv": "^7.2.4", "core-js": "^3.37.1", "mustache": "^4.2.0", "papaparse": "^5.4.1", "react-pdf": "^9.0.0", "styled-components": "^6.1.11" }, "peerDependencies": { "react": ">=17.0.0", "react-dom": ">=17.0.0" } }, "sha512-rx3HGcDpOtyuBuWjPaiMxgC4t476DeZiMS1KkQGY/o49SCjFr1Kh19UeICxYAt2oZ2mifE08xI3hcTQpIZ/jqw=="],
+
+ "@dabh/diagnostics": ["@dabh/diagnostics@2.0.3", "", { "dependencies": { "colorspace": "1.1.x", "enabled": "2.0.x", "kuler": "^2.0.0" } }, "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA=="],
+
+ "@emnapi/runtime": ["@emnapi/runtime@1.3.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw=="],
+
+ "@emotion/babel-plugin": ["@emotion/babel-plugin@11.13.5", "", { "dependencies": { "@babel/helper-module-imports": "^7.16.7", "@babel/runtime": "^7.18.3", "@emotion/hash": "^0.9.2", "@emotion/memoize": "^0.9.0", "@emotion/serialize": "^1.3.3", "babel-plugin-macros": "^3.1.0", "convert-source-map": "^1.5.0", "escape-string-regexp": "^4.0.0", "find-root": "^1.1.0", "source-map": "^0.5.7", "stylis": "4.2.0" } }, "sha512-pxHCpT2ex+0q+HH91/zsdHkw/lXd468DIN2zvfvLtPKLLMo6gQj7oLObq8PhkrxOZb/gGCq03S3Z7PDhS8pduQ=="],
+
+ "@emotion/cache": ["@emotion/cache@11.14.0", "", { "dependencies": { "@emotion/memoize": "^0.9.0", "@emotion/sheet": "^1.4.0", "@emotion/utils": "^1.4.2", "@emotion/weak-memoize": "^0.4.0", "stylis": "4.2.0" } }, "sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA=="],
+
+ "@emotion/hash": ["@emotion/hash@0.9.2", "", {}, "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g=="],
+
+ "@emotion/is-prop-valid": ["@emotion/is-prop-valid@1.2.2", "", { "dependencies": { "@emotion/memoize": "^0.8.1" } }, "sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw=="],
+
+ "@emotion/memoize": ["@emotion/memoize@0.9.0", "", {}, "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ=="],
+
+ "@emotion/react": ["@emotion/react@11.14.0", "", { "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.13.5", "@emotion/cache": "^11.14.0", "@emotion/serialize": "^1.3.3", "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", "@emotion/utils": "^1.4.2", "@emotion/weak-memoize": "^0.4.0", "hoist-non-react-statics": "^3.3.1" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-O000MLDBDdk/EohJPFUqvnp4qnHeYkVP5B0xEG0D/L7cOKP9kefu2DXn8dj74cQfsEzUqh+sr1RzFqiL1o+PpA=="],
+
+ "@emotion/serialize": ["@emotion/serialize@1.3.3", "", { "dependencies": { "@emotion/hash": "^0.9.2", "@emotion/memoize": "^0.9.0", "@emotion/unitless": "^0.10.0", "@emotion/utils": "^1.4.2", "csstype": "^3.0.2" } }, "sha512-EISGqt7sSNWHGI76hC7x1CksiXPahbxEOrC5RjmFRJTqLyEK9/9hZvBbiYn70dw4wuwMKiEMCUlR6ZXTSWQqxA=="],
+
+ "@emotion/server": ["@emotion/server@11.11.0", "", { "dependencies": { "@emotion/utils": "^1.2.1", "html-tokenize": "^2.0.0", "multipipe": "^1.0.2", "through": "^2.3.8" }, "peerDependencies": { "@emotion/css": "^11.0.0-rc.0" }, "optionalPeers": ["@emotion/css"] }, "sha512-6q89fj2z8VBTx9w93kJ5n51hsmtYuFPtZgnc1L8VzRx9ti4EU6EyvF6Nn1H1x3vcCQCF7u2dB2lY4AYJwUW4PA=="],
+
+ "@emotion/sheet": ["@emotion/sheet@1.4.0", "", {}, "sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg=="],
+
+ "@emotion/unitless": ["@emotion/unitless@0.8.1", "", {}, "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ=="],
+
+ "@emotion/use-insertion-effect-with-fallbacks": ["@emotion/use-insertion-effect-with-fallbacks@1.2.0", "", { "peerDependencies": { "react": ">=16.8.0" } }, "sha512-yJMtVdH59sxi/aVJBpk9FQq+OR8ll5GT8oWd57UpeaKEVGab41JWaCFA7FRLoMLloOZF/c/wsPoe+bfGmRKgDg=="],
+
+ "@emotion/utils": ["@emotion/utils@1.4.2", "", {}, "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA=="],
+
+ "@emotion/weak-memoize": ["@emotion/weak-memoize@0.4.0", "", {}, "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg=="],
+
+ "@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.25.0", "", { "os": "aix", "cpu": "ppc64" }, "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ=="],
+
+ "@esbuild/android-arm": ["@esbuild/android-arm@0.25.0", "", { "os": "android", "cpu": "arm" }, "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g=="],
+
+ "@esbuild/android-arm64": ["@esbuild/android-arm64@0.25.0", "", { "os": "android", "cpu": "arm64" }, "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g=="],
+
+ "@esbuild/android-x64": ["@esbuild/android-x64@0.25.0", "", { "os": "android", "cpu": "x64" }, "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg=="],
+
+ "@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.25.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw=="],
+
+ "@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.25.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg=="],
+
+ "@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.25.0", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w=="],
+
+ "@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.25.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A=="],
+
+ "@esbuild/linux-arm": ["@esbuild/linux-arm@0.25.0", "", { "os": "linux", "cpu": "arm" }, "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg=="],
+
+ "@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.25.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg=="],
+
+ "@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.25.0", "", { "os": "linux", "cpu": "ia32" }, "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg=="],
+
+ "@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.25.0", "", { "os": "linux", "cpu": "none" }, "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw=="],
+
+ "@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.25.0", "", { "os": "linux", "cpu": "none" }, "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ=="],
+
+ "@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.25.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw=="],
+
+ "@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.25.0", "", { "os": "linux", "cpu": "none" }, "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA=="],
+
+ "@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.25.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA=="],
+
+ "@esbuild/linux-x64": ["@esbuild/linux-x64@0.25.0", "", { "os": "linux", "cpu": "x64" }, "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw=="],
+
+ "@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.25.0", "", { "os": "none", "cpu": "arm64" }, "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw=="],
+
+ "@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.25.0", "", { "os": "none", "cpu": "x64" }, "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA=="],
+
+ "@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.25.0", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw=="],
+
+ "@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.25.0", "", { "os": "openbsd", "cpu": "x64" }, "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg=="],
+
+ "@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.25.0", "", { "os": "sunos", "cpu": "x64" }, "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg=="],
+
+ "@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.25.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw=="],
+
+ "@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.25.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA=="],
+
+ "@esbuild/win32-x64": ["@esbuild/win32-x64@0.25.0", "", { "os": "win32", "cpu": "x64" }, "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ=="],
+
+ "@eslint-community/eslint-utils": ["@eslint-community/eslint-utils@4.4.1", "", { "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA=="],
+
+ "@eslint-community/regexpp": ["@eslint-community/regexpp@4.12.1", "", {}, "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ=="],
+
+ "@eslint/eslintrc": ["@eslint/eslintrc@2.1.4", "", { "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" } }, "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ=="],
+
+ "@eslint/js": ["@eslint/js@8.57.1", "", {}, "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q=="],
+
+ "@expo/bunyan": ["@expo/bunyan@4.0.1", "", { "dependencies": { "uuid": "^8.0.0" } }, "sha512-+Lla7nYSiHZirgK+U/uYzsLv/X+HaJienbD5AKX1UQZHYfWaP+9uuQluRB4GrEVWF0GZ7vEVp/jzaOT9k/SQlg=="],
+
+ "@expo/cli": ["@expo/cli@0.22.18", "", { "dependencies": { "@0no-co/graphql.web": "^1.0.8", "@babel/runtime": "^7.20.0", "@expo/code-signing-certificates": "^0.0.5", "@expo/config": "~10.0.10", "@expo/config-plugins": "~9.0.15", "@expo/devcert": "^1.1.2", "@expo/env": "~0.4.2", "@expo/image-utils": "^0.6.5", "@expo/json-file": "^9.0.2", "@expo/metro-config": "~0.19.11", "@expo/osascript": "^2.1.6", "@expo/package-manager": "^1.7.2", "@expo/plist": "^0.2.2", "@expo/prebuild-config": "^8.0.28", "@expo/rudder-sdk-node": "^1.1.1", "@expo/spawn-async": "^1.7.2", "@expo/ws-tunnel": "^1.0.1", "@expo/xcpretty": "^4.3.0", "@react-native/dev-middleware": "0.76.7", "@urql/core": "^5.0.6", "@urql/exchange-retry": "^1.3.0", "accepts": "^1.3.8", "arg": "^5.0.2", "better-opn": "~3.0.2", "bplist-creator": "0.0.7", "bplist-parser": "^0.3.1", "cacache": "^18.0.2", "chalk": "^4.0.0", "ci-info": "^3.3.0", "compression": "^1.7.4", "connect": "^3.7.0", "debug": "^4.3.4", "env-editor": "^0.4.1", "fast-glob": "^3.3.2", "form-data": "^3.0.1", "freeport-async": "^2.0.0", "fs-extra": "~8.1.0", "getenv": "^1.0.0", "glob": "^10.4.2", "internal-ip": "^4.3.0", "is-docker": "^2.0.0", "is-wsl": "^2.1.1", "lodash.debounce": "^4.0.8", "minimatch": "^3.0.4", "node-forge": "^1.3.1", "npm-package-arg": "^11.0.0", "ora": "^3.4.0", "picomatch": "^3.0.1", "pretty-bytes": "^5.6.0", "pretty-format": "^29.7.0", "progress": "^2.0.3", "prompts": "^2.3.2", "qrcode-terminal": "0.11.0", "require-from-string": "^2.0.2", "requireg": "^0.2.2", "resolve": "^1.22.2", "resolve-from": "^5.0.0", "resolve.exports": "^2.0.3", "semver": "^7.6.0", "send": "^0.19.0", "slugify": "^1.3.4", "source-map-support": "~0.5.21", "stacktrace-parser": "^0.1.10", "structured-headers": "^0.4.1", "tar": "^6.2.1", "temp-dir": "^2.0.0", "tempy": "^0.7.1", "terminal-link": "^2.1.1", "undici": "^6.18.2", "unique-string": "~2.0.0", "wrap-ansi": "^7.0.0", "ws": "^8.12.1" }, "bin": { "expo-internal": "build/bin/cli" } }, "sha512-TWGKHWTYU9xE7YETPk2zQzLPl+bldpzZCa0Cqg0QeENpu03ZEnMxUqrgHwrbWGTf7ONTYC1tODBkFCFw/qgPGA=="],
+
+ "@expo/code-signing-certificates": ["@expo/code-signing-certificates@0.0.5", "", { "dependencies": { "node-forge": "^1.2.1", "nullthrows": "^1.1.1" } }, "sha512-BNhXkY1bblxKZpltzAx98G2Egj9g1Q+JRcvR7E99DOj862FTCX+ZPsAUtPTr7aHxwtrL7+fL3r0JSmM9kBm+Bw=="],
+
+ "@expo/config": ["@expo/config@10.0.10", "", { "dependencies": { "@babel/code-frame": "~7.10.4", "@expo/config-plugins": "~9.0.15", "@expo/config-types": "^52.0.4", "@expo/json-file": "^9.0.2", "deepmerge": "^4.3.1", "getenv": "^1.0.0", "glob": "^10.4.2", "require-from-string": "^2.0.2", "resolve-from": "^5.0.0", "resolve-workspace-root": "^2.0.0", "semver": "^7.6.0", "slugify": "^1.3.4", "sucrase": "3.35.0" } }, "sha512-wI9/iam3Irk99ADGM/FyD7YrrEibIZXR4huSZiU5zt9o3dASOKhqepiNJex4YPiktLfKhYrpSEJtwno1g0SrgA=="],
+
+ "@expo/config-plugins": ["@expo/config-plugins@9.0.16", "", { "dependencies": { "@expo/config-types": "^52.0.5", "@expo/json-file": "~9.0.2", "@expo/plist": "^0.2.2", "@expo/sdk-runtime-versions": "^1.0.0", "chalk": "^4.1.2", "debug": "^4.3.5", "getenv": "^1.0.0", "glob": "^10.4.2", "resolve-from": "^5.0.0", "semver": "^7.5.4", "slash": "^3.0.0", "slugify": "^1.6.6", "xcode": "^3.0.1", "xml2js": "0.6.0" } }, "sha512-AnJzmFB7ztM0JZBn+Ut6BQYC2WeGDzfIhBZVOIPMQbdBqvwJ7TmFEsGTGSxdwU/VqJaJK2sWxyt1zbWkpIYCEA=="],
+
+ "@expo/config-types": ["@expo/config-types@52.0.5", "", {}, "sha512-AMDeuDLHXXqd8W+0zSjIt7f37vUd/BP8p43k68NHpyAvQO+z8mbQZm3cNQVAMySeayK2XoPigAFB1JF2NFajaA=="],
+
+ "@expo/devcert": ["@expo/devcert@1.1.4", "", { "dependencies": { "application-config-path": "^0.1.0", "command-exists": "^1.2.4", "debug": "^3.1.0", "eol": "^0.9.1", "get-port": "^3.2.0", "glob": "^10.4.2", "lodash": "^4.17.21", "mkdirp": "^0.5.1", "password-prompt": "^1.0.4", "sudo-prompt": "^8.2.0", "tmp": "^0.0.33", "tslib": "^2.4.0" } }, "sha512-fqBODr8c72+gBSX5Ty3SIzaY4bXainlpab78+vEYEKL3fXmsOswMLf0+KE36mUEAa36BYabX7K3EiXOXX5OPMw=="],
+
+ "@expo/env": ["@expo/env@0.4.2", "", { "dependencies": { "chalk": "^4.0.0", "debug": "^4.3.4", "dotenv": "~16.4.5", "dotenv-expand": "~11.0.6", "getenv": "^1.0.0" } }, "sha512-TgbCgvSk0Kq0e2fLoqHwEBL4M0ztFjnBEz0YCDm5boc1nvkV1VMuIMteVdeBwnTh8Z0oPJTwHCD49vhMEt1I6A=="],
+
+ "@expo/fingerprint": ["@expo/fingerprint@0.11.11", "", { "dependencies": { "@expo/spawn-async": "^1.7.2", "arg": "^5.0.2", "chalk": "^4.1.2", "debug": "^4.3.4", "find-up": "^5.0.0", "getenv": "^1.0.0", "minimatch": "^3.0.4", "p-limit": "^3.1.0", "resolve-from": "^5.0.0", "semver": "^7.6.0" }, "bin": { "fingerprint": "bin/cli.js" } }, "sha512-gNyn1KnAOpEa8gSNsYqXMTcq0fSwqU/vit6fP5863vLSKxHm/dNt/gm/uZJxrRZxKq71KUJWF6I7d3z8qIfq5g=="],
+
+ "@expo/image-utils": ["@expo/image-utils@0.6.5", "", { "dependencies": { "@expo/spawn-async": "^1.7.2", "chalk": "^4.0.0", "fs-extra": "9.0.0", "getenv": "^1.0.0", "jimp-compact": "0.16.1", "parse-png": "^2.1.0", "resolve-from": "^5.0.0", "semver": "^7.6.0", "temp-dir": "~2.0.0", "unique-string": "~2.0.0" } }, "sha512-RsS/1CwJYzccvlprYktD42KjyfWZECH6PPIEowvoSmXfGLfdViwcUEI4RvBfKX5Jli6P67H+6YmHvPTbGOboew=="],
+
+ "@expo/json-file": ["@expo/json-file@9.0.2", "", { "dependencies": { "@babel/code-frame": "~7.10.4", "json5": "^2.2.3", "write-file-atomic": "^2.3.0" } }, "sha512-yAznIUrybOIWp3Uax7yRflB0xsEpvIwIEqIjao9SGi2Gaa+N0OamWfe0fnXBSWF+2zzF4VvqwT4W5zwelchfgw=="],
+
+ "@expo/metro-config": ["@expo/metro-config@0.19.11", "", { "dependencies": { "@babel/core": "^7.20.0", "@babel/generator": "^7.20.5", "@babel/parser": "^7.20.0", "@babel/types": "^7.20.0", "@expo/config": "~10.0.10", "@expo/env": "~0.4.2", "@expo/json-file": "~9.0.2", "@expo/spawn-async": "^1.7.2", "chalk": "^4.1.0", "debug": "^4.3.2", "fs-extra": "^9.1.0", "getenv": "^1.0.0", "glob": "^10.4.2", "jsc-safe-url": "^0.2.4", "lightningcss": "~1.27.0", "minimatch": "^3.0.4", "postcss": "~8.4.32", "resolve-from": "^5.0.0" } }, "sha512-XaobHTcsoHQdKEH7PI/DIpr2QiugkQmPYolbfzkpSJMplNWfSh+cTRjrm4//mS2Sb78qohtu0u2CGJnFqFUGag=="],
+
+ "@expo/osascript": ["@expo/osascript@2.1.6", "", { "dependencies": { "@expo/spawn-async": "^1.7.2", "exec-async": "^2.2.0" } }, "sha512-SbMp4BUwDAKiFF4zZEJf32rRYMeNnLK9u4FaPo0lQRer60F+SKd20NTSys0wgssiVeQyQz2OhGLRx3cxYowAGw=="],
+
+ "@expo/package-manager": ["@expo/package-manager@1.7.2", "", { "dependencies": { "@expo/json-file": "^9.0.2", "@expo/spawn-async": "^1.7.2", "ansi-regex": "^5.0.0", "chalk": "^4.0.0", "find-up": "^5.0.0", "js-yaml": "^3.13.1", "micromatch": "^4.0.8", "npm-package-arg": "^11.0.0", "ora": "^3.4.0", "resolve-workspace-root": "^2.0.0", "split": "^1.0.1", "sudo-prompt": "9.1.1" } }, "sha512-wT/qh9ebNjl6xr00bYkSh93b6E/78J3JPlT6WzGbxbsnv5FIZKB/nr522oWqVe1E+ML7BpXs8WugErWDN9kOFg=="],
+
+ "@expo/plist": ["@expo/plist@0.2.2", "", { "dependencies": { "@xmldom/xmldom": "~0.7.7", "base64-js": "^1.2.3", "xmlbuilder": "^14.0.0" } }, "sha512-ZZGvTO6vEWq02UAPs3LIdja+HRO18+LRI5QuDl6Hs3Ps7KX7xU6Y6kjahWKY37Rx2YjNpX07dGpBFzzC+vKa2g=="],
+
+ "@expo/prebuild-config": ["@expo/prebuild-config@8.0.28", "", { "dependencies": { "@expo/config": "~10.0.10", "@expo/config-plugins": "~9.0.15", "@expo/config-types": "^52.0.4", "@expo/image-utils": "^0.6.5", "@expo/json-file": "^9.0.2", "@react-native/normalize-colors": "0.76.7", "debug": "^4.3.1", "fs-extra": "^9.0.0", "resolve-from": "^5.0.0", "semver": "^7.6.0", "xml2js": "0.6.0" } }, "sha512-SDDgCKKS1wFNNm3de2vBP8Q5bnxcabuPDE9Mnk9p7Gb4qBavhwMbAtrLcAyZB+WRb4QM+yan3z3K95vvCfI/+A=="],
+
+ "@expo/rudder-sdk-node": ["@expo/rudder-sdk-node@1.1.1", "", { "dependencies": { "@expo/bunyan": "^4.0.0", "@segment/loosely-validate-event": "^2.0.0", "fetch-retry": "^4.1.1", "md5": "^2.2.1", "node-fetch": "^2.6.1", "remove-trailing-slash": "^0.1.0", "uuid": "^8.3.2" } }, "sha512-uy/hS/awclDJ1S88w9UGpc6Nm9XnNUjzOAAib1A3PVAnGQIwebg8DpFqOthFBTlZxeuV/BKbZ5jmTbtNZkp1WQ=="],
+
+ "@expo/sdk-runtime-versions": ["@expo/sdk-runtime-versions@1.0.0", "", {}, "sha512-Doz2bfiPndXYFPMRwPyGa1k5QaKDVpY806UJj570epIiMzWaYyCtobasyfC++qfIXVb5Ocy7r3tP9d62hAQ7IQ=="],
+
+ "@expo/spawn-async": ["@expo/spawn-async@1.7.2", "", { "dependencies": { "cross-spawn": "^7.0.3" } }, "sha512-QdWi16+CHB9JYP7gma19OVVg0BFkvU8zNj9GjWorYI8Iv8FUxjOCcYRuAmX4s/h91e4e7BPsskc8cSrZYho9Ew=="],
+
+ "@expo/vector-icons": ["@expo/vector-icons@14.0.4", "", { "dependencies": { "prop-types": "^15.8.1" } }, "sha512-+yKshcbpDfbV4zoXOgHxCwh7lkE9VVTT5T03OUlBsqfze1PLy6Hi4jp1vSb1GVbY6eskvMIivGVc9SKzIv0oEQ=="],
+
+ "@expo/ws-tunnel": ["@expo/ws-tunnel@1.0.5", "", {}, "sha512-Ta9KzslHAIbw2ZoyZ7Ud7/QImucy+K4YvOqo9AhGfUfH76hQzaffQreOySzYusDfW8Y+EXh0ZNWE68dfCumFFw=="],
+
+ "@expo/xcpretty": ["@expo/xcpretty@4.3.2", "", { "dependencies": { "@babel/code-frame": "7.10.4", "chalk": "^4.1.0", "find-up": "^5.0.0", "js-yaml": "^4.1.0" }, "bin": { "excpretty": "build/cli.js" } }, "sha512-ReZxZ8pdnoI3tP/dNnJdnmAk7uLT4FjsKDGW7YeDdvdOMz2XCQSmSCM9IWlrXuWtMF9zeSB6WJtEhCQ41gQOfw=="],
+
+ "@floating-ui/core": ["@floating-ui/core@1.6.9", "", { "dependencies": { "@floating-ui/utils": "^0.2.9" } }, "sha512-uMXCuQ3BItDUbAMhIXw7UPXRfAlOAvZzdK9BWpE60MCn+Svt3aLn9jsPTi/WNGlRUu2uI0v5S7JiIUsbsvh3fw=="],
+
+ "@floating-ui/dom": ["@floating-ui/dom@1.6.13", "", { "dependencies": { "@floating-ui/core": "^1.6.0", "@floating-ui/utils": "^0.2.9" } }, "sha512-umqzocjDgNRGTuO7Q8CU32dkHkECqI8ZdMZ5Swb6QAM0t5rnlrN3lGo1hdpscRd3WS8T6DKYK4ephgIH9iRh3w=="],
+
+ "@floating-ui/react": ["@floating-ui/react@0.19.2", "", { "dependencies": { "@floating-ui/react-dom": "^1.3.0", "aria-hidden": "^1.1.3", "tabbable": "^6.0.1" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-JyNk4A0Ezirq8FlXECvRtQOX/iBe5Ize0W/pLkrZjfHW9GUV7Xnq6zm6fyZuQzaHHqEnVizmvlA96e1/CkZv+w=="],
+
+ "@floating-ui/react-dom": ["@floating-ui/react-dom@1.3.0", "", { "dependencies": { "@floating-ui/dom": "^1.2.1" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-htwHm67Ji5E/pROEAr7f8IKFShuiCKHwUC/UY4vC3I5jiSvGFAYnSYiZO5MlGmads+QqvUkR9ANHEguGrDv72g=="],
+
+ "@floating-ui/utils": ["@floating-ui/utils@0.2.9", "", {}, "sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg=="],
+
+ "@google/generative-ai": ["@google/generative-ai@0.19.0", "", {}, "sha512-iGf/62v3sTwtEJGJY6S5m7PfkglU8hi1URaxqIjiRg1OItV27xyc4aVeR0og8cDkZFkUlGZKv+23bJtT1QWFzQ=="],
+
+ "@hookstate/core": ["@hookstate/core@4.0.1", "", { "peerDependencies": { "react": "^16.8.6 || ^17.0.0 || ^18.0.0" } }, "sha512-Uh2D8Z0z/pqOJ7t+SfC+2sj13JQcB4yFhtL+T1choCaBxTSlgOS/CKRBohgJ4cjTKoxOmTT8uSQysu3gUjX+Gw=="],
+
+ "@huggingface/jinja": ["@huggingface/jinja@0.3.3", "", {}, "sha512-vQQr2JyWvVFba3Lj9es4q9vCl1sAc74fdgnEMoX8qHrXtswap9ge9uO3ONDzQB0cQ0PUyaKY2N6HaVbTBvSXvw=="],
+
+ "@huggingface/transformers": ["@huggingface/transformers@3.3.3", "", { "dependencies": { "@huggingface/jinja": "^0.3.3", "onnxruntime-node": "1.20.1", "onnxruntime-web": "1.21.0-dev.20250206-d981b153d3", "sharp": "^0.33.5" } }, "sha512-OcMubhBjW6u1xnp0zSt5SvCxdGHuhP2k+w2Vlm3i0vNcTJhJTZWxxYQmPBfcb7PX+Q6c43lGSzWD6tsJFwka4Q=="],
+
+ "@humanwhocodes/config-array": ["@humanwhocodes/config-array@0.13.0", "", { "dependencies": { "@humanwhocodes/object-schema": "^2.0.3", "debug": "^4.3.1", "minimatch": "^3.0.5" } }, "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw=="],
+
+ "@humanwhocodes/module-importer": ["@humanwhocodes/module-importer@1.0.1", "", {}, "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA=="],
+
+ "@humanwhocodes/object-schema": ["@humanwhocodes/object-schema@2.0.3", "", {}, "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA=="],
+
+ "@img/sharp-darwin-arm64": ["@img/sharp-darwin-arm64@0.33.5", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-arm64": "1.0.4" }, "os": "darwin", "cpu": "arm64" }, "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ=="],
+
+ "@img/sharp-darwin-x64": ["@img/sharp-darwin-x64@0.33.5", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-x64": "1.0.4" }, "os": "darwin", "cpu": "x64" }, "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q=="],
+
+ "@img/sharp-libvips-darwin-arm64": ["@img/sharp-libvips-darwin-arm64@1.0.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg=="],
+
+ "@img/sharp-libvips-darwin-x64": ["@img/sharp-libvips-darwin-x64@1.0.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ=="],
+
+ "@img/sharp-libvips-linux-arm": ["@img/sharp-libvips-linux-arm@1.0.5", "", { "os": "linux", "cpu": "arm" }, "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g=="],
+
+ "@img/sharp-libvips-linux-arm64": ["@img/sharp-libvips-linux-arm64@1.0.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA=="],
+
+ "@img/sharp-libvips-linux-s390x": ["@img/sharp-libvips-linux-s390x@1.0.4", "", { "os": "linux", "cpu": "s390x" }, "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA=="],
+
+ "@img/sharp-libvips-linux-x64": ["@img/sharp-libvips-linux-x64@1.0.4", "", { "os": "linux", "cpu": "x64" }, "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw=="],
+
+ "@img/sharp-libvips-linuxmusl-arm64": ["@img/sharp-libvips-linuxmusl-arm64@1.0.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA=="],
+
+ "@img/sharp-libvips-linuxmusl-x64": ["@img/sharp-libvips-linuxmusl-x64@1.0.4", "", { "os": "linux", "cpu": "x64" }, "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw=="],
+
+ "@img/sharp-linux-arm": ["@img/sharp-linux-arm@0.33.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm": "1.0.5" }, "os": "linux", "cpu": "arm" }, "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ=="],
+
+ "@img/sharp-linux-arm64": ["@img/sharp-linux-arm64@0.33.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm64": "1.0.4" }, "os": "linux", "cpu": "arm64" }, "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA=="],
+
+ "@img/sharp-linux-s390x": ["@img/sharp-linux-s390x@0.33.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-s390x": "1.0.4" }, "os": "linux", "cpu": "s390x" }, "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q=="],
+
+ "@img/sharp-linux-x64": ["@img/sharp-linux-x64@0.33.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-x64": "1.0.4" }, "os": "linux", "cpu": "x64" }, "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA=="],
+
+ "@img/sharp-linuxmusl-arm64": ["@img/sharp-linuxmusl-arm64@0.33.5", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" }, "os": "linux", "cpu": "arm64" }, "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g=="],
+
+ "@img/sharp-linuxmusl-x64": ["@img/sharp-linuxmusl-x64@0.33.5", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-x64": "1.0.4" }, "os": "linux", "cpu": "x64" }, "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw=="],
+
+ "@img/sharp-wasm32": ["@img/sharp-wasm32@0.33.5", "", { "dependencies": { "@emnapi/runtime": "^1.2.0" }, "cpu": "none" }, "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg=="],
+
+ "@img/sharp-win32-ia32": ["@img/sharp-win32-ia32@0.33.5", "", { "os": "win32", "cpu": "ia32" }, "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ=="],
+
+ "@img/sharp-win32-x64": ["@img/sharp-win32-x64@0.33.5", "", { "os": "win32", "cpu": "x64" }, "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg=="],
+
+ "@isaacs/cliui": ["@isaacs/cliui@8.0.2", "", { "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", "strip-ansi": "^7.0.1", "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", "wrap-ansi": "^8.1.0", "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" } }, "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA=="],
+
+ "@isaacs/fs-minipass": ["@isaacs/fs-minipass@4.0.1", "", { "dependencies": { "minipass": "^7.0.4" } }, "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w=="],
+
+ "@isaacs/ttlcache": ["@isaacs/ttlcache@1.4.1", "", {}, "sha512-RQgQ4uQ+pLbqXfOmieB91ejmLwvSgv9nLx6sT6sD83s7umBypgg+OIBOBbEUiJXrfpnp9j0mRhYYdzp9uqq3lA=="],
+
+ "@istanbuljs/load-nyc-config": ["@istanbuljs/load-nyc-config@1.1.0", "", { "dependencies": { "camelcase": "^5.3.1", "find-up": "^4.1.0", "get-package-type": "^0.1.0", "js-yaml": "^3.13.1", "resolve-from": "^5.0.0" } }, "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ=="],
+
+ "@istanbuljs/schema": ["@istanbuljs/schema@0.1.3", "", {}, "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA=="],
+
+ "@jest/create-cache-key-function": ["@jest/create-cache-key-function@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3" } }, "sha512-4QqS3LY5PBmTRHj9sAg1HLoPzqAI0uOX6wI/TRqHIcOxlFidy6YEmCQJk6FSZjNLGCeubDMfmkWL+qaLKhSGQA=="],
+
+ "@jest/environment": ["@jest/environment@29.7.0", "", { "dependencies": { "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "jest-mock": "^29.7.0" } }, "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw=="],
+
+ "@jest/fake-timers": ["@jest/fake-timers@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", "jest-message-util": "^29.7.0", "jest-mock": "^29.7.0", "jest-util": "^29.7.0" } }, "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ=="],
+
+ "@jest/schemas": ["@jest/schemas@29.6.3", "", { "dependencies": { "@sinclair/typebox": "^0.27.8" } }, "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA=="],
+
+ "@jest/transform": ["@jest/transform@29.7.0", "", { "dependencies": { "@babel/core": "^7.11.6", "@jest/types": "^29.6.3", "@jridgewell/trace-mapping": "^0.3.18", "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", "jest-haste-map": "^29.7.0", "jest-regex-util": "^29.6.3", "jest-util": "^29.7.0", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", "write-file-atomic": "^4.0.2" } }, "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw=="],
+
+ "@jest/types": ["@jest/types@29.6.3", "", { "dependencies": { "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", "@types/yargs": "^17.0.8", "chalk": "^4.0.0" } }, "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw=="],
+
+ "@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.8", "", { "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA=="],
+
+ "@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="],
+
+ "@jridgewell/set-array": ["@jridgewell/set-array@1.2.1", "", {}, "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A=="],
+
+ "@jridgewell/source-map": ["@jridgewell/source-map@0.3.6", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25" } }, "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ=="],
+
+ "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.0", "", {}, "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ=="],
+
+ "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.9", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ=="],
+
+ "@mantine/carousel": ["@mantine/carousel@7.17.0", "", { "peerDependencies": { "@mantine/core": "7.17.0", "@mantine/hooks": "7.17.0", "embla-carousel-react": ">=7.0.0", "react": "^18.x || ^19.x", "react-dom": "^18.x || ^19.x" } }, "sha512-NrgfUBa7tbtDFem6TAntZjQknymqhzZ/d52szheRu+3GIfd9d8qEPHV1sMFRQ3DkzMxiJfzI6G61GvW6yLOaGg=="],
+
+ "@mantine/core": ["@mantine/core@6.0.22", "", { "dependencies": { "@floating-ui/react": "^0.19.1", "@mantine/styles": "6.0.22", "@mantine/utils": "6.0.22", "@radix-ui/react-scroll-area": "1.0.2", "react-remove-scroll": "^2.5.5", "react-textarea-autosize": "8.3.4" }, "peerDependencies": { "@mantine/hooks": "6.0.22", "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-6kv0eY7n565fyjgS20qUYeCSxg3f1TJ5vurzbP1HHtFXXKSY0bYoqqDoHipFCt6NxsPQGeiC6cC0c/IWIlxoKQ=="],
+
+ "@mantine/dates": ["@mantine/dates@6.0.22", "", { "dependencies": { "@mantine/utils": "6.0.22" }, "peerDependencies": { "@mantine/core": "6.0.22", "@mantine/hooks": "6.0.22", "dayjs": ">=1.0.0", "react": ">=16.8.0" } }, "sha512-RwZzaRtyCdwXWrszjoDFUrYdy2s6sAZgXZzp+ytp0KJDm63+H+4ri1Qkv7bWKVBgrTP7alsxCIGHV2weEOZKog=="],
+
+ "@mantine/dropzone": ["@mantine/dropzone@7.17.0", "", { "dependencies": { "react-dropzone-esm": "15.2.0" }, "peerDependencies": { "@mantine/core": "7.17.0", "@mantine/hooks": "7.17.0", "react": "^18.x || ^19.x", "react-dom": "^18.x || ^19.x" } }, "sha512-1BGOH/Fs1xxsVl6JUxFAElwqdmtj1nrzc7QSV3vs3xh7zAIAH6wqeor8j8+yycxz4lCfehHSaVAyDDv3AFsX8w=="],
+
+ "@mantine/form": ["@mantine/form@7.17.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "klona": "^2.0.6" }, "peerDependencies": { "react": "^18.x || ^19.x" } }, "sha512-LONdeb+wL8h9fvyQ339ZFLxqrvYff+b+H+kginZhnr45OBTZDLXNVAt/YoKVFEkynF9WDJjdBVrXKcOZvPgmrA=="],
+
+ "@mantine/hooks": ["@mantine/hooks@6.0.22", "", { "peerDependencies": { "react": ">=16.8.0" } }, "sha512-e10//QTN2sAmC4Ryeu5X5L/TsxnrjXMOaGq3dxFPIPsCSwLzyxqySfjzVViWmoPWAj0Ak9MvE2MHFjzmOpA80w=="],
+
+ "@mantine/next": ["@mantine/next@6.0.22", "", { "dependencies": { "@mantine/ssr": "6.0.22", "@mantine/styles": "6.0.22" }, "peerDependencies": { "next": "*", "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-OIDeCaMSVfmaN0F38y6Ir8tmMZHDAmy8MhalDAFjGdTD9UKO1V9nQKTNJAuvo5yldslGlfvwhKUjKy7oy/M65g=="],
+
+ "@mantine/notifications": ["@mantine/notifications@6.0.22", "", { "dependencies": { "@mantine/utils": "6.0.22", "react-transition-group": "4.4.2" }, "peerDependencies": { "@mantine/core": "6.0.22", "@mantine/hooks": "6.0.22", "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-x7iIil2yC81fEv/7YK6NYn6CKaftlw0E/hdprmxGWFhy87W9sYiYzPqigXZh11IJZFFW9ZPftpjPQFvDwE4KOw=="],
+
+ "@mantine/ssr": ["@mantine/ssr@6.0.22", "", { "dependencies": { "@mantine/styles": "6.0.22", "html-react-parser": "1.4.12" }, "peerDependencies": { "@emotion/react": ">=11.9.0", "@emotion/server": ">=11.4.0", "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-ZW89nrL39sfOEOSRlUEP92y5ItWFAbKOYwtgGBS7vHZ56hd6cOWH7bLr5GoQZGLJFywB/0lIpMk+pGsaA8YVEQ=="],
+
+ "@mantine/styles": ["@mantine/styles@6.0.22", "", { "dependencies": { "clsx": "1.1.1", "csstype": "3.0.9" }, "peerDependencies": { "@emotion/react": ">=11.9.0", "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-Rud/IQp2EFYDiP4csRy2XBrho/Ct+W2/b+XbvCRTeQTmpFy/NfAKm/TWJa5zPvuv/iLTjGkVos9SHw/DteESpQ=="],
+
+ "@mantine/tiptap": ["@mantine/tiptap@7.17.0", "", { "peerDependencies": { "@mantine/core": "7.17.0", "@mantine/hooks": "7.17.0", "@tiptap/extension-link": ">=2.1.12", "@tiptap/react": ">=2.1.12", "react": "^18.x || ^19.x", "react-dom": "^18.x || ^19.x" } }, "sha512-WgmtQ5xJ9fenEbgpfG/HFU8O5R9SWrI8NJTpc0VLQKA2t+I4S/j8dTXr58aLCEXqqo6MlX9hkIDZQSxzUNoPXQ=="],
+
+ "@mantine/utils": ["@mantine/utils@6.0.22", "", { "peerDependencies": { "react": ">=16.8.0" } }, "sha512-RSKlNZvxhMCkOFZ6slbYvZYbWjHUM+PxDQnupIOxIdsTZQQjx/BFfrfJ7kQFOP+g7MtpOds8weAetEs5obwMOQ=="],
+
+ "@mapbox/jsonlint-lines-primitives": ["@mapbox/jsonlint-lines-primitives@2.0.2", "", {}, "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ=="],
+
+ "@mapbox/mapbox-gl-supported": ["@mapbox/mapbox-gl-supported@3.0.0", "", {}, "sha512-2XghOwu16ZwPJLOFVuIOaLbN0iKMn867evzXFyf0P22dqugezfJwLmdanAgU25ITvz1TvOfVP4jsDImlDJzcWg=="],
+
+ "@mapbox/point-geometry": ["@mapbox/point-geometry@0.1.0", "", {}, "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ=="],
+
+ "@mapbox/tiny-sdf": ["@mapbox/tiny-sdf@2.0.6", "", {}, "sha512-qMqa27TLw+ZQz5Jk+RcwZGH7BQf5G/TrutJhspsca/3SHwmgKQ1iq+d3Jxz5oysPVYTGP6aXxCo5Lk9Er6YBAA=="],
+
+ "@mapbox/unitbezier": ["@mapbox/unitbezier@0.0.1", "", {}, "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw=="],
+
+ "@mapbox/vector-tile": ["@mapbox/vector-tile@1.3.1", "", { "dependencies": { "@mapbox/point-geometry": "~0.1.0" } }, "sha512-MCEddb8u44/xfQ3oD+Srl/tNcQoqTw3goGk2oLsrFxOTc3dUp+kAnby3PvAeeBYSMSjSPD1nd1AJA6W49WnoUw=="],
+
+ "@mapbox/whoots-js": ["@mapbox/whoots-js@3.1.0", "", {}, "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q=="],
+
+ "@maplibre/maplibre-gl-style-spec": ["@maplibre/maplibre-gl-style-spec@19.3.3", "", { "dependencies": { "@mapbox/jsonlint-lines-primitives": "~2.0.2", "@mapbox/unitbezier": "^0.0.1", "json-stringify-pretty-compact": "^3.0.0", "minimist": "^1.2.8", "rw": "^1.3.3", "sort-object": "^3.0.3" }, "bin": { "gl-style-format": "dist/gl-style-format.mjs", "gl-style-migrate": "dist/gl-style-migrate.mjs", "gl-style-validate": "dist/gl-style-validate.mjs" } }, "sha512-cOZZOVhDSulgK0meTsTkmNXb1ahVvmTmWmfx9gRBwc6hq98wS9JP35ESIoNq3xqEan+UN+gn8187Z6E4NKhLsw=="],
+
+ "@msgpack/msgpack": ["@msgpack/msgpack@2.8.0", "", {}, "sha512-h9u4u/jiIRKbq25PM+zymTyW6bhTzELvOoUd+AvYriWOAKpLGnIamaET3pnHYoI5iYphAHBI4ayx0MehR+VVPQ=="],
+
+ "@napi-rs/canvas": ["@napi-rs/canvas@0.1.67", "", { "optionalDependencies": { "@napi-rs/canvas-android-arm64": "0.1.67", "@napi-rs/canvas-darwin-arm64": "0.1.67", "@napi-rs/canvas-darwin-x64": "0.1.67", "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.67", "@napi-rs/canvas-linux-arm64-gnu": "0.1.67", "@napi-rs/canvas-linux-arm64-musl": "0.1.67", "@napi-rs/canvas-linux-riscv64-gnu": "0.1.67", "@napi-rs/canvas-linux-x64-gnu": "0.1.67", "@napi-rs/canvas-linux-x64-musl": "0.1.67", "@napi-rs/canvas-win32-x64-msvc": "0.1.67" } }, "sha512-VA4Khm/5Kg2bQGx3jXotTC4MloOG8b1Ung80exafUK0k5u6yJmIz3Q2iXeeWZs5weV+LQOEB+CPKsYwEYaGAjw=="],
+
+ "@napi-rs/canvas-android-arm64": ["@napi-rs/canvas-android-arm64@0.1.67", "", { "os": "android", "cpu": "arm64" }, "sha512-W+3DFG5h0WU8Vqqb3W5fNmm5/TPH5ECZRinQDK4CAKFSUkc4iZcDwrmyFG9sB4KdHazf1mFVHCpEeVMO6Mk6Zg=="],
+
+ "@napi-rs/canvas-darwin-arm64": ["@napi-rs/canvas-darwin-arm64@0.1.67", "", { "os": "darwin", "cpu": "arm64" }, "sha512-xzrv7QboI47yhIHR5P5u/9KGswokuOKLiKSukr1Ku03RRJxP6lGuVtrAZAgdRg7F9FsuF2REf2yK53YVb6pMlA=="],
+
+ "@napi-rs/canvas-darwin-x64": ["@napi-rs/canvas-darwin-x64@0.1.67", "", { "os": "darwin", "cpu": "x64" }, "sha512-SNk9lYBr84N0gW8MZ2IrjygFtbFBILr3SEqMdHzHHuph20SQmssFvJGPZwSSCMEyKAvyqhogbmlew0te5Z4w9Q=="],
+
+ "@napi-rs/canvas-linux-arm-gnueabihf": ["@napi-rs/canvas-linux-arm-gnueabihf@0.1.67", "", { "os": "linux", "cpu": "arm" }, "sha512-qmBlSvUpl567bzH8tNXi82u5FrL4d0qINqd6K9O7GWGGGFmKMJdrgi2/SW3wwCTxqHBasIDdVWc4KSJfwyaoDQ=="],
+
+ "@napi-rs/canvas-linux-arm64-gnu": ["@napi-rs/canvas-linux-arm64-gnu@0.1.67", "", { "os": "linux", "cpu": "arm64" }, "sha512-k3nAPQefkMeFuJ65Rqdnx92KX1JXQhEKjjWeKsCJB+7sIBgQUWtHo9c3etfVLv5pkWJJDFi/Zc2soNkH3E8dRA=="],
+
+ "@napi-rs/canvas-linux-arm64-musl": ["@napi-rs/canvas-linux-arm64-musl@0.1.67", "", { "os": "linux", "cpu": "arm64" }, "sha512-lZwHWR1cCP408l86n3Qbs3X1oFeAYMjJIQvQl1VMZh6wo5PfI+jaZSKBUOd8x44TnVllX9yhLY9unNRztk/sUQ=="],
+
+ "@napi-rs/canvas-linux-riscv64-gnu": ["@napi-rs/canvas-linux-riscv64-gnu@0.1.67", "", { "os": "linux", "cpu": "none" }, "sha512-PdBC9p6bLHA1W3OdA0vTHj701SB/kioGQ1uCFBRMs5KBCaMLb/H4aNi8uaIUIEvBWnxeAjoNcLU7//q0FxEosw=="],
+
+ "@napi-rs/canvas-linux-x64-gnu": ["@napi-rs/canvas-linux-x64-gnu@0.1.67", "", { "os": "linux", "cpu": "x64" }, "sha512-kJJX6eWzjipL/LdKOWCJctc88e5yzuXri8+s0V/lN06OwuLGW62TWS3lvi8qlUrGMOfRGabSWWlB4omhASSB8w=="],
+
+ "@napi-rs/canvas-linux-x64-musl": ["@napi-rs/canvas-linux-x64-musl@0.1.67", "", { "os": "linux", "cpu": "x64" }, "sha512-jLKiPWGeN6ZzhnaLG7ex7eexsiHJ1mdtPK1qKvETIcu45dApMXyUIHvdL6XWB5gFFtj5ScHzLUxv1vkfPZsoxA=="],
+
+ "@napi-rs/canvas-win32-x64-msvc": ["@napi-rs/canvas-win32-x64-msvc@0.1.67", "", { "os": "win32", "cpu": "x64" }, "sha512-K/JmkOFbc4iRZYUqJhj0jwqfHA/wNQEmTiGNsgZ6d59yF/IBNp5T0D5eg3B8ghjI8GxDYCiSJ6DNX8mC3Oh2EQ=="],
+
+ "@next/env": ["@next/env@13.5.8", "", {}, "sha512-YmiG58BqyZ2FjrF2+5uZExL2BrLr8RTQzLXNDJ8pJr0O+rPlOeDPXp1p1/4OrR3avDidzZo3D8QO2cuDv1KCkw=="],
+
+ "@next/eslint-plugin-next": ["@next/eslint-plugin-next@13.5.8", "", { "dependencies": { "glob": "7.1.7" } }, "sha512-rmNr6kz5g7x2CQ/5RMmav7/wTGOFIv4fcP+bxawNaJP+Y5Gb0Dvq+omBUvL66pDo/fhWurElatelEFpHX+tMSw=="],
+
+ "@next/swc-darwin-arm64": ["@next/swc-darwin-arm64@13.5.8", "", { "os": "darwin", "cpu": "arm64" }, "sha512-HkFw3QPeIy9bImWVTbsvzfEWQkuzBEQTK/L7ORMg+9sXNN0vNR5Gz/chD4/VbozTHyA38lWTrMBfLoWVpD+2IA=="],
+
+ "@next/swc-darwin-x64": ["@next/swc-darwin-x64@13.5.8", "", { "os": "darwin", "cpu": "x64" }, "sha512-TpRTH5FyH4qGw0MCq6UE3yQGWtwhdDCwSE0wWcYwDWC5cpx3mGKVmAVKwDNbrpk0U5bl0tEzgxp5X4UPHWA81A=="],
+
+ "@next/swc-linux-arm64-gnu": ["@next/swc-linux-arm64-gnu@13.5.8", "", { "os": "linux", "cpu": "arm64" }, "sha512-KUPKuu4EZCCTU5M61YLpuL2fKMWQRijJLtBk2Hph8FJUx6RsNRDwS0MVlJqAr2IwjJwrNxYm5QAdQ1LuRbrZMw=="],
+
+ "@next/swc-linux-arm64-musl": ["@next/swc-linux-arm64-musl@13.5.8", "", { "os": "linux", "cpu": "arm64" }, "sha512-hLyaBgXynyuVgqLwzcwF6loc0XuEz9zuK8XbzX5uslj3aqiw38l+qL1IJNLzHmkDX0nfVuBfIRV6QPsm0sCXnQ=="],
+
+ "@next/swc-linux-x64-gnu": ["@next/swc-linux-x64-gnu@13.5.8", "", { "os": "linux", "cpu": "x64" }, "sha512-IhxeEpi+U85GU9p6bVSAFMwuCNRdpmHueM8Z9DRft8f70Rvt3Q9tNFJxqLxAbiGoNOR7TuLNjAw2wJucHfMw3g=="],
+
+ "@next/swc-linux-x64-musl": ["@next/swc-linux-x64-musl@13.5.8", "", { "os": "linux", "cpu": "x64" }, "sha512-NQICDU7X/tcAVkTEfvpkq5Z1EViodDj3m18wiyJ5wpzOFf4LH7vFjLBVCWNcf3/sfqv/yfD8jshqrffOPtZitg=="],
+
+ "@next/swc-win32-arm64-msvc": ["@next/swc-win32-arm64-msvc@13.5.8", "", { "os": "win32", "cpu": "arm64" }, "sha512-ndLIuFI/26CrhG+pqGkW+yPV/xuIijgaZbzPhujlDaUGczizzXgnI78iuisdPdGoMHLlQ9pRkFUeMGzENdyEHg=="],
+
+ "@next/swc-win32-ia32-msvc": ["@next/swc-win32-ia32-msvc@13.5.8", "", { "os": "win32", "cpu": "ia32" }, "sha512-9HUxSP76n8VbEtwZVNZDMY32Y4fm53ORaiopQkGQ4q54okYa5T8szhVkLTFKu4gaA/KJcJGvCC5dDIaqfSta1w=="],
+
+ "@next/swc-win32-x64-msvc": ["@next/swc-win32-x64-msvc@13.5.8", "", { "os": "win32", "cpu": "x64" }, "sha512-WFisiehrLrkX/nv6Vg7CUT6tdrhO6Nv0mLh5zuYQ5GLD4OnaOHkBt9iRkOziMy7ny+qF+V7023+loZIV/R9j8A=="],
+
+ "@nodelib/fs.scandir": ["@nodelib/fs.scandir@2.1.5", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="],
+
+ "@nodelib/fs.stat": ["@nodelib/fs.stat@2.0.5", "", {}, "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A=="],
+
+ "@nodelib/fs.walk": ["@nodelib/fs.walk@1.2.8", "", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="],
+
+ "@nolyfill/is-core-module": ["@nolyfill/is-core-module@1.0.39", "", {}, "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA=="],
+
+ "@npmcli/fs": ["@npmcli/fs@3.1.1", "", { "dependencies": { "semver": "^7.3.5" } }, "sha512-q9CRWjpHCMIh5sVyefoD1cA7PkvILqCZsnSOEUUivORLjxCO/Irmue2DprETiNgEqktDBZaM1Bi+jrarx1XdCg=="],
+
+ "@octokit/app": ["@octokit/app@15.1.5", "", { "dependencies": { "@octokit/auth-app": "^7.1.5", "@octokit/auth-unauthenticated": "^6.1.2", "@octokit/core": "^6.1.4", "@octokit/oauth-app": "^7.1.6", "@octokit/plugin-paginate-rest": "^11.4.2", "@octokit/types": "^13.8.0", "@octokit/webhooks": "^13.6.1" } }, "sha512-6cxLT9U8x7GGQ7lNWsKtFr4ccg9oLkGvowk373sX9HvX5U37kql5d55SzaQUxPE8PwgX2cqkzDm5NF5aPKevqg=="],
+
+ "@octokit/auth-app": ["@octokit/auth-app@7.1.5", "", { "dependencies": { "@octokit/auth-oauth-app": "^8.1.3", "@octokit/auth-oauth-user": "^5.1.3", "@octokit/request": "^9.2.1", "@octokit/request-error": "^6.1.7", "@octokit/types": "^13.8.0", "toad-cache": "^3.7.0", "universal-github-app-jwt": "^2.2.0", "universal-user-agent": "^7.0.0" } }, "sha512-boklS4E6LpbA3nRx+SU2fRKRGZJdOGoSZne/i3Y0B5rfHOcGwFgcXrwDLdtbv4igfDSnAkZaoNBv1GYjPDKRNw=="],
+
+ "@octokit/auth-oauth-app": ["@octokit/auth-oauth-app@8.1.3", "", { "dependencies": { "@octokit/auth-oauth-device": "^7.1.3", "@octokit/auth-oauth-user": "^5.1.3", "@octokit/request": "^9.2.1", "@octokit/types": "^13.6.2", "universal-user-agent": "^7.0.0" } }, "sha512-4e6OjVe5rZ8yBe8w7byBjpKtSXFuro7gqeGAAZc7QYltOF8wB93rJl2FE0a4U1Mt88xxPv/mS+25/0DuLk0Ewg=="],
+
+ "@octokit/auth-oauth-device": ["@octokit/auth-oauth-device@7.1.3", "", { "dependencies": { "@octokit/oauth-methods": "^5.1.4", "@octokit/request": "^9.2.1", "@octokit/types": "^13.6.2", "universal-user-agent": "^7.0.0" } }, "sha512-BECO/N4B/Uikj0w3GCvjf/odMujtYTP3q82BJSjxC2J3rxTEiZIJ+z2xnRlDb0IE9dQSaTgRqUPVOieSbFcVzg=="],
+
+ "@octokit/auth-oauth-user": ["@octokit/auth-oauth-user@5.1.3", "", { "dependencies": { "@octokit/auth-oauth-device": "^7.1.3", "@octokit/oauth-methods": "^5.1.3", "@octokit/request": "^9.2.1", "@octokit/types": "^13.6.2", "universal-user-agent": "^7.0.0" } }, "sha512-zNPByPn9K7TC+OOHKGxU+MxrE9SZAN11UHYEFLsK2NRn3akJN2LHRl85q+Eypr3tuB2GrKx3rfj2phJdkYCvzw=="],
+
+ "@octokit/auth-token": ["@octokit/auth-token@5.1.2", "", {}, "sha512-JcQDsBdg49Yky2w2ld20IHAlwr8d/d8N6NiOXbtuoPCqzbsiJgF633mVUw3x4mo0H5ypataQIX7SFu3yy44Mpw=="],
+
+ "@octokit/auth-unauthenticated": ["@octokit/auth-unauthenticated@6.1.2", "", { "dependencies": { "@octokit/request-error": "^6.1.7", "@octokit/types": "^13.6.2" } }, "sha512-07DlUGcz/AAVdzu3EYfi/dOyMSHp9YsOxPl/MPmtlVXWiD//GlV8HgZsPhud94DEyx+RfrW0wSl46Lx+AWbOlg=="],
+
+ "@octokit/core": ["@octokit/core@6.1.4", "", { "dependencies": { "@octokit/auth-token": "^5.0.0", "@octokit/graphql": "^8.1.2", "@octokit/request": "^9.2.1", "@octokit/request-error": "^6.1.7", "@octokit/types": "^13.6.2", "before-after-hook": "^3.0.2", "universal-user-agent": "^7.0.0" } }, "sha512-lAS9k7d6I0MPN+gb9bKDt7X8SdxknYqAMh44S5L+lNqIN2NuV8nvv3g8rPp7MuRxcOpxpUIATWprO0C34a8Qmg=="],
+
+ "@octokit/endpoint": ["@octokit/endpoint@10.1.3", "", { "dependencies": { "@octokit/types": "^13.6.2", "universal-user-agent": "^7.0.2" } }, "sha512-nBRBMpKPhQUxCsQQeW+rCJ/OPSMcj3g0nfHn01zGYZXuNDvvXudF/TYY6APj5THlurerpFN4a/dQAIAaM6BYhA=="],
+
+ "@octokit/graphql": ["@octokit/graphql@8.2.1", "", { "dependencies": { "@octokit/request": "^9.2.2", "@octokit/types": "^13.8.0", "universal-user-agent": "^7.0.0" } }, "sha512-n57hXtOoHrhwTWdvhVkdJHdhTv0JstjDbDRhJfwIRNfFqmSo1DaK/mD2syoNUoLCyqSjBpGAKOG0BuwF392slw=="],
+
+ "@octokit/oauth-app": ["@octokit/oauth-app@7.1.6", "", { "dependencies": { "@octokit/auth-oauth-app": "^8.1.3", "@octokit/auth-oauth-user": "^5.1.3", "@octokit/auth-unauthenticated": "^6.1.2", "@octokit/core": "^6.1.4", "@octokit/oauth-authorization-url": "^7.1.1", "@octokit/oauth-methods": "^5.1.4", "@types/aws-lambda": "^8.10.83", "universal-user-agent": "^7.0.0" } }, "sha512-OMcMzY2WFARg80oJNFwWbY51TBUfLH4JGTy119cqiDawSFXSIBujxmpXiKbGWQlvfn0CxE6f7/+c6+Kr5hI2YA=="],
+
+ "@octokit/oauth-authorization-url": ["@octokit/oauth-authorization-url@7.1.1", "", {}, "sha512-ooXV8GBSabSWyhLUowlMIVd9l1s2nsOGQdlP2SQ4LnkEsGXzeCvbSbCPdZThXhEFzleGPwbapT0Sb+YhXRyjCA=="],
+
+ "@octokit/oauth-methods": ["@octokit/oauth-methods@5.1.4", "", { "dependencies": { "@octokit/oauth-authorization-url": "^7.0.0", "@octokit/request": "^9.2.1", "@octokit/request-error": "^6.1.7", "@octokit/types": "^13.6.2" } }, "sha512-Jc/ycnePClOvO1WL7tlC+TRxOFtyJBGuTDsL4dzXNiVZvzZdrPuNw7zHI3qJSUX2n6RLXE5L0SkFmYyNaVUFoQ=="],
+
+ "@octokit/openapi-types": ["@octokit/openapi-types@23.0.1", "", {}, "sha512-izFjMJ1sir0jn0ldEKhZ7xegCTj/ObmEDlEfpFrx4k/JyZSMRHbO3/rBwgE7f3m2DHt+RrNGIVw4wSmwnm3t/g=="],
+
+ "@octokit/openapi-webhooks-types": ["@octokit/openapi-webhooks-types@10.1.1", "", {}, "sha512-qBfqQVIDQaCFeGCofXieJDwvXcGgDn17+UwZ6WW6lfEvGYGreLFzTiaz9xjet9Us4zDf8iasoW3ixUj/R5lMhA=="],
+
+ "@octokit/plugin-paginate-graphql": ["@octokit/plugin-paginate-graphql@5.2.4", "", { "peerDependencies": { "@octokit/core": ">=6" } }, "sha512-pLZES1jWaOynXKHOqdnwZ5ULeVR6tVVCMm+AUbp0htdcyXDU95WbkYdU4R2ej1wKj5Tu94Mee2Ne0PjPO9cCyA=="],
+
+ "@octokit/plugin-paginate-rest": ["@octokit/plugin-paginate-rest@11.4.3", "", { "dependencies": { "@octokit/types": "^13.7.0" }, "peerDependencies": { "@octokit/core": ">=6" } }, "sha512-tBXaAbXkqVJlRoA/zQVe9mUdb8rScmivqtpv3ovsC5xhje/a+NOCivs7eUhWBwCApJVsR4G5HMeaLbq7PxqZGA=="],
+
+ "@octokit/plugin-rest-endpoint-methods": ["@octokit/plugin-rest-endpoint-methods@13.3.1", "", { "dependencies": { "@octokit/types": "^13.8.0" }, "peerDependencies": { "@octokit/core": ">=6" } }, "sha512-o8uOBdsyR+WR8MK9Cco8dCgvG13H1RlM1nWnK/W7TEACQBFux/vPREgKucxUfuDQ5yi1T3hGf4C5ZmZXAERgwQ=="],
+
+ "@octokit/plugin-retry": ["@octokit/plugin-retry@7.1.4", "", { "dependencies": { "@octokit/request-error": "^6.1.7", "@octokit/types": "^13.6.2", "bottleneck": "^2.15.3" }, "peerDependencies": { "@octokit/core": ">=6" } }, "sha512-7AIP4p9TttKN7ctygG4BtR7rrB0anZqoU9ThXFk8nETqIfvgPUANTSYHqWYknK7W3isw59LpZeLI8pcEwiJdRg=="],
+
+ "@octokit/plugin-throttling": ["@octokit/plugin-throttling@9.4.0", "", { "dependencies": { "@octokit/types": "^13.7.0", "bottleneck": "^2.15.3" }, "peerDependencies": { "@octokit/core": "^6.1.3" } }, "sha512-IOlXxXhZA4Z3m0EEYtrrACkuHiArHLZ3CvqWwOez/pURNqRuwfoFlTPbN5Muf28pzFuztxPyiUiNwz8KctdZaQ=="],
+
+ "@octokit/request": ["@octokit/request@9.2.2", "", { "dependencies": { "@octokit/endpoint": "^10.1.3", "@octokit/request-error": "^6.1.7", "@octokit/types": "^13.6.2", "fast-content-type-parse": "^2.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-dZl0ZHx6gOQGcffgm1/Sf6JfEpmh34v3Af2Uci02vzUYz6qEN6zepoRtmybWXIGXFIK8K9ylE3b+duCWqhArtg=="],
+
+ "@octokit/request-error": ["@octokit/request-error@6.1.7", "", { "dependencies": { "@octokit/types": "^13.6.2" } }, "sha512-69NIppAwaauwZv6aOzb+VVLwt+0havz9GT5YplkeJv7fG7a40qpLt/yZKyiDxAhgz0EtgNdNcb96Z0u+Zyuy2g=="],
+
+ "@octokit/types": ["@octokit/types@13.8.0", "", { "dependencies": { "@octokit/openapi-types": "^23.0.1" } }, "sha512-x7DjTIbEpEWXK99DMd01QfWy0hd5h4EN+Q7shkdKds3otGQP+oWE/y0A76i1OvH9fygo4ddvNf7ZvF0t78P98A=="],
+
+ "@octokit/webhooks": ["@octokit/webhooks@13.7.4", "", { "dependencies": { "@octokit/openapi-webhooks-types": "10.1.1", "@octokit/request-error": "^6.1.7", "@octokit/webhooks-methods": "^5.1.1" } }, "sha512-f386XyLTieQbgKPKS6ZMlH4dq8eLsxNddwofiKRZCq0bZ2gikoFwMD99K6l1oAwqe/KZNzrEziGicRgnzplplQ=="],
+
+ "@octokit/webhooks-methods": ["@octokit/webhooks-methods@5.1.1", "", {}, "sha512-NGlEHZDseJTCj8TMMFehzwa9g7On4KJMPVHDSrHxCQumL6uSQR8wIkP/qesv52fXqV1BPf4pTxwtS31ldAt9Xg=="],
+
+ "@oven/bun-darwin-aarch64": ["@oven/bun-darwin-aarch64@1.2.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-xBz/Q7X6AFwMg7MXtBemjjt5uB+tvEYBmi9Zbm1r8qnI2V8m/Smuhma0EARhiVfLuIAYj2EM5qjzxeAFV4TBJA=="],
+
+ "@oven/bun-darwin-x64": ["@oven/bun-darwin-x64@1.2.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-ufyty+2754QCFDhq447H39JiqabMlFRItLn1YFp+2hdpKak7KCYLGOUuHnlr1pmImKJzDHURjnvTTq1QRlUWAA=="],
+
+ "@oven/bun-darwin-x64-baseline": ["@oven/bun-darwin-x64-baseline@1.2.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-stsq8vBiYgfGunBGlf2M7ST7Ymyw3WnwrxEeJ04vkKmMEEE2LpX8Rkol6UPRvZawab9s9/scFIRgFi6hu9H4SQ=="],
+
+ "@oven/bun-linux-aarch64": ["@oven/bun-linux-aarch64@1.2.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-OhVpzme2vvLA7w8GYeJg2SQ2h2CwJQN9oYDiGeoML4EwE+DEoYHdxgaBZsQySOwZtFIr8ufpc/8iD4hssJ50qg=="],
+
+ "@oven/bun-linux-aarch64-musl": ["@oven/bun-linux-aarch64-musl@1.2.4", "", { "os": "linux", "cpu": "none" }, "sha512-+lxWF7up9MuB1ZdGxXCH3AH3XmYtdBC6soQ38+yg3+y3iOPrAlSG+wytHEkypN/UU2mGvCuaEED3cMvejrGdDw=="],
+
+ "@oven/bun-linux-x64": ["@oven/bun-linux-x64@1.2.4", "", { "os": "linux", "cpu": "x64" }, "sha512-oof3ii92Cz2yIOZRbVFHMHmffCutRPFITIdXLZ2/rkqVuKUe0ZdqWjHPhxJFm31AL9MlJ/dSqDbPb51SaLI7tw=="],
+
+ "@oven/bun-linux-x64-baseline": ["@oven/bun-linux-x64-baseline@1.2.4", "", { "os": "linux", "cpu": "x64" }, "sha512-3nmDDZJH73MzhBg2sRYioj4CE8wgaz0w24OieMqj4/c44BbNr3X5RewrldsMD2cU6DtVbi52FuD5WpTw3N8nmw=="],
+
+ "@oven/bun-linux-x64-musl": ["@oven/bun-linux-x64-musl@1.2.4", "", { "os": "linux", "cpu": "x64" }, "sha512-cLdMbK7srNoUbYSG3Tp4GYdPAO0+5mgUhdbU053GZs0DLQmQ8h1JQhALp+ZjrUWstmQe7ddcNu7l7EAu6E76XA=="],
+
+ "@oven/bun-linux-x64-musl-baseline": ["@oven/bun-linux-x64-musl-baseline@1.2.4", "", { "os": "linux", "cpu": "x64" }, "sha512-qDsUvKCW0WUlVOt6Yx5eEzxgCbvzuSJBsu0sXtr6uGt8TnMKghmliRO5FmiMLQ0k/PUDA8vPJCtuv5k14bDi6g=="],
+
+ "@oven/bun-windows-x64": ["@oven/bun-windows-x64@1.2.4", "", { "os": "win32", "cpu": "x64" }, "sha512-4YRJd4pdaTWEM+uawYmchOeNv874RGAFpIZQubWnN4SBf6HfcDm0OMMZcm0f0I70Wd5gbPg1+rvCRtDZWVmZog=="],
+
+ "@oven/bun-windows-x64-baseline": ["@oven/bun-windows-x64-baseline@1.2.4", "", { "os": "win32", "cpu": "x64" }, "sha512-j/G4bnfsRAiCvpTADda40m29iSGvueIaF9Kc9hBu4jN8dTS9fEXdNNXuf8c30/z7/npxw2dhzsAn8jbc5QvD1A=="],
+
+ "@pdf-lib/standard-fonts": ["@pdf-lib/standard-fonts@1.0.0", "", { "dependencies": { "pako": "^1.0.6" } }, "sha512-hU30BK9IUN/su0Mn9VdlVKsWBS6GyhVfqjwl1FjZN4TxP6cCw0jP2w7V3Hf5uX7M0AZJ16vey9yE0ny7Sa59ZA=="],
+
+ "@pdf-lib/upng": ["@pdf-lib/upng@1.0.1", "", { "dependencies": { "pako": "^1.0.10" } }, "sha512-dQK2FUMQtowVP00mtIksrlZhdFXQZPC+taih1q4CvPZ5vqdxR/LKBaFg0oAfzd1GlHZXXSPdQfzQnt+ViGvEIQ=="],
+
+ "@peculiar/asn1-schema": ["@peculiar/asn1-schema@2.3.15", "", { "dependencies": { "asn1js": "^3.0.5", "pvtsutils": "^1.3.6", "tslib": "^2.8.1" } }, "sha512-QPeD8UA8axQREpgR5UTAfu2mqQmm97oUqahDtNdBcfj3qAnoXzFdQW+aNf/tD2WVXF8Fhmftxoj0eMIT++gX2w=="],
+
+ "@peculiar/json-schema": ["@peculiar/json-schema@1.1.12", "", { "dependencies": { "tslib": "^2.0.0" } }, "sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w=="],
+
+ "@peculiar/webcrypto": ["@peculiar/webcrypto@1.5.0", "", { "dependencies": { "@peculiar/asn1-schema": "^2.3.8", "@peculiar/json-schema": "^1.1.12", "pvtsutils": "^1.3.5", "tslib": "^2.6.2", "webcrypto-core": "^1.8.0" } }, "sha512-BRs5XUAwiyCDQMsVA9IDvDa7UBR9gAvPHgugOeGng3YN6vJ9JYonyDc0lNczErgtCWtucjR5N7VtaonboD/ezg=="],
+
+ "@pkgjs/parseargs": ["@pkgjs/parseargs@0.11.0", "", {}, "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg=="],
+
+ "@popperjs/core": ["@popperjs/core@2.11.8", "", {}, "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A=="],
+
+ "@prisma/client": ["@prisma/client@6.4.1", "", { "peerDependencies": { "prisma": "*", "typescript": ">=5.1.0" }, "optionalPeers": ["prisma", "typescript"] }, "sha512-A7Mwx44+GVZVexT5e2GF/WcKkEkNNKbgr059xpr5mn+oUm2ZW1svhe+0TRNBwCdzhfIZ+q23jEgsNPvKD9u+6g=="],
+
+ "@prisma/debug": ["@prisma/debug@6.4.1", "", {}, "sha512-Q9xk6yjEGIThjSD8zZegxd5tBRNHYd13GOIG0nLsanbTXATiPXCLyvlYEfvbR2ft6dlRsziQXfQGxAgv7zcMUA=="],
+
+ "@prisma/engines": ["@prisma/engines@6.4.1", "", { "dependencies": { "@prisma/debug": "6.4.1", "@prisma/engines-version": "6.4.0-29.a9055b89e58b4b5bfb59600785423b1db3d0e75d", "@prisma/fetch-engine": "6.4.1", "@prisma/get-platform": "6.4.1" } }, "sha512-KldENzMHtKYwsOSLThghOIdXOBEsfDuGSrxAZjMnimBiDKd3AE4JQ+Kv+gBD/x77WoV9xIPf25GXMWffXZ17BA=="],
+
+ "@prisma/engines-version": ["@prisma/engines-version@6.4.0-29.a9055b89e58b4b5bfb59600785423b1db3d0e75d", "", {}, "sha512-Xq54qw55vaCGrGgIJqyDwOq0TtjZPJEWsbQAHugk99hpDf2jcEeQhUcF+yzEsSqegBaDNLA4IC8Nn34sXmkiTQ=="],
+
+ "@prisma/fetch-engine": ["@prisma/fetch-engine@6.4.1", "", { "dependencies": { "@prisma/debug": "6.4.1", "@prisma/engines-version": "6.4.0-29.a9055b89e58b4b5bfb59600785423b1db3d0e75d", "@prisma/get-platform": "6.4.1" } }, "sha512-uZ5hVeTmDspx7KcaRCNoXmcReOD+84nwlO2oFvQPRQh9xiFYnnUKDz7l9bLxp8t4+25CsaNlgrgilXKSQwrIGQ=="],
+
+ "@prisma/get-platform": ["@prisma/get-platform@6.4.1", "", { "dependencies": { "@prisma/debug": "6.4.1" } }, "sha512-gXqZaDI5scDkBF8oza7fOD3Q3QMD0e0rBynlzDDZdTWbWmzjuW58PRZtj+jkvKje2+ZigCWkH8SsWZAsH6q1Yw=="],
+
+ "@protobufjs/aspromise": ["@protobufjs/aspromise@1.1.2", "", {}, "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ=="],
+
+ "@protobufjs/base64": ["@protobufjs/base64@1.1.2", "", {}, "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg=="],
+
+ "@protobufjs/codegen": ["@protobufjs/codegen@2.0.4", "", {}, "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg=="],
+
+ "@protobufjs/eventemitter": ["@protobufjs/eventemitter@1.1.0", "", {}, "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q=="],
+
+ "@protobufjs/fetch": ["@protobufjs/fetch@1.1.0", "", { "dependencies": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" } }, "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ=="],
+
+ "@protobufjs/float": ["@protobufjs/float@1.0.2", "", {}, "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ=="],
+
+ "@protobufjs/inquire": ["@protobufjs/inquire@1.1.0", "", {}, "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q=="],
+
+ "@protobufjs/path": ["@protobufjs/path@1.1.2", "", {}, "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA=="],
+
+ "@protobufjs/pool": ["@protobufjs/pool@1.1.0", "", {}, "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw=="],
+
+ "@protobufjs/utf8": ["@protobufjs/utf8@1.1.0", "", {}, "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="],
+
+ "@radix-ui/number": ["@radix-ui/number@1.0.0", "", { "dependencies": { "@babel/runtime": "^7.13.10" } }, "sha512-Ofwh/1HX69ZfJRiRBMTy7rgjAzHmwe4kW9C9Y99HTRUcYLUuVT0KESFj15rPjRgKJs20GPq8Bm5aEDJ8DuA3vA=="],
+
+ "@radix-ui/primitive": ["@radix-ui/primitive@1.0.0", "", { "dependencies": { "@babel/runtime": "^7.13.10" } }, "sha512-3e7rn8FDMin4CgeL7Z/49smCA3rFYY3Ha2rUQ7HRWFadS5iCRw08ZgVT1LaNTCNqgvrUiyczLflrVrF0SRQtNA=="],
+
+ "@radix-ui/react-compose-refs": ["@radix-ui/react-compose-refs@1.0.0", "", { "dependencies": { "@babel/runtime": "^7.13.10" }, "peerDependencies": { "react": "^16.8 || ^17.0 || ^18.0" } }, "sha512-0KaSv6sx787/hK3eF53iOkiSLwAGlFMx5lotrqD2pTjB18KbybKoEIgkNZTKC60YECDQTKGTRcDBILwZVqVKvA=="],
+
+ "@radix-ui/react-context": ["@radix-ui/react-context@1.0.0", "", { "dependencies": { "@babel/runtime": "^7.13.10" }, "peerDependencies": { "react": "^16.8 || ^17.0 || ^18.0" } }, "sha512-1pVM9RfOQ+n/N5PJK33kRSKsr1glNxomxONs5c49MliinBY6Yw2Q995qfBUUo0/Mbg05B/sGA0gkgPI7kmSHBg=="],
+
+ "@radix-ui/react-direction": ["@radix-ui/react-direction@1.0.0", "", { "dependencies": { "@babel/runtime": "^7.13.10" }, "peerDependencies": { "react": "^16.8 || ^17.0 || ^18.0" } }, "sha512-2HV05lGUgYcA6xgLQ4BKPDmtL+QbIZYH5fCOTAOOcJ5O0QbWS3i9lKaurLzliYUDhORI2Qr3pyjhJh44lKA3rQ=="],
+
+ "@radix-ui/react-presence": ["@radix-ui/react-presence@1.0.0", "", { "dependencies": { "@babel/runtime": "^7.13.10", "@radix-ui/react-compose-refs": "1.0.0", "@radix-ui/react-use-layout-effect": "1.0.0" }, "peerDependencies": { "react": "^16.8 || ^17.0 || ^18.0", "react-dom": "^16.8 || ^17.0 || ^18.0" } }, "sha512-A+6XEvN01NfVWiKu38ybawfHsBjWum42MRPnEuqPsBZ4eV7e/7K321B5VgYMPv3Xx5An6o1/l9ZuDBgmcmWK3w=="],
+
+ "@radix-ui/react-primitive": ["@radix-ui/react-primitive@1.0.1", "", { "dependencies": { "@babel/runtime": "^7.13.10", "@radix-ui/react-slot": "1.0.1" }, "peerDependencies": { "react": "^16.8 || ^17.0 || ^18.0", "react-dom": "^16.8 || ^17.0 || ^18.0" } }, "sha512-fHbmislWVkZaIdeF6GZxF0A/NH/3BjrGIYj+Ae6eTmTCr7EB0RQAAVEiqsXK6p3/JcRqVSBQoceZroj30Jj3XA=="],
+
+ "@radix-ui/react-scroll-area": ["@radix-ui/react-scroll-area@1.0.2", "", { "dependencies": { "@babel/runtime": "^7.13.10", "@radix-ui/number": "1.0.0", "@radix-ui/primitive": "1.0.0", "@radix-ui/react-compose-refs": "1.0.0", "@radix-ui/react-context": "1.0.0", "@radix-ui/react-direction": "1.0.0", "@radix-ui/react-presence": "1.0.0", "@radix-ui/react-primitive": "1.0.1", "@radix-ui/react-use-callback-ref": "1.0.0", "@radix-ui/react-use-layout-effect": "1.0.0" }, "peerDependencies": { "react": "^16.8 || ^17.0 || ^18.0", "react-dom": "^16.8 || ^17.0 || ^18.0" } }, "sha512-k8VseTxI26kcKJaX0HPwkvlNBPTs56JRdYzcZ/vzrNUkDlvXBy8sMc7WvCpYzZkHgb+hd72VW9MqkqecGtuNgg=="],
+
+ "@radix-ui/react-slot": ["@radix-ui/react-slot@1.0.1", "", { "dependencies": { "@babel/runtime": "^7.13.10", "@radix-ui/react-compose-refs": "1.0.0" }, "peerDependencies": { "react": "^16.8 || ^17.0 || ^18.0" } }, "sha512-avutXAFL1ehGvAXtPquu0YK5oz6ctS474iM3vNGQIkswrVhdrS52e3uoMQBzZhNRAIE0jBnUyXWNmSjGHhCFcw=="],
+
+ "@radix-ui/react-use-callback-ref": ["@radix-ui/react-use-callback-ref@1.0.0", "", { "dependencies": { "@babel/runtime": "^7.13.10" }, "peerDependencies": { "react": "^16.8 || ^17.0 || ^18.0" } }, "sha512-GZtyzoHz95Rhs6S63D2t/eqvdFCm7I+yHMLVQheKM7nBD8mbZIt+ct1jz4536MDnaOGKIxynJ8eHTkVGVVkoTg=="],
+
+ "@radix-ui/react-use-layout-effect": ["@radix-ui/react-use-layout-effect@1.0.0", "", { "dependencies": { "@babel/runtime": "^7.13.10" }, "peerDependencies": { "react": "^16.8 || ^17.0 || ^18.0" } }, "sha512-6Tpkq+R6LOlmQb1R5NNETLG0B4YP0wc+klfXafpUCj6JGyaUc8il7/kUZ7m59rGbXGczE9Bs+iz2qloqsZBduQ=="],
+
+ "@react-native/assets-registry": ["@react-native/assets-registry@0.78.0", "", {}, "sha512-PPHlTRuP9litTYkbFNkwveQFto3I94QRWPBBARU0cH/4ks4EkfCfb/Pdb3AHgtJi58QthSHKFvKTQnAWyHPs7w=="],
+
+ "@react-native/babel-plugin-codegen": ["@react-native/babel-plugin-codegen@0.76.7", "", { "dependencies": { "@react-native/codegen": "0.76.7" } }, "sha512-+8H4DXJREM4l/pwLF/wSVMRzVhzhGDix5jLezNrMD9J1U1AMfV2aSkWA1XuqR7pjPs/Vqf6TaPL7vJMZ4LU05Q=="],
+
+ "@react-native/babel-preset": ["@react-native/babel-preset@0.76.7", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/plugin-proposal-export-default-from": "^7.24.7", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-default-from": "^7.24.7", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-transform-arrow-functions": "^7.24.7", "@babel/plugin-transform-async-generator-functions": "^7.25.4", "@babel/plugin-transform-async-to-generator": "^7.24.7", "@babel/plugin-transform-block-scoping": "^7.25.0", "@babel/plugin-transform-class-properties": "^7.25.4", "@babel/plugin-transform-classes": "^7.25.4", "@babel/plugin-transform-computed-properties": "^7.24.7", "@babel/plugin-transform-destructuring": "^7.24.8", "@babel/plugin-transform-flow-strip-types": "^7.25.2", "@babel/plugin-transform-for-of": "^7.24.7", "@babel/plugin-transform-function-name": "^7.25.1", "@babel/plugin-transform-literals": "^7.25.2", "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", "@babel/plugin-transform-modules-commonjs": "^7.24.8", "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", "@babel/plugin-transform-numeric-separator": "^7.24.7", "@babel/plugin-transform-object-rest-spread": "^7.24.7", "@babel/plugin-transform-optional-catch-binding": "^7.24.7", "@babel/plugin-transform-optional-chaining": "^7.24.8", "@babel/plugin-transform-parameters": "^7.24.7", "@babel/plugin-transform-private-methods": "^7.24.7", "@babel/plugin-transform-private-property-in-object": "^7.24.7", "@babel/plugin-transform-react-display-name": "^7.24.7", "@babel/plugin-transform-react-jsx": "^7.25.2", "@babel/plugin-transform-react-jsx-self": "^7.24.7", "@babel/plugin-transform-react-jsx-source": "^7.24.7", "@babel/plugin-transform-regenerator": "^7.24.7", "@babel/plugin-transform-runtime": "^7.24.7", "@babel/plugin-transform-shorthand-properties": "^7.24.7", "@babel/plugin-transform-spread": "^7.24.7", "@babel/plugin-transform-sticky-regex": "^7.24.7", "@babel/plugin-transform-typescript": "^7.25.2", "@babel/plugin-transform-unicode-regex": "^7.24.7", "@babel/template": "^7.25.0", "@react-native/babel-plugin-codegen": "0.76.7", "babel-plugin-syntax-hermes-parser": "^0.25.1", "babel-plugin-transform-flow-enums": "^0.0.2", "react-refresh": "^0.14.0" } }, "sha512-/c5DYZ6y8tyg+g8tgXKndDT7mWnGmkZ9F+T3qNDfoE3Qh7ucrNeC2XWvU9h5pk8eRtj9l4SzF4aO1phzwoibyg=="],
+
+ "@react-native/codegen": ["@react-native/codegen@0.78.0", "", { "dependencies": { "@babel/parser": "^7.25.3", "glob": "^7.1.1", "hermes-parser": "0.25.1", "invariant": "^2.2.4", "jscodeshift": "^17.0.0", "nullthrows": "^1.1.1", "yargs": "^17.6.2" }, "peerDependencies": { "@babel/preset-env": "^7.1.6" } }, "sha512-8iVT2VYhkalLFUWoQRGSluZZHEG93StfwQGwQ+wk1vOUlOfoT/Xqglt6DvGXIyM9gaMCr6fJBFQVrU+FrXEFYA=="],
+
+ "@react-native/community-cli-plugin": ["@react-native/community-cli-plugin@0.78.0", "", { "dependencies": { "@react-native/dev-middleware": "0.78.0", "@react-native/metro-babel-transformer": "0.78.0", "chalk": "^4.0.0", "debug": "^2.2.0", "invariant": "^2.2.4", "metro": "^0.81.0", "metro-config": "^0.81.0", "metro-core": "^0.81.0", "readline": "^1.3.0", "semver": "^7.1.3" }, "peerDependencies": { "@react-native-community/cli-server-api": "*" }, "optionalPeers": ["@react-native-community/cli-server-api"] }, "sha512-LpfEU+F1hZGcxIf07aBrjlImA0hh8v76V4wTJOgxxqGDUjjQ/X6h9V+bMXne60G9gwccTtvs1G0xiKWNUPI0VQ=="],
+
+ "@react-native/debugger-frontend": ["@react-native/debugger-frontend@0.76.7", "", {}, "sha512-89ZtZXt7ZxE94i7T94qzZMhp4Gfcpr/QVpGqEaejAxZD+gvDCH21cYSF+/Rz2ttBazm0rk5MZ0mFqb0Iqp1jmw=="],
+
+ "@react-native/dev-middleware": ["@react-native/dev-middleware@0.76.7", "", { "dependencies": { "@isaacs/ttlcache": "^1.4.1", "@react-native/debugger-frontend": "0.76.7", "chrome-launcher": "^0.15.2", "chromium-edge-launcher": "^0.2.0", "connect": "^3.6.5", "debug": "^2.2.0", "invariant": "^2.2.4", "nullthrows": "^1.1.1", "open": "^7.0.3", "selfsigned": "^2.4.1", "serve-static": "^1.13.1", "ws": "^6.2.3" } }, "sha512-Jsw8g9DyLPnR9yHEGuT09yHZ7M88/GL9CtU9WmyChlBwdXSeE3AmRqLegsV3XcgULQ1fqdemokaOZ/MwLYkjdA=="],
+
+ "@react-native/gradle-plugin": ["@react-native/gradle-plugin@0.78.0", "", {}, "sha512-WvwgfmVs1QfFl1FOL514kz2Fs5Nkg2BGgpE8V0ild8b/UT6jCD8qh2dTI5kL0xdT0d2Xd2BxfuFN0xCLkMC+SA=="],
+
+ "@react-native/js-polyfills": ["@react-native/js-polyfills@0.78.0", "", {}, "sha512-YZ9XtS77s/df7548B6dszX89ReehnA7hiab/axc30j/Mgk7Wv2woOjBKnAA4+rZ0ITLtxNwyJIMaRAc9kGznXw=="],
+
+ "@react-native/metro-babel-transformer": ["@react-native/metro-babel-transformer@0.78.0", "", { "dependencies": { "@babel/core": "^7.25.2", "@react-native/babel-preset": "0.78.0", "hermes-parser": "0.25.1", "nullthrows": "^1.1.1" } }, "sha512-Hy/dl+zytLCRD9dp32ukcRS1Bn0gZH0h0i3AbriS6OGYgUgjAUFhXOKzZ15/G1SEq2sng91MNo/hMvo4uXoc5A=="],
+
+ "@react-native/normalize-colors": ["@react-native/normalize-colors@0.78.0", "", {}, "sha512-FkeLvLLaMYlGsSntixTUvlNtc1OHij4TYRtymMNPWqBKFAMXJB/qe45VxXNzWP+jD0Ok6yXineQFtktKcHk9PA=="],
+
+ "@react-native/virtualized-lists": ["@react-native/virtualized-lists@0.78.0", "", { "dependencies": { "invariant": "^2.2.4", "nullthrows": "^1.1.1" }, "peerDependencies": { "@types/react": "^19.0.0", "react": "*", "react-native": "*" }, "optionalPeers": ["@types/react"] }, "sha512-ibETs3AwpkkRcORRANvZeEFjzvN41W02X882sBzoxC5XdHiZ2DucXo4fjKF7i86MhYCFLfNSIYbwupx1D1iFmg=="],
+
+ "@react-pdf/fns": ["@react-pdf/fns@2.2.1", "", { "dependencies": { "@babel/runtime": "^7.20.13" } }, "sha512-s78aDg0vDYaijU5lLOCsUD+qinQbfOvcNeaoX9AiE7+kZzzCo6B/nX+l48cmt9OosJmvZvE9DWR9cLhrhOi2pA=="],
+
+ "@react-pdf/font": ["@react-pdf/font@2.5.2", "", { "dependencies": { "@babel/runtime": "^7.20.13", "@react-pdf/types": "^2.6.0", "cross-fetch": "^3.1.5", "fontkit": "^2.0.2", "is-url": "^1.2.4" } }, "sha512-Ud0EfZ2FwrbvwAWx8nz+KKLmiqACCH9a/N/xNDOja0e/YgSnqTpuyHegFBgIMKjuBtO5dNvkb4dXkxAhGe/ayw=="],
+
+ "@react-pdf/image": ["@react-pdf/image@2.3.6", "", { "dependencies": { "@babel/runtime": "^7.20.13", "@react-pdf/png-js": "^2.3.1", "cross-fetch": "^3.1.5", "jay-peg": "^1.0.2" } }, "sha512-7iZDYZrZlJqNzS6huNl2XdMcLFUo68e6mOdzQeJ63d5eApdthhSHBnkGzHfLhH5t8DCpZNtClmklzuLL63ADfw=="],
+
+ "@react-pdf/layout": ["@react-pdf/layout@3.13.0", "", { "dependencies": { "@babel/runtime": "^7.20.13", "@react-pdf/fns": "2.2.1", "@react-pdf/image": "^2.3.6", "@react-pdf/pdfkit": "^3.2.0", "@react-pdf/primitives": "^3.1.1", "@react-pdf/stylesheet": "^4.3.0", "@react-pdf/textkit": "^4.4.1", "@react-pdf/types": "^2.6.0", "cross-fetch": "^3.1.5", "emoji-regex": "^10.3.0", "queue": "^6.0.1", "yoga-layout": "^2.0.1" } }, "sha512-lpPj/EJYHFOc0ALiJwLP09H28B4ADyvTjxOf67xTF+qkWd+dq1vg7dw3wnYESPnWk5T9NN+HlUenJqdYEY9AvA=="],
+
+ "@react-pdf/pdfkit": ["@react-pdf/pdfkit@3.2.0", "", { "dependencies": { "@babel/runtime": "^7.20.13", "@react-pdf/png-js": "^2.3.1", "browserify-zlib": "^0.2.0", "crypto-js": "^4.2.0", "fontkit": "^2.0.2", "jay-peg": "^1.0.2", "vite-compatible-readable-stream": "^3.6.1" } }, "sha512-OBfCcnTC6RpD9uv9L2woF60Zj1uQxhLFzTBXTdcYE9URzPE/zqXIyzpXEA4Vf3TFbvBCgFE2RzJ2ZUS0asq7yA=="],
+
+ "@react-pdf/png-js": ["@react-pdf/png-js@2.3.1", "", { "dependencies": { "browserify-zlib": "^0.2.0" } }, "sha512-pEZ18I4t1vAUS4lmhvXPmXYP4PHeblpWP/pAlMMRkEyP7tdAeHUN7taQl9sf9OPq7YITMY3lWpYpJU6t4CZgZg=="],
+
+ "@react-pdf/primitives": ["@react-pdf/primitives@3.1.1", "", {}, "sha512-miwjxLwTnO3IjoqkTVeTI+9CdyDggwekmSLhVCw+a/7FoQc+gF3J2dSKwsHvAcVFM0gvU8mzCeTofgw0zPDq0w=="],
+
+ "@react-pdf/render": ["@react-pdf/render@3.5.0", "", { "dependencies": { "@babel/runtime": "^7.20.13", "@react-pdf/fns": "2.2.1", "@react-pdf/primitives": "^3.1.1", "@react-pdf/textkit": "^4.4.1", "@react-pdf/types": "^2.6.0", "abs-svg-path": "^0.1.1", "color-string": "^1.9.1", "normalize-svg-path": "^1.1.0", "parse-svg-path": "^0.1.2", "svg-arc-to-cubic-bezier": "^3.2.0" } }, "sha512-gFOpnyqCgJ6l7VzfJz6rG1i2S7iVSD8bUHDjPW9Mze8TmyksHzN2zBH3y7NbsQOw1wU6hN4NhRmslrsn+BRDPA=="],
+
+ "@react-pdf/renderer": ["@react-pdf/renderer@3.4.5", "", { "dependencies": { "@babel/runtime": "^7.20.13", "@react-pdf/font": "^2.5.2", "@react-pdf/layout": "^3.13.0", "@react-pdf/pdfkit": "^3.2.0", "@react-pdf/primitives": "^3.1.1", "@react-pdf/render": "^3.5.0", "@react-pdf/types": "^2.6.0", "events": "^3.3.0", "object-assign": "^4.1.1", "prop-types": "^15.6.2", "queue": "^6.0.1", "scheduler": "^0.17.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, "sha512-O1N8q45bTs7YuC+x9afJSKQWDYQy2RjoCxlxEGdbCwP+WD5G6dWRUWXlc8F0TtzU3uFglYMmDab2YhXTmnVN9g=="],
+
+ "@react-pdf/stylesheet": ["@react-pdf/stylesheet@4.3.0", "", { "dependencies": { "@babel/runtime": "^7.20.13", "@react-pdf/fns": "2.2.1", "@react-pdf/types": "^2.6.0", "color-string": "^1.9.1", "hsl-to-hex": "^1.0.0", "media-engine": "^1.0.3", "postcss-value-parser": "^4.1.0" } }, "sha512-x7IVZOqRrUum9quuDeFXBveXwBht+z/6B0M+z4a4XjfSg1vZVvzoTl07Oa1yvQ/4yIC5yIkG2TSMWeKnDB+hrw=="],
+
+ "@react-pdf/textkit": ["@react-pdf/textkit@4.4.1", "", { "dependencies": { "@babel/runtime": "^7.20.13", "@react-pdf/fns": "2.2.1", "bidi-js": "^1.0.2", "hyphen": "^1.6.4", "unicode-properties": "^1.4.1" } }, "sha512-Jl9wdTqIvJ5pX+vAGz0EOhP7ut5Two9H6CzTKo/YYPeD79cM2yTXF3JzTERBC28y7LR0Waq9D2LHQjI+b/EYUQ=="],
+
+ "@react-pdf/types": ["@react-pdf/types@2.8.0", "", { "dependencies": { "@react-pdf/font": "^3.1.0", "@react-pdf/primitives": "^4.1.1", "@react-pdf/stylesheet": "^6.0.0" } }, "sha512-lBnLonM2GupyTzUGlWTEoUUGvsRcgbWLn0Py3i3lK/tgn2rPCYwJ9gQ5A3warT5g4jQWyc7HmaNoPU/Zy5iBbQ=="],
+
+ "@remirror/core-constants": ["@remirror/core-constants@3.0.0", "", {}, "sha512-42aWfPrimMfDKDi4YegyS7x+/0tlzaqwPQCULLanv3DMIlu96KTJR0fM5isWX2UViOqlGnX6YFgqWepcX+XMNg=="],
+
+ "@rtsao/scc": ["@rtsao/scc@1.1.0", "", {}, "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g=="],
+
+ "@rushstack/eslint-patch": ["@rushstack/eslint-patch@1.10.5", "", {}, "sha512-kkKUDVlII2DQiKy7UstOR1ErJP8kUKAQ4oa+SQtM0K+lPdmmjj0YnnxBgtTVYH7mUKtbsxeFC9y0AmK7Yb78/A=="],
+
+ "@segment/loosely-validate-event": ["@segment/loosely-validate-event@2.0.0", "", { "dependencies": { "component-type": "^1.2.1", "join-component": "^1.1.0" } }, "sha512-ZMCSfztDBqwotkl848ODgVcAmN4OItEWDCkshcKz0/W6gGSQayuuCtWV/MlodFivAZD793d6UgANd6wCXUfrIw=="],
+
+ "@sinclair/typebox": ["@sinclair/typebox@0.27.8", "", {}, "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA=="],
+
+ "@sinonjs/commons": ["@sinonjs/commons@3.0.1", "", { "dependencies": { "type-detect": "4.0.8" } }, "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ=="],
+
+ "@sinonjs/fake-timers": ["@sinonjs/fake-timers@10.3.0", "", { "dependencies": { "@sinonjs/commons": "^3.0.0" } }, "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA=="],
+
+ "@socket.io/component-emitter": ["@socket.io/component-emitter@3.1.2", "", {}, "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA=="],
+
+ "@supabase/auth-js": ["@supabase/auth-js@2.68.0", "", { "dependencies": { "@supabase/node-fetch": "^2.6.14" } }, "sha512-odG7nb7aOmZPUXk6SwL2JchSsn36Ppx11i2yWMIc/meUO2B2HK9YwZHPK06utD9Ql9ke7JKDbwGin/8prHKxxQ=="],
+
+ "@supabase/functions-js": ["@supabase/functions-js@2.4.4", "", { "dependencies": { "@supabase/node-fetch": "^2.6.14" } }, "sha512-WL2p6r4AXNGwop7iwvul2BvOtuJ1YQy8EbOd0dhG1oN1q8el/BIRSFCFnWAMM/vJJlHWLi4ad22sKbKr9mvjoA=="],
+
+ "@supabase/node-fetch": ["@supabase/node-fetch@2.6.15", "", { "dependencies": { "whatwg-url": "^5.0.0" } }, "sha512-1ibVeYUacxWYi9i0cf5efil6adJ9WRyZBLivgjs+AUpewx1F3xPi7gLgaASI2SmIQxPoCEjAsLAzKPgMJVgOUQ=="],
+
+ "@supabase/postgrest-js": ["@supabase/postgrest-js@1.19.2", "", { "dependencies": { "@supabase/node-fetch": "^2.6.14" } }, "sha512-MXRbk4wpwhWl9IN6rIY1mR8uZCCG4MZAEji942ve6nMwIqnBgBnZhZlON6zTTs6fgveMnoCILpZv1+K91jN+ow=="],
+
+ "@supabase/realtime-js": ["@supabase/realtime-js@2.11.2", "", { "dependencies": { "@supabase/node-fetch": "^2.6.14", "@types/phoenix": "^1.5.4", "@types/ws": "^8.5.10", "ws": "^8.18.0" } }, "sha512-u/XeuL2Y0QEhXSoIPZZwR6wMXgB+RQbJzG9VErA3VghVt7uRfSVsjeqd7m5GhX3JR6dM/WRmLbVR8URpDWG4+w=="],
+
+ "@supabase/storage-js": ["@supabase/storage-js@2.7.1", "", { "dependencies": { "@supabase/node-fetch": "^2.6.14" } }, "sha512-asYHcyDR1fKqrMpytAS1zjyEfvxuOIp1CIXX7ji4lHHcJKqyk+sLl/Vxgm4sN6u8zvuUtae9e4kDxQP2qrwWBA=="],
+
+ "@supabase/supabase-js": ["@supabase/supabase-js@2.49.1", "", { "dependencies": { "@supabase/auth-js": "2.68.0", "@supabase/functions-js": "2.4.4", "@supabase/node-fetch": "2.6.15", "@supabase/postgrest-js": "1.19.2", "@supabase/realtime-js": "2.11.2", "@supabase/storage-js": "2.7.1" } }, "sha512-lKaptKQB5/juEF5+jzmBeZlz69MdHZuxf+0f50NwhL+IE//m4ZnOeWlsKRjjsM0fVayZiQKqLvYdBn0RLkhGiQ=="],
+
+ "@swc/counter": ["@swc/counter@0.1.3", "", {}, "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ=="],
+
+ "@swc/helpers": ["@swc/helpers@0.5.2", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw=="],
+
+ "@tabler/icons": ["@tabler/icons@3.31.0", "", {}, "sha512-dblAdeKY3+GA1U+Q9eziZ0ooVlZMHsE8dqP0RkwvRtEsAULoKOYaCUOcJ4oW1DjWegdxk++UAt2SlQVnmeHv+g=="],
+
+ "@tabler/icons-react": ["@tabler/icons-react@3.31.0", "", { "dependencies": { "@tabler/icons": "3.31.0" }, "peerDependencies": { "react": ">= 16" } }, "sha512-2rrCM5y/VnaVKnORpDdAua9SEGuJKVqPtWxeQ/vUVsgaUx30LDgBZph7/lterXxDY1IKR6NO//HDhWiifXTi3w=="],
+
+ "@tiptap/core": ["@tiptap/core@2.11.5", "", { "peerDependencies": { "@tiptap/pm": "^2.7.0" } }, "sha512-jb0KTdUJaJY53JaN7ooY3XAxHQNoMYti/H6ANo707PsLXVeEqJ9o8+eBup1JU5CuwzrgnDc2dECt2WIGX9f8Jw=="],
+
+ "@tiptap/extension-blockquote": ["@tiptap/extension-blockquote@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-MZfcRIzKRD8/J1hkt/eYv49060GTL6qGR3NY/oTDuw2wYzbQXXLEbjk8hxAtjwNn7G+pWQv3L+PKFzZDxibLuA=="],
+
+ "@tiptap/extension-bold": ["@tiptap/extension-bold@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-OAq03MHEbl7MtYCUzGuwb0VpOPnM0k5ekMbEaRILFU5ZC7cEAQ36XmPIw1dQayrcuE8GZL35BKub2qtRxyC9iA=="],
+
+ "@tiptap/extension-bubble-menu": ["@tiptap/extension-bubble-menu@2.11.5", "", { "dependencies": { "tippy.js": "^6.3.7" }, "peerDependencies": { "@tiptap/core": "^2.7.0", "@tiptap/pm": "^2.7.0" } }, "sha512-rx+rMd7EEdht5EHLWldpkzJ56SWYA9799b33ustePqhXd6linnokJCzBqY13AfZ9+xp3RsR6C0ZHI9GGea0tIA=="],
+
+ "@tiptap/extension-bullet-list": ["@tiptap/extension-bullet-list@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-VXwHlX6A/T6FAspnyjbKDO0TQ+oetXuat6RY1/JxbXphH42nLuBaGWJ6pgy6xMl6XY8/9oPkTNrfJw/8/eeRwA=="],
+
+ "@tiptap/extension-code": ["@tiptap/extension-code@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-xOvHevNIQIcCCVn9tpvXa1wBp0wHN/2umbAZGTVzS+AQtM7BTo0tz8IyzwxkcZJaImONcUVYLOLzt2AgW1LltA=="],
+
+ "@tiptap/extension-code-block": ["@tiptap/extension-code-block@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0", "@tiptap/pm": "^2.7.0" } }, "sha512-ksxMMvqLDlC+ftcQLynqZMdlJT1iHYZorXsXw/n+wuRd7YElkRkd6YWUX/Pq/njFY6lDjKiqFLEXBJB8nrzzBA=="],
+
+ "@tiptap/extension-document": ["@tiptap/extension-document@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-7I4BRTpIux2a0O2qS3BDmyZ5LGp3pszKbix32CmeVh7lN9dV7W5reDqtJJ9FCZEEF+pZ6e1/DQA362dflwZw2g=="],
+
+ "@tiptap/extension-dropcursor": ["@tiptap/extension-dropcursor@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0", "@tiptap/pm": "^2.7.0" } }, "sha512-uIN7L3FU0904ec7FFFbndO7RQE/yiON4VzAMhNn587LFMyWO8US139HXIL4O8dpZeYwYL3d1FnDTflZl6CwLlg=="],
+
+ "@tiptap/extension-floating-menu": ["@tiptap/extension-floating-menu@2.11.5", "", { "dependencies": { "tippy.js": "^6.3.7" }, "peerDependencies": { "@tiptap/core": "^2.7.0", "@tiptap/pm": "^2.7.0" } }, "sha512-HsMI0hV5Lwzm530Z5tBeyNCBNG38eJ3qjfdV2OHlfSf3+KOEfn6a5AUdoNaZO02LF79/8+7BaYU2drafag9cxQ=="],
+
+ "@tiptap/extension-gapcursor": ["@tiptap/extension-gapcursor@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0", "@tiptap/pm": "^2.7.0" } }, "sha512-kcWa+Xq9cb6lBdiICvLReuDtz/rLjFKHWpW3jTTF3FiP3wx4H8Rs6bzVtty7uOVTfwupxZRiKICAMEU6iT0xrQ=="],
+
+ "@tiptap/extension-hard-break": ["@tiptap/extension-hard-break@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-q9doeN+Yg9F5QNTG8pZGYfNye3tmntOwch683v0CCVCI4ldKaLZ0jG3NbBTq+mosHYdgOH2rNbIORlRRsQ+iYQ=="],
+
+ "@tiptap/extension-heading": ["@tiptap/extension-heading@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-x/MV53psJ9baRcZ4k4WjnCUBMt8zCX7mPlKVT+9C/o+DEs/j/qxPLs95nHeQv70chZpSwCQCt93xMmuF0kPoAg=="],
+
+ "@tiptap/extension-highlight": ["@tiptap/extension-highlight@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-VBZfT869L9CiTLF8qr+3FBUtJcmlyUTECORNo0ceEiNDg4H6V9uNPwaROMXrWiQCc+DYVCOkx541QrXwNMzxlg=="],
+
+ "@tiptap/extension-history": ["@tiptap/extension-history@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0", "@tiptap/pm": "^2.7.0" } }, "sha512-b+wOS33Dz1azw6F1i9LFTEIJ/gUui0Jwz5ZvmVDpL2ZHBhq1Ui0/spTT+tuZOXq7Y/uCbKL8Liu4WoedIvhboQ=="],
+
+ "@tiptap/extension-horizontal-rule": ["@tiptap/extension-horizontal-rule@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0", "@tiptap/pm": "^2.7.0" } }, "sha512-3up2r1Du8/5/4ZYzTC0DjTwhgPI3dn8jhOCLu73m5F3OGvK/9whcXoeWoX103hYMnGDxBlfOje71yQuN35FL4A=="],
+
+ "@tiptap/extension-image": ["@tiptap/extension-image@2.11.7", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-YvCmTDB7Oo+A56tR4S/gcNaYpqU4DDlSQcRp5IQvmQV5EekSe0lnEazGDoqOCwsit9qQhj4MPQJhKrnaWrJUrg=="],
+
+ "@tiptap/extension-italic": ["@tiptap/extension-italic@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-9VGfb2/LfPhQ6TjzDwuYLRvw0A6VGbaIp3F+5Mql8XVdTBHb2+rhELbyhNGiGVR78CaB/EiKb6dO9xu/tBWSYA=="],
+
+ "@tiptap/extension-link": ["@tiptap/extension-link@2.11.5", "", { "dependencies": { "linkifyjs": "^4.2.0" }, "peerDependencies": { "@tiptap/core": "^2.7.0", "@tiptap/pm": "^2.7.0" } }, "sha512-4Iu/aPzevbYpe50xDI0ZkqRa6nkZ9eF270Ue2qaF3Ab47nehj+9Jl78XXzo8+LTyFMnrETI73TAs1aC/IGySeQ=="],
+
+ "@tiptap/extension-list-item": ["@tiptap/extension-list-item@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-Mp5RD/pbkfW1vdc6xMVxXYcta73FOwLmblQlFNn/l/E5/X1DUSA4iGhgDDH4EWO3swbs03x2f7Zka/Xoj3+WLg=="],
+
+ "@tiptap/extension-ordered-list": ["@tiptap/extension-ordered-list@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-Cu8KwruBNWAaEfshRQR0yOSaUKAeEwxW7UgbvF9cN/zZuKgK5uZosPCPTehIFCcRe+TBpRtZQh+06f/gNYpYYg=="],
+
+ "@tiptap/extension-paragraph": ["@tiptap/extension-paragraph@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-YFBWeg7xu/sBnsDIF/+nh9Arf7R0h07VZMd0id5Ydd2Qe3c1uIZwXxeINVtH0SZozuPIQFAT8ICe9M0RxmE+TA=="],
+
+ "@tiptap/extension-strike": ["@tiptap/extension-strike@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-PVfUiCqrjvsLpbIoVlegSY8RlkR64F1Rr2RYmiybQfGbg+AkSZXDeO0eIrc03//4gua7D9DfIozHmAKv1KN3ow=="],
+
+ "@tiptap/extension-subscript": ["@tiptap/extension-subscript@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-VpaSzxku/Bcvf4SgDB2K5d0E+FNA/56iJHMygg/WXsq2F4tMMUEivQHI/n+17ndUEO4Wybz0wItnM1G2JfRuLQ=="],
+
+ "@tiptap/extension-superscript": ["@tiptap/extension-superscript@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-sK6v2G0zFfGW+j9CmYp2e+tyZ3FTa3dP0xY4kJzefgZcHhMJLlLnjxBRwHCSi/jj5ie6WdZT4KoEooxnPs1Vzw=="],
+
+ "@tiptap/extension-text": ["@tiptap/extension-text@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-Gq1WwyhFpCbEDrLPIHt5A8aLSlf8bfz4jm417c8F/JyU0J5dtYdmx0RAxjnLw1i7ZHE7LRyqqAoS0sl7JHDNSQ=="],
+
+ "@tiptap/extension-text-align": ["@tiptap/extension-text-align@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-Ei0zDpH5N9EV59ogydK4HTKa4lCPicCsQllM5n/Nf2tUJPir3aiYxzJ73FzhComD4Hpo1ANYnmssBhy8QeoPZA=="],
+
+ "@tiptap/extension-text-style": ["@tiptap/extension-text-style@2.11.5", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-YUmYl0gILSd/u/ZkOmNxjNXVw+mu8fpC2f8G4I4tLODm0zCx09j9DDEJXSrM5XX72nxJQqtSQsCpNKnL0hfeEQ=="],
+
+ "@tiptap/extension-underline": ["@tiptap/extension-underline@2.11.7", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-NtoQw6PGijOAtXC6G+0Aq0/Z5wwEjPhNHs8nsjXogfWIgaj/aI4/zfBnA06eI3WT+emMYQTl0fTc4CUPnLVU8g=="],
+
+ "@tiptap/pm": ["@tiptap/pm@2.11.5", "", { "dependencies": { "prosemirror-changeset": "^2.2.1", "prosemirror-collab": "^1.3.1", "prosemirror-commands": "^1.6.2", "prosemirror-dropcursor": "^1.8.1", "prosemirror-gapcursor": "^1.3.2", "prosemirror-history": "^1.4.1", "prosemirror-inputrules": "^1.4.0", "prosemirror-keymap": "^1.2.2", "prosemirror-markdown": "^1.13.1", "prosemirror-menu": "^1.2.4", "prosemirror-model": "^1.23.0", "prosemirror-schema-basic": "^1.2.3", "prosemirror-schema-list": "^1.4.1", "prosemirror-state": "^1.4.3", "prosemirror-tables": "^1.6.3", "prosemirror-trailing-node": "^3.0.0", "prosemirror-transform": "^1.10.2", "prosemirror-view": "^1.37.0" } }, "sha512-z9JFtqc5ZOsdQLd9vRnXfTCQ8v5ADAfRt9Nm7SqP6FUHII8E1hs38ACzf5xursmth/VonJYb5+73Pqxk1hGIPw=="],
+
+ "@tiptap/react": ["@tiptap/react@2.11.5", "", { "dependencies": { "@tiptap/extension-bubble-menu": "^2.11.5", "@tiptap/extension-floating-menu": "^2.11.5", "@types/use-sync-external-store": "^0.0.6", "fast-deep-equal": "^3", "use-sync-external-store": "^1" }, "peerDependencies": { "@tiptap/core": "^2.7.0", "@tiptap/pm": "^2.7.0", "react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Dp8eHL1G+R/C4+QzAczyb3t1ovexEIZx9ln7SGEM+cT1KHKAw9XGPRgsp92+NQaYI+EdEb/YqoBOSzQcd18/OQ=="],
+
+ "@tiptap/starter-kit": ["@tiptap/starter-kit@2.11.5", "", { "dependencies": { "@tiptap/core": "^2.11.5", "@tiptap/extension-blockquote": "^2.11.5", "@tiptap/extension-bold": "^2.11.5", "@tiptap/extension-bullet-list": "^2.11.5", "@tiptap/extension-code": "^2.11.5", "@tiptap/extension-code-block": "^2.11.5", "@tiptap/extension-document": "^2.11.5", "@tiptap/extension-dropcursor": "^2.11.5", "@tiptap/extension-gapcursor": "^2.11.5", "@tiptap/extension-hard-break": "^2.11.5", "@tiptap/extension-heading": "^2.11.5", "@tiptap/extension-history": "^2.11.5", "@tiptap/extension-horizontal-rule": "^2.11.5", "@tiptap/extension-italic": "^2.11.5", "@tiptap/extension-list-item": "^2.11.5", "@tiptap/extension-ordered-list": "^2.11.5", "@tiptap/extension-paragraph": "^2.11.5", "@tiptap/extension-strike": "^2.11.5", "@tiptap/extension-text": "^2.11.5", "@tiptap/extension-text-style": "^2.11.5", "@tiptap/pm": "^2.11.5" } }, "sha512-SLI7Aj2ruU1t//6Mk8f+fqW+18uTqpdfLUJYgwu0CkqBckrkRZYZh6GVLk/02k3H2ki7QkFxiFbZrdbZdng0JA=="],
+
+ "@tsconfig/node10": ["@tsconfig/node10@1.0.11", "", {}, "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw=="],
+
+ "@tsconfig/node12": ["@tsconfig/node12@1.0.11", "", {}, "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag=="],
+
+ "@tsconfig/node14": ["@tsconfig/node14@1.0.3", "", {}, "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow=="],
+
+ "@tsconfig/node16": ["@tsconfig/node16@1.0.4", "", {}, "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA=="],
+
+ "@types/accepts": ["@types/accepts@1.3.7", "", { "dependencies": { "@types/node": "*" } }, "sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ=="],
+
+ "@types/autocannon": ["@types/autocannon@7.12.6", "", { "dependencies": { "@types/node": "*" } }, "sha512-eBluTewWVKr1XlCPz3hYuzs+5JPme+Jh01sKpGPSnWg4wep1Oz2hpGn+dmcITl+uxYoV+rnhA+8LMengL+zcVw=="],
+
+ "@types/aws-lambda": ["@types/aws-lambda@8.10.147", "", {}, "sha512-nD0Z9fNIZcxYX5Mai2CTmFD7wX7UldCkW2ezCF8D1T5hdiLsnTWDGRpfRYntU6VjTdLQjOvyszru7I1c1oCQew=="],
+
+ "@types/babel__core": ["@types/babel__core@7.20.5", "", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="],
+
+ "@types/babel__generator": ["@types/babel__generator@7.6.8", "", { "dependencies": { "@babel/types": "^7.0.0" } }, "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw=="],
+
+ "@types/babel__template": ["@types/babel__template@7.4.4", "", { "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" } }, "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A=="],
+
+ "@types/babel__traverse": ["@types/babel__traverse@7.20.6", "", { "dependencies": { "@babel/types": "^7.20.7" } }, "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg=="],
+
+ "@types/blessed": ["@types/blessed@0.1.25", "", { "dependencies": { "@types/node": "*" } }, "sha512-kQsjBgtsbJLmG6CJA+Z6Nujj+tq1fcSE3UIowbDvzQI4wWmoTV7djUDhSo5lDjgwpIN0oRvks0SA5mMdKE5eFg=="],
+
+ "@types/body-parser": ["@types/body-parser@1.19.5", "", { "dependencies": { "@types/connect": "*", "@types/node": "*" } }, "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg=="],
+
+ "@types/bun": ["@types/bun@1.2.4", "", { "dependencies": { "bun-types": "1.2.4" } }, "sha512-QtuV5OMR8/rdKJs213iwXDpfVvnskPXY/S0ZiFbsTjQZycuqPbMW8Gf/XhLfwE5njW8sxI2WjISURXPlHypMFA=="],
+
+ "@types/cli-progress": ["@types/cli-progress@3.11.6", "", { "dependencies": { "@types/node": "*" } }, "sha512-cE3+jb9WRlu+uOSAugewNpITJDt1VF8dHOopPO4IABFc3SXYL5WE/+PTz/FCdZRRfIujiWW3n3aMbv1eIGVRWA=="],
+
+ "@types/connect": ["@types/connect@3.4.38", "", { "dependencies": { "@types/node": "*" } }, "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug=="],
+
+ "@types/content-disposition": ["@types/content-disposition@0.5.8", "", {}, "sha512-QVSSvno3dE0MgO76pJhmv4Qyi/j0Yk9pBp0Y7TJ2Tlj+KCgJWY6qX7nnxCOLkZ3VYRSIk1WTxCvwUSdx6CCLdg=="],
+
+ "@types/cookie": ["@types/cookie@0.5.4", "", {}, "sha512-7z/eR6O859gyWIAjuvBWFzNURmf2oPBmJlfVWkwehU5nzIyjwBsTh7WMmEEV4JFnHuQ3ex4oyTvfKzcyJVDBNA=="],
+
+ "@types/cookies": ["@types/cookies@0.9.0", "", { "dependencies": { "@types/connect": "*", "@types/express": "*", "@types/keygrip": "*", "@types/node": "*" } }, "sha512-40Zk8qR147RABiQ7NQnBzWzDcjKzNrntB5BAmeGCb2p/MIyOE+4BVvc17wumsUqUw00bJYqoXFHYygQnEFh4/Q=="],
+
+ "@types/crypto-js": ["@types/crypto-js@4.2.2", "", {}, "sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ=="],
+
+ "@types/express": ["@types/express@4.17.21", "", { "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.33", "@types/qs": "*", "@types/serve-static": "*" } }, "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ=="],
+
+ "@types/express-serve-static-core": ["@types/express-serve-static-core@4.19.6", "", { "dependencies": { "@types/node": "*", "@types/qs": "*", "@types/range-parser": "*", "@types/send": "*" } }, "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A=="],
+
+ "@types/geojson": ["@types/geojson@7946.0.16", "", {}, "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg=="],
+
+ "@types/geojson-vt": ["@types/geojson-vt@3.2.5", "", { "dependencies": { "@types/geojson": "*" } }, "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g=="],
+
+ "@types/graceful-fs": ["@types/graceful-fs@4.1.9", "", { "dependencies": { "@types/node": "*" } }, "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ=="],
+
+ "@types/http-assert": ["@types/http-assert@1.5.6", "", {}, "sha512-TTEwmtjgVbYAzZYWyeHPrrtWnfVkm8tQkP8P21uQifPgMRgjrow3XDEYqucuC8SKZJT7pUnhU/JymvjggxO9vw=="],
+
+ "@types/http-errors": ["@types/http-errors@2.0.4", "", {}, "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA=="],
+
+ "@types/istanbul-lib-coverage": ["@types/istanbul-lib-coverage@2.0.6", "", {}, "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w=="],
+
+ "@types/istanbul-lib-report": ["@types/istanbul-lib-report@3.0.3", "", { "dependencies": { "@types/istanbul-lib-coverage": "*" } }, "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA=="],
+
+ "@types/istanbul-reports": ["@types/istanbul-reports@3.0.4", "", { "dependencies": { "@types/istanbul-lib-report": "*" } }, "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ=="],
+
+ "@types/json5": ["@types/json5@0.0.29", "", {}, "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ=="],
+
+ "@types/keygrip": ["@types/keygrip@1.0.6", "", {}, "sha512-lZuNAY9xeJt7Bx4t4dx0rYCDqGPW8RXhQZK1td7d4H6E9zYbLoOtjBvfwdTKpsyxQI/2jv+armjX/RW+ZNpXOQ=="],
+
+ "@types/koa": ["@types/koa@2.15.0", "", { "dependencies": { "@types/accepts": "*", "@types/content-disposition": "*", "@types/cookies": "*", "@types/http-assert": "*", "@types/http-errors": "*", "@types/keygrip": "*", "@types/koa-compose": "*", "@types/node": "*" } }, "sha512-7QFsywoE5URbuVnG3loe03QXuGajrnotr3gQkXcEBShORai23MePfFYdhz90FEtBBpkyIYQbVD+evKtloCgX3g=="],
+
+ "@types/koa-compose": ["@types/koa-compose@3.2.8", "", { "dependencies": { "@types/koa": "*" } }, "sha512-4Olc63RY+MKvxMwVknCUDhRQX1pFQoBZ/lXcRLP69PQkEpze/0cr8LNqJQe5NFb/b19DWi2a5bTi2VAlQzhJuA=="],
+
+ "@types/linkify-it": ["@types/linkify-it@5.0.0", "", {}, "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q=="],
+
+ "@types/lodash": ["@types/lodash@4.17.15", "", {}, "sha512-w/P33JFeySuhN6JLkysYUK2gEmy9kHHFN7E8ro0tkfmlDOgxBDzWEZ/J8cWA+fHqFevpswDTFZnDx+R9lbL6xw=="],
+
+ "@types/mapbox-gl": ["@types/mapbox-gl@3.4.1", "", { "dependencies": { "@types/geojson": "*" } }, "sha512-NsGKKtgW93B+UaLPti6B7NwlxYlES5DpV5Gzj9F75rK5ALKsqSk15CiEHbOnTr09RGbr6ZYiCdI+59NNNcAImg=="],
+
+ "@types/mapbox__point-geometry": ["@types/mapbox__point-geometry@0.1.4", "", {}, "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA=="],
+
+ "@types/mapbox__vector-tile": ["@types/mapbox__vector-tile@1.3.4", "", { "dependencies": { "@types/geojson": "*", "@types/mapbox__point-geometry": "*", "@types/pbf": "*" } }, "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg=="],
+
+ "@types/markdown-it": ["@types/markdown-it@14.1.2", "", { "dependencies": { "@types/linkify-it": "^5", "@types/mdurl": "^2" } }, "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog=="],
+
+ "@types/mdurl": ["@types/mdurl@2.0.0", "", {}, "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg=="],
+
+ "@types/mime": ["@types/mime@1.3.5", "", {}, "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w=="],
+
+ "@types/mustache": ["@types/mustache@4.2.5", "", {}, "sha512-PLwiVvTBg59tGFL/8VpcGvqOu3L4OuveNvPi0EYbWchRdEVP++yRUXJPFl+CApKEq13017/4Nf7aQ5lTtHUNsA=="],
+
+ "@types/node": ["@types/node@20.4.5", "", {}, "sha512-rt40Nk13II9JwQBdeYqmbn2Q6IVTA5uPhvSO+JVqdXw/6/4glI6oR9ezty/A9Hg5u7JH4OmYmuQ+XvjKm0Datg=="],
+
+ "@types/node-fetch": ["@types/node-fetch@2.6.12", "", { "dependencies": { "@types/node": "*", "form-data": "^4.0.0" } }, "sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA=="],
+
+ "@types/node-forge": ["@types/node-forge@1.3.11", "", { "dependencies": { "@types/node": "*" } }, "sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ=="],
+
+ "@types/papaparse": ["@types/papaparse@5.3.15", "", { "dependencies": { "@types/node": "*" } }, "sha512-JHe6vF6x/8Z85nCX4yFdDslN11d+1pr12E526X8WAfhadOeaOTx5AuIkvDKIBopfvlzpzkdMx4YyvSKCM9oqtw=="],
+
+ "@types/parse-json": ["@types/parse-json@4.0.2", "", {}, "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw=="],
+
+ "@types/pbf": ["@types/pbf@3.0.5", "", {}, "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA=="],
+
+ "@types/phoenix": ["@types/phoenix@1.6.6", "", {}, "sha512-PIzZZlEppgrpoT2QgbnDU+MMzuR6BbCjllj0bM70lWoejMeNJAxCchxnv7J3XFkI8MpygtRpzXrIlmWUBclP5A=="],
+
+ "@types/prop-types": ["@types/prop-types@15.7.14", "", {}, "sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ=="],
+
+ "@types/qs": ["@types/qs@6.9.18", "", {}, "sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA=="],
+
+ "@types/quill": ["@types/quill@1.3.10", "", { "dependencies": { "parchment": "^1.1.2" } }, "sha512-IhW3fPW+bkt9MLNlycw8u8fWb7oO7W5URC9MfZYHBlA24rex9rs23D5DETChu1zvgVdc5ka64ICjJOgQMr6Shw=="],
+
+ "@types/range-parser": ["@types/range-parser@1.2.7", "", {}, "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ=="],
+
+ "@types/react": ["@types/react@18.2.17", "", { "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", "csstype": "^3.0.2" } }, "sha512-u+e7OlgPPh+aryjOm5UJMX32OvB2E3QASOAqVMY6Ahs90djagxwv2ya0IctglNbNTexC12qCSMZG47KPfy1hAA=="],
+
+ "@types/react-dom": ["@types/react-dom@18.2.7", "", { "dependencies": { "@types/react": "*" } }, "sha512-GRaAEriuT4zp9N4p1i8BDBYmEyfo+xQ3yHjJU4eiK5NDa1RmUZG+unZABUTK4/Ox/M+GaHwb6Ow8rUITrtjszA=="],
+
+ "@types/readable-stream": ["@types/readable-stream@4.0.18", "", { "dependencies": { "@types/node": "*", "safe-buffer": "~5.1.1" } }, "sha512-21jK/1j+Wg+7jVw1xnSwy/2Q1VgVjWuFssbYGTREPUBeZ+rqVFl2udq0IkxzPC0ZhOzVceUbyIACFZKLqKEBlA=="],
+
+ "@types/scheduler": ["@types/scheduler@0.23.0", "", {}, "sha512-YIoDCTH3Af6XM5VuwGG/QL/CJqga1Zm3NkU3HZ4ZHK2fRMPYP1VczsTUqtsf43PH/iJNVlPHAo2oWX7BSdB2Hw=="],
+
+ "@types/send": ["@types/send@0.17.4", "", { "dependencies": { "@types/mime": "^1", "@types/node": "*" } }, "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA=="],
+
+ "@types/serve-static": ["@types/serve-static@1.15.7", "", { "dependencies": { "@types/http-errors": "*", "@types/node": "*", "@types/send": "*" } }, "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw=="],
+
+ "@types/stack-utils": ["@types/stack-utils@2.0.3", "", {}, "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw=="],
+
+ "@types/stylis": ["@types/stylis@4.2.5", "", {}, "sha512-1Xve+NMN7FWjY14vLoY5tL3BVEQ/n42YLwaqJIPYhotZ9uBHt87VceMwWQpzmdEt2TNXIorIFG+YeCUUW7RInw=="],
+
+ "@types/supercluster": ["@types/supercluster@7.1.3", "", { "dependencies": { "@types/geojson": "*" } }, "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA=="],
+
+ "@types/triple-beam": ["@types/triple-beam@1.3.5", "", {}, "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw=="],
+
+ "@types/use-sync-external-store": ["@types/use-sync-external-store@0.0.6", "", {}, "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg=="],
+
+ "@types/uuid": ["@types/uuid@9.0.8", "", {}, "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA=="],
+
+ "@types/web-push": ["@types/web-push@3.6.4", "", { "dependencies": { "@types/node": "*" } }, "sha512-GnJmSr40H3RAnj0s34FNTcJi1hmWFV5KXugE0mYWnYhgTAHLJ/dJKAwDmvPJYMke0RplY2XE9LnM4hqSqKIjhQ=="],
+
+ "@types/ws": ["@types/ws@8.5.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw=="],
+
+ "@types/yargs": ["@types/yargs@17.0.33", "", { "dependencies": { "@types/yargs-parser": "*" } }, "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA=="],
+
+ "@types/yargs-parser": ["@types/yargs-parser@21.0.3", "", {}, "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ=="],
+
+ "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@7.18.0", "", { "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "7.18.0", "@typescript-eslint/type-utils": "7.18.0", "@typescript-eslint/utils": "7.18.0", "@typescript-eslint/visitor-keys": "7.18.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", "ts-api-utils": "^1.3.0" }, "peerDependencies": { "@typescript-eslint/parser": "^7.0.0", "eslint": "^8.56.0" } }, "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw=="],
+
+ "@typescript-eslint/parser": ["@typescript-eslint/parser@7.18.0", "", { "dependencies": { "@typescript-eslint/scope-manager": "7.18.0", "@typescript-eslint/types": "7.18.0", "@typescript-eslint/typescript-estree": "7.18.0", "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4" }, "peerDependencies": { "eslint": "^8.56.0" } }, "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg=="],
+
+ "@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@7.18.0", "", { "dependencies": { "@typescript-eslint/types": "7.18.0", "@typescript-eslint/visitor-keys": "7.18.0" } }, "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA=="],
+
+ "@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@7.18.0", "", { "dependencies": { "@typescript-eslint/typescript-estree": "7.18.0", "@typescript-eslint/utils": "7.18.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, "peerDependencies": { "eslint": "^8.56.0" } }, "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA=="],
+
+ "@typescript-eslint/types": ["@typescript-eslint/types@7.18.0", "", {}, "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ=="],
+
+ "@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@7.18.0", "", { "dependencies": { "@typescript-eslint/types": "7.18.0", "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", "ts-api-utils": "^1.3.0" } }, "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA=="],
+
+ "@typescript-eslint/utils": ["@typescript-eslint/utils@7.18.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@typescript-eslint/scope-manager": "7.18.0", "@typescript-eslint/types": "7.18.0", "@typescript-eslint/typescript-estree": "7.18.0" }, "peerDependencies": { "eslint": "^8.56.0" } }, "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw=="],
+
+ "@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@7.18.0", "", { "dependencies": { "@typescript-eslint/types": "7.18.0", "eslint-visitor-keys": "^3.4.3" } }, "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg=="],
+
+ "@ungap/structured-clone": ["@ungap/structured-clone@1.3.0", "", {}, "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g=="],
+
+ "@urql/core": ["@urql/core@5.1.0", "", { "dependencies": { "@0no-co/graphql.web": "^1.0.5", "wonka": "^6.3.2" } }, "sha512-yC3sw8yqjbX45GbXxfiBY8GLYCiyW/hLBbQF9l3TJrv4ro00Y0ChkKaD9I2KntRxAVm9IYBqh0awX8fwWAe/Yw=="],
+
+ "@urql/exchange-retry": ["@urql/exchange-retry@1.3.0", "", { "dependencies": { "@urql/core": "^5.0.0", "wonka": "^6.3.2" } }, "sha512-FLt+d81gP4oiHah4hWFDApimc+/xABWMU1AMYsZ1PVB0L0YPtrMCjbOp9WMM7hBzy4gbTDrG24sio0dCfSh/HQ=="],
+
+ "@xmldom/xmldom": ["@xmldom/xmldom@0.7.13", "", {}, "sha512-lm2GW5PkosIzccsaZIz7tp8cPADSIlIHWDFTR1N0SzfinhhYgeIQjFMz4rYzanCScr3DqQLeomUDArp6MWKm+g=="],
+
+ "abbrev": ["abbrev@1.1.1", "", {}, "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="],
+
+ "abort-controller": ["abort-controller@3.0.0", "", { "dependencies": { "event-target-shim": "^5.0.0" } }, "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg=="],
+
+ "abs-svg-path": ["abs-svg-path@0.1.1", "", {}, "sha512-d8XPSGjfyzlXC3Xx891DJRyZfqk5JU0BJrDQcsWomFIV1/BIzPW5HDH5iDdWpqWaav0YVIEzT1RHTwWr0FFshA=="],
+
+ "accepts": ["accepts@1.3.8", "", { "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" } }, "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw=="],
+
+ "acorn": ["acorn@8.14.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA=="],
+
+ "acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="],
+
+ "acorn-walk": ["acorn-walk@8.3.4", "", { "dependencies": { "acorn": "^8.11.0" } }, "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g=="],
+
+ "agent-base": ["agent-base@7.1.3", "", {}, "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw=="],
+
+ "agentkeepalive": ["agentkeepalive@4.6.0", "", { "dependencies": { "humanize-ms": "^1.2.1" } }, "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ=="],
+
+ "aggregate-error": ["aggregate-error@3.1.0", "", { "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" } }, "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA=="],
+
+ "ajv": ["ajv@6.12.6", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g=="],
+
+ "anser": ["anser@1.4.10", "", {}, "sha512-hCv9AqTQ8ycjpSd3upOJd7vFwW1JaoYQ7tpham03GJ1ca8/65rqn0RpaWpItOAd6ylW9wAw6luXYPJIyPFVOww=="],
+
+ "ansi-escapes": ["ansi-escapes@6.2.1", "", {}, "sha512-4nJ3yixlEthEJ9Rk4vPcdBRkZvQZlYyu8j4/Mqz5sgIkddmEnH2Yj2ZrnP9S3tQOvSNRUIgVNF/1yPpRAGNRig=="],
+
+ "ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
+
+ "ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
+
+ "ansi-term": ["ansi-term@0.0.2", "", { "dependencies": { "x256": ">=0.0.1" } }, "sha512-jLnGE+n8uAjksTJxiWZf/kcUmXq+cRWSl550B9NmQ8YiqaTM+lILcSe5dHdp8QkJPhaOghDjnMKwyYSMjosgAA=="],
+
+ "ansicolors": ["ansicolors@0.3.2", "", {}, "sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg=="],
+
+ "any-promise": ["any-promise@1.3.0", "", {}, "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A=="],
+
+ "anymatch": ["anymatch@3.1.3", "", { "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" } }, "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw=="],
+
+ "app-root-path": ["app-root-path@3.1.0", "", {}, "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA=="],
+
+ "application-config-path": ["application-config-path@0.1.1", "", {}, "sha512-zy9cHePtMP0YhwG+CfHm0bgwdnga2X3gZexpdCwEj//dpb+TKajtiC8REEUJUSq6Ab4f9cgNy2l8ObXzCXFkEw=="],
+
+ "arg": ["arg@5.0.2", "", {}, "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg=="],
+
+ "argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="],
+
+ "aria-hidden": ["aria-hidden@1.2.4", "", { "dependencies": { "tslib": "^2.0.0" } }, "sha512-y+CcFFwelSXpLZk/7fMB2mUbGtX9lKycf1MWJ7CaTIERyitVlyQx6C+sxcROU2BAJ24OiZyK+8wj2i8AlBoS3A=="],
+
+ "aria-query": ["aria-query@5.3.2", "", {}, "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw=="],
+
+ "arr-union": ["arr-union@3.1.0", "", {}, "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q=="],
+
+ "array-buffer-byte-length": ["array-buffer-byte-length@1.0.2", "", { "dependencies": { "call-bound": "^1.0.3", "is-array-buffer": "^3.0.5" } }, "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw=="],
+
+ "array-includes": ["array-includes@3.1.8", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2", "es-object-atoms": "^1.0.0", "get-intrinsic": "^1.2.4", "is-string": "^1.0.7" } }, "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ=="],
+
+ "array-parallel": ["array-parallel@0.1.3", "", {}, "sha512-TDPTwSWW5E4oiFiKmz6RGJ/a80Y91GuLgUYuLd49+XBS75tYo8PNgaT2K/OxuQYqkoI852MDGBorg9OcUSTQ8w=="],
+
+ "array-series": ["array-series@0.1.5", "", {}, "sha512-L0XlBwfx9QetHOsbLDrE/vh2t018w9462HM3iaFfxRiK83aJjAt/Ja3NMkOW7FICwWTlQBa3ZbL5FKhuQWkDrg=="],
+
+ "array-union": ["array-union@2.1.0", "", {}, "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw=="],
+
+ "array.prototype.findlast": ["array.prototype.findlast@1.2.5", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "es-shim-unscopables": "^1.0.2" } }, "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ=="],
+
+ "array.prototype.findlastindex": ["array.prototype.findlastindex@1.2.5", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "es-shim-unscopables": "^1.0.2" } }, "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ=="],
+
+ "array.prototype.flat": ["array.prototype.flat@1.3.3", "", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-shim-unscopables": "^1.0.2" } }, "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg=="],
+
+ "array.prototype.flatmap": ["array.prototype.flatmap@1.3.3", "", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-shim-unscopables": "^1.0.2" } }, "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg=="],
+
+ "array.prototype.reduce": ["array.prototype.reduce@1.0.7", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2", "es-array-method-boxes-properly": "^1.0.0", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "is-string": "^1.0.7" } }, "sha512-mzmiUCVwtiD4lgxYP8g7IYy8El8p2CSMePvIbTS7gchKir/L1fgJrk0yDKmAX6mnRQFKNADYIk8nNlTris5H1Q=="],
+
+ "array.prototype.tosorted": ["array.prototype.tosorted@1.1.4", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.3", "es-errors": "^1.3.0", "es-shim-unscopables": "^1.0.2" } }, "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA=="],
+
+ "arraybuffer.prototype.slice": ["arraybuffer.prototype.slice@1.0.4", "", { "dependencies": { "array-buffer-byte-length": "^1.0.1", "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "is-array-buffer": "^3.0.4" } }, "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ=="],
+
+ "asap": ["asap@2.0.6", "", {}, "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA=="],
+
+ "asn1.js": ["asn1.js@5.4.1", "", { "dependencies": { "bn.js": "^4.0.0", "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0", "safer-buffer": "^2.1.0" } }, "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA=="],
+
+ "asn1js": ["asn1js@3.0.5", "", { "dependencies": { "pvtsutils": "^1.3.2", "pvutils": "^1.1.3", "tslib": "^2.4.0" } }, "sha512-FVnvrKJwpt9LP2lAMl8qZswRNm3T4q9CON+bxldk2iwk3FFpuwhx2FfinyitizWHsVYyaY+y5JzDR0rCMV5yTQ=="],
+
+ "assign-symbols": ["assign-symbols@1.0.0", "", {}, "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw=="],
+
+ "ast-types": ["ast-types@0.16.1", "", { "dependencies": { "tslib": "^2.0.1" } }, "sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg=="],
+
+ "ast-types-flow": ["ast-types-flow@0.0.8", "", {}, "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ=="],
+
+ "async": ["async@3.2.6", "", {}, "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA=="],
+
+ "async-function": ["async-function@1.0.0", "", {}, "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA=="],
+
+ "async-limiter": ["async-limiter@1.0.1", "", {}, "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="],
+
+ "asynckit": ["asynckit@0.4.0", "", {}, "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="],
+
+ "at-least-node": ["at-least-node@1.0.0", "", {}, "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg=="],
+
+ "autocannon": ["autocannon@7.15.0", "", { "dependencies": { "chalk": "^4.1.0", "char-spinner": "^1.0.1", "cli-table3": "^0.6.0", "color-support": "^1.1.1", "cross-argv": "^2.0.0", "form-data": "^4.0.0", "has-async-hooks": "^1.0.0", "hdr-histogram-js": "^3.0.0", "hdr-histogram-percentiles-obj": "^3.0.0", "http-parser-js": "^0.5.2", "hyperid": "^3.0.0", "lodash.chunk": "^4.2.0", "lodash.clonedeep": "^4.5.0", "lodash.flatten": "^4.4.0", "manage-path": "^2.0.0", "on-net-listen": "^1.1.1", "pretty-bytes": "^5.4.1", "progress": "^2.0.3", "reinterval": "^1.1.0", "retimer": "^3.0.0", "semver": "^7.3.2", "subarg": "^1.0.0", "timestring": "^6.0.0" }, "bin": { "autocannon": "autocannon.js" } }, "sha512-NaP2rQyA+tcubOJMFv2+oeW9jv2pq/t+LM6BL3cfJic0HEfscEcnWgAyU5YovE/oTHUzAgTliGdLPR+RQAWUbg=="],
+
+ "autoprefixer": ["autoprefixer@10.4.14", "", { "dependencies": { "browserslist": "^4.21.5", "caniuse-lite": "^1.0.30001464", "fraction.js": "^4.2.0", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.1.0" }, "bin": { "autoprefixer": "bin/autoprefixer" } }, "sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ=="],
+
+ "available-typed-arrays": ["available-typed-arrays@1.0.7", "", { "dependencies": { "possible-typed-array-names": "^1.0.0" } }, "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ=="],
+
+ "axe-core": ["axe-core@4.10.2", "", {}, "sha512-RE3mdQ7P3FRSe7eqCWoeQ/Z9QXrtniSjp1wUjt5nRC3WIpz5rSCve6o3fsZ2aCpJtrZjSZgjwXAoTO5k4tEI0w=="],
+
+ "axios": ["axios@0.26.1", "", { "dependencies": { "follow-redirects": "^1.14.8" } }, "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA=="],
+
+ "axobject-query": ["axobject-query@4.1.0", "", {}, "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ=="],
+
+ "babel-core": ["babel-core@7.0.0-bridge.0", "", { "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg=="],
+
+ "babel-jest": ["babel-jest@29.7.0", "", { "dependencies": { "@jest/transform": "^29.7.0", "@types/babel__core": "^7.1.14", "babel-plugin-istanbul": "^6.1.1", "babel-preset-jest": "^29.6.3", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "slash": "^3.0.0" }, "peerDependencies": { "@babel/core": "^7.8.0" } }, "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg=="],
+
+ "babel-plugin-istanbul": ["babel-plugin-istanbul@6.1.1", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@istanbuljs/load-nyc-config": "^1.0.0", "@istanbuljs/schema": "^0.1.2", "istanbul-lib-instrument": "^5.0.4", "test-exclude": "^6.0.0" } }, "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA=="],
+
+ "babel-plugin-jest-hoist": ["babel-plugin-jest-hoist@29.6.3", "", { "dependencies": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", "@types/babel__core": "^7.1.14", "@types/babel__traverse": "^7.0.6" } }, "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg=="],
+
+ "babel-plugin-macros": ["babel-plugin-macros@3.1.0", "", { "dependencies": { "@babel/runtime": "^7.12.5", "cosmiconfig": "^7.0.0", "resolve": "^1.19.0" } }, "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg=="],
+
+ "babel-plugin-polyfill-corejs2": ["babel-plugin-polyfill-corejs2@0.4.12", "", { "dependencies": { "@babel/compat-data": "^7.22.6", "@babel/helper-define-polyfill-provider": "^0.6.3", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-CPWT6BwvhrTO2d8QVorhTCQw9Y43zOu7G9HigcfxvepOU6b8o3tcWad6oVgZIsZCTt42FFv97aA7ZJsbM4+8og=="],
+
+ "babel-plugin-polyfill-corejs3": ["babel-plugin-polyfill-corejs3@0.11.1", "", { "dependencies": { "@babel/helper-define-polyfill-provider": "^0.6.3", "core-js-compat": "^3.40.0" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-yGCqvBT4rwMczo28xkH/noxJ6MZ4nJfkVYdoDaC/utLtWrXxv27HVrzAeSbqR8SxDsp46n0YF47EbHoixy6rXQ=="],
+
+ "babel-plugin-polyfill-regenerator": ["babel-plugin-polyfill-regenerator@0.6.3", "", { "dependencies": { "@babel/helper-define-polyfill-provider": "^0.6.3" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-LiWSbl4CRSIa5x/JAU6jZiG9eit9w6mz+yVMFwDE83LAWvt0AfGBoZ7HS/mkhrKuh2ZlzfVZYKoLjXdqw6Yt7Q=="],
+
+ "babel-plugin-react-native-web": ["babel-plugin-react-native-web@0.19.13", "", {}, "sha512-4hHoto6xaN23LCyZgL9LJZc3olmAxd7b6jDzlZnKXAh4rRAbZRKNBJoOOdp46OBqgy+K0t0guTj5/mhA8inymQ=="],
+
+ "babel-plugin-syntax-hermes-parser": ["babel-plugin-syntax-hermes-parser@0.25.1", "", { "dependencies": { "hermes-parser": "0.25.1" } }, "sha512-IVNpGzboFLfXZUAwkLFcI/bnqVbwky0jP3eBno4HKtqvQJAHBLdgxiG6lQ4to0+Q/YCN3PO0od5NZwIKyY4REQ=="],
+
+ "babel-plugin-transform-flow-enums": ["babel-plugin-transform-flow-enums@0.0.2", "", { "dependencies": { "@babel/plugin-syntax-flow": "^7.12.1" } }, "sha512-g4aaCrDDOsWjbm0PUUeVnkcVd6AKJsVc/MbnPhEotEpkeJQP6b8nzewohQi7+QS8UyPehOhGWn0nOwjvWpmMvQ=="],
+
+ "babel-preset-current-node-syntax": ["babel-preset-current-node-syntax@1.1.0", "", { "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-bigint": "^7.8.3", "@babel/plugin-syntax-class-properties": "^7.12.13", "@babel/plugin-syntax-class-static-block": "^7.14.5", "@babel/plugin-syntax-import-attributes": "^7.24.7", "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/plugin-syntax-json-strings": "^7.8.3", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", "@babel/plugin-syntax-numeric-separator": "^7.10.4", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-syntax-private-property-in-object": "^7.14.5", "@babel/plugin-syntax-top-level-await": "^7.14.5" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw=="],
+
+ "babel-preset-expo": ["babel-preset-expo@12.0.9", "", { "dependencies": { "@babel/plugin-proposal-decorators": "^7.12.9", "@babel/plugin-transform-export-namespace-from": "^7.22.11", "@babel/plugin-transform-object-rest-spread": "^7.12.13", "@babel/plugin-transform-parameters": "^7.22.15", "@babel/preset-react": "^7.22.15", "@babel/preset-typescript": "^7.23.0", "@react-native/babel-preset": "0.76.7", "babel-plugin-react-native-web": "~0.19.13", "react-refresh": "^0.14.2" }, "peerDependencies": { "babel-plugin-react-compiler": "^19.0.0-beta-9ee70a1-20241017", "react-compiler-runtime": "^19.0.0-beta-8a03594-20241020" }, "optionalPeers": ["babel-plugin-react-compiler", "react-compiler-runtime"] }, "sha512-1c+ysrTavT49WgVAj0OX/TEzt1kU2mfPhDaDajstshNHXFKPenMPWSViA/DHrJKVIMwaqr+z3GbUOD9GtKgpdg=="],
+
+ "babel-preset-jest": ["babel-preset-jest@29.6.3", "", { "dependencies": { "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA=="],
+
+ "balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
+
+ "base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],
+
+ "before-after-hook": ["before-after-hook@3.0.2", "", {}, "sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A=="],
+
+ "better-opn": ["better-opn@3.0.2", "", { "dependencies": { "open": "^8.0.4" } }, "sha512-aVNobHnJqLiUelTaHat9DZ1qM2w0C0Eym4LPI/3JxOnSokGVdsl1T1kN7TFvsEAD8G47A6VKQ0TVHqbBnYMJlQ=="],
+
+ "bidi-js": ["bidi-js@1.0.3", "", { "dependencies": { "require-from-string": "^2.0.2" } }, "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw=="],
+
+ "big-integer": ["big-integer@1.6.52", "", {}, "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg=="],
+
+ "binary-extensions": ["binary-extensions@2.3.0", "", {}, "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw=="],
+
+ "bl": ["bl@6.0.19", "", { "dependencies": { "@types/readable-stream": "^4.0.0", "buffer": "^6.0.3", "inherits": "^2.0.4", "readable-stream": "^4.2.0" } }, "sha512-4Ay3A3oDfGg3GGirhl4s62ebtnk0pJZA5mLp672MPKOQXsWvXjEF4dqdXySjJIs7b9OVr/O8aOo0Lm+xdjo2JA=="],
+
+ "blessed": ["blessed@0.1.81", "", { "bin": { "blessed": "./bin/tput.js" } }, "sha512-LoF5gae+hlmfORcG1M5+5XZi4LBmvlXTzwJWzUlPryN/SJdSflZvROM2TwkT0GMpq7oqT48NRd4GS7BiVBc5OQ=="],
+
+ "blessed-contrib": ["blessed-contrib@4.11.0", "", { "dependencies": { "ansi-term": ">=0.0.2", "chalk": "^1.1.0", "drawille-canvas-blessed-contrib": ">=0.1.3", "lodash": "~>=4.17.21", "map-canvas": ">=0.1.5", "marked": "^4.0.12", "marked-terminal": "^5.1.1", "memory-streams": "^0.1.0", "memorystream": "^0.3.1", "picture-tuber": "^1.0.1", "sparkline": "^0.1.1", "strip-ansi": "^3.0.0", "term-canvas": "0.0.5", "x256": ">=0.0.1" } }, "sha512-P00Xji3xPp53+FdU9f74WpvnOAn/SS0CKLy4vLAf5Ps7FGDOTY711ruJPZb3/7dpFuP+4i7f4a/ZTZdLlKG9WA=="],
+
+ "bn.js": ["bn.js@4.12.1", "", {}, "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg=="],
+
+ "bottleneck": ["bottleneck@2.19.5", "", {}, "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw=="],
+
+ "bplist-creator": ["bplist-creator@0.0.7", "", { "dependencies": { "stream-buffers": "~2.2.0" } }, "sha512-xp/tcaV3T5PCiaY04mXga7o/TE+t95gqeLmADeBI1CvZtdWTbgBt3uLpvh4UWtenKeBhCV6oVxGk38yZr2uYEA=="],
+
+ "bplist-parser": ["bplist-parser@0.3.2", "", { "dependencies": { "big-integer": "1.6.x" } }, "sha512-apC2+fspHGI3mMKj+dGevkGo/tCqVB8jMb6i+OX+E29p0Iposz07fABkRIfVUPNd5A5VbuOz1bZbnmkKLYF+wQ=="],
+
+ "brace-expansion": ["brace-expansion@1.1.11", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA=="],
+
+ "braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="],
+
+ "bresenham": ["bresenham@0.0.3", "", {}, "sha512-wbMxoJJM1p3+6G7xEFXYNCJ30h2qkwmVxebkbwIl4OcnWtno5R3UT9VuYLfStlVNAQCmRjkGwjPFdfaPd4iNXw=="],
+
+ "brotli": ["brotli@1.3.3", "", { "dependencies": { "base64-js": "^1.1.2" } }, "sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg=="],
+
+ "browserify-zlib": ["browserify-zlib@0.2.0", "", { "dependencies": { "pako": "~1.0.5" } }, "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA=="],
+
+ "browserslist": ["browserslist@4.24.4", "", { "dependencies": { "caniuse-lite": "^1.0.30001688", "electron-to-chromium": "^1.5.73", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.1" }, "bin": { "browserslist": "cli.js" } }, "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A=="],
+
+ "bser": ["bser@2.1.1", "", { "dependencies": { "node-int64": "^0.4.0" } }, "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ=="],
+
+ "buffer": ["buffer@6.0.3", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA=="],
+
+ "buffer-alloc": ["buffer-alloc@1.2.0", "", { "dependencies": { "buffer-alloc-unsafe": "^1.1.0", "buffer-fill": "^1.0.0" } }, "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow=="],
+
+ "buffer-alloc-unsafe": ["buffer-alloc-unsafe@1.1.0", "", {}, "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg=="],
+
+ "buffer-equal-constant-time": ["buffer-equal-constant-time@1.0.1", "", {}, "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA=="],
+
+ "buffer-fill": ["buffer-fill@1.0.0", "", {}, "sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ=="],
+
+ "buffer-from": ["buffer-from@0.1.2", "", {}, "sha512-RiWIenusJsmI2KcvqQABB83tLxCByE3upSP8QU3rJDMVFGPWLvPQJt/O1Su9moRWeH7d+Q2HYb68f6+v+tw2vg=="],
+
+ "buffers": ["buffers@0.1.1", "", {}, "sha512-9q/rDEGSb/Qsvv2qvzIzdluL5k7AaJOTrw23z9reQthrbF7is4CtlT0DXyO1oei2DCp4uojjzQ7igaSHp1kAEQ=="],
+
+ "bufferutil": ["bufferutil@4.0.9", "", { "dependencies": { "node-gyp-build": "^4.3.0" } }, "sha512-WDtdLmJvAuNNPzByAYpRo2rF1Mmradw6gvWsQKf63476DDXmomT9zUiGypLcG4ibIM67vhAj8jJRdbmEws2Aqw=="],
+
+ "bun": ["bun@1.2.4", "", { "optionalDependencies": { "@oven/bun-darwin-aarch64": "1.2.4", "@oven/bun-darwin-x64": "1.2.4", "@oven/bun-darwin-x64-baseline": "1.2.4", "@oven/bun-linux-aarch64": "1.2.4", "@oven/bun-linux-aarch64-musl": "1.2.4", "@oven/bun-linux-x64": "1.2.4", "@oven/bun-linux-x64-baseline": "1.2.4", "@oven/bun-linux-x64-musl": "1.2.4", "@oven/bun-linux-x64-musl-baseline": "1.2.4", "@oven/bun-windows-x64": "1.2.4", "@oven/bun-windows-x64-baseline": "1.2.4" }, "os": [ "linux", "win32", "darwin", ], "cpu": [ "x64", "arm64", ], "bin": { "bun": "bin/bun.exe", "bunx": "bin/bun.exe" } }, "sha512-ZY0EZ/UKqheaLeAtMsfJA6jWoWvV9HAtfFaOJSmS3LrNpFKs1Sg5fZLSsczN1h3a+Dtheo4O3p3ZYWrf40kRGw=="],
+
+ "bun-types": ["bun-types@1.2.4", "", { "dependencies": { "@types/node": "*", "@types/ws": "~8.5.10" } }, "sha512-nDPymR207ZZEoWD4AavvEaa/KZe/qlrbMSchqpQwovPZCKc7pwMoENjEtHgMKaAjJhy+x6vfqSBA1QU3bJgs0Q=="],
+
+ "busboy": ["busboy@1.6.0", "", { "dependencies": { "streamsearch": "^1.1.0" } }, "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA=="],
+
+ "bytes": ["bytes@3.1.2", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="],
+
+ "bytewise": ["bytewise@1.1.0", "", { "dependencies": { "bytewise-core": "^1.2.2", "typewise": "^1.0.3" } }, "sha512-rHuuseJ9iQ0na6UDhnrRVDh8YnWVlU6xM3VH6q/+yHDeUH2zIhUzP+2/h3LIrhLDBtTqzWpE3p3tP/boefskKQ=="],
+
+ "bytewise-core": ["bytewise-core@1.2.3", "", { "dependencies": { "typewise-core": "^1.2" } }, "sha512-nZD//kc78OOxeYtRlVk8/zXqTB4gf/nlguL1ggWA8FuchMyOxcyHR4QPQZMUmA7czC+YnaBrPUCubqAWe50DaA=="],
+
+ "cacache": ["cacache@18.0.4", "", { "dependencies": { "@npmcli/fs": "^3.1.0", "fs-minipass": "^3.0.0", "glob": "^10.2.2", "lru-cache": "^10.0.1", "minipass": "^7.0.3", "minipass-collect": "^2.0.1", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "p-map": "^4.0.0", "ssri": "^10.0.0", "tar": "^6.1.11", "unique-filename": "^3.0.0" } }, "sha512-B+L5iIa9mgcjLbliir2th36yEwPftrzteHYujzsx3dFP/31GCHcIeS8f5MGd80odLOjaOvSpU3EEAmRQptkxLQ=="],
+
+ "call-bind": ["call-bind@1.0.8", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" } }, "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww=="],
+
+ "call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
+
+ "call-bound": ["call-bound@1.0.3", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "get-intrinsic": "^1.2.6" } }, "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA=="],
+
+ "caller-callsite": ["caller-callsite@2.0.0", "", { "dependencies": { "callsites": "^2.0.0" } }, "sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ=="],
+
+ "caller-path": ["caller-path@2.0.0", "", { "dependencies": { "caller-callsite": "^2.0.0" } }, "sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A=="],
+
+ "callsites": ["callsites@3.1.0", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="],
+
+ "camelcase": ["camelcase@6.3.0", "", {}, "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA=="],
+
+ "camelcase-css": ["camelcase-css@2.0.1", "", {}, "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA=="],
+
+ "camelize": ["camelize@1.0.1", "", {}, "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ=="],
+
+ "caniuse-lite": ["caniuse-lite@1.0.30001701", "", {}, "sha512-faRs/AW3jA9nTwmJBSO1PQ6L/EOgsB5HMQQq4iCu5zhPgVVgO/pZRHlmatwijZKetFw8/Pr4q6dEN8sJuq8qTw=="],
+
+ "canvas": ["canvas@3.1.0", "", { "dependencies": { "node-addon-api": "^7.0.0", "prebuild-install": "^7.1.1" } }, "sha512-tTj3CqqukVJ9NgSahykNwtGda7V33VLObwrHfzT0vqJXu7J4d4C/7kQQW3fOEGDfZZoILPut5H00gOjyttPGyg=="],
+
+ "cardinal": ["cardinal@2.1.1", "", { "dependencies": { "ansicolors": "~0.3.2", "redeyed": "~2.1.0" }, "bin": { "cdl": "./bin/cdl.js" } }, "sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw=="],
+
+ "chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
+
+ "char-spinner": ["char-spinner@1.0.1", "", {}, "sha512-acv43vqJ0+N0rD+Uw3pDHSxP30FHrywu2NO6/wBaHChJIizpDeBUd6NjqhNhy9LGaEAhZAXn46QzmlAvIWd16g=="],
+
+ "charenc": ["charenc@0.0.2", "", {}, "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA=="],
+
+ "charm": ["charm@0.1.2", "", {}, "sha512-syedaZ9cPe7r3hoQA9twWYKu5AIyCswN5+szkmPBe9ccdLrj4bYaCnLVPTLd2kgVRc7+zoX4tyPgRnFKCj5YjQ=="],
+
+ "cheap-ruler": ["cheap-ruler@4.0.0", "", {}, "sha512-0BJa8f4t141BYKQyn9NSQt1PguFQXMXwZiA5shfoaBYHAb2fFk2RAX+tiWMoQU+Agtzt3mdt0JtuyshAXqZ+Vw=="],
+
+ "chokidar": ["chokidar@3.6.0", "", { "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw=="],
+
+ "chownr": ["chownr@2.0.0", "", {}, "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ=="],
+
+ "chrome-launcher": ["chrome-launcher@0.15.2", "", { "dependencies": { "@types/node": "*", "escape-string-regexp": "^4.0.0", "is-wsl": "^2.2.0", "lighthouse-logger": "^1.0.0" }, "bin": { "print-chrome-path": "bin/print-chrome-path.js" } }, "sha512-zdLEwNo3aUVzIhKhTtXfxhdvZhUghrnmkvcAq2NoDd+LeOHKf03H5jwZ8T/STsAlzyALkBVK552iaG1fGf1xVQ=="],
+
+ "chromium-edge-launcher": ["chromium-edge-launcher@0.2.0", "", { "dependencies": { "@types/node": "*", "escape-string-regexp": "^4.0.0", "is-wsl": "^2.2.0", "lighthouse-logger": "^1.0.0", "mkdirp": "^1.0.4", "rimraf": "^3.0.2" } }, "sha512-JfJjUnq25y9yg4FABRRVPmBGWPZZi+AQXT4mxupb67766/0UlhG8PAZCz6xzEMXTbW3CsSoE8PcCWA49n35mKg=="],
+
+ "ci-info": ["ci-info@3.9.0", "", {}, "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ=="],
+
+ "classnames": ["classnames@2.5.1", "", {}, "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow=="],
+
+ "clean-stack": ["clean-stack@2.2.0", "", {}, "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A=="],
+
+ "cli-cursor": ["cli-cursor@2.1.0", "", { "dependencies": { "restore-cursor": "^2.0.0" } }, "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw=="],
+
+ "cli-progress": ["cli-progress@3.12.0", "", { "dependencies": { "string-width": "^4.2.3" } }, "sha512-tRkV3HJ1ASwm19THiiLIXLO7Im7wlTuKnvkYaTkyoAPefqjNg7W7DHKUlGRxy9vxDvbyCYQkQozvptuMkGCg8A=="],
+
+ "cli-spinners": ["cli-spinners@2.9.2", "", {}, "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg=="],
+
+ "cli-table3": ["cli-table3@0.6.5", "", { "dependencies": { "string-width": "^4.2.0" }, "optionalDependencies": { "@colors/colors": "1.5.0" } }, "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ=="],
+
+ "client-only": ["client-only@0.0.1", "", {}, "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA=="],
+
+ "cliui": ["cliui@8.0.1", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" } }, "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ=="],
+
+ "clone": ["clone@2.1.2", "", {}, "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w=="],
+
+ "clone-deep": ["clone-deep@4.0.1", "", { "dependencies": { "is-plain-object": "^2.0.4", "kind-of": "^6.0.2", "shallow-clone": "^3.0.0" } }, "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ=="],
+
+ "clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="],
+
+ "color": ["color@4.2.3", "", { "dependencies": { "color-convert": "^2.0.1", "color-string": "^1.9.0" } }, "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A=="],
+
+ "color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="],
+
+ "color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="],
+
+ "color-string": ["color-string@1.9.1", "", { "dependencies": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" } }, "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg=="],
+
+ "color-support": ["color-support@1.1.3", "", { "bin": { "color-support": "bin.js" } }, "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg=="],
+
+ "colors": ["colors@1.4.0", "", {}, "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA=="],
+
+ "colors-cli": ["colors-cli@1.0.33", "", { "bin": { "colors": "bin/colors" } }, "sha512-PWGsmoJFdOB0t+BeHgmtuoRZUQucOLl5ii81NBzOOGVxlgE04muFNHlR5j8i8MKbOPELBl3243AI6lGBTj5ICQ=="],
+
+ "colorspace": ["colorspace@1.1.4", "", { "dependencies": { "color": "^3.1.3", "text-hex": "1.0.x" } }, "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w=="],
+
+ "combined-stream": ["combined-stream@1.0.8", "", { "dependencies": { "delayed-stream": "~1.0.0" } }, "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="],
+
+ "command-exists": ["command-exists@1.2.9", "", {}, "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w=="],
+
+ "commander": ["commander@12.1.0", "", {}, "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA=="],
+
+ "commist": ["commist@3.2.0", "", {}, "sha512-4PIMoPniho+LqXmpS5d3NuGYncG6XWlkBSVGiWycL22dd42OYdUGil2CWuzklaJoNxyxUSpO4MKIBU94viWNAw=="],
+
+ "commondir": ["commondir@1.0.1", "", {}, "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg=="],
+
+ "component-type": ["component-type@1.2.2", "", {}, "sha512-99VUHREHiN5cLeHm3YLq312p6v+HUEcwtLCAtelvUDI6+SH5g5Cr85oNR2S1o6ywzL0ykMbuwLzM2ANocjEOIA=="],
+
+ "compressible": ["compressible@2.0.18", "", { "dependencies": { "mime-db": ">= 1.43.0 < 2" } }, "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg=="],
+
+ "compression": ["compression@1.8.0", "", { "dependencies": { "bytes": "3.1.2", "compressible": "~2.0.18", "debug": "2.6.9", "negotiator": "~0.6.4", "on-headers": "~1.0.2", "safe-buffer": "5.2.1", "vary": "~1.1.2" } }, "sha512-k6WLKfunuqCYD3t6AsuPGvQWaKwuLLh2/xHNcX4qE+vIfDNXpSqnrhwA7O53R7WVQUnt8dVAIW+YHr7xTgOgGA=="],
+
+ "concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="],
+
+ "concat-stream": ["concat-stream@2.0.0", "", { "dependencies": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.0.2", "typedarray": "^0.0.6" } }, "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A=="],
+
+ "connect": ["connect@3.7.0", "", { "dependencies": { "debug": "2.6.9", "finalhandler": "1.1.2", "parseurl": "~1.3.3", "utils-merge": "1.0.1" } }, "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ=="],
+
+ "convert-source-map": ["convert-source-map@1.9.0", "", {}, "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A=="],
+
+ "cookie": ["cookie@0.5.0", "", {}, "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw=="],
+
+ "core-js": ["core-js@3.40.0", "", {}, "sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ=="],
+
+ "core-js-compat": ["core-js-compat@3.40.0", "", { "dependencies": { "browserslist": "^4.24.3" } }, "sha512-0XEDpr5y5mijvw8Lbc6E5AkjrHfp7eEoPlu36SWeAbcL8fn1G1ANe8DBlo2XoNN89oVpxWwOjYIPVzR4ZvsKCQ=="],
+
+ "core-util-is": ["core-util-is@1.0.3", "", {}, "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="],
+
+ "cosmiconfig": ["cosmiconfig@7.1.0", "", { "dependencies": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", "parse-json": "^5.0.0", "path-type": "^4.0.0", "yaml": "^1.10.0" } }, "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA=="],
+
+ "create-require": ["create-require@1.1.1", "", {}, "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ=="],
+
+ "crelt": ["crelt@1.0.6", "", {}, "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g=="],
+
+ "cross-argv": ["cross-argv@2.0.0", "", {}, "sha512-YIaY9TR5Nxeb8SMdtrU8asWVM4jqJDNDYlKV21LxtYcfNJhp1kEsgSa6qXwXgzN0WQWGODps0+TlGp2xQSHwOg=="],
+
+ "cross-fetch": ["cross-fetch@3.2.0", "", { "dependencies": { "node-fetch": "^2.7.0" } }, "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q=="],
+
+ "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
+
+ "crypt": ["crypt@0.0.2", "", {}, "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow=="],
+
+ "crypto-js": ["crypto-js@4.2.0", "", {}, "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="],
+
+ "crypto-random-string": ["crypto-random-string@2.0.0", "", {}, "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA=="],
+
+ "css-color-keywords": ["css-color-keywords@1.0.0", "", {}, "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg=="],
+
+ "css-in-js-utils": ["css-in-js-utils@3.1.0", "", { "dependencies": { "hyphenate-style-name": "^1.0.3" } }, "sha512-fJAcud6B3rRu+KHYk+Bwf+WFL2MDCJJ1XG9x137tJQ0xYxor7XziQtuGFbWNdqrvF4Tk26O3H73nfVqXt/fW1A=="],
+
+ "css-to-react-native": ["css-to-react-native@3.2.0", "", { "dependencies": { "camelize": "^1.0.0", "css-color-keywords": "^1.0.0", "postcss-value-parser": "^4.0.2" } }, "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ=="],
+
+ "csscolorparser": ["csscolorparser@1.0.3", "", {}, "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w=="],
+
+ "cssesc": ["cssesc@3.0.0", "", { "bin": { "cssesc": "bin/cssesc" } }, "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg=="],
+
+ "csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
+
+ "damerau-levenshtein": ["damerau-levenshtein@1.0.8", "", {}, "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA=="],
+
+ "data-uri-to-buffer": ["data-uri-to-buffer@4.0.1", "", {}, "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A=="],
+
+ "data-view-buffer": ["data-view-buffer@1.0.2", "", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-data-view": "^1.0.2" } }, "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ=="],
+
+ "data-view-byte-length": ["data-view-byte-length@1.0.2", "", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-data-view": "^1.0.2" } }, "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ=="],
+
+ "data-view-byte-offset": ["data-view-byte-offset@1.0.1", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-data-view": "^1.0.1" } }, "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ=="],
+
+ "date-fns": ["date-fns@4.1.0", "", {}, "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg=="],
+
+ "dayjs": ["dayjs@1.11.13", "", {}, "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="],
+
+ "debug": ["debug@4.4.0", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA=="],
+
+ "decompress-response": ["decompress-response@6.0.0", "", { "dependencies": { "mimic-response": "^3.1.0" } }, "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ=="],
+
+ "dedent": ["dedent@1.5.3", "", { "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, "optionalPeers": ["babel-plugin-macros"] }, "sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ=="],
+
+ "deep-equal": ["deep-equal@1.1.2", "", { "dependencies": { "is-arguments": "^1.1.1", "is-date-object": "^1.0.5", "is-regex": "^1.1.4", "object-is": "^1.1.5", "object-keys": "^1.1.1", "regexp.prototype.flags": "^1.5.1" } }, "sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg=="],
+
+ "deep-extend": ["deep-extend@0.6.0", "", {}, "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="],
+
+ "deep-is": ["deep-is@0.1.4", "", {}, "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="],
+
+ "deepmerge": ["deepmerge@4.3.1", "", {}, "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="],
+
+ "default-gateway": ["default-gateway@4.2.0", "", { "dependencies": { "execa": "^1.0.0", "ip-regex": "^2.1.0" } }, "sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA=="],
+
+ "defaults": ["defaults@1.0.4", "", { "dependencies": { "clone": "^1.0.2" } }, "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A=="],
+
+ "define-data-property": ["define-data-property@1.1.4", "", { "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.0.1" } }, "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A=="],
+
+ "define-lazy-prop": ["define-lazy-prop@2.0.0", "", {}, "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og=="],
+
+ "define-properties": ["define-properties@1.2.1", "", { "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } }, "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg=="],
+
+ "del": ["del@6.1.1", "", { "dependencies": { "globby": "^11.0.1", "graceful-fs": "^4.2.4", "is-glob": "^4.0.1", "is-path-cwd": "^2.2.0", "is-path-inside": "^3.0.2", "p-map": "^4.0.0", "rimraf": "^3.0.2", "slash": "^3.0.0" } }, "sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg=="],
+
+ "delayed-stream": ["delayed-stream@1.0.0", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="],
+
+ "depd": ["depd@2.0.0", "", {}, "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="],
+
+ "dequal": ["dequal@2.0.3", "", {}, "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA=="],
+
+ "destroy": ["destroy@1.2.0", "", {}, "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="],
+
+ "detect-libc": ["detect-libc@2.0.3", "", {}, "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw=="],
+
+ "detect-node-es": ["detect-node-es@1.1.0", "", {}, "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ=="],
+
+ "dfa": ["dfa@1.2.0", "", {}, "sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q=="],
+
+ "didyoumean": ["didyoumean@1.2.2", "", {}, "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw=="],
+
+ "diff": ["diff@4.0.2", "", {}, "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A=="],
+
+ "dir-glob": ["dir-glob@3.0.1", "", { "dependencies": { "path-type": "^4.0.0" } }, "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA=="],
+
+ "directory-import": ["directory-import@3.3.2", "", {}, "sha512-dSApZXgx29qO/6AVigdsoC6HSvaHWinJ4HTRPKrlMAxX71FgPzn/WEWbgM+aB1PlKD9IfSC3Ir2ouYYQR1uy+g=="],
+
+ "dlv": ["dlv@1.1.3", "", {}, "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA=="],
+
+ "doctrine": ["doctrine@3.0.0", "", { "dependencies": { "esutils": "^2.0.2" } }, "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w=="],
+
+ "dom-helpers": ["dom-helpers@5.2.1", "", { "dependencies": { "@babel/runtime": "^7.8.7", "csstype": "^3.0.2" } }, "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA=="],
+
+ "dom-serializer": ["dom-serializer@1.4.1", "", { "dependencies": { "domelementtype": "^2.0.1", "domhandler": "^4.2.0", "entities": "^2.0.0" } }, "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag=="],
+
+ "domelementtype": ["domelementtype@2.3.0", "", {}, "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw=="],
+
+ "domhandler": ["domhandler@4.3.1", "", { "dependencies": { "domelementtype": "^2.2.0" } }, "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ=="],
+
+ "domutils": ["domutils@2.8.0", "", { "dependencies": { "dom-serializer": "^1.0.1", "domelementtype": "^2.2.0", "domhandler": "^4.2.0" } }, "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A=="],
+
+ "dotenv": ["dotenv@16.4.7", "", {}, "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ=="],
+
+ "dotenv-expand": ["dotenv-expand@11.0.7", "", { "dependencies": { "dotenv": "^16.4.5" } }, "sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA=="],
+
+ "drawille-blessed-contrib": ["drawille-blessed-contrib@1.0.0", "", {}, "sha512-WnHMgf5en/hVOsFhxLI8ZX0qTJmerOsVjIMQmn4cR1eI8nLGu+L7w5ENbul+lZ6w827A3JakCuernES5xbHLzQ=="],
+
+ "drawille-canvas-blessed-contrib": ["drawille-canvas-blessed-contrib@0.1.3", "", { "dependencies": { "ansi-term": ">=0.0.2", "bresenham": "0.0.3", "drawille-blessed-contrib": ">=0.0.1", "gl-matrix": "^2.1.0", "x256": ">=0.0.1" } }, "sha512-bdDvVJOxlrEoPLifGDPaxIzFh3cD7QH05ePoQ4fwnqfi08ZSxzEhOUpI5Z0/SQMlWgcCQOEtuw0zrwezacXglw=="],
+
+ "dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
+
+ "duplexer2": ["duplexer2@0.1.4", "", { "dependencies": { "readable-stream": "^2.0.2" } }, "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA=="],
+
+ "earcut": ["earcut@3.0.1", "", {}, "sha512-0l1/0gOjESMeQyYaK5IDiPNvFeu93Z/cO0TjZh9eZ1vyCtZnA7KMZ8rQggpsJHIbGSdrqYq9OhuveadOVHCshw=="],
+
+ "eastasianwidth": ["eastasianwidth@0.2.0", "", {}, "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="],
+
+ "ecdsa-sig-formatter": ["ecdsa-sig-formatter@1.0.11", "", { "dependencies": { "safe-buffer": "^5.0.1" } }, "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ=="],
+
+ "echarts": ["echarts@5.6.0", "", { "dependencies": { "tslib": "2.3.0", "zrender": "5.6.1" } }, "sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA=="],
+
+ "echarts-for-react": ["echarts-for-react@3.0.2", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "size-sensor": "^1.0.1" }, "peerDependencies": { "echarts": "^3.0.0 || ^4.0.0 || ^5.0.0", "react": "^15.0.0 || >=16.0.0" } }, "sha512-DRwIiTzx8JfwPOVgGttDytBqdp5VzCSyMRIxubgU/g2n9y3VLUmF2FK7Icmg/sNVkv4+rktmrLN9w22U2yy3fA=="],
+
+ "ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="],
+
+ "electron-to-chromium": ["electron-to-chromium@1.5.108", "", {}, "sha512-tiGxpQmvXBEzrfU5ertmbCV/nG5yqCkC1G4T1SIKP335Y5rjXzPWmijR6XcoGXZvVoo4dknfdNe4Tl7lcIROLg=="],
+
+ "embla-carousel": ["embla-carousel@8.5.2", "", {}, "sha512-xQ9oVLrun/eCG/7ru3R+I5bJ7shsD8fFwLEY7yPe27/+fDHCNj0OT5EoG5ZbFyOxOcG6yTwW8oTz/dWyFnyGpg=="],
+
+ "embla-carousel-react": ["embla-carousel-react@8.5.2", "", { "dependencies": { "embla-carousel": "8.5.2", "embla-carousel-reactive-utils": "8.5.2" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.1 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-Tmx+uY3MqseIGdwp0ScyUuxpBgx5jX1f7od4Cm5mDwg/dptEiTKf9xp6tw0lZN2VA9JbnVMl/aikmbc53c6QFA=="],
+
+ "embla-carousel-reactive-utils": ["embla-carousel-reactive-utils@8.5.2", "", { "peerDependencies": { "embla-carousel": "8.5.2" } }, "sha512-QC8/hYSK/pEmqEdU1IO5O+XNc/Ptmmq7uCB44vKplgLKhB/l0+yvYx0+Cv0sF6Ena8Srld5vUErZkT+yTahtDg=="],
+
+ "emoji-regex": ["emoji-regex@10.4.0", "", {}, "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw=="],
+
+ "enabled": ["enabled@2.0.0", "", {}, "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ=="],
+
+ "encodeurl": ["encodeurl@2.0.0", "", {}, "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="],
+
+ "end-of-stream": ["end-of-stream@1.4.4", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q=="],
+
+ "engine.io-client": ["engine.io-client@6.6.3", "", { "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1", "engine.io-parser": "~5.2.1", "ws": "~8.17.1", "xmlhttprequest-ssl": "~2.1.1" } }, "sha512-T0iLjnyNWahNyv/lcjS2y4oE358tVS/SYQNxYXGAJ9/GLgH4VCvOQ/mhTjqU88mLZCQgiG8RIegFHYCdVC+j5w=="],
+
+ "engine.io-parser": ["engine.io-parser@5.2.3", "", {}, "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q=="],
+
+ "enhanced-resolve": ["enhanced-resolve@5.18.1", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" } }, "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg=="],
+
+ "entities": ["entities@4.5.0", "", {}, "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw=="],
+
+ "env-editor": ["env-editor@0.4.2", "", {}, "sha512-ObFo8v4rQJAE59M69QzwloxPZtd33TpYEIjtKD1rrFDcM1Gd7IkDxEBU+HriziN6HSHQnBJi8Dmy+JWkav5HKA=="],
+
+ "eol": ["eol@0.9.1", "", {}, "sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg=="],
+
+ "error-ex": ["error-ex@1.3.2", "", { "dependencies": { "is-arrayish": "^0.2.1" } }, "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g=="],
+
+ "error-stack-parser": ["error-stack-parser@2.1.4", "", { "dependencies": { "stackframe": "^1.3.4" } }, "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ=="],
+
+ "es-abstract": ["es-abstract@1.23.9", "", { "dependencies": { "array-buffer-byte-length": "^1.0.2", "arraybuffer.prototype.slice": "^1.0.4", "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "call-bound": "^1.0.3", "data-view-buffer": "^1.0.2", "data-view-byte-length": "^1.0.2", "data-view-byte-offset": "^1.0.1", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "es-set-tostringtag": "^2.1.0", "es-to-primitive": "^1.3.0", "function.prototype.name": "^1.1.8", "get-intrinsic": "^1.2.7", "get-proto": "^1.0.0", "get-symbol-description": "^1.1.0", "globalthis": "^1.0.4", "gopd": "^1.2.0", "has-property-descriptors": "^1.0.2", "has-proto": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "internal-slot": "^1.1.0", "is-array-buffer": "^3.0.5", "is-callable": "^1.2.7", "is-data-view": "^1.0.2", "is-regex": "^1.2.1", "is-shared-array-buffer": "^1.0.4", "is-string": "^1.1.1", "is-typed-array": "^1.1.15", "is-weakref": "^1.1.0", "math-intrinsics": "^1.1.0", "object-inspect": "^1.13.3", "object-keys": "^1.1.1", "object.assign": "^4.1.7", "own-keys": "^1.0.1", "regexp.prototype.flags": "^1.5.3", "safe-array-concat": "^1.1.3", "safe-push-apply": "^1.0.0", "safe-regex-test": "^1.1.0", "set-proto": "^1.0.0", "string.prototype.trim": "^1.2.10", "string.prototype.trimend": "^1.0.9", "string.prototype.trimstart": "^1.0.8", "typed-array-buffer": "^1.0.3", "typed-array-byte-length": "^1.0.3", "typed-array-byte-offset": "^1.0.4", "typed-array-length": "^1.0.7", "unbox-primitive": "^1.1.0", "which-typed-array": "^1.1.18" } }, "sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA=="],
+
+ "es-array-method-boxes-properly": ["es-array-method-boxes-properly@1.0.0", "", {}, "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA=="],
+
+ "es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
+
+ "es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
+
+ "es-iterator-helpers": ["es-iterator-helpers@1.2.1", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-abstract": "^1.23.6", "es-errors": "^1.3.0", "es-set-tostringtag": "^2.0.3", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.6", "globalthis": "^1.0.4", "gopd": "^1.2.0", "has-property-descriptors": "^1.0.2", "has-proto": "^1.2.0", "has-symbols": "^1.1.0", "internal-slot": "^1.1.0", "iterator.prototype": "^1.1.4", "safe-array-concat": "^1.1.3" } }, "sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w=="],
+
+ "es-object-atoms": ["es-object-atoms@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA=="],
+
+ "es-set-tostringtag": ["es-set-tostringtag@2.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA=="],
+
+ "es-shim-unscopables": ["es-shim-unscopables@1.1.0", "", { "dependencies": { "hasown": "^2.0.2" } }, "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw=="],
+
+ "es-to-primitive": ["es-to-primitive@1.3.0", "", { "dependencies": { "is-callable": "^1.2.7", "is-date-object": "^1.0.5", "is-symbol": "^1.0.4" } }, "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g=="],
+
+ "es7-shim": ["es7-shim@6.0.0", "", { "dependencies": { "array-includes": "^3.0.2", "object.entries": "^1.0.3", "object.getownpropertydescriptors": "^2.0.2", "object.values": "^1.0.3", "string-at": "^1.0.1", "string.prototype.padend": "^3.0.0", "string.prototype.padstart": "^3.0.0", "string.prototype.trimleft": "^2.0.0", "string.prototype.trimright": "^2.0.0" } }, "sha512-aiQ/QyJBVJbabtsSediM1S4qI+P3p8F5J5YR5o/bH003BCnnclzxK9pi5Qd2Hg01ktAtZCaQBdejHrkOBGwf5Q=="],
+
+ "esbuild": ["esbuild@0.25.0", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.25.0", "@esbuild/android-arm": "0.25.0", "@esbuild/android-arm64": "0.25.0", "@esbuild/android-x64": "0.25.0", "@esbuild/darwin-arm64": "0.25.0", "@esbuild/darwin-x64": "0.25.0", "@esbuild/freebsd-arm64": "0.25.0", "@esbuild/freebsd-x64": "0.25.0", "@esbuild/linux-arm": "0.25.0", "@esbuild/linux-arm64": "0.25.0", "@esbuild/linux-ia32": "0.25.0", "@esbuild/linux-loong64": "0.25.0", "@esbuild/linux-mips64el": "0.25.0", "@esbuild/linux-ppc64": "0.25.0", "@esbuild/linux-riscv64": "0.25.0", "@esbuild/linux-s390x": "0.25.0", "@esbuild/linux-x64": "0.25.0", "@esbuild/netbsd-arm64": "0.25.0", "@esbuild/netbsd-x64": "0.25.0", "@esbuild/openbsd-arm64": "0.25.0", "@esbuild/openbsd-x64": "0.25.0", "@esbuild/sunos-x64": "0.25.0", "@esbuild/win32-arm64": "0.25.0", "@esbuild/win32-ia32": "0.25.0", "@esbuild/win32-x64": "0.25.0" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw=="],
+
+ "esbuild-register": ["esbuild-register@3.6.0", "", { "dependencies": { "debug": "^4.3.4" }, "peerDependencies": { "esbuild": ">=0.12 <1" } }, "sha512-H2/S7Pm8a9CL1uhp9OvjwrBh5Pvx0H8qVOxNu8Wed9Y7qv56MPtq+GGM8RJpq6glYJn9Wspr8uw7l55uyinNeg=="],
+
+ "escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="],
+
+ "escape-html": ["escape-html@1.0.3", "", {}, "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="],
+
+ "escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="],
+
+ "eslint": ["eslint@8.57.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", "@eslint/js": "8.57.1", "@humanwhocodes/config-array": "^0.13.0", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.2.2", "eslint-visitor-keys": "^3.4.3", "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.19.0", "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3", "strip-ansi": "^6.0.1", "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" } }, "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA=="],
+
+ "eslint-config-next": ["eslint-config-next@13.5.8", "", { "dependencies": { "@next/eslint-plugin-next": "13.5.8", "@rushstack/eslint-patch": "^1.3.3", "@typescript-eslint/parser": "^5.4.2 || ^6.0.0", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.28.1", "eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.5.0 || 5.0.0-canary-7118f5dd7-20230705" }, "peerDependencies": { "eslint": "^7.23.0 || ^8.0.0", "typescript": ">=3.3.1" }, "optionalPeers": ["typescript"] }, "sha512-EpNu08GB4KT377oDOQ6bi6icQFBgXcynqCE2neCu138k2Hsfr2i+5goUrRhz3YReDXB3YhelvQJLxm2apr3Gdw=="],
+
+ "eslint-import-resolver-node": ["eslint-import-resolver-node@0.3.9", "", { "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", "resolve": "^1.22.4" } }, "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g=="],
+
+ "eslint-import-resolver-typescript": ["eslint-import-resolver-typescript@3.8.3", "", { "dependencies": { "@nolyfill/is-core-module": "1.0.39", "debug": "^4.3.7", "enhanced-resolve": "^5.15.0", "get-tsconfig": "^4.10.0", "is-bun-module": "^1.0.2", "stable-hash": "^0.0.4", "tinyglobby": "^0.2.12" }, "peerDependencies": { "eslint": "*", "eslint-plugin-import": "*", "eslint-plugin-import-x": "*" }, "optionalPeers": ["eslint-plugin-import", "eslint-plugin-import-x"] }, "sha512-A0bu4Ks2QqDWNpeEgTQMPTngaMhuDu4yv6xpftBMAf+1ziXnpx+eSR1WRfoPTe2BAiAjHFZ7kSNx1fvr5g5pmQ=="],
+
+ "eslint-module-utils": ["eslint-module-utils@2.12.0", "", { "dependencies": { "debug": "^3.2.7" } }, "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg=="],
+
+ "eslint-plugin-import": ["eslint-plugin-import@2.31.0", "", { "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.8", "array.prototype.findlastindex": "^1.2.5", "array.prototype.flat": "^1.3.2", "array.prototype.flatmap": "^1.3.2", "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.9", "eslint-module-utils": "^2.12.0", "hasown": "^2.0.2", "is-core-module": "^2.15.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", "object.fromentries": "^2.0.8", "object.groupby": "^1.0.3", "object.values": "^1.2.0", "semver": "^6.3.1", "string.prototype.trimend": "^1.0.8", "tsconfig-paths": "^3.15.0" }, "peerDependencies": { "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A=="],
+
+ "eslint-plugin-jsx-a11y": ["eslint-plugin-jsx-a11y@6.10.2", "", { "dependencies": { "aria-query": "^5.3.2", "array-includes": "^3.1.8", "array.prototype.flatmap": "^1.3.2", "ast-types-flow": "^0.0.8", "axe-core": "^4.10.0", "axobject-query": "^4.1.0", "damerau-levenshtein": "^1.0.8", "emoji-regex": "^9.2.2", "hasown": "^2.0.2", "jsx-ast-utils": "^3.3.5", "language-tags": "^1.0.9", "minimatch": "^3.1.2", "object.fromentries": "^2.0.8", "safe-regex-test": "^1.0.3", "string.prototype.includes": "^2.0.1" }, "peerDependencies": { "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9" } }, "sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q=="],
+
+ "eslint-plugin-react": ["eslint-plugin-react@7.37.4", "", { "dependencies": { "array-includes": "^3.1.8", "array.prototype.findlast": "^1.2.5", "array.prototype.flatmap": "^1.3.3", "array.prototype.tosorted": "^1.1.4", "doctrine": "^2.1.0", "es-iterator-helpers": "^1.2.1", "estraverse": "^5.3.0", "hasown": "^2.0.2", "jsx-ast-utils": "^2.4.1 || ^3.0.0", "minimatch": "^3.1.2", "object.entries": "^1.1.8", "object.fromentries": "^2.0.8", "object.values": "^1.2.1", "prop-types": "^15.8.1", "resolve": "^2.0.0-next.5", "semver": "^6.3.1", "string.prototype.matchall": "^4.0.12", "string.prototype.repeat": "^1.0.0" }, "peerDependencies": { "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" } }, "sha512-BGP0jRmfYyvOyvMoRX/uoUeW+GqNj9y16bPQzqAHf3AYII/tDs+jMN0dBVkl88/OZwNGwrVFxE7riHsXVfy/LQ=="],
+
+ "eslint-plugin-react-hooks": ["eslint-plugin-react-hooks@4.6.2", "", { "peerDependencies": { "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" } }, "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ=="],
+
+ "eslint-scope": ["eslint-scope@7.2.2", "", { "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } }, "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg=="],
+
+ "eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="],
+
+ "espree": ["espree@9.6.1", "", { "dependencies": { "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.4.1" } }, "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ=="],
+
+ "esprima": ["esprima@4.0.1", "", { "bin": { "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" } }, "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="],
+
+ "esquery": ["esquery@1.6.0", "", { "dependencies": { "estraverse": "^5.1.0" } }, "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg=="],
+
+ "esrecurse": ["esrecurse@4.3.0", "", { "dependencies": { "estraverse": "^5.2.0" } }, "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag=="],
+
+ "estraverse": ["estraverse@5.3.0", "", {}, "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="],
+
+ "esutils": ["esutils@2.0.3", "", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="],
+
+ "etag": ["etag@1.8.1", "", {}, "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="],
+
+ "event-stream": ["event-stream@0.9.8", "", { "dependencies": { "optimist": "0.2" } }, "sha512-o5h0Mp1bkoR6B0i7pTCAzRy+VzdsRWH997KQD4Psb0EOPoKEIiaRx/EsOdUl7p1Ktjw7aIWvweI/OY1R9XrlUg=="],
+
+ "event-target-shim": ["event-target-shim@5.0.1", "", {}, "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="],
+
+ "eventemitter3": ["eventemitter3@2.0.3", "", {}, "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg=="],
+
+ "events": ["events@3.3.0", "", {}, "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q=="],
+
+ "exec-async": ["exec-async@2.2.0", "", {}, "sha512-87OpwcEiMia/DeiKFzaQNBNFeN3XkkpYIh9FyOqq5mS2oKv3CBE67PXoEKcr6nodWdXNogTiQ0jE2NGuoffXPw=="],
+
+ "execa": ["execa@1.0.0", "", { "dependencies": { "cross-spawn": "^6.0.0", "get-stream": "^4.0.0", "is-stream": "^1.1.0", "npm-run-path": "^2.0.0", "p-finally": "^1.0.0", "signal-exit": "^3.0.0", "strip-eof": "^1.0.0" } }, "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA=="],
+
+ "expand-template": ["expand-template@2.0.3", "", {}, "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg=="],
+
+ "expo": ["expo@52.0.37", "", { "dependencies": { "@babel/runtime": "^7.20.0", "@expo/cli": "0.22.18", "@expo/config": "~10.0.10", "@expo/config-plugins": "~9.0.15", "@expo/fingerprint": "0.11.11", "@expo/metro-config": "0.19.11", "@expo/vector-icons": "^14.0.0", "babel-preset-expo": "~12.0.9", "expo-asset": "~11.0.4", "expo-constants": "~17.0.7", "expo-file-system": "~18.0.11", "expo-font": "~13.0.4", "expo-keep-awake": "~14.0.3", "expo-modules-autolinking": "2.0.8", "expo-modules-core": "2.2.2", "fbemitter": "^3.0.0", "web-streams-polyfill": "^3.3.2", "whatwg-url-without-unicode": "8.0.0-3" }, "peerDependencies": { "@expo/dom-webview": "*", "@expo/metro-runtime": "*", "react": "*", "react-native": "*", "react-native-webview": "*" }, "optionalPeers": ["@expo/dom-webview", "@expo/metro-runtime", "react-native-webview"], "bin": { "expo": "bin/cli" } }, "sha512-fo37ClqjNLOVInerm7BU27H8lfPfeTC7Pmu72roPzq46DnJfs+KzTxTzE34GcJ0b6hMUx9FRSSGyTQqxzo2TVQ=="],
+
+ "expo-asset": ["expo-asset@11.0.4", "", { "dependencies": { "@expo/image-utils": "^0.6.5", "expo-constants": "~17.0.7", "invariant": "^2.2.4", "md5-file": "^3.2.3" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-CdIywU0HrR3wsW5c3n0cT3jW9hccZdnqGsRqY+EY/RWzJbDXtDfAQVEiFHO3mDK7oveUwrP2jK/6ZRNek41/sg=="],
+
+ "expo-constants": ["expo-constants@17.0.7", "", { "dependencies": { "@expo/config": "~10.0.10", "@expo/env": "~0.4.2" }, "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-sp5NUiV17I3JblVPIBDgoxgt7JIZS30vcyydCYHxsEoo+aKaeRYXxGYilCvb9lgI6BBwSL24sQ6ZjWsCWoF1VA=="],
+
+ "expo-file-system": ["expo-file-system@18.0.11", "", { "dependencies": { "web-streams-polyfill": "^3.3.2" }, "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-yDwYfEzWgPXsBZHJW2RJ8Q66ceiFN9Wa5D20pp3fjXVkzPBDwxnYwiPWk4pVmCa5g4X5KYMoMne1pUrsL4OEpg=="],
+
+ "expo-font": ["expo-font@13.0.4", "", { "dependencies": { "fontfaceobserver": "^2.1.0" }, "peerDependencies": { "expo": "*", "react": "*" } }, "sha512-eAP5hyBgC8gafFtprsz0HMaB795qZfgJWqTmU0NfbSin1wUuVySFMEPMOrTkTgmazU73v4Cb4x7p86jY1XXYUw=="],
+
+ "expo-keep-awake": ["expo-keep-awake@14.0.3", "", { "peerDependencies": { "expo": "*", "react": "*" } }, "sha512-6Jh94G6NvTZfuLnm2vwIpKe3GdOiVBuISl7FI8GqN0/9UOg9E0WXXp5cDcfAG8bn80RfgLJS8P7EPUGTZyOvhg=="],
+
+ "expo-modules-autolinking": ["expo-modules-autolinking@2.0.8", "", { "dependencies": { "@expo/spawn-async": "^1.7.2", "chalk": "^4.1.0", "commander": "^7.2.0", "fast-glob": "^3.2.5", "find-up": "^5.0.0", "fs-extra": "^9.1.0", "require-from-string": "^2.0.2", "resolve-from": "^5.0.0" }, "bin": { "expo-modules-autolinking": "bin/expo-modules-autolinking.js" } }, "sha512-DezgnEYFQYic8hKGhkbztBA3QUmSftjaNDIKNAtS2iGJmzCcNIkatjN2slFDSWjSTNo8gOvPQyMKfyHWFvLpOQ=="],
+
+ "expo-modules-core": ["expo-modules-core@2.2.2", "", { "dependencies": { "invariant": "^2.2.4" } }, "sha512-SgjK86UD89gKAscRK3bdpn6Ojfs/KU4GujtuFx1wm4JaBjmXH4aakWkItkPlAV2pjIiHJHWQbENL9xjbw/Qr/g=="],
+
+ "exponential-backoff": ["exponential-backoff@3.1.2", "", {}, "sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA=="],
+
+ "extend": ["extend@3.0.2", "", {}, "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="],
+
+ "extend-shallow": ["extend-shallow@2.0.1", "", { "dependencies": { "is-extendable": "^0.1.0" } }, "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug=="],
+
+ "fast-content-type-parse": ["fast-content-type-parse@2.0.1", "", {}, "sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q=="],
+
+ "fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="],
+
+ "fast-diff": ["fast-diff@1.1.2", "", {}, "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig=="],
+
+ "fast-glob": ["fast-glob@3.3.3", "", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" } }, "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg=="],
+
+ "fast-json-stable-stringify": ["fast-json-stable-stringify@2.1.0", "", {}, "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="],
+
+ "fast-levenshtein": ["fast-levenshtein@2.0.6", "", {}, "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="],
+
+ "fast-loops": ["fast-loops@1.1.4", "", {}, "sha512-8dbd3XWoKCTms18ize6JmQF1SFnnfj5s0B7rRry22EofgMu7B6LKHVh+XfFqFGsqnbH54xgeO83PzpKI+ODhlg=="],
+
+ "fast-unique-numbers": ["fast-unique-numbers@8.0.13", "", { "dependencies": { "@babel/runtime": "^7.23.8", "tslib": "^2.6.2" } }, "sha512-7OnTFAVPefgw2eBJ1xj2PGGR9FwYzSUso9decayHgCDX4sJkHLdcsYTytTg+tYv+wKF3U8gJuSBz2jJpQV4u/g=="],
+
+ "fastq": ["fastq@1.19.1", "", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ=="],
+
+ "fb-watchman": ["fb-watchman@2.0.2", "", { "dependencies": { "bser": "2.1.1" } }, "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA=="],
+
+ "fbemitter": ["fbemitter@3.0.0", "", { "dependencies": { "fbjs": "^3.0.0" } }, "sha512-KWKaceCwKQU0+HPoop6gn4eOHk50bBv/VxjJtGMfwmJt3D29JpN4H4eisCtIPA+a8GVBam+ldMMpMjJUvpDyHw=="],
+
+ "fbjs": ["fbjs@3.0.5", "", { "dependencies": { "cross-fetch": "^3.1.5", "fbjs-css-vars": "^1.0.0", "loose-envify": "^1.0.0", "object-assign": "^4.1.0", "promise": "^7.1.1", "setimmediate": "^1.0.5", "ua-parser-js": "^1.0.35" } }, "sha512-ztsSx77JBtkuMrEypfhgc3cI0+0h+svqeie7xHbh1k/IKdcydnvadp/mUaGgjAOXQmQSxsqgaRhS3q9fy+1kxg=="],
+
+ "fbjs-css-vars": ["fbjs-css-vars@1.0.2", "", {}, "sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ=="],
+
+ "fdir": ["fdir@6.4.3", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw=="],
+
+ "fecha": ["fecha@4.2.3", "", {}, "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw=="],
+
+ "fetch-blob": ["fetch-blob@3.2.0", "", { "dependencies": { "node-domexception": "^1.0.0", "web-streams-polyfill": "^3.0.3" } }, "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ=="],
+
+ "fetch-retry": ["fetch-retry@4.1.1", "", {}, "sha512-e6eB7zN6UBSwGVwrbWVH+gdLnkW9WwHhmq2YDK1Sh30pzx1onRVGBvogTlUeWxwTa+L86NYdo4hFkh7O8ZjSnA=="],
+
+ "file-entry-cache": ["file-entry-cache@6.0.1", "", { "dependencies": { "flat-cache": "^3.0.4" } }, "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg=="],
+
+ "file-stream-rotator": ["file-stream-rotator@0.6.1", "", { "dependencies": { "moment": "^2.29.1" } }, "sha512-u+dBid4PvZw17PmDeRcNOtCP9CCK/9lRN2w+r1xIS7yOL9JFrIBKTvrYsxT4P0pGtThYTn++QS5ChHaUov3+zQ=="],
+
+ "fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="],
+
+ "finalhandler": ["finalhandler@1.1.2", "", { "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "on-finished": "~2.3.0", "parseurl": "~1.3.3", "statuses": "~1.5.0", "unpipe": "~1.0.0" } }, "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA=="],
+
+ "find-cache-dir": ["find-cache-dir@2.1.0", "", { "dependencies": { "commondir": "^1.0.1", "make-dir": "^2.0.0", "pkg-dir": "^3.0.0" } }, "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ=="],
+
+ "find-root": ["find-root@1.1.0", "", {}, "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng=="],
+
+ "find-up": ["find-up@5.0.0", "", { "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="],
+
+ "flat-cache": ["flat-cache@3.2.0", "", { "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.3", "rimraf": "^3.0.2" } }, "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw=="],
+
+ "flatbuffers": ["flatbuffers@25.2.10", "", {}, "sha512-7JlN9ZvLDG1McO3kbX0k4v+SUAg48L1rIwEvN6ZQl/eCtgJz9UylTMzE9wrmYrcorgxm3CX/3T/w5VAub99UUw=="],
+
+ "flatted": ["flatted@3.3.3", "", {}, "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg=="],
+
+ "flow-enums-runtime": ["flow-enums-runtime@0.0.6", "", {}, "sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw=="],
+
+ "flow-parser": ["flow-parser@0.262.0", "", {}, "sha512-K3asSw4s2/sRoUC4xD2OfGi04gdYCCFRgkcwEXi5JyfFhS0HrFWLcDPp55ttv95OY5970WKl4T+7hWrnuOAUMQ=="],
+
+ "fn.name": ["fn.name@1.1.0", "", {}, "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="],
+
+ "follow-redirects": ["follow-redirects@1.15.9", "", {}, "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ=="],
+
+ "fontfaceobserver": ["fontfaceobserver@2.3.0", "", {}, "sha512-6FPvD/IVyT4ZlNe7Wcn5Fb/4ChigpucKYSvD6a+0iMoLn2inpo711eyIcKjmDtE5XNcgAkSH9uN/nfAeZzHEfg=="],
+
+ "fontkit": ["fontkit@2.0.4", "", { "dependencies": { "@swc/helpers": "^0.5.12", "brotli": "^1.3.2", "clone": "^2.1.2", "dfa": "^1.2.0", "fast-deep-equal": "^3.1.3", "restructure": "^3.0.0", "tiny-inflate": "^1.0.3", "unicode-properties": "^1.4.0", "unicode-trie": "^2.0.0" } }, "sha512-syetQadaUEDNdxdugga9CpEYVaQIxOwk7GlwZWWZ19//qW4zE5bknOKeMBDYAASwnpaSHKJITRLMF9m1fp3s6g=="],
+
+ "for-each": ["for-each@0.3.5", "", { "dependencies": { "is-callable": "^1.2.7" } }, "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg=="],
+
+ "foreground-child": ["foreground-child@3.3.1", "", { "dependencies": { "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" } }, "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw=="],
+
+ "form-data": ["form-data@4.0.2", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" } }, "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w=="],
+
+ "form-data-encoder": ["form-data-encoder@1.7.2", "", {}, "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A=="],
+
+ "formdata-node": ["formdata-node@4.4.1", "", { "dependencies": { "node-domexception": "1.0.0", "web-streams-polyfill": "4.0.0-beta.3" } }, "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ=="],
+
+ "formdata-polyfill": ["formdata-polyfill@4.0.10", "", { "dependencies": { "fetch-blob": "^3.1.2" } }, "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g=="],
+
+ "fraction.js": ["fraction.js@4.3.7", "", {}, "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew=="],
+
+ "freeport-async": ["freeport-async@2.0.0", "", {}, "sha512-K7od3Uw45AJg00XUmy15+Hae2hOcgKcmN3/EF6Y7i01O0gaqiRx8sUSpsb9+BRNL8RPBrhzPsVfy8q9ADlJuWQ=="],
+
+ "fresh": ["fresh@0.5.2", "", {}, "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="],
+
+ "fs-constants": ["fs-constants@1.0.0", "", {}, "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="],
+
+ "fs-extra": ["fs-extra@8.1.0", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" } }, "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g=="],
+
+ "fs-minipass": ["fs-minipass@3.0.3", "", { "dependencies": { "minipass": "^7.0.3" } }, "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw=="],
+
+ "fs.realpath": ["fs.realpath@1.0.0", "", {}, "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="],
+
+ "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
+
+ "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
+
+ "function.prototype.name": ["function.prototype.name@1.1.8", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "functions-have-names": "^1.2.3", "hasown": "^2.0.2", "is-callable": "^1.2.7" } }, "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q=="],
+
+ "functions-have-names": ["functions-have-names@1.2.3", "", {}, "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ=="],
+
+ "gensync": ["gensync@1.0.0-beta.2", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="],
+
+ "geojson-vt": ["geojson-vt@4.0.2", "", {}, "sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A=="],
+
+ "get-caller-file": ["get-caller-file@2.0.5", "", {}, "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="],
+
+ "get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
+
+ "get-nonce": ["get-nonce@1.0.1", "", {}, "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q=="],
+
+ "get-package-type": ["get-package-type@0.1.0", "", {}, "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q=="],
+
+ "get-port": ["get-port@3.2.0", "", {}, "sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg=="],
+
+ "get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
+
+ "get-stream": ["get-stream@4.1.0", "", { "dependencies": { "pump": "^3.0.0" } }, "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w=="],
+
+ "get-symbol-description": ["get-symbol-description@1.1.0", "", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6" } }, "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg=="],
+
+ "get-tsconfig": ["get-tsconfig@4.10.0", "", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A=="],
+
+ "get-value": ["get-value@2.0.6", "", {}, "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA=="],
+
+ "getenv": ["getenv@1.0.0", "", {}, "sha512-7yetJWqbS9sbn0vIfliPsFgoXMKn/YMF+Wuiog97x+urnSRRRZ7xB+uVkwGKzRgq9CDFfMQnE9ruL5DHv9c6Xg=="],
+
+ "github-from-package": ["github-from-package@0.0.0", "", {}, "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="],
+
+ "gl-matrix": ["gl-matrix@3.4.3", "", {}, "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA=="],
+
+ "glob": ["glob@7.1.7", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ=="],
+
+ "glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="],
+
+ "glob-to-regexp": ["glob-to-regexp@0.4.1", "", {}, "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw=="],
+
+ "globals": ["globals@13.24.0", "", { "dependencies": { "type-fest": "^0.20.2" } }, "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ=="],
+
+ "globalthis": ["globalthis@1.0.4", "", { "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" } }, "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ=="],
+
+ "globby": ["globby@11.1.0", "", { "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", "fast-glob": "^3.2.9", "ignore": "^5.2.0", "merge2": "^1.4.1", "slash": "^3.0.0" } }, "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g=="],
+
+ "gm": ["gm@1.25.1", "", { "dependencies": { "array-parallel": "~0.1.3", "array-series": "~0.1.5", "cross-spawn": "^7.0.5", "debug": "^3.1.0" } }, "sha512-jgcs2vKir9hFogGhXIfs0ODhJTfIrbECCehg38tqFgHm8zqXx7kAJyCYAFK4jTjx71AxrkFtkJBawbAxYUPX9A=="],
+
+ "gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
+
+ "gpt-3-encoder": ["gpt-3-encoder@1.1.4", "", {}, "sha512-fSQRePV+HUAhCn7+7HL7lNIXNm6eaFWFbNLOOGtmSJ0qJycyQvj60OvRlH7mee8xAMjBDNRdMXlMwjAbMTDjkg=="],
+
+ "graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
+
+ "graphemer": ["graphemer@1.4.0", "", {}, "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag=="],
+
+ "grid-index": ["grid-index@1.1.0", "", {}, "sha512-HZRwumpOGUrHyxO5bqKZL0B0GlUpwtCAzZ42sgxUPniu33R1LSFH5yrIcBCHjkctCAh3mtWKcKd9J4vDDdeVHA=="],
+
+ "guid-typescript": ["guid-typescript@1.0.9", "", {}, "sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ=="],
+
+ "has-ansi": ["has-ansi@2.0.0", "", { "dependencies": { "ansi-regex": "^2.0.0" } }, "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg=="],
+
+ "has-async-hooks": ["has-async-hooks@1.0.0", "", {}, "sha512-YF0VPGjkxr7AyyQQNykX8zK4PvtEDsUJAPqwu06UFz1lb6EvI53sPh5H1kWxg8NXI5LsfRCZ8uX9NkYDZBb/mw=="],
+
+ "has-bigints": ["has-bigints@1.1.0", "", {}, "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg=="],
+
+ "has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="],
+
+ "has-property-descriptors": ["has-property-descriptors@1.0.2", "", { "dependencies": { "es-define-property": "^1.0.0" } }, "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg=="],
+
+ "has-proto": ["has-proto@1.2.0", "", { "dependencies": { "dunder-proto": "^1.0.0" } }, "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ=="],
+
+ "has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
+
+ "has-tostringtag": ["has-tostringtag@1.0.2", "", { "dependencies": { "has-symbols": "^1.0.3" } }, "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw=="],
+
+ "hash.js": ["hash.js@1.1.7", "", { "dependencies": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" } }, "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA=="],
+
+ "hasown": ["hasown@2.0.2", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="],
+
+ "hdr-histogram-js": ["hdr-histogram-js@3.0.0", "", { "dependencies": { "@assemblyscript/loader": "^0.19.21", "base64-js": "^1.2.0", "pako": "^1.0.3" } }, "sha512-/EpvQI2/Z98mNFYEnlqJ8Ogful8OpArLG/6Tf2bPnkutBVLIeMVNHjk1ZDfshF2BUweipzbk+dB1hgSB7SIakw=="],
+
+ "hdr-histogram-percentiles-obj": ["hdr-histogram-percentiles-obj@3.0.0", "", {}, "sha512-7kIufnBqdsBGcSZLPJwqHT3yhk1QTsSlFsVD3kx5ixH/AlgBs9yM1q6DPhXZ8f8gtdqgh7N7/5btRLpQsS2gHw=="],
+
+ "help-me": ["help-me@5.0.0", "", {}, "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg=="],
+
+ "here": ["here@0.0.2", "", {}, "sha512-U7VYImCTcPoY27TSmzoiFsmWLEqQFaYNdpsPb9K0dXJhE6kufUqycaz51oR09CW85dDU9iWyy7At8M+p7hb3NQ=="],
+
+ "hermes-estree": ["hermes-estree@0.25.1", "", {}, "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw=="],
+
+ "hermes-parser": ["hermes-parser@0.25.1", "", { "dependencies": { "hermes-estree": "0.25.1" } }, "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA=="],
+
+ "hoist-non-react-statics": ["hoist-non-react-statics@3.3.2", "", { "dependencies": { "react-is": "^16.7.0" } }, "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw=="],
+
+ "hosted-git-info": ["hosted-git-info@7.0.2", "", { "dependencies": { "lru-cache": "^10.0.1" } }, "sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w=="],
+
+ "hsl-to-hex": ["hsl-to-hex@1.0.0", "", { "dependencies": { "hsl-to-rgb-for-reals": "^1.1.0" } }, "sha512-K6GVpucS5wFf44X0h2bLVRDsycgJmf9FF2elg+CrqD8GcFU8c6vYhgXn8NjUkFCwj+xDFb70qgLbTUm6sxwPmA=="],
+
+ "hsl-to-rgb-for-reals": ["hsl-to-rgb-for-reals@1.1.1", "", {}, "sha512-LgOWAkrN0rFaQpfdWBQlv/VhkOxb5AsBjk6NQVx4yEzWS923T07X0M1Y0VNko2H52HeSpZrZNNMJ0aFqsdVzQg=="],
+
+ "html-dom-parser": ["html-dom-parser@1.2.0", "", { "dependencies": { "domhandler": "4.3.1", "htmlparser2": "7.2.0" } }, "sha512-2HIpFMvvffsXHFUFjso0M9LqM+1Lm22BF+Df2ba+7QHJXjk63pWChEnI6YG27eaWqUdfnh5/Vy+OXrNTtepRsg=="],
+
+ "html-react-parser": ["html-react-parser@1.4.12", "", { "dependencies": { "domhandler": "4.3.1", "html-dom-parser": "1.2.0", "react-property": "2.0.0", "style-to-js": "1.1.0" }, "peerDependencies": { "react": "0.14 || 15 || 16 || 17 || 18" } }, "sha512-nqYQzr4uXh67G9ejAG7djupTHmQvSTgjY83zbXLRfKHJ0F06751jXx6WKSFARDdXxCngo2/7H4Rwtfeowql4gQ=="],
+
+ "html-tokenize": ["html-tokenize@2.0.1", "", { "dependencies": { "buffer-from": "~0.1.1", "inherits": "~2.0.1", "minimist": "~1.2.5", "readable-stream": "~1.0.27-1", "through2": "~0.4.1" }, "bin": { "html-tokenize": "bin/cmd.js" } }, "sha512-QY6S+hZ0f5m1WT8WffYN+Hg+xm/w5I8XeUcAq/ZYP5wVC8xbKi4Whhru3FtrAebD5EhBW8rmFzkDI6eCAuFe2w=="],
+
+ "htmlparser2": ["htmlparser2@7.2.0", "", { "dependencies": { "domelementtype": "^2.0.1", "domhandler": "^4.2.2", "domutils": "^2.8.0", "entities": "^3.0.1" } }, "sha512-H7MImA4MS6cw7nbyURtLPO1Tms7C5H602LRETv95z1MxO/7CP7rDVROehUYeYBUYEON94NXXDEPmZuq+hX4sog=="],
+
+ "http-errors": ["http-errors@2.0.0", "", { "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", "statuses": "2.0.1", "toidentifier": "1.0.1" } }, "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ=="],
+
+ "http-parser-js": ["http-parser-js@0.5.9", "", {}, "sha512-n1XsPy3rXVxlqxVioEWdC+0+M+SQw0DpJynwtOPo1X+ZlvdzTLtDBIJJlDQTnwZIFJrZSzSGmIOUdP8tu+SgLw=="],
+
+ "http_ece": ["http_ece@1.2.0", "", {}, "sha512-JrF8SSLVmcvc5NducxgyOrKXe3EsyHMgBFgSaIUGmArKe+rwr0uphRkRXvwiom3I+fpIfoItveHrfudL8/rxuA=="],
+
+ "https-proxy-agent": ["https-proxy-agent@7.0.6", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="],
+
+ "humanize-ms": ["humanize-ms@1.2.1", "", { "dependencies": { "ms": "^2.0.0" } }, "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ=="],
+
+ "hyperid": ["hyperid@3.3.0", "", { "dependencies": { "buffer": "^5.2.1", "uuid": "^8.3.2", "uuid-parse": "^1.1.0" } }, "sha512-7qhCVT4MJIoEsNcbhglhdmBKb09QtcmJNiIQGq7js/Khf5FtQQ9bzcAuloeqBeee7XD7JqDeve9KNlQya5tSGQ=="],
+
+ "hyphen": ["hyphen@1.10.6", "", {}, "sha512-fXHXcGFTXOvZTSkPJuGOQf5Lv5T/R2itiiCVPg9LxAje5D00O0pP83yJShFq5V89Ly//Gt6acj7z8pbBr34stw=="],
+
+ "hyphenate-style-name": ["hyphenate-style-name@1.1.0", "", {}, "sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw=="],
+
+ "ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="],
+
+ "ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="],
+
+ "image-size": ["image-size@1.2.0", "", { "dependencies": { "queue": "6.0.2" }, "bin": { "image-size": "bin/image-size.js" } }, "sha512-4S8fwbO6w3GeCVN6OPtA9I5IGKkcDMPcKndtUlpJuCwu7JLjtj7JZpwqLuyY2nrmQT3AWsCJLSKPsc2mPBSl3w=="],
+
+ "import-fresh": ["import-fresh@3.3.1", "", { "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ=="],
+
+ "imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="],
+
+ "indent-string": ["indent-string@4.0.0", "", {}, "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg=="],
+
+ "inflight": ["inflight@1.0.6", "", { "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA=="],
+
+ "inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],
+
+ "ini": ["ini@1.3.8", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="],
+
+ "inline-style-parser": ["inline-style-parser@0.1.1", "", {}, "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q=="],
+
+ "inline-style-prefixer": ["inline-style-prefixer@6.0.4", "", { "dependencies": { "css-in-js-utils": "^3.1.0", "fast-loops": "^1.1.3" } }, "sha512-FwXmZC2zbeeS7NzGjJ6pAiqRhXR0ugUShSNb6GApMl6da0/XGc4MOJsoWAywia52EEWbXNSy0pzkwz/+Y+swSg=="],
+
+ "internal-ip": ["internal-ip@4.3.0", "", { "dependencies": { "default-gateway": "^4.2.0", "ipaddr.js": "^1.9.0" } }, "sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg=="],
+
+ "internal-slot": ["internal-slot@1.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.2", "side-channel": "^1.1.0" } }, "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw=="],
+
+ "invariant": ["invariant@2.2.4", "", { "dependencies": { "loose-envify": "^1.0.0" } }, "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA=="],
+
+ "ip-regex": ["ip-regex@2.1.0", "", {}, "sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw=="],
+
+ "ipaddr.js": ["ipaddr.js@1.9.1", "", {}, "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="],
+
+ "iron-session": ["iron-session@6.3.1", "", { "dependencies": { "@peculiar/webcrypto": "^1.4.0", "@types/cookie": "^0.5.1", "@types/express": "^4.17.13", "@types/koa": "^2.13.5", "@types/node": "^17.0.41", "cookie": "^0.5.0", "iron-webcrypto": "^0.2.5" }, "peerDependencies": { "express": ">=4", "koa": ">=2", "next": ">=10" }, "optionalPeers": ["express", "koa", "next"] }, "sha512-3UJ7y2vk/WomAtEySmPgM6qtYF1cZ3tXuWX5GsVX4PJXAcs5y/sV9HuSfpjKS6HkTL/OhZcTDWJNLZ7w+Erx3A=="],
+
+ "iron-webcrypto": ["iron-webcrypto@0.2.8", "", { "dependencies": { "buffer": "^6" } }, "sha512-YPdCvjFMOBjXaYuDj5tiHst5CEk6Xw84Jo8Y2+jzhMceclAnb3+vNPP/CTtb5fO2ZEuXEaO4N+w62Vfko757KA=="],
+
+ "is-arguments": ["is-arguments@1.2.0", "", { "dependencies": { "call-bound": "^1.0.2", "has-tostringtag": "^1.0.2" } }, "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA=="],
+
+ "is-array-buffer": ["is-array-buffer@3.0.5", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "get-intrinsic": "^1.2.6" } }, "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A=="],
+
+ "is-arrayish": ["is-arrayish@0.3.2", "", {}, "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="],
+
+ "is-async-function": ["is-async-function@2.1.1", "", { "dependencies": { "async-function": "^1.0.0", "call-bound": "^1.0.3", "get-proto": "^1.0.1", "has-tostringtag": "^1.0.2", "safe-regex-test": "^1.1.0" } }, "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ=="],
+
+ "is-bigint": ["is-bigint@1.1.0", "", { "dependencies": { "has-bigints": "^1.0.2" } }, "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ=="],
+
+ "is-binary-path": ["is-binary-path@2.1.0", "", { "dependencies": { "binary-extensions": "^2.0.0" } }, "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw=="],
+
+ "is-boolean-object": ["is-boolean-object@1.2.2", "", { "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" } }, "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A=="],
+
+ "is-buffer": ["is-buffer@1.1.6", "", {}, "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="],
+
+ "is-bun-module": ["is-bun-module@1.3.0", "", { "dependencies": { "semver": "^7.6.3" } }, "sha512-DgXeu5UWI0IsMQundYb5UAOzm6G2eVnarJ0byP6Tm55iZNKceD59LNPA2L4VvsScTtHcw0yEkVwSf7PC+QoLSA=="],
+
+ "is-callable": ["is-callable@1.2.7", "", {}, "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA=="],
+
+ "is-core-module": ["is-core-module@2.16.1", "", { "dependencies": { "hasown": "^2.0.2" } }, "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w=="],
+
+ "is-data-view": ["is-data-view@1.0.2", "", { "dependencies": { "call-bound": "^1.0.2", "get-intrinsic": "^1.2.6", "is-typed-array": "^1.1.13" } }, "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw=="],
+
+ "is-date-object": ["is-date-object@1.1.0", "", { "dependencies": { "call-bound": "^1.0.2", "has-tostringtag": "^1.0.2" } }, "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg=="],
+
+ "is-directory": ["is-directory@0.3.1", "", {}, "sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw=="],
+
+ "is-docker": ["is-docker@2.2.1", "", { "bin": { "is-docker": "cli.js" } }, "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ=="],
+
+ "is-extendable": ["is-extendable@0.1.1", "", {}, "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw=="],
+
+ "is-extglob": ["is-extglob@2.1.1", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="],
+
+ "is-finalizationregistry": ["is-finalizationregistry@1.1.1", "", { "dependencies": { "call-bound": "^1.0.3" } }, "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg=="],
+
+ "is-fullwidth-code-point": ["is-fullwidth-code-point@3.0.0", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="],
+
+ "is-generator-function": ["is-generator-function@1.1.0", "", { "dependencies": { "call-bound": "^1.0.3", "get-proto": "^1.0.0", "has-tostringtag": "^1.0.2", "safe-regex-test": "^1.1.0" } }, "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ=="],
+
+ "is-glob": ["is-glob@4.0.3", "", { "dependencies": { "is-extglob": "^2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="],
+
+ "is-map": ["is-map@2.0.3", "", {}, "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw=="],
+
+ "is-number": ["is-number@7.0.0", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="],
+
+ "is-number-object": ["is-number-object@1.1.1", "", { "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" } }, "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw=="],
+
+ "is-path-cwd": ["is-path-cwd@2.2.0", "", {}, "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ=="],
+
+ "is-path-inside": ["is-path-inside@3.0.3", "", {}, "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ=="],
+
+ "is-plain-object": ["is-plain-object@2.0.4", "", { "dependencies": { "isobject": "^3.0.1" } }, "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og=="],
+
+ "is-regex": ["is-regex@1.2.1", "", { "dependencies": { "call-bound": "^1.0.2", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g=="],
+
+ "is-set": ["is-set@2.0.3", "", {}, "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg=="],
+
+ "is-shared-array-buffer": ["is-shared-array-buffer@1.0.4", "", { "dependencies": { "call-bound": "^1.0.3" } }, "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A=="],
+
+ "is-stream": ["is-stream@2.0.1", "", {}, "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg=="],
+
+ "is-string": ["is-string@1.1.1", "", { "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" } }, "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA=="],
+
+ "is-symbol": ["is-symbol@1.1.1", "", { "dependencies": { "call-bound": "^1.0.2", "has-symbols": "^1.1.0", "safe-regex-test": "^1.1.0" } }, "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w=="],
+
+ "is-typed-array": ["is-typed-array@1.1.15", "", { "dependencies": { "which-typed-array": "^1.1.16" } }, "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ=="],
+
+ "is-url": ["is-url@1.2.4", "", {}, "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww=="],
+
+ "is-weakmap": ["is-weakmap@2.0.2", "", {}, "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w=="],
+
+ "is-weakref": ["is-weakref@1.1.1", "", { "dependencies": { "call-bound": "^1.0.3" } }, "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew=="],
+
+ "is-weakset": ["is-weakset@2.0.4", "", { "dependencies": { "call-bound": "^1.0.3", "get-intrinsic": "^1.2.6" } }, "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ=="],
+
+ "is-wsl": ["is-wsl@2.2.0", "", { "dependencies": { "is-docker": "^2.0.0" } }, "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww=="],
+
+ "isarray": ["isarray@0.0.1", "", {}, "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="],
+
+ "isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="],
+
+ "isobject": ["isobject@3.0.1", "", {}, "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg=="],
+
+ "istanbul-lib-coverage": ["istanbul-lib-coverage@3.2.2", "", {}, "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg=="],
+
+ "istanbul-lib-instrument": ["istanbul-lib-instrument@5.2.1", "", { "dependencies": { "@babel/core": "^7.12.3", "@babel/parser": "^7.14.7", "@istanbuljs/schema": "^0.1.2", "istanbul-lib-coverage": "^3.2.0", "semver": "^6.3.0" } }, "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg=="],
+
+ "iterator.prototype": ["iterator.prototype@1.1.5", "", { "dependencies": { "define-data-property": "^1.1.4", "es-object-atoms": "^1.0.0", "get-intrinsic": "^1.2.6", "get-proto": "^1.0.0", "has-symbols": "^1.1.0", "set-function-name": "^2.0.2" } }, "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g=="],
+
+ "jackspeak": ["jackspeak@3.4.3", "", { "dependencies": { "@isaacs/cliui": "^8.0.2" }, "optionalDependencies": { "@pkgjs/parseargs": "^0.11.0" } }, "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw=="],
+
+ "jay-peg": ["jay-peg@1.1.1", "", { "dependencies": { "restructure": "^3.0.0" } }, "sha512-D62KEuBxz/ip2gQKOEhk/mx14o7eiFRaU+VNNSP4MOiIkwb/D6B3G1Mfas7C/Fit8EsSV2/IWjZElx/Gs6A4ww=="],
+
+ "jest-environment-node": ["jest-environment-node@29.7.0", "", { "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "jest-mock": "^29.7.0", "jest-util": "^29.7.0" } }, "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw=="],
+
+ "jest-get-type": ["jest-get-type@29.6.3", "", {}, "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw=="],
+
+ "jest-haste-map": ["jest-haste-map@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", "graceful-fs": "^4.2.9", "jest-regex-util": "^29.6.3", "jest-util": "^29.7.0", "jest-worker": "^29.7.0", "micromatch": "^4.0.4", "walker": "^1.0.8" }, "optionalDependencies": { "fsevents": "^2.3.2" } }, "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA=="],
+
+ "jest-message-util": ["jest-message-util@29.7.0", "", { "dependencies": { "@babel/code-frame": "^7.12.13", "@jest/types": "^29.6.3", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" } }, "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w=="],
+
+ "jest-mock": ["jest-mock@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", "jest-util": "^29.7.0" } }, "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw=="],
+
+ "jest-regex-util": ["jest-regex-util@29.6.3", "", {}, "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg=="],
+
+ "jest-util": ["jest-util@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", "graceful-fs": "^4.2.9", "picomatch": "^2.2.3" } }, "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA=="],
+
+ "jest-validate": ["jest-validate@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "camelcase": "^6.2.0", "chalk": "^4.0.0", "jest-get-type": "^29.6.3", "leven": "^3.1.0", "pretty-format": "^29.7.0" } }, "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw=="],
+
+ "jest-worker": ["jest-worker@29.7.0", "", { "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" } }, "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw=="],
+
+ "jimp-compact": ["jimp-compact@0.16.1", "", {}, "sha512-dZ6Ra7u1G8c4Letq/B5EzAxj4tLFHL+cGtdpR+PVm4yzPDj+lCk+AbivWt1eOM+ikzkowtyV7qSqX6qr3t71Ww=="],
+
+ "jiti": ["jiti@1.21.7", "", { "bin": { "jiti": "bin/jiti.js" } }, "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A=="],
+
+ "join-component": ["join-component@1.1.0", "", {}, "sha512-bF7vcQxbODoGK1imE2P9GS9aw4zD0Sd+Hni68IMZLj7zRnquH7dXUmMw9hDI5S/Jzt7q+IyTXN0rSg2GI0IKhQ=="],
+
+ "jose": ["jose@5.10.0", "", {}, "sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg=="],
+
+ "jotai": ["jotai@2.12.1", "", { "peerDependencies": { "@types/react": ">=17.0.0", "react": ">=17.0.0" }, "optionalPeers": ["@types/react", "react"] }, "sha512-VUW0nMPYIru5g89tdxwr9ftiVdc/nGV9jvHISN8Ucx+m1vI9dBeHemfqYzEuw5XSkmYjD/MEyApN9k6yrATsZQ=="],
+
+ "js-sdsl": ["js-sdsl@4.3.0", "", {}, "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ=="],
+
+ "js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="],
+
+ "js-yaml": ["js-yaml@4.1.0", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA=="],
+
+ "jsc-safe-url": ["jsc-safe-url@0.2.4", "", {}, "sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q=="],
+
+ "jscodeshift": ["jscodeshift@17.1.2", "", { "dependencies": { "@babel/core": "^7.24.7", "@babel/parser": "^7.24.7", "@babel/plugin-transform-class-properties": "^7.24.7", "@babel/plugin-transform-modules-commonjs": "^7.24.7", "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", "@babel/plugin-transform-optional-chaining": "^7.24.7", "@babel/plugin-transform-private-methods": "^7.24.7", "@babel/preset-flow": "^7.24.7", "@babel/preset-typescript": "^7.24.7", "@babel/register": "^7.24.6", "flow-parser": "0.*", "graceful-fs": "^4.2.4", "micromatch": "^4.0.7", "neo-async": "^2.5.0", "picocolors": "^1.0.1", "recast": "^0.23.9", "tmp": "^0.2.3", "write-file-atomic": "^5.0.1" }, "peerDependencies": { "@babel/preset-env": "^7.1.6" }, "optionalPeers": ["@babel/preset-env"], "bin": { "jscodeshift": "bin/jscodeshift.js" } }, "sha512-uime4vFOiZ1o3ICT4Sm/AbItHEVw2oCxQ3a0egYVy3JMMOctxe07H3SKL1v175YqjMt27jn1N+3+Bj9SKDNgdQ=="],
+
+ "jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="],
+
+ "json-buffer": ["json-buffer@3.0.1", "", {}, "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="],
+
+ "json-parse-better-errors": ["json-parse-better-errors@1.0.2", "", {}, "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw=="],
+
+ "json-parse-even-better-errors": ["json-parse-even-better-errors@2.3.1", "", {}, "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="],
+
+ "json-schema-traverse": ["json-schema-traverse@0.4.1", "", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="],
+
+ "json-stable-stringify-without-jsonify": ["json-stable-stringify-without-jsonify@1.0.1", "", {}, "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="],
+
+ "json-stringify-pretty-compact": ["json-stringify-pretty-compact@3.0.0", "", {}, "sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA=="],
+
+ "json-to-ts": ["json-to-ts@2.1.0", "", { "dependencies": { "es7-shim": "^6.0.0", "hash.js": "^1.0.3", "pluralize": "^3.1.0" } }, "sha512-JeScjtIGYAxQVxEYgQUKROU0329eS+rsTSviGtuKiwKuXpcIU7DxhDYm2tey0vcBetwc9kD0+YHDI5KvEexMew=="],
+
+ "json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="],
+
+ "jsonfile": ["jsonfile@4.0.0", "", { "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg=="],
+
+ "jsx-ast-utils": ["jsx-ast-utils@3.3.5", "", { "dependencies": { "array-includes": "^3.1.6", "array.prototype.flat": "^1.3.1", "object.assign": "^4.1.4", "object.values": "^1.1.6" } }, "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ=="],
+
+ "jwa": ["jwa@2.0.0", "", { "dependencies": { "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA=="],
+
+ "jws": ["jws@4.0.0", "", { "dependencies": { "jwa": "^2.0.0", "safe-buffer": "^5.0.1" } }, "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg=="],
+
+ "kdbush": ["kdbush@4.0.2", "", {}, "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA=="],
+
+ "keyv": ["keyv@4.5.4", "", { "dependencies": { "json-buffer": "3.0.1" } }, "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw=="],
+
+ "kind-of": ["kind-of@6.0.3", "", {}, "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw=="],
+
+ "kleur": ["kleur@3.0.3", "", {}, "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w=="],
+
+ "klona": ["klona@2.0.6", "", {}, "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA=="],
+
+ "kuler": ["kuler@2.0.0", "", {}, "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A=="],
+
+ "language-subtag-registry": ["language-subtag-registry@0.3.23", "", {}, "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ=="],
+
+ "language-tags": ["language-tags@1.0.9", "", { "dependencies": { "language-subtag-registry": "^0.3.20" } }, "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA=="],
+
+ "leven": ["leven@3.1.0", "", {}, "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A=="],
+
+ "levn": ["levn@0.4.1", "", { "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="],
+
+ "lighthouse-logger": ["lighthouse-logger@1.4.2", "", { "dependencies": { "debug": "^2.6.9", "marky": "^1.2.2" } }, "sha512-gPWxznF6TKmUHrOQjlVo2UbaL2EJ71mb2CCeRs/2qBpi4L/g4LUVc9+3lKQ6DTUZwJswfM7ainGrLO1+fOqa2g=="],
+
+ "lightningcss": ["lightningcss@1.27.0", "", { "dependencies": { "detect-libc": "^1.0.3" }, "optionalDependencies": { "lightningcss-darwin-arm64": "1.27.0", "lightningcss-darwin-x64": "1.27.0", "lightningcss-freebsd-x64": "1.27.0", "lightningcss-linux-arm-gnueabihf": "1.27.0", "lightningcss-linux-arm64-gnu": "1.27.0", "lightningcss-linux-arm64-musl": "1.27.0", "lightningcss-linux-x64-gnu": "1.27.0", "lightningcss-linux-x64-musl": "1.27.0", "lightningcss-win32-arm64-msvc": "1.27.0", "lightningcss-win32-x64-msvc": "1.27.0" } }, "sha512-8f7aNmS1+etYSLHht0fQApPc2kNO8qGRutifN5rVIc6Xo6ABsEbqOr758UwI7ALVbTt4x1fllKt0PYgzD9S3yQ=="],
+
+ "lightningcss-darwin-arm64": ["lightningcss-darwin-arm64@1.27.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Gl/lqIXY+d+ySmMbgDf0pgaWSqrWYxVHoc88q+Vhf2YNzZ8DwoRzGt5NZDVqqIW5ScpSnmmjcgXP87Dn2ylSSQ=="],
+
+ "lightningcss-darwin-x64": ["lightningcss-darwin-x64@1.27.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-0+mZa54IlcNAoQS9E0+niovhyjjQWEMrwW0p2sSdLRhLDc8LMQ/b67z7+B5q4VmjYCMSfnFi3djAAQFIDuj/Tg=="],
+
+ "lightningcss-freebsd-x64": ["lightningcss-freebsd-x64@1.27.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-n1sEf85fePoU2aDN2PzYjoI8gbBqnmLGEhKq7q0DKLj0UTVmOTwDC7PtLcy/zFxzASTSBlVQYJUhwIStQMIpRA=="],
+
+ "lightningcss-linux-arm-gnueabihf": ["lightningcss-linux-arm-gnueabihf@1.27.0", "", { "os": "linux", "cpu": "arm" }, "sha512-MUMRmtdRkOkd5z3h986HOuNBD1c2lq2BSQA1Jg88d9I7bmPGx08bwGcnB75dvr17CwxjxD6XPi3Qh8ArmKFqCA=="],
+
+ "lightningcss-linux-arm64-gnu": ["lightningcss-linux-arm64-gnu@1.27.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-cPsxo1QEWq2sfKkSq2Bq5feQDHdUEwgtA9KaB27J5AX22+l4l0ptgjMZZtYtUnteBofjee+0oW1wQ1guv04a7A=="],
+
+ "lightningcss-linux-arm64-musl": ["lightningcss-linux-arm64-musl@1.27.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-rCGBm2ax7kQ9pBSeITfCW9XSVF69VX+fm5DIpvDZQl4NnQoMQyRwhZQm9pd59m8leZ1IesRqWk2v/DntMo26lg=="],
+
+ "lightningcss-linux-x64-gnu": ["lightningcss-linux-x64-gnu@1.27.0", "", { "os": "linux", "cpu": "x64" }, "sha512-Dk/jovSI7qqhJDiUibvaikNKI2x6kWPN79AQiD/E/KeQWMjdGe9kw51RAgoWFDi0coP4jinaH14Nrt/J8z3U4A=="],
+
+ "lightningcss-linux-x64-musl": ["lightningcss-linux-x64-musl@1.27.0", "", { "os": "linux", "cpu": "x64" }, "sha512-QKjTxXm8A9s6v9Tg3Fk0gscCQA1t/HMoF7Woy1u68wCk5kS4fR+q3vXa1p3++REW784cRAtkYKrPy6JKibrEZA=="],
+
+ "lightningcss-win32-arm64-msvc": ["lightningcss-win32-arm64-msvc@1.27.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-/wXegPS1hnhkeG4OXQKEMQeJd48RDC3qdh+OA8pCuOPCyvnm/yEayrJdJVqzBsqpy1aJklRCVxscpFur80o6iQ=="],
+
+ "lightningcss-win32-x64-msvc": ["lightningcss-win32-x64-msvc@1.27.0", "", { "os": "win32", "cpu": "x64" }, "sha512-/OJLj94Zm/waZShL8nB5jsNj3CfNATLCTyFxZyouilfTmSoLDX7VlVAmhPHoZWVFp4vdmoiEbPEYC8HID3m6yw=="],
+
+ "lilconfig": ["lilconfig@2.1.0", "", {}, "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ=="],
+
+ "lines-and-columns": ["lines-and-columns@1.2.4", "", {}, "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="],
+
+ "linkify-it": ["linkify-it@5.0.0", "", { "dependencies": { "uc.micro": "^2.0.0" } }, "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ=="],
+
+ "linkifyjs": ["linkifyjs@4.2.0", "", {}, "sha512-pCj3PrQyATaoTYKHrgWRF3SJwsm61udVh+vuls/Rl6SptiDhgE7ziUIudAedRY9QEfynmM7/RmLEfPUyw1HPCw=="],
+
+ "loading-cli": ["loading-cli@1.1.2", "", { "dependencies": { "colors-cli": "^1.0.26" } }, "sha512-M1ntfXHpdGoQxfaqKBOQPwSrTr9EIoTgj664Q9UVSbSnJvAFdribo+Ij//1jvACgrGHaTvfKoD9PG3NOxGj44g=="],
+
+ "loadsh": ["loadsh@0.0.4", "", {}, "sha512-U+wLL8InpfRalWrr+0SuhWgGt10M4OyAk6G8xCYo2rwpiHtxZkWiFpjei0vO463ghW8LPCdhqQxXlMy2qicAEw=="],
+
+ "locate-path": ["locate-path@6.0.0", "", { "dependencies": { "p-locate": "^5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="],
+
+ "lodash": ["lodash@4.17.21", "", {}, "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="],
+
+ "lodash.chunk": ["lodash.chunk@4.2.0", "", {}, "sha512-ZzydJKfUHJwHa+hF5X66zLFCBrWn5GeF28OHEr4WVWtNDXlQ/IjWKPBiikqKo2ne0+v6JgCgJ0GzJp8k8bHC7w=="],
+
+ "lodash.clonedeep": ["lodash.clonedeep@4.5.0", "", {}, "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ=="],
+
+ "lodash.debounce": ["lodash.debounce@4.0.8", "", {}, "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow=="],
+
+ "lodash.flatten": ["lodash.flatten@4.4.0", "", {}, "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g=="],
+
+ "lodash.merge": ["lodash.merge@4.6.2", "", {}, "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="],
+
+ "lodash.throttle": ["lodash.throttle@4.1.1", "", {}, "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ=="],
+
+ "log-symbols": ["log-symbols@2.2.0", "", { "dependencies": { "chalk": "^2.0.1" } }, "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg=="],
+
+ "logform": ["logform@2.7.0", "", { "dependencies": { "@colors/colors": "1.6.0", "@types/triple-beam": "^1.3.2", "fecha": "^4.2.0", "ms": "^2.1.1", "safe-stable-stringify": "^2.3.1", "triple-beam": "^1.3.0" } }, "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ=="],
+
+ "long": ["long@5.3.1", "", {}, "sha512-ka87Jz3gcx/I7Hal94xaN2tZEOPoUOEVftkQqZx2EeQRN7LGdfLlI3FvZ+7WDplm+vK2Urx9ULrvSowtdCieng=="],
+
+ "loose-envify": ["loose-envify@1.4.0", "", { "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, "bin": { "loose-envify": "cli.js" } }, "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q=="],
+
+ "lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="],
+
+ "make-cancellable-promise": ["make-cancellable-promise@1.3.2", "", {}, "sha512-GCXh3bq/WuMbS+Ky4JBPW1hYTOU+znU+Q5m9Pu+pI8EoUqIHk9+tviOKC6/qhHh8C4/As3tzJ69IF32kdz85ww=="],
+
+ "make-dir": ["make-dir@2.1.0", "", { "dependencies": { "pify": "^4.0.1", "semver": "^5.6.0" } }, "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA=="],
+
+ "make-error": ["make-error@1.3.6", "", {}, "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw=="],
+
+ "make-event-props": ["make-event-props@1.6.2", "", {}, "sha512-iDwf7mA03WPiR8QxvcVHmVWEPfMY1RZXerDVNCRYW7dUr2ppH3J58Rwb39/WG39yTZdRSxr3x+2v22tvI0VEvA=="],
+
+ "makeerror": ["makeerror@1.0.12", "", { "dependencies": { "tmpl": "1.0.5" } }, "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg=="],
+
+ "manage-path": ["manage-path@2.0.0", "", {}, "sha512-NJhyB+PJYTpxhxZJ3lecIGgh4kwIY2RAh44XvAz9UlqthlQwtPBf62uBVR8XaD8CRuSjQ6TnZH2lNJkbLPZM2A=="],
+
+ "map-canvas": ["map-canvas@0.1.5", "", { "dependencies": { "drawille-canvas-blessed-contrib": ">=0.0.1", "xml2js": "^0.4.5" } }, "sha512-f7M3sOuL9+up0NCOZbb1rQpWDLZwR/ftCiNbyscjl9LUUEwrRaoumH4sz6swgs58lF21DQ0hsYOCw5C6Zz7hbg=="],
+
+ "mapbox-gl": ["mapbox-gl@3.10.0", "", { "dependencies": { "@mapbox/jsonlint-lines-primitives": "^2.0.2", "@mapbox/mapbox-gl-supported": "^3.0.0", "@mapbox/point-geometry": "^0.1.0", "@mapbox/tiny-sdf": "^2.0.6", "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", "@types/geojson": "^7946.0.16", "@types/geojson-vt": "^3.2.5", "@types/mapbox__point-geometry": "^0.1.4", "@types/mapbox__vector-tile": "^1.3.4", "@types/pbf": "^3.0.5", "@types/supercluster": "^7.1.3", "cheap-ruler": "^4.0.0", "csscolorparser": "~1.0.3", "earcut": "^3.0.0", "geojson-vt": "^4.0.2", "gl-matrix": "^3.4.3", "grid-index": "^1.1.0", "kdbush": "^4.0.2", "murmurhash-js": "^1.0.0", "pbf": "^3.2.1", "potpack": "^2.0.0", "quickselect": "^3.0.0", "serialize-to-js": "^3.1.2", "supercluster": "^8.0.1", "tinyqueue": "^3.0.0", "vt-pbf": "^3.1.3" } }, "sha512-YnQxjlthuv/tidcxGYU2C8nRDVXMlAHa3qFhuOJeX4AfRP72OMRBf9ApL+M+k5VWcAXi2fcNOUVgphknjLumjA=="],
+
+ "markdown-it": ["markdown-it@14.1.0", "", { "dependencies": { "argparse": "^2.0.1", "entities": "^4.4.0", "linkify-it": "^5.0.0", "mdurl": "^2.0.0", "punycode.js": "^2.3.1", "uc.micro": "^2.1.0" }, "bin": { "markdown-it": "bin/markdown-it.mjs" } }, "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg=="],
+
+ "marked": ["marked@4.3.0", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A=="],
+
+ "marked-terminal": ["marked-terminal@5.2.0", "", { "dependencies": { "ansi-escapes": "^6.2.0", "cardinal": "^2.1.1", "chalk": "^5.2.0", "cli-table3": "^0.6.3", "node-emoji": "^1.11.0", "supports-hyperlinks": "^2.3.0" }, "peerDependencies": { "marked": "^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0" } }, "sha512-Piv6yNwAQXGFjZSaiNljyNFw7jKDdGrw70FSbtxEyldLsyeuV5ZHm/1wW++kWbrOF1VPnUgYOhB2oLL0ZpnekA=="],
+
+ "marky": ["marky@1.2.5", "", {}, "sha512-q9JtQJKjpsVxCRVgQ+WapguSbKC3SQ5HEzFGPAJMStgh3QjCawp00UKv3MTTAArTmGmmPUvllHZoNbZ3gs0I+Q=="],
+
+ "math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],
+
+ "md5": ["md5@2.3.0", "", { "dependencies": { "charenc": "0.0.2", "crypt": "0.0.2", "is-buffer": "~1.1.6" } }, "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g=="],
+
+ "md5-file": ["md5-file@3.2.3", "", { "dependencies": { "buffer-alloc": "^1.1.0" }, "bin": { "md5-file": "cli.js" } }, "sha512-3Tkp1piAHaworfcCgH0jKbTvj1jWWFgbvh2cXaNCgHwyTCBxxvD1Y04rmfpvdPm1P4oXMOpm6+2H7sr7v9v8Fw=="],
+
+ "mdurl": ["mdurl@2.0.0", "", {}, "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w=="],
+
+ "media-engine": ["media-engine@1.0.3", "", {}, "sha512-aa5tG6sDoK+k70B9iEX1NeyfT8ObCKhNDs6lJVpwF6r8vhUfuKMslIcirq6HIUYuuUYLefcEQOn9bSBOvawtwg=="],
+
+ "memoize-one": ["memoize-one@5.2.1", "", {}, "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q=="],
+
+ "memory-streams": ["memory-streams@0.1.3", "", { "dependencies": { "readable-stream": "~1.0.2" } }, "sha512-qVQ/CjkMyMInPaaRMrwWNDvf6boRZXaT/DbQeMYcCWuXPEBf1v8qChOc9OlEVQp2uOvRXa1Qu30fLmKhY6NipA=="],
+
+ "memorystream": ["memorystream@0.3.1", "", {}, "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw=="],
+
+ "merge-refs": ["merge-refs@1.3.0", "", { "peerDependencies": { "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "optionalPeers": ["@types/react"] }, "sha512-nqXPXbso+1dcKDpPCXvwZyJILz+vSLqGGOnDrYHQYE+B8n9JTCekVLC65AfCpR4ggVyA/45Y0iR9LDyS2iI+zA=="],
+
+ "merge-stream": ["merge-stream@2.0.0", "", {}, "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="],
+
+ "merge2": ["merge2@1.4.1", "", {}, "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg=="],
+
+ "metro": ["metro@0.81.2", "", { "dependencies": { "@babel/code-frame": "^7.24.7", "@babel/core": "^7.25.2", "@babel/generator": "^7.25.0", "@babel/parser": "^7.25.3", "@babel/template": "^7.25.0", "@babel/traverse": "^7.25.3", "@babel/types": "^7.25.2", "accepts": "^1.3.7", "chalk": "^4.0.0", "ci-info": "^2.0.0", "connect": "^3.6.5", "debug": "^2.2.0", "error-stack-parser": "^2.0.6", "flow-enums-runtime": "^0.0.6", "graceful-fs": "^4.2.4", "hermes-parser": "0.25.1", "image-size": "^1.0.2", "invariant": "^2.2.4", "jest-worker": "^29.7.0", "jsc-safe-url": "^0.2.2", "lodash.throttle": "^4.1.1", "metro-babel-transformer": "0.81.2", "metro-cache": "0.81.2", "metro-cache-key": "0.81.2", "metro-config": "0.81.2", "metro-core": "0.81.2", "metro-file-map": "0.81.2", "metro-resolver": "0.81.2", "metro-runtime": "0.81.2", "metro-source-map": "0.81.2", "metro-symbolicate": "0.81.2", "metro-transform-plugins": "0.81.2", "metro-transform-worker": "0.81.2", "mime-types": "^2.1.27", "nullthrows": "^1.1.1", "serialize-error": "^2.1.0", "source-map": "^0.5.6", "throat": "^5.0.0", "ws": "^7.5.10", "yargs": "^17.6.2" }, "bin": { "metro": "src/cli.js" } }, "sha512-3jvcYBmSEFWtXJC3BX9/pKyme0gEyrZfHuDvuZiS46+3u8rcNlk0bjnGS/qxIW/h8icyVuQRaoH/Q1VdQJHvuQ=="],
+
+ "metro-babel-transformer": ["metro-babel-transformer@0.81.2", "", { "dependencies": { "@babel/core": "^7.25.2", "flow-enums-runtime": "^0.0.6", "hermes-parser": "0.25.1", "nullthrows": "^1.1.1" } }, "sha512-Xn9JgF+CghIcDI6VTtGZFIxl7fPifePIX7mAkJ4/h8wtD9VAJsja6ymXgQ4Mftei2JOMEfCog0MYs4Us43/v8Q=="],
+
+ "metro-cache": ["metro-cache@0.81.2", "", { "dependencies": { "exponential-backoff": "^3.1.1", "flow-enums-runtime": "^0.0.6", "metro-core": "0.81.2" } }, "sha512-z07UNa4UjJ35LnQhDGrGk/qryRY3ERkYwvzkzYUpwpKZUGqWI5HnOurYzSuQSSxADV+s/NSLSFAB1yzdK8tluQ=="],
+
+ "metro-cache-key": ["metro-cache-key@0.81.2", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-+D5ySTFvvtWp1Med1ZWnEFqi8/nl8piFkTk6NFZbtCLGmNJIQhUtIW+i5foQ4YN9Mz1XARFn89652+jkRkXKhA=="],
+
+ "metro-config": ["metro-config@0.81.2", "", { "dependencies": { "connect": "^3.6.5", "cosmiconfig": "^5.0.5", "flow-enums-runtime": "^0.0.6", "jest-validate": "^29.7.0", "metro": "0.81.2", "metro-cache": "0.81.2", "metro-core": "0.81.2", "metro-runtime": "0.81.2" } }, "sha512-CzRiGh0XNANORfGB9REZ0PcpLxehWLmDgSE7XN59uAxhY0qOXccGG81J1WfkeT2zO1B/UoDWHDT5cPP1w7E3cQ=="],
+
+ "metro-core": ["metro-core@0.81.2", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "lodash.throttle": "^4.1.1", "metro-resolver": "0.81.2" } }, "sha512-OHWL/NiILmsuAkj90GNIJBMbcRCIcJ7piyT17B2EFWR2F/L1Jny7Dq7NCgWeqqRueLH7ystXUdrfcM8bKeMp8Q=="],
+
+ "metro-file-map": ["metro-file-map@0.81.2", "", { "dependencies": { "debug": "^2.2.0", "fb-watchman": "^2.0.0", "flow-enums-runtime": "^0.0.6", "graceful-fs": "^4.2.4", "invariant": "^2.2.4", "jest-worker": "^29.7.0", "micromatch": "^4.0.4", "nullthrows": "^1.1.1", "walker": "^1.0.7" } }, "sha512-k8binQShV1vzMB2rIPMlnf267ZSq78+L42vH9Y3YzmhIfumAz8Noy3ndG7zKdvOLcMjlOxzBChu1Laz3s5cgIw=="],
+
+ "metro-minify-terser": ["metro-minify-terser@0.81.2", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "terser": "^5.15.0" } }, "sha512-GWjm6ZcNMnOFyh7hjzNfAEnOqZiHYTVIKGmB/zDNMf/Eq89w6rxHXZRM41iu1YyP2IhdqrqnhwHA+Ze8v6CMtg=="],
+
+ "metro-resolver": ["metro-resolver@0.81.2", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-bu4Esd90SWkOhDADQsQTxIOG85sZnvAXtk51hT0aovN66M4x3rQmGPBRokfJpgAd3/XOZCu0KPbjoB5etyqT0Q=="],
+
+ "metro-runtime": ["metro-runtime@0.81.2", "", { "dependencies": { "@babel/runtime": "^7.25.0", "flow-enums-runtime": "^0.0.6" } }, "sha512-xk3rU6yKaa2b8B/Hk/ZhPtNzW4H07h/yq9iKBCof0F68CaN+qncdVOOIz2NGqEH7V3wAqDv4xoOfbgtbFO5rxA=="],
+
+ "metro-source-map": ["metro-source-map@0.81.2", "", { "dependencies": { "@babel/traverse": "^7.25.3", "@babel/traverse--for-generate-function-map": "npm:@babel/traverse@^7.25.3", "@babel/types": "^7.25.2", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.81.2", "nullthrows": "^1.1.1", "ob1": "0.81.2", "source-map": "^0.5.6", "vlq": "^1.0.0" } }, "sha512-/mJYbZIGswFbfxt0ouaBYw22YvqQiaCB+ql8reeA37bNjd4lHvozND7/w8NO2x7FjTfsmPBh50Iqi/mTuZFiZA=="],
+
+ "metro-symbolicate": ["metro-symbolicate@0.81.2", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-source-map": "0.81.2", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" }, "bin": { "metro-symbolicate": "src/index.js" } }, "sha512-jEZoh3XldJazigetID+4Sy41OszGdixEOvB8zI0v2k7sXgHh+Rw8J/R7UuYCxQp+f89MqCjeGLLN7qNHuvRSCQ=="],
+
+ "metro-transform-plugins": ["metro-transform-plugins@0.81.2", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/generator": "^7.25.0", "@babel/template": "^7.25.0", "@babel/traverse": "^7.25.3", "flow-enums-runtime": "^0.0.6", "nullthrows": "^1.1.1" } }, "sha512-St1zsbZ4SWA48yJBIqUuMFR4GROyu7A8auhJl/5km/Pj09vGXEri2CgOD0ReuXa/P1X9/jrOU5cIafi5csjwvw=="],
+
+ "metro-transform-worker": ["metro-transform-worker@0.81.2", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/generator": "^7.25.0", "@babel/parser": "^7.25.3", "@babel/types": "^7.25.2", "flow-enums-runtime": "^0.0.6", "metro": "0.81.2", "metro-babel-transformer": "0.81.2", "metro-cache": "0.81.2", "metro-cache-key": "0.81.2", "metro-minify-terser": "0.81.2", "metro-source-map": "0.81.2", "metro-transform-plugins": "0.81.2", "nullthrows": "^1.1.1" } }, "sha512-U1kmzJEExrB6SZN9TLxuFCZPdCq5+ofkWBiVn6U/9YxTft6HzXGNN0ebdL2Yut5ry3oaYmOtR26faKAOGiiG0Q=="],
+
+ "micromatch": ["micromatch@4.0.8", "", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="],
+
+ "midtrans-client": ["midtrans-client@1.4.2", "", { "dependencies": { "axios": "^0.26.0", "lodash": "^4.17.21" } }, "sha512-hGT6UDF6WsmOprJYdgxReT5qxOPj+9VGVbJTe6txYICkadI01yC1ApBlkf+5AH/2v4fWNo03421VVpNfJDFAyg=="],
+
+ "mime": ["mime@1.6.0", "", { "bin": { "mime": "cli.js" } }, "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="],
+
+ "mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="],
+
+ "mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],
+
+ "mimic-fn": ["mimic-fn@1.2.0", "", {}, "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="],
+
+ "mimic-response": ["mimic-response@3.1.0", "", {}, "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="],
+
+ "minimalistic-assert": ["minimalistic-assert@1.0.1", "", {}, "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A=="],
+
+ "minimatch": ["minimatch@3.1.2", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw=="],
+
+ "minimist": ["minimist@1.2.8", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="],
+
+ "minipass": ["minipass@7.1.2", "", {}, "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw=="],
+
+ "minipass-collect": ["minipass-collect@2.0.1", "", { "dependencies": { "minipass": "^7.0.3" } }, "sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw=="],
+
+ "minipass-flush": ["minipass-flush@1.0.5", "", { "dependencies": { "minipass": "^3.0.0" } }, "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw=="],
+
+ "minipass-pipeline": ["minipass-pipeline@1.2.4", "", { "dependencies": { "minipass": "^3.0.0" } }, "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A=="],
+
+ "minizlib": ["minizlib@2.1.2", "", { "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" } }, "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg=="],
+
+ "mkdirp": ["mkdirp@0.5.6", "", { "dependencies": { "minimist": "^1.2.6" }, "bin": { "mkdirp": "bin/cmd.js" } }, "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw=="],
+
+ "mkdirp-classic": ["mkdirp-classic@0.5.3", "", {}, "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="],
+
+ "moment": ["moment@2.30.1", "", {}, "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how=="],
+
+ "mqtt": ["mqtt@5.10.4", "", { "dependencies": { "@types/readable-stream": "^4.0.18", "@types/ws": "^8.5.14", "commist": "^3.2.0", "concat-stream": "^2.0.0", "debug": "^4.4.0", "help-me": "^5.0.0", "lru-cache": "^10.4.3", "minimist": "^1.2.8", "mqtt-packet": "^9.0.1", "number-allocator": "^1.0.14", "readable-stream": "^4.7.0", "reinterval": "^1.1.0", "rfdc": "^1.4.1", "split2": "^4.2.0", "worker-timers": "^7.1.8", "ws": "^8.18.0" }, "bin": { "mqtt_pub": "build/bin/pub.js", "mqtt_sub": "build/bin/sub.js", "mqtt": "build/bin/mqtt.js" } }, "sha512-wN+SuhT2/ZaG6NPxca0N6YtRivnMxk6VflxQUEeqDH4erKdj+wPAGhHmcTLzvqfE4sJRxrEJ+XJxUc0No0E7eQ=="],
+
+ "mqtt-packet": ["mqtt-packet@9.0.1", "", { "dependencies": { "bl": "^6.0.8", "debug": "^4.3.4", "process-nextick-args": "^2.0.1" } }, "sha512-koZF1V/X2RZUI6uD9wN5OK1JxxcG1ofAR4H3LjCw1FkeKzruZQ26aAA6v2m1lZyWONZIR5wMMJFrZJDRNzbiQw=="],
+
+ "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
+
+ "multipipe": ["multipipe@1.0.2", "", { "dependencies": { "duplexer2": "^0.1.2", "object-assign": "^4.1.0" } }, "sha512-6uiC9OvY71vzSGX8lZvSqscE7ft9nPupJ8fMjrCNRAUy2LREUW42UL+V/NTrogr6rFgRydUrCX4ZitfpSNkSCQ=="],
+
+ "murmurhash-js": ["murmurhash-js@1.0.0", "", {}, "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw=="],
+
+ "mustache": ["mustache@4.2.0", "", { "bin": { "mustache": "bin/mustache" } }, "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ=="],
+
+ "mz": ["mz@2.7.0", "", { "dependencies": { "any-promise": "^1.0.0", "object-assign": "^4.0.1", "thenify-all": "^1.0.0" } }, "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q=="],
+
+ "nanoid": ["nanoid@3.3.8", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w=="],
+
+ "napi-build-utils": ["napi-build-utils@2.0.0", "", {}, "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA=="],
+
+ "natural-compare": ["natural-compare@1.4.0", "", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="],
+
+ "negotiator": ["negotiator@0.6.3", "", {}, "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="],
+
+ "neo-async": ["neo-async@2.6.2", "", {}, "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="],
+
+ "nested-error-stacks": ["nested-error-stacks@2.0.1", "", {}, "sha512-SrQrok4CATudVzBS7coSz26QRSmlK9TzzoFbeKfcPBUFPjcQM9Rqvr/DlJkOrwI/0KcgvMub1n1g5Jt9EgRn4A=="],
+
+ "net": ["net@1.0.2", "", {}, "sha512-kbhcj2SVVR4caaVnGLJKmlk2+f+oLkjqdKeQlmUtz6nGzOpbcobwVIeSURNgraV/v3tlmGIX82OcPCl0K6RbHQ=="],
+
+ "next": ["next@13.5.8", "", { "dependencies": { "@next/env": "13.5.8", "@swc/helpers": "0.5.2", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001406", "postcss": "8.4.31", "styled-jsx": "5.1.1", "watchpack": "2.4.0" }, "optionalDependencies": { "@next/swc-darwin-arm64": "13.5.8", "@next/swc-darwin-x64": "13.5.8", "@next/swc-linux-arm64-gnu": "13.5.8", "@next/swc-linux-arm64-musl": "13.5.8", "@next/swc-linux-x64-gnu": "13.5.8", "@next/swc-linux-x64-musl": "13.5.8", "@next/swc-win32-arm64-msvc": "13.5.8", "@next/swc-win32-ia32-msvc": "13.5.8", "@next/swc-win32-x64-msvc": "13.5.8" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", "sass": "^1.3.0" }, "optionalPeers": ["@opentelemetry/api", "sass"], "bin": { "next": "dist/bin/next" } }, "sha512-VlR7FaXpSibCs7ujOqStaDFTGSdX/NvWgLDcd47oiHUe8i63ZtNkX9intgcYAu/MxpaeEGinHaMB5mwxuzglKw=="],
+
+ "next-dev": ["next-dev@1.2.8", "", { "dependencies": { "@babel/core": "^7.24.6", "@babel/parser": "^7.24.6", "@babel/preset-react": "^7.24.6", "@babel/traverse": "^7.24.6", "@mantine/hooks": "^7.10.1", "@types/autocannon": "^7.12.5", "@types/babel__traverse": "^7.20.6", "@types/blessed": "^0.1.25", "@types/cli-progress": "^3.11.5", "@types/lodash": "^4.17.4", "@types/yargs": "^17.0.32", "autocannon": "^7.15.0", "axios": "^1.7.2", "blessed": "^0.1.81", "blessed-contrib": "^4.11.0", "cli-progress": "^3.12.0", "colors": "^1.4.0", "lodash": "^4.17.21", "node-fetch": "^3.3.2", "prettier": "^3.3.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-icons": "^5.2.1", "readdirp": "^3.6.0", "yargs": "^17.7.2" }, "bin": { "next-dev": "dist/bin/next-dev.js" } }, "sha512-WF8QghYmtYnR2JDOJQ8z06GO38h8Xx7JuQp61oTCYEzVdBhLkPok3n2pCsBcrF3dsFnA4J40TN6dIpyXAuXcmQ=="],
+
+ "next-scroll-loader": ["next-scroll-loader@1.0.9", "", { "dependencies": { "react": "^18.3.1", "react-dom": "^18.3.1" } }, "sha512-TezMxzzgJ1XP7rk+dFbAgIpWtvTPUx1KnE8o19Rr/rxT5WnHZ67HBzP9KXAM1t4MAao+HT9OwG1KDSCi0GL8lg=="],
+
+ "nice-try": ["nice-try@1.0.5", "", {}, "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="],
+
+ "node-abi": ["node-abi@3.74.0", "", { "dependencies": { "semver": "^7.3.5" } }, "sha512-c5XK0MjkGBrQPGYG24GBADZud0NCbznxNx0ZkS+ebUTrmV1qTDxPxSL8zEAPURXSbLRWVexxmP4986BziahL5w=="],
+
+ "node-addon-api": ["node-addon-api@7.1.1", "", {}, "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ=="],
+
+ "node-dir": ["node-dir@0.1.17", "", { "dependencies": { "minimatch": "^3.0.2" } }, "sha512-tmPX422rYgofd4epzrNoOXiE8XFZYOcCq1vD7MAXCDO+O+zndlA2ztdKKMa+EeuBG5tHETpr4ml4RGgpqDCCAg=="],
+
+ "node-domexception": ["node-domexception@1.0.0", "", {}, "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="],
+
+ "node-emoji": ["node-emoji@1.11.0", "", { "dependencies": { "lodash": "^4.17.21" } }, "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A=="],
+
+ "node-fetch": ["node-fetch@3.3.2", "", { "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", "formdata-polyfill": "^4.0.10" } }, "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA=="],
+
+ "node-forge": ["node-forge@1.3.1", "", {}, "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA=="],
+
+ "node-gyp-build": ["node-gyp-build@4.8.4", "", { "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", "node-gyp-build-test": "build-test.js" } }, "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ=="],
+
+ "node-int64": ["node-int64@0.4.0", "", {}, "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw=="],
+
+ "node-releases": ["node-releases@2.0.19", "", {}, "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw=="],
+
+ "nopt": ["nopt@2.1.2", "", { "dependencies": { "abbrev": "1" }, "bin": { "nopt": "./bin/nopt.js" } }, "sha512-x8vXm7BZ2jE1Txrxh/hO74HTuYZQEbo8edoRcANgdZ4+PCV+pbjd/xdummkmjjC7LU5EjPzlu8zEq/oxWylnKA=="],
+
+ "normalize-path": ["normalize-path@3.0.0", "", {}, "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="],
+
+ "normalize-range": ["normalize-range@0.1.2", "", {}, "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA=="],
+
+ "normalize-svg-path": ["normalize-svg-path@1.1.0", "", { "dependencies": { "svg-arc-to-cubic-bezier": "^3.0.0" } }, "sha512-r9KHKG2UUeB5LoTouwDzBy2VxXlHsiM6fyLQvnJa0S5hrhzqElH/CH7TUGhT1fVvIYBIKf3OpY4YJ4CK+iaqHg=="],
+
+ "npm-package-arg": ["npm-package-arg@11.0.3", "", { "dependencies": { "hosted-git-info": "^7.0.0", "proc-log": "^4.0.0", "semver": "^7.3.5", "validate-npm-package-name": "^5.0.0" } }, "sha512-sHGJy8sOC1YraBywpzQlIKBE4pBbGbiF95U6Auspzyem956E0+FtDtsx1ZxlOJkQCZ1AFXAY/yuvtFYrOxF+Bw=="],
+
+ "npm-run-path": ["npm-run-path@2.0.2", "", { "dependencies": { "path-key": "^2.0.0" } }, "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw=="],
+
+ "nullthrows": ["nullthrows@1.1.1", "", {}, "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw=="],
+
+ "number-allocator": ["number-allocator@1.0.14", "", { "dependencies": { "debug": "^4.3.1", "js-sdsl": "4.3.0" } }, "sha512-OrL44UTVAvkKdOdRQZIJpLkAdjXGTRda052sN4sO77bKEzYYqWKMBjQvrJFzqygI99gL6Z4u2xctPW1tB8ErvA=="],
+
+ "ob1": ["ob1@0.81.2", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-K0hJXOlU4j7c4chNLaDDzVyg5yjYjbmDSQbVMXdAcTtqZndwYHfmBIO06riFMgpg2KOevxeB1pIwzqJuES2SuA=="],
+
+ "object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="],
+
+ "object-hash": ["object-hash@3.0.0", "", {}, "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw=="],
+
+ "object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
+
+ "object-is": ["object-is@1.1.6", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1" } }, "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q=="],
+
+ "object-keys": ["object-keys@1.1.1", "", {}, "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="],
+
+ "object.assign": ["object.assign@4.1.7", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0", "has-symbols": "^1.1.0", "object-keys": "^1.1.1" } }, "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw=="],
+
+ "object.entries": ["object.entries@1.1.8", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" } }, "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ=="],
+
+ "object.fromentries": ["object.fromentries@2.0.8", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2", "es-object-atoms": "^1.0.0" } }, "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ=="],
+
+ "object.getownpropertydescriptors": ["object.getownpropertydescriptors@2.1.8", "", { "dependencies": { "array.prototype.reduce": "^1.0.6", "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2", "es-object-atoms": "^1.0.0", "gopd": "^1.0.1", "safe-array-concat": "^1.1.2" } }, "sha512-qkHIGe4q0lSYMv0XI4SsBTJz3WaURhLvd0lKSgtVuOsJ2krg4SgMw3PIRQFMp07yi++UR3se2mkcLqsBNpBb/A=="],
+
+ "object.groupby": ["object.groupby@1.0.3", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2" } }, "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ=="],
+
+ "object.values": ["object.values@1.2.1", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" } }, "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA=="],
+
+ "octokit": ["octokit@4.1.2", "", { "dependencies": { "@octokit/app": "^15.1.4", "@octokit/core": "^6.1.4", "@octokit/oauth-app": "^7.1.6", "@octokit/plugin-paginate-graphql": "^5.2.4", "@octokit/plugin-paginate-rest": "^11.4.2", "@octokit/plugin-rest-endpoint-methods": "^13.3.1", "@octokit/plugin-retry": "^7.1.4", "@octokit/plugin-throttling": "^9.4.0", "@octokit/request-error": "^6.1.7", "@octokit/types": "^13.7.0" } }, "sha512-0kcTxJOK3yQrJsRb8wKa28hlTze4QOz4sLuUnfXXnhboDhFKgv8LxS86tFwbsafDW9JZ08ByuVAE8kQbYJIZkA=="],
+
+ "on-finished": ["on-finished@2.4.1", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg=="],
+
+ "on-headers": ["on-headers@1.0.2", "", {}, "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA=="],
+
+ "on-net-listen": ["on-net-listen@1.1.2", "", {}, "sha512-y1HRYy8s/RlcBvDUwKXSmkODMdx4KSuIvloCnQYJ2LdBBC1asY4HtfhXwe3UWknLakATZDnbzht2Ijw3M1EqFg=="],
+
+ "once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="],
+
+ "one-time": ["one-time@1.0.0", "", { "dependencies": { "fn.name": "1.x.x" } }, "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g=="],
+
+ "onetime": ["onetime@2.0.1", "", { "dependencies": { "mimic-fn": "^1.0.0" } }, "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ=="],
+
+ "onnxruntime-common": ["onnxruntime-common@1.20.1", "", {}, "sha512-YiU0s0IzYYC+gWvqD1HzLc46Du1sXpSiwzKb63PACIJr6LfL27VsXSXQvt68EzD3V0D5Bc0vyJTjmMxp0ylQiw=="],
+
+ "onnxruntime-node": ["onnxruntime-node@1.20.1", "", { "dependencies": { "onnxruntime-common": "1.20.1", "tar": "^7.0.1" }, "os": [ "linux", "win32", "darwin", ] }, "sha512-di/I4HDXRw+FLgq+TyHmQEDd3cEp9iFFZm0r4uJ1Wd7b/WE1VXtKWo8yemex347c6GNF/3Pv86ZfPhIWxORr0w=="],
+
+ "onnxruntime-web": ["onnxruntime-web@1.21.0-dev.20250206-d981b153d3", "", { "dependencies": { "flatbuffers": "^25.1.24", "guid-typescript": "^1.0.9", "long": "^5.2.3", "onnxruntime-common": "1.21.0-dev.20250206-d981b153d3", "platform": "^1.3.6", "protobufjs": "^7.2.4" } }, "sha512-esDVQdRic6J44VBMFLumYvcGfioMh80ceLmzF1yheJyuLKq/Th8VT2aj42XWQst+2bcWnAhw4IKmRQaqzU8ugg=="],
+
+ "open": ["open@7.4.2", "", { "dependencies": { "is-docker": "^2.0.0", "is-wsl": "^2.1.1" } }, "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q=="],
+
+ "openai": ["openai@4.86.1", "", { "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", "node-fetch": "^2.6.7" }, "peerDependencies": { "ws": "^8.18.0", "zod": "^3.23.8" }, "optionalPeers": ["ws", "zod"], "bin": { "openai": "bin/cli" } }, "sha512-x3iCLyaC3yegFVZaxOmrYJjitKxZ9hpVbLi+ZlT5UHuHTMlEQEbKXkGOM78z9qm2T5GF+XRUZCP2/aV4UPFPJQ=="],
+
+ "optimist": ["optimist@0.3.7", "", { "dependencies": { "wordwrap": "~0.0.2" } }, "sha512-TCx0dXQzVtSCg2OgY/bO9hjM9cV4XYx09TVK+s3+FhkjT6LovsLe+pPMzpWf+6yXK/hUizs2gUoTw3jHM0VaTQ=="],
+
+ "optionator": ["optionator@0.9.4", "", { "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.5" } }, "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g=="],
+
+ "ora": ["ora@3.4.0", "", { "dependencies": { "chalk": "^2.4.2", "cli-cursor": "^2.1.0", "cli-spinners": "^2.0.0", "log-symbols": "^2.2.0", "strip-ansi": "^5.2.0", "wcwidth": "^1.0.1" } }, "sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg=="],
+
+ "orderedmap": ["orderedmap@2.1.1", "", {}, "sha512-TvAWxi0nDe1j/rtMcWcIj94+Ffe6n7zhow33h40SKxmsmozs6dz/e+EajymfoFcHd7sxNn8yHM8839uixMOV6g=="],
+
+ "os-tmpdir": ["os-tmpdir@1.0.2", "", {}, "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g=="],
+
+ "own-keys": ["own-keys@1.0.1", "", { "dependencies": { "get-intrinsic": "^1.2.6", "object-keys": "^1.1.1", "safe-push-apply": "^1.0.0" } }, "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg=="],
+
+ "p-finally": ["p-finally@1.0.0", "", {}, "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow=="],
+
+ "p-limit": ["p-limit@6.2.0", "", { "dependencies": { "yocto-queue": "^1.1.1" } }, "sha512-kuUqqHNUqoIWp/c467RI4X6mmyuojY5jGutNU0wVTmEOOfcuwLqyMVoAi9MKi2Ak+5i9+nhmrK4ufZE8069kHA=="],
+
+ "p-locate": ["p-locate@5.0.0", "", { "dependencies": { "p-limit": "^3.0.2" } }, "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw=="],
+
+ "p-map": ["p-map@4.0.0", "", { "dependencies": { "aggregate-error": "^3.0.0" } }, "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ=="],
+
+ "p-try": ["p-try@2.2.0", "", {}, "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="],
+
+ "package-json-from-dist": ["package-json-from-dist@1.0.1", "", {}, "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw=="],
+
+ "pako": ["pako@1.0.11", "", {}, "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="],
+
+ "papaparse": ["papaparse@5.5.2", "", {}, "sha512-PZXg8UuAc4PcVwLosEEDYjPyfWnTEhOrUfdv+3Bx+NuAb+5NhDmXzg5fHWmdCh1mP5p7JAZfFr3IMQfcntNAdA=="],
+
+ "parchment": ["parchment@1.1.4", "", {}, "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg=="],
+
+ "parent-module": ["parent-module@1.0.1", "", { "dependencies": { "callsites": "^3.0.0" } }, "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g=="],
+
+ "parse-json": ["parse-json@5.2.0", "", { "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg=="],
+
+ "parse-png": ["parse-png@2.1.0", "", { "dependencies": { "pngjs": "^3.3.0" } }, "sha512-Nt/a5SfCLiTnQAjx3fHlqp8hRgTL3z7kTQZzvIMS9uCAepnCyjpdEc6M/sz69WqMBdaDBw9sF1F1UaHROYzGkQ=="],
+
+ "parse-svg-path": ["parse-svg-path@0.1.2", "", {}, "sha512-JyPSBnkTJ0AI8GGJLfMXvKq42cj5c006fnLz6fXy6zfoVjJizi8BNTpu8on8ziI1cKy9d9DGNuY17Ce7wuejpQ=="],
+
+ "parseurl": ["parseurl@1.3.3", "", {}, "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="],
+
+ "password-prompt": ["password-prompt@1.1.3", "", { "dependencies": { "ansi-escapes": "^4.3.2", "cross-spawn": "^7.0.3" } }, "sha512-HkrjG2aJlvF0t2BMH0e2LB/EHf3Lcq3fNMzy4GYHcQblAvOl+QQji1Lx7WRBMqpVK8p+KR7bCg7oqAMXtdgqyw=="],
+
+ "path-exists": ["path-exists@4.0.0", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="],
+
+ "path-is-absolute": ["path-is-absolute@1.0.1", "", {}, "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="],
+
+ "path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],
+
+ "path-parse": ["path-parse@1.0.7", "", {}, "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="],
+
+ "path-scurry": ["path-scurry@1.11.1", "", { "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" } }, "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA=="],
+
+ "path-type": ["path-type@4.0.0", "", {}, "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="],
+
+ "path2d": ["path2d@0.2.2", "", {}, "sha512-+vnG6S4dYcYxZd+CZxzXCNKdELYZSKfohrk98yajCo1PtRoDgCTrrwOvK1GT0UoAdVszagDVllQc0U1vaX4NUQ=="],
+
+ "pbf": ["pbf@3.3.0", "", { "dependencies": { "ieee754": "^1.1.12", "resolve-protobuf-schema": "^2.1.0" }, "bin": { "pbf": "bin/pbf" } }, "sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q=="],
+
+ "pdf-lib": ["pdf-lib@1.17.1", "", { "dependencies": { "@pdf-lib/standard-fonts": "^1.0.0", "@pdf-lib/upng": "^1.0.1", "pako": "^1.0.11", "tslib": "^1.11.1" } }, "sha512-V/mpyJAoTsN4cnP31vc0wfNA1+p20evqqnap0KLoRUN0Yk/p3wN52DOEsL4oBFcLdb76hlpKPtzJIgo67j/XLw=="],
+
+ "pdf2pic": ["pdf2pic@3.1.4", "", { "dependencies": { "gm": "^1.25.1" } }, "sha512-oDvsd/fSlICZgYK/lkyrocFTp7D7CrRFJVp3mU3O7a0MmdqByhiU54cHk3ne3HA4EnFuMbpA/NxzN5zo0jLh+A=="],
+
+ "pdfjs-dist": ["pdfjs-dist@4.10.38", "", { "optionalDependencies": { "@napi-rs/canvas": "^0.1.65" } }, "sha512-/Y3fcFrXEAsMjJXeL9J8+ZG9U01LbuWaYypvDW2ycW1jL269L3js3DVBjDJ0Up9Np1uqDXsDrRihHANhZOlwdQ=="],
+
+ "peerjs": ["peerjs@1.5.4", "", { "dependencies": { "@msgpack/msgpack": "^2.8.0", "eventemitter3": "^4.0.7", "peerjs-js-binarypack": "^2.1.0", "webrtc-adapter": "^9.0.0" } }, "sha512-yFsoLMnurJKlQbx6kVSBpOp+AlNldY1JQS2BrSsHLKCZnq6t7saHleuHM5svuLNbQkUJXHLF3sKOJB1K0xulOw=="],
+
+ "peerjs-js-binarypack": ["peerjs-js-binarypack@2.1.0", "", {}, "sha512-YIwCC+pTzp3Bi8jPI9UFKO0t0SLo6xALnHkiNt/iUFmUUZG0fEEmEyFKvjsDKweiFitzHRyhuh6NvyJZ4nNxMg=="],
+
+ "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
+
+ "picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
+
+ "picture-tuber": ["picture-tuber@1.0.2", "", { "dependencies": { "buffers": "~0.1.1", "charm": "~0.1.0", "event-stream": "~0.9.8", "optimist": "~0.3.4", "png-js": "~0.1.0", "x256": "~0.0.1" }, "bin": { "picture-tube": "bin/tube.js" } }, "sha512-49/xq+wzbwDeI32aPvwQJldM8pr7dKDRuR76IjztrkmiCkAQDaWFJzkmfVqCHmt/iFoPFhHmI9L0oKhthrTOQw=="],
+
+ "pify": ["pify@2.3.0", "", {}, "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog=="],
+
+ "pirates": ["pirates@4.0.6", "", {}, "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg=="],
+
+ "pkg-dir": ["pkg-dir@3.0.0", "", { "dependencies": { "find-up": "^3.0.0" } }, "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw=="],
+
+ "platform": ["platform@1.3.6", "", {}, "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="],
+
+ "plist": ["plist@3.1.0", "", { "dependencies": { "@xmldom/xmldom": "^0.8.8", "base64-js": "^1.5.1", "xmlbuilder": "^15.1.1" } }, "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ=="],
+
+ "pluralize": ["pluralize@3.1.0", "", {}, "sha512-2wcybwjwXOzGI1rlxWtlcs0/nSYK0OzNPqsg35TKxJFQlGhFu3cZ1x7EHS4r4bubQlhzyF4YxxlJqQnIhkUQCw=="],
+
+ "png-js": ["png-js@0.1.1", "", {}, "sha512-NTtk2SyfjBm+xYl2/VZJBhFnTQ4kU5qWC7VC4/iGbrgiU4FuB4xC+74erxADYJIqZICOR1HCvRA7EBHkpjTg9g=="],
+
+ "pngjs": ["pngjs@3.4.0", "", {}, "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w=="],
+
+ "possible-typed-array-names": ["possible-typed-array-names@1.1.0", "", {}, "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg=="],
+
+ "postcss": ["postcss@8.4.27", "", { "dependencies": { "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" } }, "sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ=="],
+
+ "postcss-import": ["postcss-import@15.1.0", "", { "dependencies": { "postcss-value-parser": "^4.0.0", "read-cache": "^1.0.0", "resolve": "^1.1.7" }, "peerDependencies": { "postcss": "^8.0.0" } }, "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew=="],
+
+ "postcss-js": ["postcss-js@4.0.1", "", { "dependencies": { "camelcase-css": "^2.0.1" }, "peerDependencies": { "postcss": "^8.4.21" } }, "sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw=="],
+
+ "postcss-load-config": ["postcss-load-config@4.0.2", "", { "dependencies": { "lilconfig": "^3.0.0", "yaml": "^2.3.4" }, "peerDependencies": { "postcss": ">=8.0.9", "ts-node": ">=9.0.0" }, "optionalPeers": ["postcss", "ts-node"] }, "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ=="],
+
+ "postcss-nested": ["postcss-nested@6.2.0", "", { "dependencies": { "postcss-selector-parser": "^6.1.1" }, "peerDependencies": { "postcss": "^8.2.14" } }, "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ=="],
+
+ "postcss-selector-parser": ["postcss-selector-parser@6.1.2", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg=="],
+
+ "postcss-value-parser": ["postcss-value-parser@4.2.0", "", {}, "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="],
+
+ "potpack": ["potpack@2.0.0", "", {}, "sha512-Q+/tYsFU9r7xoOJ+y/ZTtdVQwTWfzjbiXBDMM/JKUux3+QPP02iUuIoeBQ+Ot6oEDlC+/PGjB/5A3K7KKb7hcw=="],
+
+ "prebuild-install": ["prebuild-install@7.1.3", "", { "dependencies": { "detect-libc": "^2.0.0", "expand-template": "^2.0.3", "github-from-package": "0.0.0", "minimist": "^1.2.3", "mkdirp-classic": "^0.5.3", "napi-build-utils": "^2.0.0", "node-abi": "^3.3.0", "pump": "^3.0.0", "rc": "^1.2.7", "simple-get": "^4.0.0", "tar-fs": "^2.0.0", "tunnel-agent": "^0.6.0" }, "bin": { "prebuild-install": "bin.js" } }, "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug=="],
+
+ "prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="],
+
+ "prettier": ["prettier@3.5.2", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-lc6npv5PH7hVqozBR7lkBNOGXV9vMwROAPlumdBkX0wTbbzPu/U1hk5yL8p2pt4Xoc+2mkT8t/sow2YrV/M5qg=="],
+
+ "pretty-bytes": ["pretty-bytes@5.6.0", "", {}, "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg=="],
+
+ "pretty-format": ["pretty-format@29.7.0", "", { "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } }, "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ=="],
+
+ "prisma": ["prisma@6.4.1", "", { "dependencies": { "@prisma/engines": "6.4.1", "esbuild": ">=0.12 <1", "esbuild-register": "3.6.0" }, "optionalDependencies": { "fsevents": "2.3.3" }, "peerDependencies": { "typescript": ">=5.1.0" }, "optionalPeers": ["typescript"], "bin": { "prisma": "build/index.js" } }, "sha512-q2uJkgXnua/jj66mk6P9bX/zgYJFI/jn4Yp0aS6SPRrjH/n6VyOV7RDe1vHD0DX8Aanx4MvgmUPPoYnR6MJnPg=="],
+
+ "proc-log": ["proc-log@4.2.0", "", {}, "sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA=="],
+
+ "process": ["process@0.11.10", "", {}, "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A=="],
+
+ "process-nextick-args": ["process-nextick-args@2.0.1", "", {}, "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="],
+
+ "progress": ["progress@2.0.3", "", {}, "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA=="],
+
+ "promise": ["promise@8.3.0", "", { "dependencies": { "asap": "~2.0.6" } }, "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg=="],
+
+ "prompts": ["prompts@2.4.2", "", { "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" } }, "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q=="],
+
+ "prop-types": ["prop-types@15.8.1", "", { "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", "react-is": "^16.13.1" } }, "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg=="],
+
+ "prosemirror-changeset": ["prosemirror-changeset@2.2.1", "", { "dependencies": { "prosemirror-transform": "^1.0.0" } }, "sha512-J7msc6wbxB4ekDFj+n9gTW/jav/p53kdlivvuppHsrZXCaQdVgRghoZbSS3kwrRyAstRVQ4/+u5k7YfLgkkQvQ=="],
+
+ "prosemirror-collab": ["prosemirror-collab@1.3.1", "", { "dependencies": { "prosemirror-state": "^1.0.0" } }, "sha512-4SnynYR9TTYaQVXd/ieUvsVV4PDMBzrq2xPUWutHivDuOshZXqQ5rGbZM84HEaXKbLdItse7weMGOUdDVcLKEQ=="],
+
+ "prosemirror-commands": ["prosemirror-commands@1.7.0", "", { "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.10.2" } }, "sha512-6toodS4R/Aah5pdsrIwnTYPEjW70SlO5a66oo5Kk+CIrgJz3ukOoS+FYDGqvQlAX5PxoGWDX1oD++tn5X3pyRA=="],
+
+ "prosemirror-dropcursor": ["prosemirror-dropcursor@1.8.1", "", { "dependencies": { "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0", "prosemirror-view": "^1.1.0" } }, "sha512-M30WJdJZLyXHi3N8vxN6Zh5O8ZBbQCz0gURTfPmTIBNQ5pxrdU7A58QkNqfa98YEjSAL1HUyyU34f6Pm5xBSGw=="],
+
+ "prosemirror-gapcursor": ["prosemirror-gapcursor@1.3.2", "", { "dependencies": { "prosemirror-keymap": "^1.0.0", "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", "prosemirror-view": "^1.0.0" } }, "sha512-wtjswVBd2vaQRrnYZaBCbyDqr232Ed4p2QPtRIUK5FuqHYKGWkEwl08oQM4Tw7DOR0FsasARV5uJFvMZWxdNxQ=="],
+
+ "prosemirror-history": ["prosemirror-history@1.4.1", "", { "dependencies": { "prosemirror-state": "^1.2.2", "prosemirror-transform": "^1.0.0", "prosemirror-view": "^1.31.0", "rope-sequence": "^1.3.0" } }, "sha512-2JZD8z2JviJrboD9cPuX/Sv/1ChFng+xh2tChQ2X4bB2HeK+rra/bmJ3xGntCcjhOqIzSDG6Id7e8RJ9QPXLEQ=="],
+
+ "prosemirror-inputrules": ["prosemirror-inputrules@1.4.0", "", { "dependencies": { "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.0.0" } }, "sha512-6ygpPRuTJ2lcOXs9JkefieMst63wVJBgHZGl5QOytN7oSZs3Co/BYbc3Yx9zm9H37Bxw8kVzCnDsihsVsL4yEg=="],
+
+ "prosemirror-keymap": ["prosemirror-keymap@1.2.2", "", { "dependencies": { "prosemirror-state": "^1.0.0", "w3c-keyname": "^2.2.0" } }, "sha512-EAlXoksqC6Vbocqc0GtzCruZEzYgrn+iiGnNjsJsH4mrnIGex4qbLdWWNza3AW5W36ZRrlBID0eM6bdKH4OStQ=="],
+
+ "prosemirror-markdown": ["prosemirror-markdown@1.13.1", "", { "dependencies": { "@types/markdown-it": "^14.0.0", "markdown-it": "^14.0.0", "prosemirror-model": "^1.20.0" } }, "sha512-Sl+oMfMtAjWtlcZoj/5L/Q39MpEnVZ840Xo330WJWUvgyhNmLBLN7MsHn07s53nG/KImevWHSE6fEj4q/GihHw=="],
+
+ "prosemirror-menu": ["prosemirror-menu@1.2.4", "", { "dependencies": { "crelt": "^1.0.0", "prosemirror-commands": "^1.0.0", "prosemirror-history": "^1.0.0", "prosemirror-state": "^1.0.0" } }, "sha512-S/bXlc0ODQup6aiBbWVsX/eM+xJgCTAfMq/nLqaO5ID/am4wS0tTCIkzwytmao7ypEtjj39i7YbJjAgO20mIqA=="],
+
+ "prosemirror-model": ["prosemirror-model@1.24.1", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-YM053N+vTThzlWJ/AtPtF1j0ebO36nvbmDy4U7qA2XQB8JVaQp1FmB9Jhrps8s+z+uxhhVTny4m20ptUvhk0Mg=="],
+
+ "prosemirror-schema-basic": ["prosemirror-schema-basic@1.2.3", "", { "dependencies": { "prosemirror-model": "^1.19.0" } }, "sha512-h+H0OQwZVqMon1PNn0AG9cTfx513zgIG2DY00eJ00Yvgb3UD+GQ/VlWW5rcaxacpCGT1Yx8nuhwXk4+QbXUfJA=="],
+
+ "prosemirror-schema-list": ["prosemirror-schema-list@1.5.0", "", { "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.7.3" } }, "sha512-gg1tAfH1sqpECdhIHOA/aLg2VH3ROKBWQ4m8Qp9mBKrOxQRW61zc+gMCI8nh22gnBzd1t2u1/NPLmO3nAa3ssg=="],
+
+ "prosemirror-state": ["prosemirror-state@1.4.3", "", { "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-transform": "^1.0.0", "prosemirror-view": "^1.27.0" } }, "sha512-goFKORVbvPuAQaXhpbemJFRKJ2aixr+AZMGiquiqKxaucC6hlpHNZHWgz5R7dS4roHiwq9vDctE//CZ++o0W1Q=="],
+
+ "prosemirror-tables": ["prosemirror-tables@1.6.4", "", { "dependencies": { "prosemirror-keymap": "^1.2.2", "prosemirror-model": "^1.24.1", "prosemirror-state": "^1.4.3", "prosemirror-transform": "^1.10.2", "prosemirror-view": "^1.37.2" } }, "sha512-TkDY3Gw52gRFRfRn2f4wJv5WOgAOXLJA2CQJYIJ5+kdFbfj3acR4JUW6LX2e1hiEBiUwvEhzH5a3cZ5YSztpIA=="],
+
+ "prosemirror-trailing-node": ["prosemirror-trailing-node@3.0.0", "", { "dependencies": { "@remirror/core-constants": "3.0.0", "escape-string-regexp": "^4.0.0" }, "peerDependencies": { "prosemirror-model": "^1.22.1", "prosemirror-state": "^1.4.2", "prosemirror-view": "^1.33.8" } }, "sha512-xiun5/3q0w5eRnGYfNlW1uU9W6x5MoFKWwq/0TIRgt09lv7Hcser2QYV8t4muXbEr+Fwo0geYn79Xs4GKywrRQ=="],
+
+ "prosemirror-transform": ["prosemirror-transform@1.10.2", "", { "dependencies": { "prosemirror-model": "^1.21.0" } }, "sha512-2iUq0wv2iRoJO/zj5mv8uDUriOHWzXRnOTVgCzSXnktS/2iQRa3UUQwVlkBlYZFtygw6Nh1+X4mGqoYBINn5KQ=="],
+
+ "prosemirror-view": ["prosemirror-view@1.38.0", "", { "dependencies": { "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } }, "sha512-O45kxXQTaP9wPdXhp8TKqCR+/unS/gnfg9Q93svQcB3j0mlp2XSPAmsPefxHADwzC+fbNS404jqRxm3UQaGvgw=="],
+
+ "protobufjs": ["protobufjs@7.4.0", "", { "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", "@protobufjs/codegen": "^2.0.4", "@protobufjs/eventemitter": "^1.1.0", "@protobufjs/fetch": "^1.1.0", "@protobufjs/float": "^1.0.2", "@protobufjs/inquire": "^1.1.0", "@protobufjs/path": "^1.1.2", "@protobufjs/pool": "^1.1.0", "@protobufjs/utf8": "^1.1.0", "@types/node": ">=13.7.0", "long": "^5.0.0" } }, "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw=="],
+
+ "protocol-buffers-schema": ["protocol-buffers-schema@3.6.0", "", {}, "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw=="],
+
+ "proxy-from-env": ["proxy-from-env@1.1.0", "", {}, "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="],
+
+ "pump": ["pump@3.0.2", "", { "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw=="],
+
+ "punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="],
+
+ "punycode.js": ["punycode.js@2.3.1", "", {}, "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA=="],
+
+ "pvtsutils": ["pvtsutils@1.3.6", "", { "dependencies": { "tslib": "^2.8.1" } }, "sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg=="],
+
+ "pvutils": ["pvutils@1.1.3", "", {}, "sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ=="],
+
+ "qr.js": ["qr.js@0.0.0", "", {}, "sha512-c4iYnWb+k2E+vYpRimHqSu575b1/wKl4XFeJGpFmrJQz5I88v9aY2czh7s0w36srfCM1sXgC/xpoJz5dJfq+OQ=="],
+
+ "qrcode-terminal": ["qrcode-terminal@0.11.0", "", { "bin": { "qrcode-terminal": "./bin/qrcode-terminal.js" } }, "sha512-Uu7ii+FQy4Qf82G4xu7ShHhjhGahEpCWc3x8UavY3CTcWV+ufmmCtwkr7ZKsX42jdL0kr1B5FKUeqJvAn51jzQ=="],
+
+ "queue": ["queue@6.0.2", "", { "dependencies": { "inherits": "~2.0.3" } }, "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA=="],
+
+ "queue-microtask": ["queue-microtask@1.2.3", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="],
+
+ "quickselect": ["quickselect@3.0.0", "", {}, "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g=="],
+
+ "quill": ["quill@1.3.7", "", { "dependencies": { "clone": "^2.1.1", "deep-equal": "^1.0.1", "eventemitter3": "^2.0.3", "extend": "^3.0.2", "parchment": "^1.1.4", "quill-delta": "^3.6.2" } }, "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g=="],
+
+ "quill-delta": ["quill-delta@3.6.3", "", { "dependencies": { "deep-equal": "^1.0.1", "extend": "^3.0.2", "fast-diff": "1.1.2" } }, "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg=="],
+
+ "range-parser": ["range-parser@1.2.1", "", {}, "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="],
+
+ "rc": ["rc@1.2.8", "", { "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" }, "bin": { "rc": "./cli.js" } }, "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw=="],
+
+ "react": ["react@18.2.0", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ=="],
+
+ "react-countdown": ["react-countdown@2.3.6", "", { "dependencies": { "prop-types": "^15.7.2" }, "peerDependencies": { "react": ">= 15", "react-dom": ">= 15" } }, "sha512-ZfX6S08Hb6x6W6eCn1hMDvxPICI/T30fd+gaeVTCR/2cGZ2WJ3f26e4ImNIMX1fHkopJrUdnRpWXP13/D39+gg=="],
+
+ "react-devtools-core": ["react-devtools-core@6.1.1", "", { "dependencies": { "shell-quote": "^1.6.1", "ws": "^7" } }, "sha512-TFo1MEnkqE6hzAbaztnyR5uLTMoz6wnEWwWBsCUzNt+sVXJycuRJdDqvL078M4/h65BI/YO5XWTaxZDWVsW0fw=="],
+
+ "react-dom": ["react-dom@18.2.0", "", { "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.0" }, "peerDependencies": { "react": "^18.2.0" } }, "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g=="],
+
+ "react-dropzone-esm": ["react-dropzone-esm@15.2.0", "", { "dependencies": { "prop-types": "^15.8.1" }, "peerDependencies": { "react": ">= 16.8 || 18.0.0" } }, "sha512-pPwR8xWVL+tFLnbAb8KVH5f6Vtl397tck8dINkZ1cPMxHWH+l9dFmIgRWgbh7V7jbjIcuKXCsVrXbhQz68+dVA=="],
+
+ "react-easy-infinite-scroll-hook": ["react-easy-infinite-scroll-hook@2.1.4", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, "sha512-sRbQGWh4BjSvCHTUGQwqf6PtMsOJWYl+RQ7h7BagmNpoWRi+Q/X8qwMZJ5WyzZS6U5vi3OrSGAfjLFPKp73jrg=="],
+
+ "react-easy-swipe": ["react-easy-swipe@0.0.21", "", { "dependencies": { "prop-types": "^15.5.8" } }, "sha512-OeR2jAxdoqUMHIn/nS9fgreI5hSpgGoL5ezdal4+oO7YSSgJR8ga+PkYGJrSrJ9MKlPcQjMQXnketrD7WNmNsg=="],
+
+ "react-fast-marquee": ["react-fast-marquee@1.6.5", "", { "peerDependencies": { "react": ">= 16.8.0 || ^18.0.0", "react-dom": ">= 16.8.0 || ^18.0.0" } }, "sha512-swDnPqrT2XISAih0o74zQVE2wQJFMvkx+9VZXYYNSLb/CUcAzU9pNj637Ar2+hyRw6b4tP6xh4GQZip2ZCpQpg=="],
+
+ "react-icons": ["react-icons@5.5.0", "", { "peerDependencies": { "react": "*" } }, "sha512-MEFcXdkP3dLo8uumGI5xN3lDFNsRtrjbOEKDLD7yv76v4wpnEq2Lt2qeHaQOr34I/wPN3s3+N08WkQ+CW37Xiw=="],
+
+ "react-iframe": ["react-iframe@1.8.5", "", { "dependencies": { "object-assign": "^4.1.1" }, "peerDependencies": { "react": ">=16.x.x" } }, "sha512-F4cQJGs3ydaG6fJWfuz9yLwOU0Trzl6kttXuUG+vYwosH8enOOFxZWEDQCSbNVO8ayjfYZeqLxEvdvcsSy4GvA=="],
+
+ "react-infinite-scroll-component": ["react-infinite-scroll-component@6.1.0", "", { "dependencies": { "throttle-debounce": "^2.1.0" }, "peerDependencies": { "react": ">=16.0.0" } }, "sha512-SQu5nCqy8DxQWpnUVLx7V7b7LcA37aM7tvoWjTLZp1dk6EJibM5/4EJKzOnl07/BsM1Y40sKLuqjCwwH/xV0TQ=="],
+
+ "react-international-phone": ["react-international-phone@4.5.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-wjwHv+VfiwM49B5/6El4Z5vZKmf3ILpUeiOCI9X+b0Dq4g5nL8gROcwCdVcTXywxznbDSoxSassBX3i9tPZX6g=="],
+
+ "react-is": ["react-is@16.13.1", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="],
+
+ "react-map-gl": ["react-map-gl@7.1.9", "", { "dependencies": { "@maplibre/maplibre-gl-style-spec": "^19.2.1", "@types/mapbox-gl": ">=1.0.0" }, "peerDependencies": { "mapbox-gl": ">=1.13.0", "maplibre-gl": ">=1.13.0 <5.0.0", "react": ">=16.3.0", "react-dom": ">=16.3.0" }, "optionalPeers": ["mapbox-gl", "maplibre-gl"] }, "sha512-KsCc8Gyn05wVGlHZoopaiiCr0RCAQ6LDISo5sEy1/pV/d7RlozkF946tiX7IgyijJQMRujHol5QdwUPESjh73w=="],
+
+ "react-native": ["react-native@0.78.0", "", { "dependencies": { "@jest/create-cache-key-function": "^29.6.3", "@react-native/assets-registry": "0.78.0", "@react-native/codegen": "0.78.0", "@react-native/community-cli-plugin": "0.78.0", "@react-native/gradle-plugin": "0.78.0", "@react-native/js-polyfills": "0.78.0", "@react-native/normalize-colors": "0.78.0", "@react-native/virtualized-lists": "0.78.0", "abort-controller": "^3.0.0", "anser": "^1.4.9", "ansi-regex": "^5.0.0", "babel-jest": "^29.7.0", "babel-plugin-syntax-hermes-parser": "0.25.1", "base64-js": "^1.5.1", "chalk": "^4.0.0", "commander": "^12.0.0", "event-target-shim": "^5.0.1", "flow-enums-runtime": "^0.0.6", "glob": "^7.1.1", "invariant": "^2.2.4", "jest-environment-node": "^29.6.3", "memoize-one": "^5.0.0", "metro-runtime": "^0.81.0", "metro-source-map": "^0.81.0", "nullthrows": "^1.1.1", "pretty-format": "^29.7.0", "promise": "^8.3.0", "react-devtools-core": "^6.0.1", "react-refresh": "^0.14.0", "regenerator-runtime": "^0.13.2", "scheduler": "0.25.0", "semver": "^7.1.3", "stacktrace-parser": "^0.1.10", "whatwg-fetch": "^3.0.0", "ws": "^6.2.3", "yargs": "^17.6.2" }, "peerDependencies": { "@types/react": "^19.0.0", "react": "^19.0.0" }, "optionalPeers": ["@types/react"], "bin": { "react-native": "cli.js" } }, "sha512-3PO4tNvCN6BdAKcoY70v1sLfxYCmDR4KS1VTY+kIBKy5Qznp27QNxL7zBQjvS6Jp91gc8N82QbysQrfBlwg9gQ=="],
+
+ "react-native-web": ["react-native-web@0.19.13", "", { "dependencies": { "@babel/runtime": "^7.18.6", "@react-native/normalize-colors": "^0.74.1", "fbjs": "^3.0.4", "inline-style-prefixer": "^6.0.1", "memoize-one": "^6.0.0", "nullthrows": "^1.1.1", "postcss-value-parser": "^4.2.0", "styleq": "^0.1.3" }, "peerDependencies": { "react": "^18.0.0", "react-dom": "^18.0.0" } }, "sha512-etv3bN8rJglrRCp/uL4p7l8QvUNUC++QwDbdZ8CB7BvZiMvsxfFIRM1j04vxNldG3uo2puRd6OSWR3ibtmc29A=="],
+
+ "react-native-webview": ["react-native-webview@13.13.2", "", { "dependencies": { "escape-string-regexp": "^4.0.0", "invariant": "2.2.4" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-zACPDTF0WnaEnKZ9mA/r/UpcOpV2gQM06AAIrOOexnO8UJvXL8Pjso0b/wTqKFxUZZnmjKuwd8gHVUosVOdVrw=="],
+
+ "react-number-format": ["react-number-format@5.4.3", "", { "peerDependencies": { "react": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-VCY5hFg/soBighAoGcdE+GagkJq0230qN6jcS5sp8wQX1qy1fYN/RX7/BXkrs0oyzzwqR8/+eSUrqXbGeywdUQ=="],
+
+ "react-pdf": ["react-pdf@9.2.1", "", { "dependencies": { "clsx": "^2.0.0", "dequal": "^2.0.3", "make-cancellable-promise": "^1.3.1", "make-event-props": "^1.6.0", "merge-refs": "^1.3.0", "pdfjs-dist": "4.8.69", "tiny-invariant": "^1.0.0", "warning": "^4.0.0" }, "peerDependencies": { "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "optionalPeers": ["@types/react"] }, "sha512-AJt0lAIkItWEZRA5d/mO+Om4nPCuTiQ0saA+qItO967DTjmGjnhmF+Bi2tL286mOTfBlF5CyLzJ35KTMaDoH+A=="],
+
+ "react-property": ["react-property@2.0.0", "", {}, "sha512-kzmNjIgU32mO4mmH5+iUyrqlpFQhF8K2k7eZ4fdLSOPFrD1XgEuSBv9LDEgxRXTMBqMd8ppT0x6TIzqE5pdGdw=="],
+
+ "react-qr-code": ["react-qr-code@2.0.15", "", { "dependencies": { "prop-types": "^15.8.1", "qr.js": "0.0.0" }, "peerDependencies": { "react": "*" } }, "sha512-MkZcjEXqVKqXEIMVE0mbcGgDpkfSdd8zhuzXEl9QzYeNcw8Hq2oVIzDLWuZN2PQBwM5PWjc2S31K8Q1UbcFMfw=="],
+
+ "react-quill": ["react-quill@2.0.0", "", { "dependencies": { "@types/quill": "^1.3.10", "lodash": "^4.17.4", "quill": "^1.3.7" }, "peerDependencies": { "react": "^16 || ^17 || ^18", "react-dom": "^16 || ^17 || ^18" } }, "sha512-4qQtv1FtCfLgoD3PXAur5RyxuUbPXQGOHgTlFie3jtxp43mXDtzCKaOgQ3mLyZfi1PUlyjycfivKelFhy13QUg=="],
+
+ "react-refresh": ["react-refresh@0.14.2", "", {}, "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA=="],
+
+ "react-remove-scroll": ["react-remove-scroll@2.6.3", "", { "dependencies": { "react-remove-scroll-bar": "^2.3.7", "react-style-singleton": "^2.2.3", "tslib": "^2.1.0", "use-callback-ref": "^1.3.3", "use-sidecar": "^1.1.3" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-pnAi91oOk8g8ABQKGF5/M9qxmmOPxaAnopyTHYfqYEwJhyFrbbBtHuSgtKEoH0jpcxx5o3hXqH1mNd9/Oi+8iQ=="],
+
+ "react-remove-scroll-bar": ["react-remove-scroll-bar@2.3.8", "", { "dependencies": { "react-style-singleton": "^2.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "optionalPeers": ["@types/react"] }, "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q=="],
+
+ "react-responsive-carousel": ["react-responsive-carousel@3.2.23", "", { "dependencies": { "classnames": "^2.2.5", "prop-types": "^15.5.8", "react-easy-swipe": "^0.0.21" } }, "sha512-pqJLsBaKHWJhw/ItODgbVoziR2z4lpcJg+YwmRlSk4rKH32VE633mAtZZ9kDXjy4wFO+pgUZmDKPsPe1fPmHCg=="],
+
+ "react-style-singleton": ["react-style-singleton@2.2.3", "", { "dependencies": { "get-nonce": "^1.0.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ=="],
+
+ "react-textarea-autosize": ["react-textarea-autosize@8.3.4", "", { "dependencies": { "@babel/runtime": "^7.10.2", "use-composed-ref": "^1.3.0", "use-latest": "^1.2.1" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, "sha512-CdtmP8Dc19xL8/R6sWvtknD/eCXkQr30dtvC4VmGInhRsfF8X/ihXCq6+9l9qbxmKRiq407/7z5fxE7cVWQNgQ=="],
+
+ "react-toastify": ["react-toastify@9.1.3", "", { "dependencies": { "clsx": "^1.1.1" }, "peerDependencies": { "react": ">=16", "react-dom": ">=16" } }, "sha512-fPfb8ghtn/XMxw3LkxQBk3IyagNpF/LIKjOBflbexr2AWxAH1MJgvnESwEwBn9liLFXgTKWgBSdZpw9m4OTHTg=="],
+
+ "react-transition-group": ["react-transition-group@4.4.2", "", { "dependencies": { "@babel/runtime": "^7.5.5", "dom-helpers": "^5.0.1", "loose-envify": "^1.4.0", "prop-types": "^15.6.2" }, "peerDependencies": { "react": ">=16.6.0", "react-dom": ">=16.6.0" } }, "sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg=="],
+
+ "read-cache": ["read-cache@1.0.0", "", { "dependencies": { "pify": "^2.3.0" } }, "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA=="],
+
+ "readable-stream": ["readable-stream@4.7.0", "", { "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", "events": "^3.3.0", "process": "^0.11.10", "string_decoder": "^1.3.0" } }, "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg=="],
+
+ "readdirp": ["readdirp@3.6.0", "", { "dependencies": { "picomatch": "^2.2.1" } }, "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA=="],
+
+ "readline": ["readline@1.3.0", "", {}, "sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg=="],
+
+ "recast": ["recast@0.23.10", "", { "dependencies": { "ast-types": "^0.16.1", "esprima": "~4.0.0", "source-map": "~0.6.1", "tiny-invariant": "^1.3.3", "tslib": "^2.0.1" } }, "sha512-mbCmRMJUKCJ1h41V0cu2C26ULBURwuoZ34C9rChjcDaeJ/4Kv5al3O2HPwTs2m0wQ1vGhMY+tguhzU1aE8md1A=="],
+
+ "redeyed": ["redeyed@2.1.1", "", { "dependencies": { "esprima": "~4.0.0" } }, "sha512-FNpGGo1DycYAdnrKFxCMmKYgo/mILAqtRYbkdQD8Ep/Hk2PQ5+aEAEx+IU713RTDmuBaH0c8P5ZozurNu5ObRQ=="],
+
+ "reflect.getprototypeof": ["reflect.getprototypeof@1.0.10", "", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.9", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "get-intrinsic": "^1.2.7", "get-proto": "^1.0.1", "which-builtin-type": "^1.2.1" } }, "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw=="],
+
+ "regenerate": ["regenerate@1.4.2", "", {}, "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A=="],
+
+ "regenerate-unicode-properties": ["regenerate-unicode-properties@10.2.0", "", { "dependencies": { "regenerate": "^1.4.2" } }, "sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA=="],
+
+ "regenerator-runtime": ["regenerator-runtime@0.13.11", "", {}, "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="],
+
+ "regenerator-transform": ["regenerator-transform@0.15.2", "", { "dependencies": { "@babel/runtime": "^7.8.4" } }, "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg=="],
+
+ "regexp.prototype.flags": ["regexp.prototype.flags@1.5.4", "", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-errors": "^1.3.0", "get-proto": "^1.0.1", "gopd": "^1.2.0", "set-function-name": "^2.0.2" } }, "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA=="],
+
+ "regexpu-core": ["regexpu-core@6.2.0", "", { "dependencies": { "regenerate": "^1.4.2", "regenerate-unicode-properties": "^10.2.0", "regjsgen": "^0.8.0", "regjsparser": "^0.12.0", "unicode-match-property-ecmascript": "^2.0.0", "unicode-match-property-value-ecmascript": "^2.1.0" } }, "sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA=="],
+
+ "regjsgen": ["regjsgen@0.8.0", "", {}, "sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q=="],
+
+ "regjsparser": ["regjsparser@0.12.0", "", { "dependencies": { "jsesc": "~3.0.2" }, "bin": { "regjsparser": "bin/parser" } }, "sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ=="],
+
+ "reinterval": ["reinterval@1.1.0", "", {}, "sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ=="],
+
+ "remove-trailing-slash": ["remove-trailing-slash@0.1.1", "", {}, "sha512-o4S4Qh6L2jpnCy83ysZDau+VORNvnFw07CKSAymkd6ICNVEPisMyzlc00KlvvicsxKck94SEwhDnMNdICzO+tA=="],
+
+ "require-directory": ["require-directory@2.1.1", "", {}, "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="],
+
+ "require-from-string": ["require-from-string@2.0.2", "", {}, "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="],
+
+ "requireg": ["requireg@0.2.2", "", { "dependencies": { "nested-error-stacks": "~2.0.1", "rc": "~1.2.7", "resolve": "~1.7.1" } }, "sha512-nYzyjnFcPNGR3lx9lwPPPnuQxv6JWEZd2Ci0u9opN7N5zUEPIhY/GbL3vMGOr2UXwEg9WwSyV9X9Y/kLFgPsOg=="],
+
+ "resolve": ["resolve@1.22.10", "", { "dependencies": { "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w=="],
+
+ "resolve-from": ["resolve-from@4.0.0", "", {}, "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="],
+
+ "resolve-pkg-maps": ["resolve-pkg-maps@1.0.0", "", {}, "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw=="],
+
+ "resolve-protobuf-schema": ["resolve-protobuf-schema@2.1.0", "", { "dependencies": { "protocol-buffers-schema": "^3.3.1" } }, "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ=="],
+
+ "resolve-workspace-root": ["resolve-workspace-root@2.0.0", "", {}, "sha512-IsaBUZETJD5WsI11Wt8PKHwaIe45or6pwNc8yflvLJ4DWtImK9kuLoH5kUva/2Mmx/RdIyr4aONNSa2v9LTJsw=="],
+
+ "resolve.exports": ["resolve.exports@2.0.3", "", {}, "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A=="],
+
+ "restore-cursor": ["restore-cursor@2.0.0", "", { "dependencies": { "onetime": "^2.0.0", "signal-exit": "^3.0.2" } }, "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q=="],
+
+ "restructure": ["restructure@3.0.2", "", {}, "sha512-gSfoiOEA0VPE6Tukkrr7I0RBdE0s7H1eFCDBk05l1KIQT1UIKNc5JZy6jdyW6eYH3aR3g5b3PuL77rq0hvwtAw=="],
+
+ "retimer": ["retimer@3.0.0", "", {}, "sha512-WKE0j11Pa0ZJI5YIk0nflGI7SQsfl2ljihVy7ogh7DeQSeYAUi0ubZ/yEueGtDfUPk6GH5LRw1hBdLq4IwUBWA=="],
+
+ "reusify": ["reusify@1.1.0", "", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="],
+
+ "rfdc": ["rfdc@1.4.1", "", {}, "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA=="],
+
+ "rimraf": ["rimraf@3.0.2", "", { "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" } }, "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA=="],
+
+ "rope-sequence": ["rope-sequence@1.3.4", "", {}, "sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ=="],
+
+ "run-parallel": ["run-parallel@1.2.0", "", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="],
+
+ "rw": ["rw@1.3.3", "", {}, "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ=="],
+
+ "safe-array-concat": ["safe-array-concat@1.1.3", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", "get-intrinsic": "^1.2.6", "has-symbols": "^1.1.0", "isarray": "^2.0.5" } }, "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q=="],
+
+ "safe-buffer": ["safe-buffer@5.1.2", "", {}, "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="],
+
+ "safe-push-apply": ["safe-push-apply@1.0.0", "", { "dependencies": { "es-errors": "^1.3.0", "isarray": "^2.0.5" } }, "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA=="],
+
+ "safe-regex-test": ["safe-regex-test@1.1.0", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-regex": "^1.2.1" } }, "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw=="],
+
+ "safe-stable-stringify": ["safe-stable-stringify@2.5.0", "", {}, "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA=="],
+
+ "safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],
+
+ "sax": ["sax@1.4.1", "", {}, "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg=="],
+
+ "scheduler": ["scheduler@0.17.0", "", { "dependencies": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" } }, "sha512-7rro8Io3tnCPuY4la/NuI5F2yfESpnfZyT6TtkXnSWVkcu0BCDJ+8gk5ozUaFaxpIyNuWAPXrH0yFcSi28fnDA=="],
+
+ "sdp": ["sdp@3.2.0", "", {}, "sha512-d7wDPgDV3DDiqulJjKiV2865wKsJ34YI+NDREbm+FySq6WuKOikwyNQcm+doLAZ1O6ltdO0SeKle2xMpN3Brgw=="],
+
+ "selfsigned": ["selfsigned@2.4.1", "", { "dependencies": { "@types/node-forge": "^1.3.0", "node-forge": "^1" } }, "sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q=="],
+
+ "semver": ["semver@7.7.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA=="],
+
+ "send": ["send@0.19.1", "", { "dependencies": { "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", "http-errors": "2.0.0", "mime": "1.6.0", "ms": "2.1.3", "on-finished": "2.4.1", "range-parser": "~1.2.1", "statuses": "2.0.1" } }, "sha512-p4rRk4f23ynFEfcD9LA0xRYngj+IyGiEYyqqOak8kaN0TvNmuxC2dcVeBn62GpCeR2CpWqyHCNScTP91QbAVFg=="],
+
+ "serialize-error": ["serialize-error@2.1.0", "", {}, "sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw=="],
+
+ "serialize-to-js": ["serialize-to-js@3.1.2", "", {}, "sha512-owllqNuDDEimQat7EPG0tH7JjO090xKNzUtYz6X+Sk2BXDnOCilDdNLwjWeFywG9xkJul1ULvtUQa9O4pUaY0w=="],
+
+ "serve-static": ["serve-static@1.16.2", "", { "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", "send": "0.19.0" } }, "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw=="],
+
+ "set-function-length": ["set-function-length@1.2.2", "", { "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2" } }, "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg=="],
+
+ "set-function-name": ["set-function-name@2.0.2", "", { "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "functions-have-names": "^1.2.3", "has-property-descriptors": "^1.0.2" } }, "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ=="],
+
+ "set-proto": ["set-proto@1.0.0", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0" } }, "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw=="],
+
+ "set-value": ["set-value@2.0.1", "", { "dependencies": { "extend-shallow": "^2.0.1", "is-extendable": "^0.1.1", "is-plain-object": "^2.0.3", "split-string": "^3.0.1" } }, "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw=="],
+
+ "setimmediate": ["setimmediate@1.0.5", "", {}, "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA=="],
+
+ "setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="],
+
+ "shallow-clone": ["shallow-clone@3.0.1", "", { "dependencies": { "kind-of": "^6.0.2" } }, "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA=="],
+
+ "shallowequal": ["shallowequal@1.1.0", "", {}, "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ=="],
+
+ "sharp": ["sharp@0.33.5", "", { "dependencies": { "color": "^4.2.3", "detect-libc": "^2.0.3", "semver": "^7.6.3" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.33.5", "@img/sharp-darwin-x64": "0.33.5", "@img/sharp-libvips-darwin-arm64": "1.0.4", "@img/sharp-libvips-darwin-x64": "1.0.4", "@img/sharp-libvips-linux-arm": "1.0.5", "@img/sharp-libvips-linux-arm64": "1.0.4", "@img/sharp-libvips-linux-s390x": "1.0.4", "@img/sharp-libvips-linux-x64": "1.0.4", "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", "@img/sharp-libvips-linuxmusl-x64": "1.0.4", "@img/sharp-linux-arm": "0.33.5", "@img/sharp-linux-arm64": "0.33.5", "@img/sharp-linux-s390x": "0.33.5", "@img/sharp-linux-x64": "0.33.5", "@img/sharp-linuxmusl-arm64": "0.33.5", "@img/sharp-linuxmusl-x64": "0.33.5", "@img/sharp-wasm32": "0.33.5", "@img/sharp-win32-ia32": "0.33.5", "@img/sharp-win32-x64": "0.33.5" } }, "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw=="],
+
+ "shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
+
+ "shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="],
+
+ "shell-quote": ["shell-quote@1.8.2", "", {}, "sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA=="],
+
+ "side-channel": ["side-channel@1.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", "side-channel-list": "^1.0.0", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw=="],
+
+ "side-channel-list": ["side-channel-list@1.0.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3" } }, "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA=="],
+
+ "side-channel-map": ["side-channel-map@1.0.1", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" } }, "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA=="],
+
+ "side-channel-weakmap": ["side-channel-weakmap@1.0.2", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" } }, "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A=="],
+
+ "signal-exit": ["signal-exit@4.1.0", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="],
+
+ "simple-concat": ["simple-concat@1.0.1", "", {}, "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q=="],
+
+ "simple-get": ["simple-get@4.0.1", "", { "dependencies": { "decompress-response": "^6.0.0", "once": "^1.3.1", "simple-concat": "^1.0.0" } }, "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA=="],
+
+ "simple-plist": ["simple-plist@1.3.1", "", { "dependencies": { "bplist-creator": "0.1.0", "bplist-parser": "0.3.1", "plist": "^3.0.5" } }, "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw=="],
+
+ "simple-swizzle": ["simple-swizzle@0.2.2", "", { "dependencies": { "is-arrayish": "^0.3.1" } }, "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg=="],
+
+ "sisteransi": ["sisteransi@1.0.5", "", {}, "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg=="],
+
+ "size-sensor": ["size-sensor@1.0.2", "", {}, "sha512-2NCmWxY7A9pYKGXNBfteo4hy14gWu47rg5692peVMst6lQLPKrVjhY+UTEsPI5ceFRJSl3gVgMYaUi/hKuaiKw=="],
+
+ "slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="],
+
+ "slugify": ["slugify@1.6.6", "", {}, "sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw=="],
+
+ "socket.io-client": ["socket.io-client@4.8.1", "", { "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.2", "engine.io-client": "~6.6.1", "socket.io-parser": "~4.2.4" } }, "sha512-hJVXfu3E28NmzGk8o1sHhN3om52tRvwYeidbj7xKy2eIIse5IoKX3USlS6Tqt3BHAtflLIkCQBkzVrEEfWUyYQ=="],
+
+ "socket.io-parser": ["socket.io-parser@4.2.4", "", { "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1" } }, "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew=="],
+
+ "sort-asc": ["sort-asc@0.2.0", "", {}, "sha512-umMGhjPeHAI6YjABoSTrFp2zaBtXBej1a0yKkuMUyjjqu6FJsTF+JYwCswWDg+zJfk/5npWUUbd33HH/WLzpaA=="],
+
+ "sort-desc": ["sort-desc@0.2.0", "", {}, "sha512-NqZqyvL4VPW+RAxxXnB8gvE1kyikh8+pR+T+CXLksVRN9eiQqkQlPwqWYU0mF9Jm7UnctShlxLyAt1CaBOTL1w=="],
+
+ "sort-object": ["sort-object@3.0.3", "", { "dependencies": { "bytewise": "^1.1.0", "get-value": "^2.0.2", "is-extendable": "^0.1.1", "sort-asc": "^0.2.0", "sort-desc": "^0.2.0", "union-value": "^1.0.1" } }, "sha512-nK7WOY8jik6zaG9CRwZTaD5O7ETWDLZYMM12pqY8htll+7dYeqGfEUPcUBHOpSJg2vJOrvFIY2Dl5cX2ih1hAQ=="],
+
+ "source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="],
+
+ "source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
+
+ "source-map-support": ["source-map-support@0.5.21", "", { "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w=="],
+
+ "sparkline": ["sparkline@0.1.2", "", { "dependencies": { "here": "0.0.2", "nopt": "~2.1.2" }, "bin": { "sparkline": "bin/sparkline" } }, "sha512-t//aVOiWt9fi/e22ea1vXVWBDX+gp18y+Ch9sKqmHl828bRfvP2VtfTJVEcgWFBQHd0yDPNQRiHdqzCvbcYSDA=="],
+
+ "split": ["split@1.0.1", "", { "dependencies": { "through": "2" } }, "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg=="],
+
+ "split-string": ["split-string@3.1.0", "", { "dependencies": { "extend-shallow": "^3.0.0" } }, "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw=="],
+
+ "split2": ["split2@4.2.0", "", {}, "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg=="],
+
+ "sprintf-js": ["sprintf-js@1.0.3", "", {}, "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="],
+
+ "ssri": ["ssri@10.0.6", "", { "dependencies": { "minipass": "^7.0.3" } }, "sha512-MGrFH9Z4NP9Iyhqn16sDtBpRRNJ0Y2hNa6D65h736fVSaPCHr4DM4sWUNvVaSuC+0OBGhwsrydQwmgfg5LncqQ=="],
+
+ "stable-hash": ["stable-hash@0.0.4", "", {}, "sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g=="],
+
+ "stack-trace": ["stack-trace@0.0.10", "", {}, "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg=="],
+
+ "stack-utils": ["stack-utils@2.0.6", "", { "dependencies": { "escape-string-regexp": "^2.0.0" } }, "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ=="],
+
+ "stackframe": ["stackframe@1.3.4", "", {}, "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw=="],
+
+ "stacktrace-parser": ["stacktrace-parser@0.1.11", "", { "dependencies": { "type-fest": "^0.7.1" } }, "sha512-WjlahMgHmCJpqzU8bIBy4qtsZdU9lRlcZE3Lvyej6t4tuOuv1vk57OW3MBrj6hXBFx/nNoC9MPMTcr5YA7NQbg=="],
+
+ "statuses": ["statuses@2.0.1", "", {}, "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ=="],
+
+ "stream-buffers": ["stream-buffers@2.2.0", "", {}, "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg=="],
+
+ "streamsearch": ["streamsearch@1.1.0", "", {}, "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg=="],
+
+ "string-at": ["string-at@1.1.0", "", { "dependencies": { "define-properties": "^1.1.3", "es-abstract": "^1.17.0-next.1" } }, "sha512-jCpPowWKBn0NFdvtmK2qxK40Ol4jPcgCt8qYnKpPx6B5eDwHMDhRvq9MCsDEgsOTNtbXY6beAMHMRT2qPJXllA=="],
+
+ "string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
+
+ "string-width-cjs": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
+
+ "string.prototype.includes": ["string.prototype.includes@2.0.1", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.3" } }, "sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg=="],
+
+ "string.prototype.matchall": ["string.prototype.matchall@4.0.12", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-abstract": "^1.23.6", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "get-intrinsic": "^1.2.6", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "internal-slot": "^1.1.0", "regexp.prototype.flags": "^1.5.3", "set-function-name": "^2.0.2", "side-channel": "^1.1.0" } }, "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA=="],
+
+ "string.prototype.padend": ["string.prototype.padend@3.1.6", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2", "es-object-atoms": "^1.0.0" } }, "sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q=="],
+
+ "string.prototype.padstart": ["string.prototype.padstart@3.1.6", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.0", "es-object-atoms": "^1.0.0" } }, "sha512-1y15lz7otgfRTAVK5qbp3eHIga+w8j7+jIH+7HpUrOfnLVl6n0hbspi4EXf4tR+PNOpBjPstltemkx0SvViOCg=="],
+
+ "string.prototype.repeat": ["string.prototype.repeat@1.0.0", "", { "dependencies": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" } }, "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w=="],
+
+ "string.prototype.trim": ["string.prototype.trim@1.2.10", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", "define-data-property": "^1.1.4", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-object-atoms": "^1.0.0", "has-property-descriptors": "^1.0.2" } }, "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA=="],
+
+ "string.prototype.trimend": ["string.prototype.trimend@1.0.9", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" } }, "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ=="],
+
+ "string.prototype.trimleft": ["string.prototype.trimleft@2.1.3", "", { "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3", "string.prototype.trimstart": "^1.0.3" } }, "sha512-699Ibssmj/awVzvdNk4g83/Iu8U9vDohzmA/ly2BrQWGhamuY4Tlvs5XKmKliDt3ky6SKbE1bzPhASKCFlx9Sg=="],
+
+ "string.prototype.trimright": ["string.prototype.trimright@2.1.3", "", { "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3", "string.prototype.trimend": "^1.0.3" } }, "sha512-hoOq56oRFnnfDuXNy2lGHiwT77MehHv9d0zGfRZ8QdC+4zjrkFB9vd5i/zYTd/ymFBd4YxtbdgHt3U6ksGeuBw=="],
+
+ "string.prototype.trimstart": ["string.prototype.trimstart@1.0.8", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" } }, "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg=="],
+
+ "string_decoder": ["string_decoder@1.3.0", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="],
+
+ "strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],
+
+ "strip-ansi-cjs": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],
+
+ "strip-bom": ["strip-bom@3.0.0", "", {}, "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA=="],
+
+ "strip-eof": ["strip-eof@1.0.0", "", {}, "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q=="],
+
+ "strip-json-comments": ["strip-json-comments@3.1.1", "", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="],
+
+ "structured-headers": ["structured-headers@0.4.1", "", {}, "sha512-0MP/Cxx5SzeeZ10p/bZI0S6MpgD+yxAhi1BOQ34jgnMXsCq3j1t6tQnZu+KdlL7dvJTLT3g9xN8tl10TqgFMcg=="],
+
+ "style-to-js": ["style-to-js@1.1.0", "", { "dependencies": { "style-to-object": "0.3.0" } }, "sha512-1OqefPDxGrlMwcbfpsTVRyzwdhr4W0uxYQzeA2F1CBc8WG04udg2+ybRnvh3XYL4TdHQrCahLtax2jc8xaE6rA=="],
+
+ "style-to-object": ["style-to-object@0.3.0", "", { "dependencies": { "inline-style-parser": "0.1.1" } }, "sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA=="],
+
+ "styled-components": ["styled-components@6.1.15", "", { "dependencies": { "@emotion/is-prop-valid": "1.2.2", "@emotion/unitless": "0.8.1", "@types/stylis": "4.2.5", "css-to-react-native": "3.2.0", "csstype": "3.1.3", "postcss": "8.4.49", "shallowequal": "1.1.0", "stylis": "4.3.2", "tslib": "2.6.2" }, "peerDependencies": { "react": ">= 16.8.0", "react-dom": ">= 16.8.0" } }, "sha512-PpOTEztW87Ua2xbmLa7yssjNyUF9vE7wdldRfn1I2E6RTkqknkBYpj771OxM/xrvRGinLy2oysa7GOd7NcZZIA=="],
+
+ "styled-jsx": ["styled-jsx@5.1.1", "", { "dependencies": { "client-only": "0.0.1" }, "peerDependencies": { "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" } }, "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw=="],
+
+ "styleq": ["styleq@0.1.3", "", {}, "sha512-3ZUifmCDCQanjeej1f6kyl/BeP/Vae5EYkQ9iJfUm/QwZvlgnZzyflqAsAWYURdtea8Vkvswu2GrC57h3qffcA=="],
+
+ "stylis": ["stylis@4.3.2", "", {}, "sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg=="],
+
+ "subarg": ["subarg@1.0.0", "", { "dependencies": { "minimist": "^1.1.0" } }, "sha512-RIrIdRY0X1xojthNcVtgT9sjpOGagEUKpZdgBUi054OEPFo282yg+zE+t1Rj3+RqKq2xStL7uUHhY+AjbC4BXg=="],
+
+ "sucrase": ["sucrase@3.35.0", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.2", "commander": "^4.0.0", "glob": "^10.3.10", "lines-and-columns": "^1.1.6", "mz": "^2.7.0", "pirates": "^4.0.1", "ts-interface-checker": "^0.1.9" }, "bin": { "sucrase": "bin/sucrase", "sucrase-node": "bin/sucrase-node" } }, "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA=="],
+
+ "sudo-prompt": ["sudo-prompt@8.2.5", "", {}, "sha512-rlBo3HU/1zAJUrkY6jNxDOC9eVYliG6nS4JA8u8KAshITd07tafMc/Br7xQwCSseXwJ2iCcHCE8SNWX3q8Z+kw=="],
+
+ "supercluster": ["supercluster@8.0.1", "", { "dependencies": { "kdbush": "^4.0.2" } }, "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ=="],
+
+ "supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],
+
+ "supports-hyperlinks": ["supports-hyperlinks@2.3.0", "", { "dependencies": { "has-flag": "^4.0.0", "supports-color": "^7.0.0" } }, "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA=="],
+
+ "supports-preserve-symlinks-flag": ["supports-preserve-symlinks-flag@1.0.0", "", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="],
+
+ "svg-arc-to-cubic-bezier": ["svg-arc-to-cubic-bezier@3.2.0", "", {}, "sha512-djbJ/vZKZO+gPoSDThGNpKDO+o+bAeA4XQKovvkNCqnIS2t+S4qnLAGQhyyrulhCFRl1WWzAp0wUDV8PpTVU3g=="],
+
+ "swr": ["swr@2.3.2", "", { "dependencies": { "dequal": "^2.0.3", "use-sync-external-store": "^1.4.0" }, "peerDependencies": { "react": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-RosxFpiabojs75IwQ316DGoDRmOqtiAj0tg8wCcbEu4CiLZBs/a9QNtHV7TUfDXmmlgqij/NqzKq/eLelyv9xA=="],
+
+ "tabbable": ["tabbable@6.2.0", "", {}, "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew=="],
+
+ "tailwindcss": ["tailwindcss@3.3.3", "", { "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", "chokidar": "^3.5.3", "didyoumean": "^1.2.2", "dlv": "^1.1.3", "fast-glob": "^3.2.12", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", "jiti": "^1.18.2", "lilconfig": "^2.1.0", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", "object-hash": "^3.0.0", "picocolors": "^1.0.0", "postcss": "^8.4.23", "postcss-import": "^15.1.0", "postcss-js": "^4.0.1", "postcss-load-config": "^4.0.1", "postcss-nested": "^6.0.1", "postcss-selector-parser": "^6.0.11", "resolve": "^1.22.2", "sucrase": "^3.32.0" }, "bin": { "tailwind": "lib/cli.js", "tailwindcss": "lib/cli.js" } }, "sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w=="],
+
+ "tapable": ["tapable@2.2.1", "", {}, "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ=="],
+
+ "tar": ["tar@6.2.1", "", { "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "minipass": "^5.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" } }, "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A=="],
+
+ "tar-fs": ["tar-fs@2.1.2", "", { "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", "tar-stream": "^2.1.4" } }, "sha512-EsaAXwxmx8UB7FRKqeozqEPop69DXcmYwTQwXvyAPF352HJsPdkVhvTaDPYqfNgruveJIJy3TA2l+2zj8LJIJA=="],
+
+ "tar-stream": ["tar-stream@2.2.0", "", { "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.1.1" } }, "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ=="],
+
+ "temp": ["temp@0.8.4", "", { "dependencies": { "rimraf": "~2.6.2" } }, "sha512-s0ZZzd0BzYv5tLSptZooSjK8oj6C+c19p7Vqta9+6NPOf7r+fxq0cJe6/oN4LTC79sy5NY8ucOJNgwsKCSbfqg=="],
+
+ "temp-dir": ["temp-dir@2.0.0", "", {}, "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg=="],
+
+ "tempy": ["tempy@0.7.1", "", { "dependencies": { "del": "^6.0.0", "is-stream": "^2.0.0", "temp-dir": "^2.0.0", "type-fest": "^0.16.0", "unique-string": "^2.0.0" } }, "sha512-vXPxwOyaNVi9nyczO16mxmHGpl6ASC5/TVhRRHpqeYHvKQm58EaWNvZXxAhR0lYYnBOQFjXjhzeLsaXdjxLjRg=="],
+
+ "term-canvas": ["term-canvas@0.0.5", "", {}, "sha512-eZ3rIWi5yLnKiUcsW8P79fKyooaLmyLWAGqBhFspqMxRNUiB4GmHHk5AzQ4LxvFbJILaXqQZLwbbATLOhCFwkw=="],
+
+ "terminal-link": ["terminal-link@2.1.1", "", { "dependencies": { "ansi-escapes": "^4.2.1", "supports-hyperlinks": "^2.0.0" } }, "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ=="],
+
+ "terser": ["terser@5.39.0", "", { "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, "bin": { "terser": "bin/terser" } }, "sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw=="],
+
+ "test-exclude": ["test-exclude@6.0.0", "", { "dependencies": { "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", "minimatch": "^3.0.4" } }, "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w=="],
+
+ "text-hex": ["text-hex@1.0.0", "", {}, "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg=="],
+
+ "text-table": ["text-table@0.2.0", "", {}, "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="],
+
+ "thenify": ["thenify@3.3.1", "", { "dependencies": { "any-promise": "^1.0.0" } }, "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw=="],
+
+ "thenify-all": ["thenify-all@1.6.0", "", { "dependencies": { "thenify": ">= 3.1.0 < 4" } }, "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA=="],
+
+ "throat": ["throat@5.0.0", "", {}, "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA=="],
+
+ "throttle-debounce": ["throttle-debounce@2.3.0", "", {}, "sha512-H7oLPV0P7+jgvrk+6mwwwBDmxTaxnu9HMXmloNLXwnNO0ZxZ31Orah2n8lU1eMPvsaowP2CX+USCgyovXfdOFQ=="],
+
+ "through": ["through@2.3.8", "", {}, "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="],
+
+ "through2": ["through2@0.4.2", "", { "dependencies": { "readable-stream": "~1.0.17", "xtend": "~2.1.1" } }, "sha512-45Llu+EwHKtAZYTPPVn3XZHBgakWMN3rokhEv5hu596XP+cNgplMg+Gj+1nmAvj+L0K7+N49zBKx5rah5u0QIQ=="],
+
+ "timestring": ["timestring@6.0.0", "", {}, "sha512-wMctrWD2HZZLuIlchlkE2dfXJh7J2KDI9Dwl+2abPYg0mswQHfOAyQW3jJg1pY5VfttSINZuKcXoB3FGypVklA=="],
+
+ "tiny-inflate": ["tiny-inflate@1.0.3", "", {}, "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw=="],
+
+ "tiny-invariant": ["tiny-invariant@1.3.3", "", {}, "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="],
+
+ "tinyglobby": ["tinyglobby@0.2.12", "", { "dependencies": { "fdir": "^6.4.3", "picomatch": "^4.0.2" } }, "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww=="],
+
+ "tinyqueue": ["tinyqueue@3.0.0", "", {}, "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g=="],
+
+ "tippy.js": ["tippy.js@6.3.7", "", { "dependencies": { "@popperjs/core": "^2.9.0" } }, "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ=="],
+
+ "tls": ["tls@0.0.1", "", {}, "sha512-GzHpG+hwupY8VMR6rYsnAhTHqT/97zT45PG8WD5eTT1lq+dFE0nN+1PYpsoBcHJgSmTz5ceK2Cv88IkPmIPOtQ=="],
+
+ "tmp": ["tmp@0.0.33", "", { "dependencies": { "os-tmpdir": "~1.0.2" } }, "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw=="],
+
+ "tmpl": ["tmpl@1.0.5", "", {}, "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw=="],
+
+ "to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="],
+
+ "toad-cache": ["toad-cache@3.7.0", "", {}, "sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw=="],
+
+ "toidentifier": ["toidentifier@1.0.1", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="],
+
+ "tr46": ["tr46@0.0.3", "", {}, "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="],
+
+ "triple-beam": ["triple-beam@1.4.1", "", {}, "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg=="],
+
+ "ts-api-utils": ["ts-api-utils@1.4.3", "", { "peerDependencies": { "typescript": ">=4.2.0" } }, "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw=="],
+
+ "ts-interface-checker": ["ts-interface-checker@0.1.13", "", {}, "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA=="],
+
+ "ts-node": ["ts-node@10.9.2", "", { "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", "@tsconfig/node16": "^1.0.2", "acorn": "^8.4.1", "acorn-walk": "^8.1.1", "arg": "^4.1.0", "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "peerDependencies": { "@swc/core": ">=1.2.50", "@swc/wasm": ">=1.2.50", "@types/node": "*", "typescript": ">=2.7" }, "optionalPeers": ["@swc/core", "@swc/wasm"], "bin": { "ts-node": "dist/bin.js", "ts-script": "dist/bin-script-deprecated.js", "ts-node-cwd": "dist/bin-cwd.js", "ts-node-esm": "dist/bin-esm.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js" } }, "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ=="],
+
+ "tsconfig-paths": ["tsconfig-paths@3.15.0", "", { "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg=="],
+
+ "tslib": ["tslib@2.3.0", "", {}, "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="],
+
+ "tunnel-agent": ["tunnel-agent@0.6.0", "", { "dependencies": { "safe-buffer": "^5.0.1" } }, "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w=="],
+
+ "type-check": ["type-check@0.4.0", "", { "dependencies": { "prelude-ls": "^1.2.1" } }, "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew=="],
+
+ "type-detect": ["type-detect@4.0.8", "", {}, "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g=="],
+
+ "type-fest": ["type-fest@0.20.2", "", {}, "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ=="],
+
+ "typed-array-buffer": ["typed-array-buffer@1.0.3", "", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-typed-array": "^1.1.14" } }, "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw=="],
+
+ "typed-array-byte-length": ["typed-array-byte-length@1.0.3", "", { "dependencies": { "call-bind": "^1.0.8", "for-each": "^0.3.3", "gopd": "^1.2.0", "has-proto": "^1.2.0", "is-typed-array": "^1.1.14" } }, "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg=="],
+
+ "typed-array-byte-offset": ["typed-array-byte-offset@1.0.4", "", { "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "for-each": "^0.3.3", "gopd": "^1.2.0", "has-proto": "^1.2.0", "is-typed-array": "^1.1.15", "reflect.getprototypeof": "^1.0.9" } }, "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ=="],
+
+ "typed-array-length": ["typed-array-length@1.0.7", "", { "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", "is-typed-array": "^1.1.13", "possible-typed-array-names": "^1.0.0", "reflect.getprototypeof": "^1.0.6" } }, "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg=="],
+
+ "typedarray": ["typedarray@0.0.6", "", {}, "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA=="],
+
+ "typescript": ["typescript@5.1.6", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA=="],
+
+ "typewise": ["typewise@1.0.3", "", { "dependencies": { "typewise-core": "^1.2.0" } }, "sha512-aXofE06xGhaQSPzt8hlTY+/YWQhm9P0jYUp1f2XtmW/3Bk0qzXcyFWAtPoo2uTGQj1ZwbDuSyuxicq+aDo8lCQ=="],
+
+ "typewise-core": ["typewise-core@1.2.0", "", {}, "sha512-2SCC/WLzj2SbUwzFOzqMCkz5amXLlxtJqDKTICqg30x+2DZxcfZN2MvQZmGfXWKNWaKK9pBPsvkcwv8bF/gxKg=="],
+
+ "ua-parser-js": ["ua-parser-js@1.0.40", "", { "bin": { "ua-parser-js": "script/cli.js" } }, "sha512-z6PJ8Lml+v3ichVojCiB8toQJBuwR42ySM4ezjXIqXK3M0HczmKQ3LF4rhU55PfD99KEEXQG6yb7iOMyvYuHew=="],
+
+ "uc.micro": ["uc.micro@2.1.0", "", {}, "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A=="],
+
+ "unbox-primitive": ["unbox-primitive@1.1.0", "", { "dependencies": { "call-bound": "^1.0.3", "has-bigints": "^1.0.2", "has-symbols": "^1.1.0", "which-boxed-primitive": "^1.1.1" } }, "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw=="],
+
+ "undici": ["undici@6.21.1", "", {}, "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ=="],
+
+ "undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
+
+ "unicode-canonical-property-names-ecmascript": ["unicode-canonical-property-names-ecmascript@2.0.1", "", {}, "sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg=="],
+
+ "unicode-match-property-ecmascript": ["unicode-match-property-ecmascript@2.0.0", "", { "dependencies": { "unicode-canonical-property-names-ecmascript": "^2.0.0", "unicode-property-aliases-ecmascript": "^2.0.0" } }, "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q=="],
+
+ "unicode-match-property-value-ecmascript": ["unicode-match-property-value-ecmascript@2.2.0", "", {}, "sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg=="],
+
+ "unicode-properties": ["unicode-properties@1.4.1", "", { "dependencies": { "base64-js": "^1.3.0", "unicode-trie": "^2.0.0" } }, "sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg=="],
+
+ "unicode-property-aliases-ecmascript": ["unicode-property-aliases-ecmascript@2.1.0", "", {}, "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w=="],
+
+ "unicode-trie": ["unicode-trie@2.0.0", "", { "dependencies": { "pako": "^0.2.5", "tiny-inflate": "^1.0.0" } }, "sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ=="],
+
+ "union-value": ["union-value@1.0.1", "", { "dependencies": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", "set-value": "^2.0.1" } }, "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg=="],
+
+ "unique-filename": ["unique-filename@3.0.0", "", { "dependencies": { "unique-slug": "^4.0.0" } }, "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g=="],
+
+ "unique-slug": ["unique-slug@4.0.0", "", { "dependencies": { "imurmurhash": "^0.1.4" } }, "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ=="],
+
+ "unique-string": ["unique-string@2.0.0", "", { "dependencies": { "crypto-random-string": "^2.0.0" } }, "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg=="],
+
+ "universal-github-app-jwt": ["universal-github-app-jwt@2.2.0", "", {}, "sha512-G5o6f95b5BggDGuUfKDApKaCgNYy2x7OdHY0zSMF081O0EJobw+1130VONhrA7ezGSV2FNOGyM+KQpQZAr9bIQ=="],
+
+ "universal-user-agent": ["universal-user-agent@7.0.2", "", {}, "sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q=="],
+
+ "universalify": ["universalify@0.1.2", "", {}, "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="],
+
+ "unpipe": ["unpipe@1.0.0", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="],
+
+ "update-browserslist-db": ["update-browserslist-db@1.1.3", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw=="],
+
+ "uri-js": ["uri-js@4.4.1", "", { "dependencies": { "punycode": "^2.1.0" } }, "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="],
+
+ "use-callback-ref": ["use-callback-ref@1.3.3", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg=="],
+
+ "use-composed-ref": ["use-composed-ref@1.4.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-djviaxuOOh7wkj0paeO1Q/4wMZ8Zrnag5H6yBvzN7AKKe8beOaED9SF5/ByLqsku8NP4zQqsvM2u3ew/tJK8/w=="],
+
+ "use-isomorphic-layout-effect": ["use-isomorphic-layout-effect@1.2.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-q6ayo8DWoPZT0VdG4u3D3uxcgONP3Mevx2i2b0434cwWBoL+aelL1DzkXI6w3PhTZzUeR2kaVlZn70iCiseP6w=="],
+
+ "use-latest": ["use-latest@1.3.0", "", { "dependencies": { "use-isomorphic-layout-effect": "^1.1.1" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-mhg3xdm9NaM8q+gLT8KryJPnRFOz1/5XPBhmDEVZK1webPzDjrPk7f/mbpeLqTgB9msytYWANxgALOCJKnLvcQ=="],
+
+ "use-sidecar": ["use-sidecar@1.1.3", "", { "dependencies": { "detect-node-es": "^1.1.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ=="],
+
+ "use-sync-external-store": ["use-sync-external-store@1.4.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-9WXSPC5fMv61vaupRkCKCxsPxBocVnwakBEkMIHHpkTTg6icbJtg6jzgtLDm4bl3cSHAca52rYWih0k4K3PfHw=="],
+
+ "utf-8-validate": ["utf-8-validate@6.0.5", "", { "dependencies": { "node-gyp-build": "^4.3.0" } }, "sha512-EYZR+OpIXp9Y1eG1iueg8KRsY8TuT8VNgnanZ0uA3STqhHQTLwbl+WX76/9X5OY12yQubymBpaBSmMPkSTQcKA=="],
+
+ "util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],
+
+ "utils-merge": ["utils-merge@1.0.1", "", {}, "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="],
+
+ "uuid": ["uuid@9.0.1", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA=="],
+
+ "uuid-parse": ["uuid-parse@1.1.0", "", {}, "sha512-OdmXxA8rDsQ7YpNVbKSJkNzTw2I+S5WsbMDnCtIWSQaosNAcWtFuI/YK1TjzUI6nbkgiqEyh8gWngfcv8Asd9A=="],
+
+ "v8-compile-cache-lib": ["v8-compile-cache-lib@3.0.1", "", {}, "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg=="],
+
+ "validate-npm-package-name": ["validate-npm-package-name@5.0.1", "", {}, "sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ=="],
+
+ "vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="],
+
+ "vite-compatible-readable-stream": ["vite-compatible-readable-stream@3.6.1", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-t20zYkrSf868+j/p31cRIGN28Phrjm3nRSLR2fyc2tiWi4cZGVdv68yNlwnIINTkMTmPoMiSlc0OadaO7DXZaQ=="],
+
+ "vlq": ["vlq@1.0.1", "", {}, "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w=="],
+
+ "vt-pbf": ["vt-pbf@3.1.3", "", { "dependencies": { "@mapbox/point-geometry": "0.1.0", "@mapbox/vector-tile": "^1.3.1", "pbf": "^3.2.1" } }, "sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA=="],
+
+ "w3c-keyname": ["w3c-keyname@2.2.8", "", {}, "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ=="],
+
+ "walker": ["walker@1.0.8", "", { "dependencies": { "makeerror": "1.0.12" } }, "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ=="],
+
+ "warning": ["warning@4.0.3", "", { "dependencies": { "loose-envify": "^1.0.0" } }, "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w=="],
+
+ "watchpack": ["watchpack@2.4.0", "", { "dependencies": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" } }, "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg=="],
+
+ "wcwidth": ["wcwidth@1.0.1", "", { "dependencies": { "defaults": "^1.0.3" } }, "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg=="],
+
+ "web-push": ["web-push@3.6.7", "", { "dependencies": { "asn1.js": "^5.3.0", "http_ece": "1.2.0", "https-proxy-agent": "^7.0.0", "jws": "^4.0.0", "minimist": "^1.2.5" }, "bin": { "web-push": "src/cli.js" } }, "sha512-OpiIUe8cuGjrj3mMBFWY+e4MMIkW3SVT+7vEIjvD9kejGUypv8GPDf84JdPWskK8zMRIJ6xYGm+Kxr8YkPyA0A=="],
+
+ "web-streams-polyfill": ["web-streams-polyfill@3.3.3", "", {}, "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw=="],
+
+ "webcrypto-core": ["webcrypto-core@1.8.1", "", { "dependencies": { "@peculiar/asn1-schema": "^2.3.13", "@peculiar/json-schema": "^1.1.12", "asn1js": "^3.0.5", "pvtsutils": "^1.3.5", "tslib": "^2.7.0" } }, "sha512-P+x1MvlNCXlKbLSOY4cYrdreqPG5hbzkmawbcXLKN/mf6DZW0SdNNkZ+sjwsqVkI4A4Ko2sPZmkZtCKY58w83A=="],
+
+ "webidl-conversions": ["webidl-conversions@5.0.0", "", {}, "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA=="],
+
+ "webrtc-adapter": ["webrtc-adapter@9.0.1", "", { "dependencies": { "sdp": "^3.2.0" } }, "sha512-1AQO+d4ElfVSXyzNVTOewgGT/tAomwwztX/6e3totvyyzXPvXIIuUUjAmyZGbKBKbZOXauuJooZm3g6IuFuiNQ=="],
+
+ "whatwg-fetch": ["whatwg-fetch@3.6.20", "", {}, "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg=="],
+
+ "whatwg-url": ["whatwg-url@5.0.0", "", { "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw=="],
+
+ "whatwg-url-without-unicode": ["whatwg-url-without-unicode@8.0.0-3", "", { "dependencies": { "buffer": "^5.4.3", "punycode": "^2.1.1", "webidl-conversions": "^5.0.0" } }, "sha512-HoKuzZrUlgpz35YO27XgD28uh/WJH4B0+3ttFqRo//lmq+9T/mIOJ6kqmINI9HpUpz1imRC/nR/lxKpJiv0uig=="],
+
+ "which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],
+
+ "which-boxed-primitive": ["which-boxed-primitive@1.1.1", "", { "dependencies": { "is-bigint": "^1.1.0", "is-boolean-object": "^1.2.1", "is-number-object": "^1.1.1", "is-string": "^1.1.1", "is-symbol": "^1.1.1" } }, "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA=="],
+
+ "which-builtin-type": ["which-builtin-type@1.2.1", "", { "dependencies": { "call-bound": "^1.0.2", "function.prototype.name": "^1.1.6", "has-tostringtag": "^1.0.2", "is-async-function": "^2.0.0", "is-date-object": "^1.1.0", "is-finalizationregistry": "^1.1.0", "is-generator-function": "^1.0.10", "is-regex": "^1.2.1", "is-weakref": "^1.0.2", "isarray": "^2.0.5", "which-boxed-primitive": "^1.1.0", "which-collection": "^1.0.2", "which-typed-array": "^1.1.16" } }, "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q=="],
+
+ "which-collection": ["which-collection@1.0.2", "", { "dependencies": { "is-map": "^2.0.3", "is-set": "^2.0.3", "is-weakmap": "^2.0.2", "is-weakset": "^2.0.3" } }, "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw=="],
+
+ "which-typed-array": ["which-typed-array@1.1.18", "", { "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "call-bound": "^1.0.3", "for-each": "^0.3.3", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" } }, "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA=="],
+
+ "wibu": ["wibu@github:bipproduction/wibu#bb8dcee", { "dependencies": { "@google/generative-ai": "^0.19.0", "@hookstate/core": "^4.0.1", "@mantine/core": "^7.13.3", "@mantine/hooks": "^7.13.3", "@octokit/core": "^6.1.2", "@supabase/supabase-js": "^2.45.4", "@types/crypto-js": "^4.2.2", "@types/lodash": "^4.17.7", "@types/web-push": "^3.6.3", "app-root-path": "^3.1.0", "colors": "^1.4.0", "crypto-js": "^4.2.0", "dedent": "^1.5.3", "dotenv": "^16.4.5", "gpt-3-encoder": "^1.1.4", "jose": "^5.9.2", "json-to-ts": "^2.1.0", "loading-cli": "^1.1.2", "lodash": "^4.17.21", "net": "^1.0.2", "next": "^14.2.13", "octokit": "^4.0.2", "openai": "^4.60.0", "react": "^18.3.1", "react-dom": "^18.3.1", "readdirp": "^4.0.1", "tls": "^0.0.1", "typescript": "^5.6.2", "web-push": "^3.6.7" }, "bin": { "wibu": "dist/bin/index.js" } }, "bipproduction-wibu-bb8dcee"],
+
+ "wibu-cli": ["wibu-cli@1.0.91", "", { "dependencies": { "@huggingface/transformers": "^3.0.2", "@types/lodash": "^4.17.13", "@types/web-push": "^3.6.4", "app-root-path": "^3.1.0", "commander": "^12.1.0", "dedent": "^1.5.3", "directory-import": "^3.3.1", "dotenv": "^16.4.5", "json-to-ts": "^2.1.0", "loading-cli": "^1.1.2", "lodash": "^4.17.21", "readdirp": "^4.0.2", "web-push": "^3.6.7" }, "bin": { "wibu-cli": "bin/wibu-cli.js" } }, "sha512-FR7nkbfcb4aqu9lAcW6xZWTIpTKvVXlXDMrg8hSlMLsR+Xen5nhVSp73H7h15c9N2GGxejGEgHIE/1yRCdWygw=="],
+
+ "wibu-pkg": ["wibu-pkg@1.0.67", "", { "dependencies": { "@mantine/core": "^7.13.5", "@mantine/hooks": "^7.13.5", "@supabase/supabase-js": "^2.46.1", "@types/lodash": "^4.17.13", "@types/uuid": "^10.0.0", "@types/web-push": "^3.6.4", "colors": "^1.4.0", "loadsh": "^0.0.4", "net": "^1.0.2", "peerjs": "^1.5.4", "tls": "^0.0.1", "uuid": "^11.0.3", "web-push": "^3.6.7" } }, "sha512-R4dLT1oJ9RNeNh4pktgBQBlQ+0JzmWPBycWEnUco/lFJllIL/q4/3sITQdQpV2YXkn9+BoodctdhGHBa9zHv8A=="],
+
+ "winston": ["winston@3.17.0", "", { "dependencies": { "@colors/colors": "^1.6.0", "@dabh/diagnostics": "^2.0.2", "async": "^3.2.3", "is-stream": "^2.0.0", "logform": "^2.7.0", "one-time": "^1.0.0", "readable-stream": "^3.4.0", "safe-stable-stringify": "^2.3.1", "stack-trace": "0.0.x", "triple-beam": "^1.3.0", "winston-transport": "^4.9.0" } }, "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw=="],
+
+ "winston-daily-rotate-file": ["winston-daily-rotate-file@5.0.0", "", { "dependencies": { "file-stream-rotator": "^0.6.1", "object-hash": "^3.0.0", "triple-beam": "^1.4.1", "winston-transport": "^4.7.0" }, "peerDependencies": { "winston": "^3" } }, "sha512-JDjiXXkM5qvwY06733vf09I2wnMXpZEhxEVOSPenZMii+g7pcDcTBt2MRugnoi8BwVSuCT2jfRXBUy+n1Zz/Yw=="],
+
+ "winston-transport": ["winston-transport@4.9.0", "", { "dependencies": { "logform": "^2.7.0", "readable-stream": "^3.6.2", "triple-beam": "^1.3.0" } }, "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A=="],
+
+ "wonka": ["wonka@6.3.4", "", {}, "sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg=="],
+
+ "word-wrap": ["word-wrap@1.2.5", "", {}, "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA=="],
+
+ "wordwrap": ["wordwrap@0.0.3", "", {}, "sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw=="],
+
+ "worker-timers": ["worker-timers@7.1.8", "", { "dependencies": { "@babel/runtime": "^7.24.5", "tslib": "^2.6.2", "worker-timers-broker": "^6.1.8", "worker-timers-worker": "^7.0.71" } }, "sha512-R54psRKYVLuzff7c1OTFcq/4Hue5Vlz4bFtNEIarpSiCYhpifHU3aIQI29S84o1j87ePCYqbmEJPqwBTf+3sfw=="],
+
+ "worker-timers-broker": ["worker-timers-broker@6.1.8", "", { "dependencies": { "@babel/runtime": "^7.24.5", "fast-unique-numbers": "^8.0.13", "tslib": "^2.6.2", "worker-timers-worker": "^7.0.71" } }, "sha512-FUCJu9jlK3A8WqLTKXM9E6kAmI/dR1vAJ8dHYLMisLNB/n3GuaFIjJ7pn16ZcD1zCOf7P6H62lWIEBi+yz/zQQ=="],
+
+ "worker-timers-worker": ["worker-timers-worker@7.0.71", "", { "dependencies": { "@babel/runtime": "^7.24.5", "tslib": "^2.6.2" } }, "sha512-ks/5YKwZsto1c2vmljroppOKCivB/ma97g9y77MAAz2TBBjPPgpoOiS1qYQKIgvGTr2QYPT3XhJWIB6Rj2MVPQ=="],
+
+ "wrap-ansi": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="],
+
+ "wrap-ansi-cjs": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="],
+
+ "wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="],
+
+ "write-file-atomic": ["write-file-atomic@2.4.3", "", { "dependencies": { "graceful-fs": "^4.1.11", "imurmurhash": "^0.1.4", "signal-exit": "^3.0.2" } }, "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ=="],
+
+ "ws": ["ws@8.18.1", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w=="],
+
+ "x256": ["x256@0.0.2", "", {}, "sha512-ZsIH+sheoF8YG9YG+QKEEIdtqpHRA9FYuD7MqhfyB1kayXU43RUNBFSxBEnF8ywSUxdg+8no4+bPr5qLbyxKgA=="],
+
+ "xcode": ["xcode@3.0.1", "", { "dependencies": { "simple-plist": "^1.1.0", "uuid": "^7.0.3" } }, "sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA=="],
+
+ "xml2js": ["xml2js@0.6.0", "", { "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" } }, "sha512-eLTh0kA8uHceqesPqSE+VvO1CDDJWMwlQfB6LuN6T8w6MaDJ8Txm8P7s5cHD0miF0V+GGTZrDQfxPZQVsur33w=="],
+
+ "xmlbuilder": ["xmlbuilder@14.0.0", "", {}, "sha512-ts+B2rSe4fIckR6iquDjsKbQFK2NlUk6iG5nf14mDEyldgoc2nEKZ3jZWMPTxGQwVgToSjt6VGIho1H8/fNFTg=="],
+
+ "xmlhttprequest-ssl": ["xmlhttprequest-ssl@2.1.2", "", {}, "sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ=="],
+
+ "xtend": ["xtend@2.1.2", "", { "dependencies": { "object-keys": "~0.4.0" } }, "sha512-vMNKzr2rHP9Dp/e1NQFnLQlwlhp9L/LfvnsVdHxN1f+uggyVI3i08uD14GPvCToPkdsRfyPqIyYGmIk58V98ZQ=="],
+
+ "y18n": ["y18n@5.0.8", "", {}, "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="],
+
+ "yallist": ["yallist@4.0.0", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="],
+
+ "yaml": ["yaml@2.7.0", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA=="],
+
+ "yargs": ["yargs@17.7.2", "", { "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" } }, "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w=="],
+
+ "yargs-parser": ["yargs-parser@21.1.1", "", {}, "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw=="],
+
+ "yn": ["yn@3.1.1", "", {}, "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q=="],
+
+ "yocto-queue": ["yocto-queue@1.1.1", "", {}, "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g=="],
+
+ "yoga-layout": ["yoga-layout@2.0.1", "", {}, "sha512-tT/oChyDXelLo2A+UVnlW9GU7CsvFMaEnd9kVFsaiCQonFAXd3xrHhkLYu+suwwosrAEQ746xBU+HvYtm1Zs2Q=="],
+
+ "zrender": ["zrender@5.6.1", "", { "dependencies": { "tslib": "2.3.0" } }, "sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag=="],
+
+ "@ampproject/remapping/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.25", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ=="],
+
+ "@babel/core/convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="],
+
+ "@babel/core/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
+
+ "@babel/generator/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.25", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ=="],
+
+ "@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="],
+
+ "@babel/helper-compilation-targets/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
+
+ "@babel/helper-create-class-features-plugin/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
+
+ "@babel/helper-create-regexp-features-plugin/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
+
+ "@babel/highlight/chalk": ["chalk@2.4.2", "", { "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } }, "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ=="],
+
+ "@babel/plugin-transform-classes/globals": ["globals@11.12.0", "", {}, "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA=="],
+
+ "@babel/plugin-transform-runtime/babel-plugin-polyfill-corejs3": ["babel-plugin-polyfill-corejs3@0.10.6", "", { "dependencies": { "@babel/helper-define-polyfill-provider": "^0.6.2", "core-js-compat": "^3.38.0" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA=="],
+
+ "@babel/plugin-transform-runtime/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
+
+ "@babel/preset-env/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
+
+ "@babel/runtime/regenerator-runtime": ["regenerator-runtime@0.14.1", "", {}, "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="],
+
+ "@babel/traverse/globals": ["globals@11.12.0", "", {}, "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA=="],
+
+ "@babel/traverse--for-generate-function-map/globals": ["globals@11.12.0", "", {}, "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA=="],
+
+ "@cyntler/react-doc-viewer/ajv": ["ajv@7.2.4", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2", "uri-js": "^4.2.2" } }, "sha512-nBeQgg/ZZA3u3SYxyaDvpvDtgZ/EZPF547ARgZBrG9Bhu1vKDwAIjtIf+sDtJUKa2zOcEbmRLBRSyMraS/Oy1A=="],
+
+ "@emnapi/runtime/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "@emotion/babel-plugin/stylis": ["stylis@4.2.0", "", {}, "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw=="],
+
+ "@emotion/cache/stylis": ["stylis@4.2.0", "", {}, "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw=="],
+
+ "@emotion/is-prop-valid/@emotion/memoize": ["@emotion/memoize@0.8.1", "", {}, "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA=="],
+
+ "@emotion/serialize/@emotion/unitless": ["@emotion/unitless@0.10.0", "", {}, "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg=="],
+
+ "@expo/bunyan/uuid": ["uuid@8.3.2", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="],
+
+ "@expo/cli/form-data": ["form-data@3.0.3", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.35" } }, "sha512-q5YBMeWy6E2Un0nMGWMgI65MAKtaylxfNJGJxpGh45YDciZB4epbWpaAfImil6CPAPTYB4sh0URQNDRIZG5F2w=="],
+
+ "@expo/cli/glob": ["glob@10.4.5", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg=="],
+
+ "@expo/cli/picomatch": ["picomatch@3.0.1", "", {}, "sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag=="],
+
+ "@expo/cli/resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="],
+
+ "@expo/config/@babel/code-frame": ["@babel/code-frame@7.10.4", "", { "dependencies": { "@babel/highlight": "^7.10.4" } }, "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg=="],
+
+ "@expo/config/glob": ["glob@10.4.5", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg=="],
+
+ "@expo/config/resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="],
+
+ "@expo/config-plugins/glob": ["glob@10.4.5", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg=="],
+
+ "@expo/config-plugins/resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="],
+
+ "@expo/devcert/debug": ["debug@3.2.7", "", { "dependencies": { "ms": "^2.1.1" } }, "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ=="],
+
+ "@expo/devcert/glob": ["glob@10.4.5", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg=="],
+
+ "@expo/devcert/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "@expo/fingerprint/p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="],
+
+ "@expo/fingerprint/resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="],
+
+ "@expo/image-utils/fs-extra": ["fs-extra@9.0.0", "", { "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^1.0.0" } }, "sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g=="],
+
+ "@expo/image-utils/resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="],
+
+ "@expo/json-file/@babel/code-frame": ["@babel/code-frame@7.10.4", "", { "dependencies": { "@babel/highlight": "^7.10.4" } }, "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg=="],
+
+ "@expo/metro-config/fs-extra": ["fs-extra@9.1.0", "", { "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ=="],
+
+ "@expo/metro-config/glob": ["glob@10.4.5", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg=="],
+
+ "@expo/metro-config/postcss": ["postcss@8.4.49", "", { "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA=="],
+
+ "@expo/metro-config/resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="],
+
+ "@expo/package-manager/js-yaml": ["js-yaml@3.14.1", "", { "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g=="],
+
+ "@expo/package-manager/sudo-prompt": ["sudo-prompt@9.1.1", "", {}, "sha512-es33J1g2HjMpyAhz8lOR+ICmXXAqTuKbuXuUWLhOLew20oN9oUCgCJx615U/v7aioZg7IX5lIh9x34vwneu4pA=="],
+
+ "@expo/prebuild-config/@react-native/normalize-colors": ["@react-native/normalize-colors@0.76.7", "", {}, "sha512-ST1xxBuYVIXPdD81dR6+tzIgso7m3pa9+6rOBXTh5Xm7KEEFik7tnQX+GydXYMp3wr1gagJjragdXkPnxK6WNg=="],
+
+ "@expo/prebuild-config/fs-extra": ["fs-extra@9.1.0", "", { "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ=="],
+
+ "@expo/prebuild-config/resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="],
+
+ "@expo/rudder-sdk-node/node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="],
+
+ "@expo/rudder-sdk-node/uuid": ["uuid@8.3.2", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="],
+
+ "@expo/xcpretty/@babel/code-frame": ["@babel/code-frame@7.10.4", "", { "dependencies": { "@babel/highlight": "^7.10.4" } }, "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg=="],
+
+ "@isaacs/cliui/string-width": ["string-width@5.1.2", "", { "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" } }, "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA=="],
+
+ "@isaacs/cliui/strip-ansi": ["strip-ansi@7.1.0", "", { "dependencies": { "ansi-regex": "^6.0.1" } }, "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ=="],
+
+ "@isaacs/cliui/wrap-ansi": ["wrap-ansi@8.1.0", "", { "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } }, "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ=="],
+
+ "@istanbuljs/load-nyc-config/camelcase": ["camelcase@5.3.1", "", {}, "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="],
+
+ "@istanbuljs/load-nyc-config/find-up": ["find-up@4.1.0", "", { "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" } }, "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw=="],
+
+ "@istanbuljs/load-nyc-config/js-yaml": ["js-yaml@3.14.1", "", { "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g=="],
+
+ "@istanbuljs/load-nyc-config/resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="],
+
+ "@jest/transform/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.25", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ=="],
+
+ "@jest/transform/convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="],
+
+ "@jest/transform/write-file-atomic": ["write-file-atomic@4.0.2", "", { "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" } }, "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg=="],
+
+ "@jridgewell/gen-mapping/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.25", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ=="],
+
+ "@jridgewell/source-map/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.25", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ=="],
+
+ "@mantine/styles/clsx": ["clsx@1.1.1", "", {}, "sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA=="],
+
+ "@mantine/styles/csstype": ["csstype@3.0.9", "", {}, "sha512-rpw6JPxK6Rfg1zLOYCSwle2GFOOsnjmDYDaBwEcwoOg4qlsIVCN789VkBZDJAGi4T07gI4YSutR43t9Zz4Lzuw=="],
+
+ "@peculiar/asn1-schema/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "@peculiar/json-schema/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "@peculiar/webcrypto/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "@react-native/babel-plugin-codegen/@react-native/codegen": ["@react-native/codegen@0.76.7", "", { "dependencies": { "@babel/parser": "^7.25.3", "glob": "^7.1.1", "hermes-parser": "0.23.1", "invariant": "^2.2.4", "jscodeshift": "^0.14.0", "mkdirp": "^0.5.1", "nullthrows": "^1.1.1", "yargs": "^17.6.2" }, "peerDependencies": { "@babel/preset-env": "^7.1.6" } }, "sha512-FAn585Ll65YvkSrKDyAcsdjHhhAGiMlSTUpHh0x7J5ntudUns+voYms0xMP+pEPt0XuLdjhD7zLIIlAWP407+g=="],
+
+ "@react-native/community-cli-plugin/@react-native/dev-middleware": ["@react-native/dev-middleware@0.78.0", "", { "dependencies": { "@isaacs/ttlcache": "^1.4.1", "@react-native/debugger-frontend": "0.78.0", "chrome-launcher": "^0.15.2", "chromium-edge-launcher": "^0.2.0", "connect": "^3.6.5", "debug": "^2.2.0", "invariant": "^2.2.4", "nullthrows": "^1.1.1", "open": "^7.0.3", "selfsigned": "^2.4.1", "serve-static": "^1.16.2", "ws": "^6.2.3" } }, "sha512-zEafAZdOz4s37Jh5Xcv4hJE5qZ6uNxgrTLcpjDOJnQG6dO34/BoZeXvDrjomQFNn6ogdysR51mKJStaQ3ixp5A=="],
+
+ "@react-native/community-cli-plugin/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
+
+ "@react-native/dev-middleware/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
+
+ "@react-native/dev-middleware/ws": ["ws@6.2.3", "", { "dependencies": { "async-limiter": "~1.0.0" } }, "sha512-jmTjYU0j60B+vHey6TfR3Z7RD61z/hmxBS3VMSGIrroOWXQEneK1zNuotOUrGyBHQj0yrpsLHPWtigEFd13ndA=="],
+
+ "@react-native/metro-babel-transformer/@react-native/babel-preset": ["@react-native/babel-preset@0.78.0", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/plugin-proposal-export-default-from": "^7.24.7", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-default-from": "^7.24.7", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-transform-arrow-functions": "^7.24.7", "@babel/plugin-transform-async-generator-functions": "^7.25.4", "@babel/plugin-transform-async-to-generator": "^7.24.7", "@babel/plugin-transform-block-scoping": "^7.25.0", "@babel/plugin-transform-class-properties": "^7.25.4", "@babel/plugin-transform-classes": "^7.25.4", "@babel/plugin-transform-computed-properties": "^7.24.7", "@babel/plugin-transform-destructuring": "^7.24.8", "@babel/plugin-transform-flow-strip-types": "^7.25.2", "@babel/plugin-transform-for-of": "^7.24.7", "@babel/plugin-transform-function-name": "^7.25.1", "@babel/plugin-transform-literals": "^7.25.2", "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", "@babel/plugin-transform-modules-commonjs": "^7.24.8", "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", "@babel/plugin-transform-numeric-separator": "^7.24.7", "@babel/plugin-transform-object-rest-spread": "^7.24.7", "@babel/plugin-transform-optional-catch-binding": "^7.24.7", "@babel/plugin-transform-optional-chaining": "^7.24.8", "@babel/plugin-transform-parameters": "^7.24.7", "@babel/plugin-transform-private-methods": "^7.24.7", "@babel/plugin-transform-private-property-in-object": "^7.24.7", "@babel/plugin-transform-react-display-name": "^7.24.7", "@babel/plugin-transform-react-jsx": "^7.25.2", "@babel/plugin-transform-react-jsx-self": "^7.24.7", "@babel/plugin-transform-react-jsx-source": "^7.24.7", "@babel/plugin-transform-regenerator": "^7.24.7", "@babel/plugin-transform-runtime": "^7.24.7", "@babel/plugin-transform-shorthand-properties": "^7.24.7", "@babel/plugin-transform-spread": "^7.24.7", "@babel/plugin-transform-sticky-regex": "^7.24.7", "@babel/plugin-transform-typescript": "^7.25.2", "@babel/plugin-transform-unicode-regex": "^7.24.7", "@babel/template": "^7.25.0", "@react-native/babel-plugin-codegen": "0.78.0", "babel-plugin-syntax-hermes-parser": "0.25.1", "babel-plugin-transform-flow-enums": "^0.0.2", "react-refresh": "^0.14.0" } }, "sha512-q44ZbR0JXdPvNrjNw75VmiVXXoJhZIx8dTUBVgnZx/UHBQuhPu0e8pAuo56E2mZVkF7FK0s087/Zji8n5OSxbQ=="],
+
+ "@react-pdf/types/@react-pdf/font": ["@react-pdf/font@3.1.0", "", { "dependencies": { "@react-pdf/types": "^2.8.0", "fontkit": "^2.0.2", "is-url": "^1.2.4" } }, "sha512-5q+r3DhZK41gVZp2Uw5M69FEVWeoasnM/HscW3kdpYnwjcB2bhCRWmBGCjm8fmuwQstwNPM1ZxyCWZRTRchwnA=="],
+
+ "@react-pdf/types/@react-pdf/primitives": ["@react-pdf/primitives@4.1.1", "", {}, "sha512-IuhxYls1luJb7NUWy6q5avb1XrNaVj9bTNI40U9qGRuS6n7Hje/8H8Qi99Z9UKFV74bBP3DOf3L1wV2qZVgVrQ=="],
+
+ "@react-pdf/types/@react-pdf/stylesheet": ["@react-pdf/stylesheet@6.0.0", "", { "dependencies": { "@react-pdf/fns": "3.1.1", "@react-pdf/types": "^2.8.0", "color-string": "^1.9.1", "hsl-to-hex": "^1.0.0", "media-engine": "^1.0.3", "postcss-value-parser": "^4.1.0" } }, "sha512-uAwuMjbcEaxhRl7tGlqxAbLzo/KoYr6v9JksUJwgzd+rkvAp8jDq8NcG3sUp88tzgIyyRjBGl4FewgdxbAa2uw=="],
+
+ "@swc/helpers/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
+
+ "aria-hidden/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "asn1js/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "ast-types/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "babel-plugin-polyfill-corejs2/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
+
+ "better-opn/open": ["open@8.4.2", "", { "dependencies": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", "is-wsl": "^2.2.0" } }, "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ=="],
+
+ "blessed-contrib/chalk": ["chalk@1.1.3", "", { "dependencies": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", "has-ansi": "^2.0.0", "strip-ansi": "^3.0.0", "supports-color": "^2.0.0" } }, "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A=="],
+
+ "blessed-contrib/strip-ansi": ["strip-ansi@3.0.1", "", { "dependencies": { "ansi-regex": "^2.0.0" } }, "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg=="],
+
+ "cacache/glob": ["glob@10.4.5", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg=="],
+
+ "caller-callsite/callsites": ["callsites@2.0.0", "", {}, "sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ=="],
+
+ "chokidar/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
+
+ "chromium-edge-launcher/mkdirp": ["mkdirp@1.0.4", "", { "bin": { "mkdirp": "bin/cmd.js" } }, "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="],
+
+ "cli-table3/@colors/colors": ["@colors/colors@1.5.0", "", {}, "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ=="],
+
+ "colorspace/color": ["color@3.2.1", "", { "dependencies": { "color-convert": "^1.9.3", "color-string": "^1.6.0" } }, "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA=="],
+
+ "compression/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
+
+ "compression/negotiator": ["negotiator@0.6.4", "", {}, "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w=="],
+
+ "compression/safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
+
+ "concat-stream/buffer-from": ["buffer-from@1.1.2", "", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="],
+
+ "concat-stream/readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="],
+
+ "connect/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
+
+ "cosmiconfig/yaml": ["yaml@1.10.2", "", {}, "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg=="],
+
+ "cross-fetch/node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="],
+
+ "defaults/clone": ["clone@1.0.4", "", {}, "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg=="],
+
+ "dom-serializer/entities": ["entities@2.2.0", "", {}, "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A=="],
+
+ "drawille-canvas-blessed-contrib/gl-matrix": ["gl-matrix@2.8.1", "", {}, "sha512-0YCjVpE3pS5XWlN3J4X7AiAx65+nqAI54LndtVFnQZB6G/FVLkZH8y8V6R3cIoOQR4pUdfwQGd1iwyoXHJ4Qfw=="],
+
+ "duplexer2/readable-stream": ["readable-stream@2.3.8", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="],
+
+ "ecdsa-sig-formatter/safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
+
+ "engine.io-client/debug": ["debug@4.3.7", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ=="],
+
+ "engine.io-client/ws": ["ws@8.17.1", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ=="],
+
+ "error-ex/is-arrayish": ["is-arrayish@0.2.1", "", {}, "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="],
+
+ "eslint-config-next/@typescript-eslint/parser": ["@typescript-eslint/parser@6.21.0", "", { "dependencies": { "@typescript-eslint/scope-manager": "6.21.0", "@typescript-eslint/types": "6.21.0", "@typescript-eslint/typescript-estree": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4" }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0" } }, "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ=="],
+
+ "eslint-import-resolver-node/debug": ["debug@3.2.7", "", { "dependencies": { "ms": "^2.1.1" } }, "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ=="],
+
+ "eslint-module-utils/debug": ["debug@3.2.7", "", { "dependencies": { "ms": "^2.1.1" } }, "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ=="],
+
+ "eslint-plugin-import/debug": ["debug@3.2.7", "", { "dependencies": { "ms": "^2.1.1" } }, "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ=="],
+
+ "eslint-plugin-import/doctrine": ["doctrine@2.1.0", "", { "dependencies": { "esutils": "^2.0.2" } }, "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw=="],
+
+ "eslint-plugin-import/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
+
+ "eslint-plugin-jsx-a11y/emoji-regex": ["emoji-regex@9.2.2", "", {}, "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="],
+
+ "eslint-plugin-react/doctrine": ["doctrine@2.1.0", "", { "dependencies": { "esutils": "^2.0.2" } }, "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw=="],
+
+ "eslint-plugin-react/resolve": ["resolve@2.0.0-next.5", "", { "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA=="],
+
+ "eslint-plugin-react/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
+
+ "event-stream/optimist": ["optimist@0.2.8", "", { "dependencies": { "wordwrap": ">=0.0.1 <0.1.0" } }, "sha512-Wy7E3cQDpqsTIFyW7m22hSevyTLxw850ahYv7FWsw4G6MIKVTZ8NSA95KBrQ95a4SMsMr1UGUUnwEFKhVaSzIg=="],
+
+ "execa/cross-spawn": ["cross-spawn@6.0.6", "", { "dependencies": { "nice-try": "^1.0.4", "path-key": "^2.0.1", "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" } }, "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw=="],
+
+ "execa/is-stream": ["is-stream@1.1.0", "", {}, "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ=="],
+
+ "execa/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="],
+
+ "expo-modules-autolinking/commander": ["commander@7.2.0", "", {}, "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="],
+
+ "expo-modules-autolinking/fs-extra": ["fs-extra@9.1.0", "", { "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ=="],
+
+ "expo-modules-autolinking/resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="],
+
+ "fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
+
+ "fast-unique-numbers/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "fbjs/promise": ["promise@7.3.1", "", { "dependencies": { "asap": "~2.0.3" } }, "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg=="],
+
+ "finalhandler/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
+
+ "finalhandler/encodeurl": ["encodeurl@1.0.2", "", {}, "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w=="],
+
+ "finalhandler/on-finished": ["on-finished@2.3.0", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww=="],
+
+ "finalhandler/statuses": ["statuses@1.5.0", "", {}, "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA=="],
+
+ "fontkit/@swc/helpers": ["@swc/helpers@0.5.15", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g=="],
+
+ "formdata-node/web-streams-polyfill": ["web-streams-polyfill@4.0.0-beta.3", "", {}, "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug=="],
+
+ "gm/debug": ["debug@3.2.7", "", { "dependencies": { "ms": "^2.1.1" } }, "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ=="],
+
+ "has-ansi/ansi-regex": ["ansi-regex@2.1.1", "", {}, "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA=="],
+
+ "html-tokenize/readable-stream": ["readable-stream@1.0.34", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", "isarray": "0.0.1", "string_decoder": "~0.10.x" } }, "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg=="],
+
+ "htmlparser2/entities": ["entities@3.0.1", "", {}, "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q=="],
+
+ "hyperid/buffer": ["buffer@5.7.1", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="],
+
+ "hyperid/uuid": ["uuid@8.3.2", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="],
+
+ "iron-session/@types/node": ["@types/node@17.0.45", "", {}, "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw=="],
+
+ "istanbul-lib-instrument/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
+
+ "jest-worker/supports-color": ["supports-color@8.1.1", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q=="],
+
+ "jscodeshift/tmp": ["tmp@0.2.3", "", {}, "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w=="],
+
+ "jscodeshift/write-file-atomic": ["write-file-atomic@5.0.1", "", { "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^4.0.1" } }, "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw=="],
+
+ "jwa/safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
+
+ "jws/safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
+
+ "lighthouse-logger/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
+
+ "lightningcss/detect-libc": ["detect-libc@1.0.3", "", { "bin": { "detect-libc": "./bin/detect-libc.js" } }, "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg=="],
+
+ "log-symbols/chalk": ["chalk@2.4.2", "", { "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } }, "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ=="],
+
+ "make-dir/pify": ["pify@4.0.1", "", {}, "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g=="],
+
+ "make-dir/semver": ["semver@5.7.2", "", { "bin": { "semver": "bin/semver" } }, "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g=="],
+
+ "map-canvas/xml2js": ["xml2js@0.4.23", "", { "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" } }, "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug=="],
+
+ "marked-terminal/chalk": ["chalk@5.4.1", "", {}, "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w=="],
+
+ "memory-streams/readable-stream": ["readable-stream@1.0.34", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", "isarray": "0.0.1", "string_decoder": "~0.10.x" } }, "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg=="],
+
+ "metro/ci-info": ["ci-info@2.0.0", "", {}, "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ=="],
+
+ "metro/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
+
+ "metro/ws": ["ws@7.5.10", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ=="],
+
+ "metro-config/cosmiconfig": ["cosmiconfig@5.2.1", "", { "dependencies": { "import-fresh": "^2.0.0", "is-directory": "^0.3.1", "js-yaml": "^3.13.1", "parse-json": "^4.0.0" } }, "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA=="],
+
+ "metro-file-map/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
+
+ "minipass-flush/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="],
+
+ "minipass-pipeline/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="],
+
+ "minizlib/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="],
+
+ "next/postcss": ["postcss@8.4.31", "", { "dependencies": { "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" } }, "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ=="],
+
+ "next-dev/@mantine/hooks": ["@mantine/hooks@7.17.0", "", { "peerDependencies": { "react": "^18.x || ^19.x" } }, "sha512-vo3K49mLy1nJ8LQNb5KDbJgnX0xwt3Y8JOF3ythjB5LEFMptdLSSgulu64zj+QHtzvffFCsMb05DbTLLpVP/JQ=="],
+
+ "next-dev/axios": ["axios@1.8.1", "", { "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } }, "sha512-NN+fvwH/kV01dYUQ3PTOZns4LWtWhOFCAhQ/pHb88WQ1hNe5V/dvFwc4VJcDL11LT9xSX0QtsR8sWUuyOuOq7g=="],
+
+ "next-dev/react": ["react@18.3.1", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ=="],
+
+ "next-dev/react-dom": ["react-dom@18.3.1", "", { "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" }, "peerDependencies": { "react": "^18.3.1" } }, "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw=="],
+
+ "next-scroll-loader/react": ["react@18.3.1", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ=="],
+
+ "next-scroll-loader/react-dom": ["react-dom@18.3.1", "", { "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" }, "peerDependencies": { "react": "^18.3.1" } }, "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw=="],
+
+ "npm-run-path/path-key": ["path-key@2.0.1", "", {}, "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw=="],
+
+ "onnxruntime-node/tar": ["tar@7.4.3", "", { "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", "minizlib": "^3.0.1", "mkdirp": "^3.0.1", "yallist": "^5.0.0" } }, "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw=="],
+
+ "onnxruntime-web/onnxruntime-common": ["onnxruntime-common@1.21.0-dev.20250206-d981b153d3", "", {}, "sha512-TwaE51xV9q2y8pM61q73rbywJnusw9ivTEHAJ39GVWNZqxCoDBpe/tQkh/w9S+o/g+zS7YeeL0I/2mEWd+dgyA=="],
+
+ "openai/@types/node": ["@types/node@18.19.76", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-yvR7Q9LdPz2vGpmpJX5LolrgRdWvB67MJKDPSgIIzpFbaf9a1j/f5DnLp5VDyHGMR0QZHlTr1afsD87QCXFHKw=="],
+
+ "openai/node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="],
+
+ "ora/chalk": ["chalk@2.4.2", "", { "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } }, "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ=="],
+
+ "ora/strip-ansi": ["strip-ansi@5.2.0", "", { "dependencies": { "ansi-regex": "^4.1.0" } }, "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA=="],
+
+ "p-locate/p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="],
+
+ "password-prompt/ansi-escapes": ["ansi-escapes@4.3.2", "", { "dependencies": { "type-fest": "^0.21.3" } }, "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ=="],
+
+ "pdf-lib/tslib": ["tslib@1.14.1", "", {}, "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="],
+
+ "peerjs/eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="],
+
+ "pkg-dir/find-up": ["find-up@3.0.0", "", { "dependencies": { "locate-path": "^3.0.0" } }, "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg=="],
+
+ "plist/@xmldom/xmldom": ["@xmldom/xmldom@0.8.10", "", {}, "sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw=="],
+
+ "plist/xmlbuilder": ["xmlbuilder@15.1.1", "", {}, "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg=="],
+
+ "postcss-load-config/lilconfig": ["lilconfig@3.1.3", "", {}, "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw=="],
+
+ "pretty-format/ansi-styles": ["ansi-styles@5.2.0", "", {}, "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA=="],
+
+ "pretty-format/react-is": ["react-is@18.3.1", "", {}, "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg=="],
+
+ "pvtsutils/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "rc/strip-json-comments": ["strip-json-comments@2.0.1", "", {}, "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ=="],
+
+ "react-devtools-core/ws": ["ws@7.5.10", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ=="],
+
+ "react-dom/scheduler": ["scheduler@0.23.2", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ=="],
+
+ "react-native/scheduler": ["scheduler@0.25.0", "", {}, "sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA=="],
+
+ "react-native/ws": ["ws@6.2.3", "", { "dependencies": { "async-limiter": "~1.0.0" } }, "sha512-jmTjYU0j60B+vHey6TfR3Z7RD61z/hmxBS3VMSGIrroOWXQEneK1zNuotOUrGyBHQj0yrpsLHPWtigEFd13ndA=="],
+
+ "react-native-web/@react-native/normalize-colors": ["@react-native/normalize-colors@0.74.89", "", {}, "sha512-qoMMXddVKVhZ8PA1AbUCk83trpd6N+1nF2A6k1i6LsQObyS92fELuk8kU/lQs6M7BsMHwqyLCpQJ1uFgNvIQXg=="],
+
+ "react-native-web/memoize-one": ["memoize-one@6.0.0", "", {}, "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw=="],
+
+ "react-pdf/pdfjs-dist": ["pdfjs-dist@4.8.69", "", { "optionalDependencies": { "canvas": "^3.0.0-rc2", "path2d": "^0.2.1" } }, "sha512-IHZsA4T7YElCKNNXtiLgqScw4zPd3pG9do8UrznC757gMd7UPeHSL2qwNNMJo4r79fl8oj1Xx+1nh2YkzdMpLQ=="],
+
+ "react-remove-scroll/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "react-remove-scroll-bar/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "react-style-singleton/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "react-toastify/clsx": ["clsx@1.2.1", "", {}, "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg=="],
+
+ "recast/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="],
+
+ "recast/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "regjsparser/jsesc": ["jsesc@3.0.2", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g=="],
+
+ "requireg/resolve": ["resolve@1.7.1", "", { "dependencies": { "path-parse": "^1.0.5" } }, "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw=="],
+
+ "restore-cursor/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="],
+
+ "safe-array-concat/isarray": ["isarray@2.0.5", "", {}, "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw=="],
+
+ "safe-push-apply/isarray": ["isarray@2.0.5", "", {}, "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw=="],
+
+ "send/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
+
+ "serve-static/send": ["send@0.19.0", "", { "dependencies": { "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", "http-errors": "2.0.0", "mime": "1.6.0", "ms": "2.1.3", "on-finished": "2.4.1", "range-parser": "~1.2.1", "statuses": "2.0.1" } }, "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw=="],
+
+ "simple-plist/bplist-creator": ["bplist-creator@0.1.0", "", { "dependencies": { "stream-buffers": "2.2.x" } }, "sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg=="],
+
+ "simple-plist/bplist-parser": ["bplist-parser@0.3.1", "", { "dependencies": { "big-integer": "1.6.x" } }, "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA=="],
+
+ "socket.io-client/debug": ["debug@4.3.7", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ=="],
+
+ "socket.io-parser/debug": ["debug@4.3.7", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ=="],
+
+ "source-map-support/buffer-from": ["buffer-from@1.1.2", "", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="],
+
+ "source-map-support/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="],
+
+ "split-string/extend-shallow": ["extend-shallow@3.0.2", "", { "dependencies": { "assign-symbols": "^1.0.0", "is-extendable": "^1.0.1" } }, "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q=="],
+
+ "stack-utils/escape-string-regexp": ["escape-string-regexp@2.0.0", "", {}, "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w=="],
+
+ "stacktrace-parser/type-fest": ["type-fest@0.7.1", "", {}, "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg=="],
+
+ "string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
+
+ "string-width-cjs/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
+
+ "string_decoder/safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
+
+ "styled-components/postcss": ["postcss@8.4.49", "", { "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA=="],
+
+ "styled-components/tslib": ["tslib@2.6.2", "", {}, "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="],
+
+ "sucrase/commander": ["commander@4.1.1", "", {}, "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA=="],
+
+ "sucrase/glob": ["glob@10.4.5", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg=="],
+
+ "tar/fs-minipass": ["fs-minipass@2.1.0", "", { "dependencies": { "minipass": "^3.0.0" } }, "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg=="],
+
+ "tar/minipass": ["minipass@5.0.0", "", {}, "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ=="],
+
+ "tar/mkdirp": ["mkdirp@1.0.4", "", { "bin": { "mkdirp": "bin/cmd.js" } }, "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="],
+
+ "tar-fs/chownr": ["chownr@1.1.4", "", {}, "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="],
+
+ "tar-stream/bl": ["bl@4.1.0", "", { "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } }, "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="],
+
+ "tar-stream/readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="],
+
+ "temp/rimraf": ["rimraf@2.6.3", "", { "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "./bin.js" } }, "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA=="],
+
+ "tempy/type-fest": ["type-fest@0.16.0", "", {}, "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg=="],
+
+ "terminal-link/ansi-escapes": ["ansi-escapes@4.3.2", "", { "dependencies": { "type-fest": "^0.21.3" } }, "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ=="],
+
+ "terser/commander": ["commander@2.20.3", "", {}, "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="],
+
+ "through2/readable-stream": ["readable-stream@1.0.34", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", "isarray": "0.0.1", "string_decoder": "~0.10.x" } }, "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg=="],
+
+ "tinyglobby/picomatch": ["picomatch@4.0.2", "", {}, "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg=="],
+
+ "ts-node/arg": ["arg@4.1.3", "", {}, "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA=="],
+
+ "tsconfig-paths/json5": ["json5@1.0.2", "", { "dependencies": { "minimist": "^1.2.0" }, "bin": { "json5": "lib/cli.js" } }, "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA=="],
+
+ "tunnel-agent/safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
+
+ "unicode-trie/pako": ["pako@0.2.9", "", {}, "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA=="],
+
+ "use-callback-ref/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "use-sidecar/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "webcrypto-core/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "whatwg-url/webidl-conversions": ["webidl-conversions@3.0.1", "", {}, "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="],
+
+ "whatwg-url-without-unicode/buffer": ["buffer@5.7.1", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="],
+
+ "which-builtin-type/isarray": ["isarray@2.0.5", "", {}, "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw=="],
+
+ "wibu/@mantine/core": ["@mantine/core@7.17.0", "", { "dependencies": { "@floating-ui/react": "^0.26.28", "clsx": "^2.1.1", "react-number-format": "^5.4.3", "react-remove-scroll": "^2.6.2", "react-textarea-autosize": "8.5.6", "type-fest": "^4.27.0" }, "peerDependencies": { "@mantine/hooks": "7.17.0", "react": "^18.x || ^19.x", "react-dom": "^18.x || ^19.x" } }, "sha512-AU5UFewUNzBCUXIq5Jk6q402TEri7atZW61qHW6P0GufJ2W/JxGHRvgmHOVHTVIcuWQRCt9SBSqZoZ/vHs9LhA=="],
+
+ "wibu/@mantine/hooks": ["@mantine/hooks@7.17.0", "", { "peerDependencies": { "react": "^18.x || ^19.x" } }, "sha512-vo3K49mLy1nJ8LQNb5KDbJgnX0xwt3Y8JOF3ythjB5LEFMptdLSSgulu64zj+QHtzvffFCsMb05DbTLLpVP/JQ=="],
+
+ "wibu/next": ["next@14.2.24", "", { "dependencies": { "@next/env": "14.2.24", "@swc/helpers": "0.5.5", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", "graceful-fs": "^4.2.11", "postcss": "8.4.31", "styled-jsx": "5.1.1" }, "optionalDependencies": { "@next/swc-darwin-arm64": "14.2.24", "@next/swc-darwin-x64": "14.2.24", "@next/swc-linux-arm64-gnu": "14.2.24", "@next/swc-linux-arm64-musl": "14.2.24", "@next/swc-linux-x64-gnu": "14.2.24", "@next/swc-linux-x64-musl": "14.2.24", "@next/swc-win32-arm64-msvc": "14.2.24", "@next/swc-win32-ia32-msvc": "14.2.24", "@next/swc-win32-x64-msvc": "14.2.24" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.41.2", "react": "^18.2.0", "react-dom": "^18.2.0", "sass": "^1.3.0" }, "optionalPeers": ["@opentelemetry/api", "@playwright/test", "sass"], "bin": { "next": "dist/bin/next" } }, "sha512-En8VEexSJ0Py2FfVnRRh8gtERwDRaJGNvsvad47ShkC2Yi8AXQPXEA2vKoDJlGFSj5WE5SyF21zNi4M5gyi+SQ=="],
+
+ "wibu/react": ["react@18.3.1", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ=="],
+
+ "wibu/react-dom": ["react-dom@18.3.1", "", { "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" }, "peerDependencies": { "react": "^18.3.1" } }, "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw=="],
+
+ "wibu/readdirp": ["readdirp@4.1.2", "", {}, "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg=="],
+
+ "wibu/typescript": ["typescript@5.7.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw=="],
+
+ "wibu-cli/readdirp": ["readdirp@4.1.2", "", {}, "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg=="],
+
+ "wibu-pkg/@mantine/core": ["@mantine/core@7.17.0", "", { "dependencies": { "@floating-ui/react": "^0.26.28", "clsx": "^2.1.1", "react-number-format": "^5.4.3", "react-remove-scroll": "^2.6.2", "react-textarea-autosize": "8.5.6", "type-fest": "^4.27.0" }, "peerDependencies": { "@mantine/hooks": "7.17.0", "react": "^18.x || ^19.x", "react-dom": "^18.x || ^19.x" } }, "sha512-AU5UFewUNzBCUXIq5Jk6q402TEri7atZW61qHW6P0GufJ2W/JxGHRvgmHOVHTVIcuWQRCt9SBSqZoZ/vHs9LhA=="],
+
+ "wibu-pkg/@mantine/hooks": ["@mantine/hooks@7.17.0", "", { "peerDependencies": { "react": "^18.x || ^19.x" } }, "sha512-vo3K49mLy1nJ8LQNb5KDbJgnX0xwt3Y8JOF3ythjB5LEFMptdLSSgulu64zj+QHtzvffFCsMb05DbTLLpVP/JQ=="],
+
+ "wibu-pkg/@types/uuid": ["@types/uuid@10.0.0", "", {}, "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ=="],
+
+ "wibu-pkg/uuid": ["uuid@11.1.0", "", { "bin": { "uuid": "dist/esm/bin/uuid" } }, "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A=="],
+
+ "winston/readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="],
+
+ "winston-transport/readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="],
+
+ "worker-timers/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "worker-timers-broker/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "worker-timers-worker/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "write-file-atomic/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="],
+
+ "xcode/uuid": ["uuid@7.0.3", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg=="],
+
+ "xml2js/xmlbuilder": ["xmlbuilder@11.0.1", "", {}, "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="],
+
+ "xtend/object-keys": ["object-keys@0.4.0", "", {}, "sha512-ncrLw+X55z7bkl5PnUvHwFK9FcGuFYo9gtjws2XtSzL+aZ8tm830P60WJ0dSmFVaSalWieW5MD7kEdnXda9yJw=="],
+
+ "@babel/helper-compilation-targets/lru-cache/yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="],
+
+ "@babel/highlight/chalk/ansi-styles": ["ansi-styles@3.2.1", "", { "dependencies": { "color-convert": "^1.9.0" } }, "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA=="],
+
+ "@babel/highlight/chalk/escape-string-regexp": ["escape-string-regexp@1.0.5", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="],
+
+ "@babel/highlight/chalk/supports-color": ["supports-color@5.5.0", "", { "dependencies": { "has-flag": "^3.0.0" } }, "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow=="],
+
+ "@cyntler/react-doc-viewer/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
+
+ "@expo/cli/glob/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
+
+ "@expo/config-plugins/glob/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
+
+ "@expo/config/glob/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
+
+ "@expo/devcert/glob/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
+
+ "@expo/fingerprint/p-limit/yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="],
+
+ "@expo/image-utils/fs-extra/jsonfile": ["jsonfile@6.1.0", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ=="],
+
+ "@expo/image-utils/fs-extra/universalify": ["universalify@1.0.0", "", {}, "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug=="],
+
+ "@expo/metro-config/fs-extra/jsonfile": ["jsonfile@6.1.0", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ=="],
+
+ "@expo/metro-config/fs-extra/universalify": ["universalify@2.0.1", "", {}, "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw=="],
+
+ "@expo/metro-config/glob/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
+
+ "@expo/package-manager/js-yaml/argparse": ["argparse@1.0.10", "", { "dependencies": { "sprintf-js": "~1.0.2" } }, "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg=="],
+
+ "@expo/prebuild-config/fs-extra/jsonfile": ["jsonfile@6.1.0", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ=="],
+
+ "@expo/prebuild-config/fs-extra/universalify": ["universalify@2.0.1", "", {}, "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw=="],
+
+ "@isaacs/cliui/string-width/emoji-regex": ["emoji-regex@9.2.2", "", {}, "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="],
+
+ "@isaacs/cliui/strip-ansi/ansi-regex": ["ansi-regex@6.1.0", "", {}, "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA=="],
+
+ "@isaacs/cliui/wrap-ansi/ansi-styles": ["ansi-styles@6.2.1", "", {}, "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug=="],
+
+ "@istanbuljs/load-nyc-config/find-up/locate-path": ["locate-path@5.0.0", "", { "dependencies": { "p-locate": "^4.1.0" } }, "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g=="],
+
+ "@istanbuljs/load-nyc-config/js-yaml/argparse": ["argparse@1.0.10", "", { "dependencies": { "sprintf-js": "~1.0.2" } }, "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg=="],
+
+ "@jest/transform/write-file-atomic/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="],
+
+ "@react-native/babel-plugin-codegen/@react-native/codegen/hermes-parser": ["hermes-parser@0.23.1", "", { "dependencies": { "hermes-estree": "0.23.1" } }, "sha512-oxl5h2DkFW83hT4DAUJorpah8ou4yvmweUzLJmmr6YV2cezduCdlil1AvU/a/xSsAFo4WUcNA4GoV5Bvq6JffA=="],
+
+ "@react-native/babel-plugin-codegen/@react-native/codegen/jscodeshift": ["jscodeshift@0.14.0", "", { "dependencies": { "@babel/core": "^7.13.16", "@babel/parser": "^7.13.16", "@babel/plugin-proposal-class-properties": "^7.13.0", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.13.8", "@babel/plugin-proposal-optional-chaining": "^7.13.12", "@babel/plugin-transform-modules-commonjs": "^7.13.8", "@babel/preset-flow": "^7.13.13", "@babel/preset-typescript": "^7.13.0", "@babel/register": "^7.13.16", "babel-core": "^7.0.0-bridge.0", "chalk": "^4.1.2", "flow-parser": "0.*", "graceful-fs": "^4.2.4", "micromatch": "^4.0.4", "neo-async": "^2.5.0", "node-dir": "^0.1.17", "recast": "^0.21.0", "temp": "^0.8.4", "write-file-atomic": "^2.3.0" }, "peerDependencies": { "@babel/preset-env": "^7.1.6" }, "bin": { "jscodeshift": "bin/jscodeshift.js" } }, "sha512-7eCC1knD7bLUPuSCwXsMZUH51O8jIcoVyKtI6P0XM0IVzlGjckPy3FIwQlorzbN0Sg79oK+RlohN32Mqf/lrYA=="],
+
+ "@react-native/community-cli-plugin/@react-native/dev-middleware/@react-native/debugger-frontend": ["@react-native/debugger-frontend@0.78.0", "", {}, "sha512-KQYD9QlxES/VdmXh9EEvtZCJK1KAemLlszQq4dpLU1stnue5N8dnCY6A7PpStMf5UtAMk7tiniQhaicw0uVHgQ=="],
+
+ "@react-native/community-cli-plugin/@react-native/dev-middleware/ws": ["ws@6.2.3", "", { "dependencies": { "async-limiter": "~1.0.0" } }, "sha512-jmTjYU0j60B+vHey6TfR3Z7RD61z/hmxBS3VMSGIrroOWXQEneK1zNuotOUrGyBHQj0yrpsLHPWtigEFd13ndA=="],
+
+ "@react-native/community-cli-plugin/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
+
+ "@react-native/dev-middleware/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
+
+ "@react-native/metro-babel-transformer/@react-native/babel-preset/@react-native/babel-plugin-codegen": ["@react-native/babel-plugin-codegen@0.78.0", "", { "dependencies": { "@babel/traverse": "^7.25.3", "@react-native/codegen": "0.78.0" } }, "sha512-+Sy9Uine0QAbQRxMl6kBlkzKW0qHQk8hghCoKswRWt1ZfxaMA3rezobD5mtSwt/Yhadds9cGbMFWfFJM3Tynsg=="],
+
+ "@react-pdf/types/@react-pdf/stylesheet/@react-pdf/fns": ["@react-pdf/fns@3.1.1", "", {}, "sha512-fYvgOWWRxTdkCciLSla2iek8W/oDLhExPTLPw3aArGPJHgVUc86V2c3YLULNHIBuy/64QVpPLB7gwNkTEW5m/A=="],
+
+ "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
+
+ "blessed-contrib/chalk/ansi-styles": ["ansi-styles@2.2.1", "", {}, "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA=="],
+
+ "blessed-contrib/chalk/escape-string-regexp": ["escape-string-regexp@1.0.5", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="],
+
+ "blessed-contrib/chalk/supports-color": ["supports-color@2.0.0", "", {}, "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g=="],
+
+ "blessed-contrib/strip-ansi/ansi-regex": ["ansi-regex@2.1.1", "", {}, "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA=="],
+
+ "cacache/glob/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
+
+ "colorspace/color/color-convert": ["color-convert@1.9.3", "", { "dependencies": { "color-name": "1.1.3" } }, "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg=="],
+
+ "compression/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
+
+ "connect/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
+
+ "duplexer2/readable-stream/isarray": ["isarray@1.0.0", "", {}, "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="],
+
+ "duplexer2/readable-stream/string_decoder": ["string_decoder@1.1.1", "", { "dependencies": { "safe-buffer": "~5.1.0" } }, "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg=="],
+
+ "eslint-config-next/@typescript-eslint/parser/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@6.21.0", "", { "dependencies": { "@typescript-eslint/types": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0" } }, "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg=="],
+
+ "eslint-config-next/@typescript-eslint/parser/@typescript-eslint/types": ["@typescript-eslint/types@6.21.0", "", {}, "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg=="],
+
+ "eslint-config-next/@typescript-eslint/parser/@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@6.21.0", "", { "dependencies": { "@typescript-eslint/types": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", "minimatch": "9.0.3", "semver": "^7.5.4", "ts-api-utils": "^1.0.1" } }, "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ=="],
+
+ "eslint-config-next/@typescript-eslint/parser/@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@6.21.0", "", { "dependencies": { "@typescript-eslint/types": "6.21.0", "eslint-visitor-keys": "^3.4.1" } }, "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A=="],
+
+ "execa/cross-spawn/path-key": ["path-key@2.0.1", "", {}, "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw=="],
+
+ "execa/cross-spawn/semver": ["semver@5.7.2", "", { "bin": { "semver": "bin/semver" } }, "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g=="],
+
+ "execa/cross-spawn/shebang-command": ["shebang-command@1.2.0", "", { "dependencies": { "shebang-regex": "^1.0.0" } }, "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg=="],
+
+ "execa/cross-spawn/which": ["which@1.3.1", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "which": "./bin/which" } }, "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ=="],
+
+ "expo-modules-autolinking/fs-extra/jsonfile": ["jsonfile@6.1.0", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ=="],
+
+ "expo-modules-autolinking/fs-extra/universalify": ["universalify@2.0.1", "", {}, "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw=="],
+
+ "finalhandler/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
+
+ "fontkit/@swc/helpers/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "html-tokenize/readable-stream/string_decoder": ["string_decoder@0.10.31", "", {}, "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ=="],
+
+ "lighthouse-logger/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
+
+ "log-symbols/chalk/ansi-styles": ["ansi-styles@3.2.1", "", { "dependencies": { "color-convert": "^1.9.0" } }, "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA=="],
+
+ "log-symbols/chalk/escape-string-regexp": ["escape-string-regexp@1.0.5", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="],
+
+ "log-symbols/chalk/supports-color": ["supports-color@5.5.0", "", { "dependencies": { "has-flag": "^3.0.0" } }, "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow=="],
+
+ "map-canvas/xml2js/xmlbuilder": ["xmlbuilder@11.0.1", "", {}, "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="],
+
+ "memory-streams/readable-stream/string_decoder": ["string_decoder@0.10.31", "", {}, "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ=="],
+
+ "metro-config/cosmiconfig/import-fresh": ["import-fresh@2.0.0", "", { "dependencies": { "caller-path": "^2.0.0", "resolve-from": "^3.0.0" } }, "sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg=="],
+
+ "metro-config/cosmiconfig/js-yaml": ["js-yaml@3.14.1", "", { "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g=="],
+
+ "metro-config/cosmiconfig/parse-json": ["parse-json@4.0.0", "", { "dependencies": { "error-ex": "^1.3.1", "json-parse-better-errors": "^1.0.1" } }, "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw=="],
+
+ "metro-file-map/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
+
+ "metro/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
+
+ "next-dev/react-dom/scheduler": ["scheduler@0.23.2", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ=="],
+
+ "next-scroll-loader/react-dom/scheduler": ["scheduler@0.23.2", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ=="],
+
+ "onnxruntime-node/tar/chownr": ["chownr@3.0.0", "", {}, "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g=="],
+
+ "onnxruntime-node/tar/minizlib": ["minizlib@3.0.1", "", { "dependencies": { "minipass": "^7.0.4", "rimraf": "^5.0.5" } }, "sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg=="],
+
+ "onnxruntime-node/tar/mkdirp": ["mkdirp@3.0.1", "", { "bin": { "mkdirp": "dist/cjs/src/bin.js" } }, "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg=="],
+
+ "onnxruntime-node/tar/yallist": ["yallist@5.0.0", "", {}, "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw=="],
+
+ "ora/chalk/ansi-styles": ["ansi-styles@3.2.1", "", { "dependencies": { "color-convert": "^1.9.0" } }, "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA=="],
+
+ "ora/chalk/escape-string-regexp": ["escape-string-regexp@1.0.5", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="],
+
+ "ora/chalk/supports-color": ["supports-color@5.5.0", "", { "dependencies": { "has-flag": "^3.0.0" } }, "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow=="],
+
+ "ora/strip-ansi/ansi-regex": ["ansi-regex@4.1.1", "", {}, "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g=="],
+
+ "p-locate/p-limit/yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="],
+
+ "password-prompt/ansi-escapes/type-fest": ["type-fest@0.21.3", "", {}, "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w=="],
+
+ "pkg-dir/find-up/locate-path": ["locate-path@3.0.0", "", { "dependencies": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" } }, "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A=="],
+
+ "send/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
+
+ "serve-static/send/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
+
+ "serve-static/send/encodeurl": ["encodeurl@1.0.2", "", {}, "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w=="],
+
+ "split-string/extend-shallow/is-extendable": ["is-extendable@1.0.1", "", { "dependencies": { "is-plain-object": "^2.0.4" } }, "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA=="],
+
+ "sucrase/glob/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
+
+ "tar-stream/bl/buffer": ["buffer@5.7.1", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="],
+
+ "tar/fs-minipass/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="],
+
+ "terminal-link/ansi-escapes/type-fest": ["type-fest@0.21.3", "", {}, "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w=="],
+
+ "through2/readable-stream/string_decoder": ["string_decoder@0.10.31", "", {}, "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ=="],
+
+ "wibu-pkg/@mantine/core/@floating-ui/react": ["@floating-ui/react@0.26.28", "", { "dependencies": { "@floating-ui/react-dom": "^2.1.2", "@floating-ui/utils": "^0.2.8", "tabbable": "^6.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-yORQuuAtVpiRjpMhdc0wJj06b9JFjrYF4qp96j++v2NBpbi6SEGF7donUJ3TMieerQ6qVkAv1tgr7L4r5roTqw=="],
+
+ "wibu-pkg/@mantine/core/react-textarea-autosize": ["react-textarea-autosize@8.5.6", "", { "dependencies": { "@babel/runtime": "^7.20.13", "use-composed-ref": "^1.3.0", "use-latest": "^1.2.1" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-aT3ioKXMa8f6zHYGebhbdMD2L00tKeRX1zuVuDx9YQK/JLLRSaSxq3ugECEmUB9z2kvk6bFSIoRHLkkUv0RJiw=="],
+
+ "wibu-pkg/@mantine/core/type-fest": ["type-fest@4.35.0", "", {}, "sha512-2/AwEFQDFEy30iOLjrvHDIH7e4HEWH+f1Yl1bI5XMqzuoCUqwYCdxachgsgv0og/JdVZUhbfjcJAoHj5L1753A=="],
+
+ "wibu/@mantine/core/@floating-ui/react": ["@floating-ui/react@0.26.28", "", { "dependencies": { "@floating-ui/react-dom": "^2.1.2", "@floating-ui/utils": "^0.2.8", "tabbable": "^6.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-yORQuuAtVpiRjpMhdc0wJj06b9JFjrYF4qp96j++v2NBpbi6SEGF7donUJ3TMieerQ6qVkAv1tgr7L4r5roTqw=="],
+
+ "wibu/@mantine/core/react-textarea-autosize": ["react-textarea-autosize@8.5.6", "", { "dependencies": { "@babel/runtime": "^7.20.13", "use-composed-ref": "^1.3.0", "use-latest": "^1.2.1" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-aT3ioKXMa8f6zHYGebhbdMD2L00tKeRX1zuVuDx9YQK/JLLRSaSxq3ugECEmUB9z2kvk6bFSIoRHLkkUv0RJiw=="],
+
+ "wibu/@mantine/core/type-fest": ["type-fest@4.35.0", "", {}, "sha512-2/AwEFQDFEy30iOLjrvHDIH7e4HEWH+f1Yl1bI5XMqzuoCUqwYCdxachgsgv0og/JdVZUhbfjcJAoHj5L1753A=="],
+
+ "wibu/next/@next/env": ["@next/env@14.2.24", "", {}, "sha512-LAm0Is2KHTNT6IT16lxT+suD0u+VVfYNQqM+EJTKuFRRuY2z+zj01kueWXPCxbMBDt0B5vONYzabHGUNbZYAhA=="],
+
+ "wibu/next/@next/swc-darwin-arm64": ["@next/swc-darwin-arm64@14.2.24", "", { "os": "darwin", "cpu": "arm64" }, "sha512-7Tdi13aojnAZGpapVU6meVSpNzgrFwZ8joDcNS8cJVNuP3zqqrLqeory9Xec5TJZR/stsGJdfwo8KeyloT3+rQ=="],
+
+ "wibu/next/@next/swc-darwin-x64": ["@next/swc-darwin-x64@14.2.24", "", { "os": "darwin", "cpu": "x64" }, "sha512-lXR2WQqUtu69l5JMdTwSvQUkdqAhEWOqJEYUQ21QczQsAlNOW2kWZCucA6b3EXmPbcvmHB1kSZDua/713d52xg=="],
+
+ "wibu/next/@next/swc-linux-arm64-gnu": ["@next/swc-linux-arm64-gnu@14.2.24", "", { "os": "linux", "cpu": "arm64" }, "sha512-nxvJgWOpSNmzidYvvGDfXwxkijb6hL9+cjZx1PVG6urr2h2jUqBALkKjT7kpfurRWicK6hFOvarmaWsINT1hnA=="],
+
+ "wibu/next/@next/swc-linux-arm64-musl": ["@next/swc-linux-arm64-musl@14.2.24", "", { "os": "linux", "cpu": "arm64" }, "sha512-PaBgOPhqa4Abxa3y/P92F3kklNPsiFjcjldQGT7kFmiY5nuFn8ClBEoX8GIpqU1ODP2y8P6hio6vTomx2Vy0UQ=="],
+
+ "wibu/next/@next/swc-linux-x64-gnu": ["@next/swc-linux-x64-gnu@14.2.24", "", { "os": "linux", "cpu": "x64" }, "sha512-vEbyadiRI7GOr94hd2AB15LFVgcJZQWu7Cdi9cWjCMeCiUsHWA0U5BkGPuoYRnTxTn0HacuMb9NeAmStfBCLoQ=="],
+
+ "wibu/next/@next/swc-linux-x64-musl": ["@next/swc-linux-x64-musl@14.2.24", "", { "os": "linux", "cpu": "x64" }, "sha512-df0FC9ptaYsd8nQCINCzFtDWtko8PNRTAU0/+d7hy47E0oC17tI54U/0NdGk7l/76jz1J377dvRjmt6IUdkpzQ=="],
+
+ "wibu/next/@next/swc-win32-arm64-msvc": ["@next/swc-win32-arm64-msvc@14.2.24", "", { "os": "win32", "cpu": "arm64" }, "sha512-ZEntbLjeYAJ286eAqbxpZHhDFYpYjArotQ+/TW9j7UROh0DUmX7wYDGtsTPpfCV8V+UoqHBPU7q9D4nDNH014Q=="],
+
+ "wibu/next/@next/swc-win32-ia32-msvc": ["@next/swc-win32-ia32-msvc@14.2.24", "", { "os": "win32", "cpu": "ia32" }, "sha512-9KuS+XUXM3T6v7leeWU0erpJ6NsFIwiTFD5nzNg8J5uo/DMIPvCp3L1Ao5HjbHX0gkWPB1VrKoo/Il4F0cGK2Q=="],
+
+ "wibu/next/@next/swc-win32-x64-msvc": ["@next/swc-win32-x64-msvc@14.2.24", "", { "os": "win32", "cpu": "x64" }, "sha512-cXcJ2+x0fXQ2CntaE00d7uUH+u1Bfp/E0HsNQH79YiLaZE5Rbm7dZzyAYccn3uICM7mw+DxoMqEfGXZtF4Fgaw=="],
+
+ "wibu/next/@swc/helpers": ["@swc/helpers@0.5.5", "", { "dependencies": { "@swc/counter": "^0.1.3", "tslib": "^2.4.0" } }, "sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A=="],
+
+ "wibu/next/postcss": ["postcss@8.4.31", "", { "dependencies": { "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" } }, "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ=="],
+
+ "wibu/react-dom/scheduler": ["scheduler@0.23.2", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ=="],
+
+ "@babel/highlight/chalk/ansi-styles/color-convert": ["color-convert@1.9.3", "", { "dependencies": { "color-name": "1.1.3" } }, "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg=="],
+
+ "@babel/highlight/chalk/supports-color/has-flag": ["has-flag@3.0.0", "", {}, "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="],
+
+ "@expo/cli/glob/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
+
+ "@expo/config-plugins/glob/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
+
+ "@expo/config/glob/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
+
+ "@expo/devcert/glob/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
+
+ "@expo/image-utils/fs-extra/jsonfile/universalify": ["universalify@2.0.1", "", {}, "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw=="],
+
+ "@expo/metro-config/glob/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
+
+ "@istanbuljs/load-nyc-config/find-up/locate-path/p-locate": ["p-locate@4.1.0", "", { "dependencies": { "p-limit": "^2.2.0" } }, "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A=="],
+
+ "@react-native/babel-plugin-codegen/@react-native/codegen/hermes-parser/hermes-estree": ["hermes-estree@0.23.1", "", {}, "sha512-eT5MU3f5aVhTqsfIReZ6n41X5sYn4IdQL0nvz6yO+MMlPxw49aSARHLg/MSehQftyjnrE8X6bYregzSumqc6cg=="],
+
+ "@react-native/babel-plugin-codegen/@react-native/codegen/jscodeshift/recast": ["recast@0.21.5", "", { "dependencies": { "ast-types": "0.15.2", "esprima": "~4.0.0", "source-map": "~0.6.1", "tslib": "^2.0.1" } }, "sha512-hjMmLaUXAm1hIuTqOdeYObMslq/q+Xff6QE3Y2P+uoHAg2nmVlLBps2hzh1UJDdMtDTMXOFewK6ky51JQIeECg=="],
+
+ "cacache/glob/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
+
+ "colorspace/color/color-convert/color-name": ["color-name@1.1.3", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="],
+
+ "eslint-config-next/@typescript-eslint/parser/@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.3", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg=="],
+
+ "execa/cross-spawn/shebang-command/shebang-regex": ["shebang-regex@1.0.0", "", {}, "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ=="],
+
+ "log-symbols/chalk/ansi-styles/color-convert": ["color-convert@1.9.3", "", { "dependencies": { "color-name": "1.1.3" } }, "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg=="],
+
+ "log-symbols/chalk/supports-color/has-flag": ["has-flag@3.0.0", "", {}, "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="],
+
+ "metro-config/cosmiconfig/import-fresh/resolve-from": ["resolve-from@3.0.0", "", {}, "sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw=="],
+
+ "metro-config/cosmiconfig/js-yaml/argparse": ["argparse@1.0.10", "", { "dependencies": { "sprintf-js": "~1.0.2" } }, "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg=="],
+
+ "onnxruntime-node/tar/minizlib/rimraf": ["rimraf@5.0.10", "", { "dependencies": { "glob": "^10.3.7" }, "bin": { "rimraf": "dist/esm/bin.mjs" } }, "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ=="],
+
+ "ora/chalk/ansi-styles/color-convert": ["color-convert@1.9.3", "", { "dependencies": { "color-name": "1.1.3" } }, "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg=="],
+
+ "ora/chalk/supports-color/has-flag": ["has-flag@3.0.0", "", {}, "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="],
+
+ "pkg-dir/find-up/locate-path/p-locate": ["p-locate@3.0.0", "", { "dependencies": { "p-limit": "^2.0.0" } }, "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ=="],
+
+ "pkg-dir/find-up/locate-path/path-exists": ["path-exists@3.0.0", "", {}, "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ=="],
+
+ "serve-static/send/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
+
+ "sucrase/glob/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
+
+ "wibu-pkg/@mantine/core/@floating-ui/react/@floating-ui/react-dom": ["@floating-ui/react-dom@2.1.2", "", { "dependencies": { "@floating-ui/dom": "^1.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-06okr5cgPzMNBy+Ycse2A6udMi4bqwW/zgBF/rwjcNqWkyr82Mcg8b0vjX8OJpZFy/FKjJmw6wV7t44kK6kW7A=="],
+
+ "wibu/@mantine/core/@floating-ui/react/@floating-ui/react-dom": ["@floating-ui/react-dom@2.1.2", "", { "dependencies": { "@floating-ui/dom": "^1.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-06okr5cgPzMNBy+Ycse2A6udMi4bqwW/zgBF/rwjcNqWkyr82Mcg8b0vjX8OJpZFy/FKjJmw6wV7t44kK6kW7A=="],
+
+ "wibu/next/@swc/helpers/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "@babel/highlight/chalk/ansi-styles/color-convert/color-name": ["color-name@1.1.3", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="],
+
+ "@istanbuljs/load-nyc-config/find-up/locate-path/p-locate/p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="],
+
+ "@react-native/babel-plugin-codegen/@react-native/codegen/jscodeshift/recast/ast-types": ["ast-types@0.15.2", "", { "dependencies": { "tslib": "^2.0.1" } }, "sha512-c27loCv9QkZinsa5ProX751khO9DJl/AcB5c2KNtA6NRvHKS0PgLfcftz72KVq504vB0Gku5s2kUZzDBvQWvHg=="],
+
+ "@react-native/babel-plugin-codegen/@react-native/codegen/jscodeshift/recast/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="],
+
+ "@react-native/babel-plugin-codegen/@react-native/codegen/jscodeshift/recast/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "eslint-config-next/@typescript-eslint/parser/@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
+
+ "log-symbols/chalk/ansi-styles/color-convert/color-name": ["color-name@1.1.3", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="],
+
+ "onnxruntime-node/tar/minizlib/rimraf/glob": ["glob@10.4.5", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg=="],
+
+ "ora/chalk/ansi-styles/color-convert/color-name": ["color-name@1.1.3", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="],
+
+ "pkg-dir/find-up/locate-path/p-locate/p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="],
+
+ "onnxruntime-node/tar/minizlib/rimraf/glob/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
+
+ "onnxruntime-node/tar/minizlib/rimraf/glob/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
+ }
+}
diff --git a/bun.lockb b/bun.lockb
deleted file mode 100755
index 03d96215..00000000
Binary files a/bun.lockb and /dev/null differ
diff --git a/eslint.config.mjs.back.txt b/eslint.config.mjs.back.txt
new file mode 100644
index 00000000..882f628d
--- /dev/null
+++ b/eslint.config.mjs.back.txt
@@ -0,0 +1,16 @@
+import { fileURLToPath } from "url";
+import { dirname } from "path"; // Pastikan `dirname` diimpor
+import { FlatCompat } from "@eslint/eslintrc";
+
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = dirname(__filename);
+
+const compat = new FlatCompat({
+ baseDirectory: __dirname,
+});
+
+const eslintConfig = [
+ ...compat.extends("next/core-web-vitals", "next/typescript"),
+];
+
+export default eslintConfig;
diff --git a/logs/.gitkeep b/logs/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/logs/backend/.gitkeep b/logs/backend/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/logs/frontend/.gitkeep b/logs/frontend/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/next.config.js b/next.config.js
index 5c728631..438386a8 100644
--- a/next.config.js
+++ b/next.config.js
@@ -1,10 +1,27 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
- reactStrictMode: false,
- experimental: {
- serverActions: true
- },
-
-}
+ reactStrictMode: false,
+ experimental: {
+ serverActions: true,
+ },
+ output: "standalone",
+ staticPageGenerationTimeout: 180, // tingkatkan menjadi 3 menit
+ eslint: {
+ ignoreDuringBuilds: true,
+ },
+ // async headers() {
+ // return [
+ // {
+ // source: "/(.*)",
+ // headers: [
+ // {
+ // key: "Cache-Control",
+ // value: "no-store, max-age=0",
+ // },
+ // ],
+ // },
+ // ];
+ // },
+};
-module.exports = nextConfig
+module.exports = nextConfig;
diff --git a/package.json b/package.json
index 3b1dba92..d7e768e6 100644
--- a/package.json
+++ b/package.json
@@ -1,15 +1,16 @@
{
"name": "hipmi",
- "version": "1.2.12",
+ "version": "1.4.28",
"private": true,
"prisma": {
- "seed": "npx tsx prisma/seed.ts --yes"
+ "seed": "bun prisma/seed.ts"
},
- "scripts": {
- "dev": "bun --bun run next dev --experimental-https",
- "build": "bun --bun run next build",
- "start": "bun --bun run next start",
- "lint": "bun --bun run next lint",
+ "scripts": {
+ "dev": "next dev --experimental-https",
+ "build": "next build",
+ "build:dev": "next build",
+ "start": "next start",
+ "lint": "next lint",
"ver": "bunx commit-and-tag-version -- --prerelease"
},
"dependencies": {
@@ -27,18 +28,20 @@
"@mantine/next": "^6.0.17",
"@mantine/notifications": "^6.0.17",
"@mantine/tiptap": "^7.5.3",
- "@prisma/client": "^5.0.0",
+ "@prisma/client": "^6.3.0",
"@react-pdf/renderer": "^3.4.4",
- "@tabler/icons-react": "^2.38.0",
+ "@tabler/icons-react": "^3.31.0",
"@tiptap/extension-highlight": "^2.2.3",
+ "@tiptap/extension-image": "^2.11.7",
"@tiptap/extension-link": "^2.2.3",
"@tiptap/extension-subscript": "^2.2.3",
"@tiptap/extension-superscript": "^2.2.3",
"@tiptap/extension-text-align": "^2.2.3",
- "@tiptap/extension-underline": "^2.2.3",
+ "@tiptap/extension-underline": "^2.11.7",
"@tiptap/pm": "^2.2.3",
"@tiptap/react": "^2.2.3",
"@tiptap/starter-kit": "^2.2.3",
+ "@types/bun": "^1.1.14",
"@types/lodash": "^4.17.4",
"@types/mapbox-gl": "^3.4.0",
"@types/node": "20.4.5",
@@ -47,13 +50,15 @@
"@types/uuid": "^9.0.4",
"autoprefixer": "10.4.14",
"bufferutil": "^4.0.8",
+ "bun": "^1.1.38",
+ "colors": "^1.4.0",
+ "date-fns": "^4.1.0",
"dayjs": "^1.11.10",
"dotenv": "^16.4.5",
"echarts": "^5.4.3",
"echarts-for-react": "^3.0.2",
"embla-carousel-react": "^8.0.0-rc14",
- "eslint": "8.45.0",
- "eslint-config-next": "13.4.12",
+ "eslint-config-next": "^13.5.4",
"iron-session": "^6.3.1",
"jose": "^5.9.2",
"jotai": "^2.4.3",
@@ -62,18 +67,20 @@
"midtrans-client": "^1.3.1",
"moment": "^2.29.4",
"mqtt": "^5.5.0",
- "next": "^13.5.4-canary.8",
+ "next": "^13.5.4",
"next-dev": "^1.1.9",
"next-scroll-loader": "^1.0.9",
+ "p-limit": "^6.2.0",
+ "pdf-lib": "^1.17.1",
+ "pdf2pic": "^3.1.3",
"pdfjs-dist": "^4.6.82",
"postcss": "8.4.27",
- "prisma": "^5.19.1",
+ "prisma": "^6.3.0",
"react": "18.2.0",
"react-countdown": "^2.3.5",
"react-dom": "18.2.0",
"react-easy-infinite-scroll-hook": "^2.1.4",
"react-fast-marquee": "^1.6.4",
- "react-icons": "^5.0.1",
"react-iframe": "^1.8.5",
"react-infinite-scroll-component": "^6.1.0",
"react-international-phone": "^4.2.6",
@@ -83,7 +90,9 @@
"react-quill": "^2.0.0",
"react-responsive-carousel": "^3.2.23",
"react-toastify": "^9.1.3",
+ "sharp": "^0.33.5",
"socket.io-client": "^4.7.2",
+ "swr": "^2.3.0",
"tailwindcss": "3.3.3",
"ts-node": "^10.9.2",
"typescript": "5.1.6",
@@ -92,6 +101,13 @@
"wibu": "bipproduction/wibu",
"wibu-cli": "^1.0.91",
"wibu-pkg": "^1.0.3",
+ "winston": "^3.17.0",
+ "winston-daily-rotate-file": "^5.0.0",
"yaml": "^2.3.2"
+ },
+ "devDependencies": {
+ "eslint": "^8.56.0",
+ "@typescript-eslint/eslint-plugin": "^7.0.0",
+ "@typescript-eslint/parser": "^7.0.0"
}
}
diff --git a/prisma/migrations/20250108154615_new_database/migration.sql b/prisma/migrations/20250108154615_new_database/migration.sql
new file mode 100644
index 00000000..3476e5af
--- /dev/null
+++ b/prisma/migrations/20250108154615_new_database/migration.sql
@@ -0,0 +1,198 @@
+/*
+ Warnings:
+
+ - You are about to drop the column `imagesId` on the `Job` table. All the data in the column will be lost.
+ - You are about to drop the column `active` on the `MasterBank` table. All the data in the column will be lost.
+ - You are about to drop the column `name` on the `MasterBank` table. All the data in the column will be lost.
+ - You are about to drop the column `imagesBackgroundId` on the `Profile` table. All the data in the column will be lost.
+ - You are about to drop the column `imagesId` on the `Profile` table. All the data in the column will be lost.
+ - You are about to drop the `ImagesBackground` table. If the table is not empty, all the data it contains will be lost.
+ - Added the required column `namaAkun` to the `MasterBank` table without a default value. This is not possible if the table is not empty.
+ - Added the required column `namaBank` to the `MasterBank` table without a default value. This is not possible if the table is not empty.
+
+*/
+-- DropForeignKey
+ALTER TABLE "Job" DROP CONSTRAINT "Job_imagesId_fkey";
+
+-- DropForeignKey
+ALTER TABLE "Notifikasi" DROP CONSTRAINT "NotifikasiAdmin";
+
+-- DropForeignKey
+ALTER TABLE "Notifikasi" DROP CONSTRAINT "NotifikasiUser";
+
+-- DropForeignKey
+ALTER TABLE "Portofolio" DROP CONSTRAINT "Portofolio_logoId_fkey";
+
+-- DropForeignKey
+ALTER TABLE "Profile" DROP CONSTRAINT "Profile_imagesBackgroundId_fkey";
+
+-- DropForeignKey
+ALTER TABLE "Profile" DROP CONSTRAINT "Profile_imagesId_fkey";
+
+-- DropIndex
+DROP INDEX "Profile_imagesBackgroundId_key";
+
+-- DropIndex
+DROP INDEX "Profile_imagesId_key";
+
+-- AlterTable
+ALTER TABLE "BeritaInvestasi" ADD COLUMN "imageId" TEXT;
+
+-- AlterTable
+ALTER TABLE "DokumenInvestasi" ADD COLUMN "fileId" TEXT,
+ALTER COLUMN "url" DROP NOT NULL;
+
+-- AlterTable
+ALTER TABLE "Donasi" ADD COLUMN "imageId" TEXT;
+
+-- AlterTable
+ALTER TABLE "Donasi_Cerita" ADD COLUMN "imageId" TEXT;
+
+-- AlterTable
+ALTER TABLE "Donasi_Invoice" ADD COLUMN "imageId" TEXT;
+
+-- AlterTable
+ALTER TABLE "Donasi_Kabar" ADD COLUMN "imageId" TEXT;
+
+-- AlterTable
+ALTER TABLE "Donasi_PencairanDana" ADD COLUMN "imageId" TEXT;
+
+-- AlterTable
+ALTER TABLE "Donasi_TemporaryCreate" ADD COLUMN "imageId" TEXT;
+
+-- AlterTable
+ALTER TABLE "Event" ADD COLUMN "isArsip" BOOLEAN DEFAULT false,
+ADD COLUMN "tanggalSelesai" TIMESTAMP(3),
+ALTER COLUMN "tanggal" DROP NOT NULL;
+
+-- AlterTable
+ALTER TABLE "Event_Peserta" ADD COLUMN "isPresent" BOOLEAN NOT NULL DEFAULT false;
+
+-- AlterTable
+ALTER TABLE "Investasi" ADD COLUMN "imageId" TEXT,
+ADD COLUMN "prospektusFileId" TEXT;
+
+-- AlterTable
+ALTER TABLE "Job" DROP COLUMN "imagesId",
+ADD COLUMN "imageId" TEXT;
+
+-- AlterTable
+ALTER TABLE "MasterBank" DROP COLUMN "active",
+DROP COLUMN "name",
+ADD COLUMN "isActive" BOOLEAN NOT NULL DEFAULT true,
+ADD COLUMN "namaAkun" TEXT NOT NULL,
+ADD COLUMN "namaBank" TEXT NOT NULL;
+
+-- AlterTable
+ALTER TABLE "Notifikasi" ALTER COLUMN "userId" DROP NOT NULL,
+ALTER COLUMN "adminId" DROP NOT NULL;
+
+-- AlterTable
+ALTER TABLE "Profile" DROP COLUMN "imagesBackgroundId",
+DROP COLUMN "imagesId",
+ADD COLUMN "imageBackgroundId" TEXT,
+ADD COLUMN "imageId" TEXT;
+
+-- AlterTable
+ALTER TABLE "ProspektusInvestasi" ADD COLUMN "fileId" TEXT,
+ADD COLUMN "title" TEXT;
+
+-- AlterTable
+ALTER TABLE "User" ALTER COLUMN "active" SET DEFAULT false;
+
+-- AlterTable
+ALTER TABLE "UserSession" ALTER COLUMN "expires" DROP NOT NULL;
+
+-- AlterTable
+ALTER TABLE "Voting" ADD COLUMN "isArsip" BOOLEAN NOT NULL DEFAULT false;
+
+-- DropTable
+DROP TABLE "ImagesBackground";
+
+-- CreateTable
+CREATE TABLE "Investasi_Invoice" (
+ "id" TEXT NOT NULL,
+ "isActive" BOOLEAN NOT NULL DEFAULT true,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" TIMESTAMP(3) NOT NULL,
+ "nominal" TEXT NOT NULL,
+ "lembarTerbeli" TEXT NOT NULL,
+ "investasiId" TEXT,
+ "masterBankId" TEXT,
+ "statusInvoiceId" TEXT,
+ "authorId" TEXT,
+ "imagesId" TEXT,
+ "imageId" TEXT,
+
+ CONSTRAINT "Investasi_Invoice_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "InvestasiMaster_StatusInvoice" (
+ "id" TEXT NOT NULL,
+ "name" TEXT NOT NULL,
+ "isActive" BOOLEAN NOT NULL DEFAULT true,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" TIMESTAMP(3) NOT NULL,
+
+ CONSTRAINT "InvestasiMaster_StatusInvoice_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "BusinessMaps" (
+ "id" TEXT NOT NULL,
+ "isActive" BOOLEAN NOT NULL DEFAULT true,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" TIMESTAMP(3) NOT NULL,
+ "namePin" TEXT NOT NULL,
+ "latitude" DOUBLE PRECISION NOT NULL,
+ "longitude" DOUBLE PRECISION NOT NULL,
+ "authorId" TEXT,
+ "portofolioId" TEXT,
+ "imageId" TEXT,
+ "pinId" TEXT,
+
+ CONSTRAINT "BusinessMaps_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "MasterKategoriApp" (
+ "id" TEXT NOT NULL,
+ "isActive" BOOLEAN NOT NULL DEFAULT true,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" TIMESTAMP(3) NOT NULL,
+ "name" TEXT NOT NULL,
+ "value" TEXT,
+
+ CONSTRAINT "MasterKategoriApp_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateIndex
+CREATE UNIQUE INDEX "BusinessMaps_portofolioId_key" ON "BusinessMaps"("portofolioId");
+
+-- AddForeignKey
+ALTER TABLE "Investasi_Invoice" ADD CONSTRAINT "Investasi_Invoice_investasiId_fkey" FOREIGN KEY ("investasiId") REFERENCES "Investasi"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Investasi_Invoice" ADD CONSTRAINT "Investasi_Invoice_masterBankId_fkey" FOREIGN KEY ("masterBankId") REFERENCES "MasterBank"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Investasi_Invoice" ADD CONSTRAINT "Investasi_Invoice_statusInvoiceId_fkey" FOREIGN KEY ("statusInvoiceId") REFERENCES "InvestasiMaster_StatusInvoice"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Investasi_Invoice" ADD CONSTRAINT "Investasi_Invoice_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Investasi_Invoice" ADD CONSTRAINT "Investasi_Invoice_imagesId_fkey" FOREIGN KEY ("imagesId") REFERENCES "Images"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Notifikasi" ADD CONSTRAINT "NotifikasiUser" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Notifikasi" ADD CONSTRAINT "NotifikasiAdmin" FOREIGN KEY ("adminId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "BusinessMaps" ADD CONSTRAINT "BusinessMaps_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "BusinessMaps" ADD CONSTRAINT "BusinessMaps_portofolioId_fkey" FOREIGN KEY ("portofolioId") REFERENCES "Portofolio"("id") ON DELETE SET NULL ON UPDATE CASCADE;
diff --git a/prisma/migrations/20250514090639_add_unique_to_master_emotions/migration.sql b/prisma/migrations/20250514090639_add_unique_to_master_emotions/migration.sql
new file mode 100644
index 00000000..7a576b49
--- /dev/null
+++ b/prisma/migrations/20250514090639_add_unique_to_master_emotions/migration.sql
@@ -0,0 +1,125 @@
+-- AlterTable
+ALTER TABLE "MasterBidangBisnis" ADD COLUMN "slug" TEXT NOT NULL DEFAULT 'NULL';
+
+-- CreateTable
+CREATE TABLE "Portofolio_BidangDanSubBidangBisnis" (
+ "id" TEXT NOT NULL,
+ "isActive" BOOLEAN NOT NULL DEFAULT true,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" TIMESTAMP(3) NOT NULL,
+ "portofolioId" TEXT,
+ "masterBidangBisnisId" TEXT,
+ "masterSubBidangBisnisId" TEXT,
+
+ CONSTRAINT "Portofolio_BidangDanSubBidangBisnis_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "MasterSubBidangBisnis" (
+ "id" TEXT NOT NULL,
+ "name" TEXT NOT NULL,
+ "slug" TEXT NOT NULL DEFAULT 'NULL',
+ "isActive" BOOLEAN NOT NULL DEFAULT true,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "masterBidangBisnisId" TEXT,
+
+ CONSTRAINT "MasterSubBidangBisnis_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "MasterStatusTransaksi" (
+ "id" TEXT NOT NULL,
+ "name" TEXT NOT NULL,
+ "isActive" BOOLEAN NOT NULL DEFAULT true,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" TIMESTAMP(3) NOT NULL,
+
+ CONSTRAINT "MasterStatusTransaksi_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "MasterEmotions" (
+ "id" SERIAL NOT NULL,
+ "label" TEXT NOT NULL,
+ "value" TEXT NOT NULL,
+ "isActive" BOOLEAN NOT NULL DEFAULT true,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" TIMESTAMP(3) NOT NULL,
+
+ CONSTRAINT "MasterEmotions_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "EventSponsor" (
+ "id" TEXT NOT NULL,
+ "isActive" BOOLEAN NOT NULL DEFAULT true,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" TIMESTAMP(3) NOT NULL,
+ "name" TEXT NOT NULL,
+ "isTransfer" BOOLEAN DEFAULT false,
+ "fileName" TEXT NOT NULL,
+ "fileExt" TEXT,
+ "fileId" TEXT NOT NULL,
+ "authorId" TEXT,
+ "eventId" TEXT,
+
+ CONSTRAINT "EventSponsor_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "EventTransaksi" (
+ "id" TEXT NOT NULL,
+ "isActive" BOOLEAN NOT NULL DEFAULT true,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" TIMESTAMP(3) NOT NULL,
+ "nominal" INTEGER NOT NULL,
+ "status" TEXT NOT NULL,
+ "transferImageId" TEXT,
+ "masterBankId" TEXT,
+ "authorId" TEXT,
+ "eventId" TEXT,
+ "eventSponsorId" TEXT,
+ "masterStatusTransaksiId" TEXT,
+
+ CONSTRAINT "EventTransaksi_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateIndex
+CREATE UNIQUE INDEX "MasterEmotions_value_key" ON "MasterEmotions"("value");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "EventTransaksi_eventSponsorId_key" ON "EventTransaksi"("eventSponsorId");
+
+-- AddForeignKey
+ALTER TABLE "Portofolio_BidangDanSubBidangBisnis" ADD CONSTRAINT "Portofolio_BidangDanSubBidangBisnis_portofolioId_fkey" FOREIGN KEY ("portofolioId") REFERENCES "Portofolio"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Portofolio_BidangDanSubBidangBisnis" ADD CONSTRAINT "Portofolio_BidangDanSubBidangBisnis_masterBidangBisnisId_fkey" FOREIGN KEY ("masterBidangBisnisId") REFERENCES "MasterBidangBisnis"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Portofolio_BidangDanSubBidangBisnis" ADD CONSTRAINT "Portofolio_BidangDanSubBidangBisnis_masterSubBidangBisnisI_fkey" FOREIGN KEY ("masterSubBidangBisnisId") REFERENCES "MasterSubBidangBisnis"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "MasterSubBidangBisnis" ADD CONSTRAINT "MasterSubBidangBisnis_masterBidangBisnisId_fkey" FOREIGN KEY ("masterBidangBisnisId") REFERENCES "MasterBidangBisnis"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "EventSponsor" ADD CONSTRAINT "EventSponsor_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "EventSponsor" ADD CONSTRAINT "EventSponsor_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "Event"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "EventTransaksi" ADD CONSTRAINT "EventTransaksi_masterBankId_fkey" FOREIGN KEY ("masterBankId") REFERENCES "MasterBank"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "EventTransaksi" ADD CONSTRAINT "EventTransaksi_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "EventTransaksi" ADD CONSTRAINT "EventTransaksi_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "Event"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "EventTransaksi" ADD CONSTRAINT "EventTransaksi_eventSponsorId_fkey" FOREIGN KEY ("eventSponsorId") REFERENCES "EventSponsor"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "EventTransaksi" ADD CONSTRAINT "EventTransaksi_masterStatusTransaksiId_fkey" FOREIGN KEY ("masterStatusTransaksiId") REFERENCES "MasterStatusTransaksi"("id") ON DELETE SET NULL ON UPDATE CASCADE;
diff --git a/prisma/migrations/20250515060811_relasi/migration.sql b/prisma/migrations/20250515060811_relasi/migration.sql
new file mode 100644
index 00000000..7099dfb1
--- /dev/null
+++ b/prisma/migrations/20250515060811_relasi/migration.sql
@@ -0,0 +1,30 @@
+-- CreateTable
+CREATE TABLE "Stiker" (
+ "id" TEXT NOT NULL,
+ "isActive" BOOLEAN NOT NULL DEFAULT true,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" TIMESTAMP(3) NOT NULL,
+ "name" TEXT,
+ "fileName" TEXT,
+ "fileExt" TEXT,
+ "fileId" TEXT NOT NULL,
+
+ CONSTRAINT "Stiker_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "_StikerEmotions" (
+ "A" INTEGER NOT NULL,
+ "B" TEXT NOT NULL,
+
+ CONSTRAINT "_StikerEmotions_AB_pkey" PRIMARY KEY ("A","B")
+);
+
+-- CreateIndex
+CREATE INDEX "_StikerEmotions_B_index" ON "_StikerEmotions"("B");
+
+-- AddForeignKey
+ALTER TABLE "_StikerEmotions" ADD CONSTRAINT "_StikerEmotions_A_fkey" FOREIGN KEY ("A") REFERENCES "MasterEmotions"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "_StikerEmotions" ADD CONSTRAINT "_StikerEmotions_B_fkey" FOREIGN KEY ("B") REFERENCES "Stiker"("id") ON DELETE CASCADE ON UPDATE CASCADE;
diff --git a/prisma/migrations/20250515062136_ganti/migration.sql b/prisma/migrations/20250515062136_ganti/migration.sql
new file mode 100644
index 00000000..caf9b319
--- /dev/null
+++ b/prisma/migrations/20250515062136_ganti/migration.sql
@@ -0,0 +1,28 @@
+/*
+ Warnings:
+
+ - You are about to drop the `Stiker` table. If the table is not empty, all the data it contains will be lost.
+
+*/
+-- DropForeignKey
+ALTER TABLE "_StikerEmotions" DROP CONSTRAINT "_StikerEmotions_B_fkey";
+
+-- DropTable
+DROP TABLE "Stiker";
+
+-- CreateTable
+CREATE TABLE "Sticker" (
+ "id" TEXT NOT NULL,
+ "isActive" BOOLEAN NOT NULL DEFAULT true,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" TIMESTAMP(3) NOT NULL,
+ "name" TEXT,
+ "fileName" TEXT,
+ "fileExt" TEXT,
+ "fileId" TEXT NOT NULL,
+
+ CONSTRAINT "Sticker_pkey" PRIMARY KEY ("id")
+);
+
+-- AddForeignKey
+ALTER TABLE "_StikerEmotions" ADD CONSTRAINT "_StikerEmotions_B_fkey" FOREIGN KEY ("B") REFERENCES "Sticker"("id") ON DELETE CASCADE ON UPDATE CASCADE;
diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml
index fbffa92c..648c57fd 100644
--- a/prisma/migrations/migration_lock.toml
+++ b/prisma/migrations/migration_lock.toml
@@ -1,3 +1,3 @@
# Please do not edit this file manually
-# It should be added in your version-control system (i.e. Git)
+# It should be added in your version-control system (e.g., Git)
provider = "postgresql"
\ No newline at end of file
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index faebf9e8..72dd8579 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -2,8 +2,9 @@
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
- provider = "prisma-client-js"
- engineType = "binary"
+ provider = "prisma-client-js"
+ engineType = "binary"
+ binaryTargets = ["native"]
}
datasource db {
@@ -47,6 +48,9 @@ model User {
User_Notifikasi Notifikasi[] @relation("UserNotifikasi")
BusinessMaps BusinessMaps[]
Investasi_Invoice Investasi_Invoice[]
+
+ EventSponsor EventSponsor[]
+ EventTransaksi EventTransaksi[]
}
model MasterUserRole {
@@ -125,11 +129,13 @@ model Portofolio {
updatedAt DateTime @default(now()) @updatedAt
Profile Profile? @relation(fields: [profileId], references: [id])
profileId String?
- MasterBidangBisnis MasterBidangBisnis @relation(fields: [masterBidangBisnisId], references: [id])
- masterBidangBisnisId String
Portofolio_MediaSosial Portofolio_MediaSosial?
BusinessMaps BusinessMaps?
logoId String?
+
+ MasterBidangBisnis MasterBidangBisnis @relation(fields: [masterBidangBisnisId], references: [id])
+ masterBidangBisnisId String
+ Portofolio_BidangDanSubBidangBisnis Portofolio_BidangDanSubBidangBisnis[]
}
model Portofolio_MediaSosial {
@@ -146,17 +152,46 @@ model Portofolio_MediaSosial {
portofolioId String? @unique
}
-model MasterBidangBisnis {
- id String @id
- name String
- active Boolean @default(true)
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- Portofolio Portofolio[]
+model Portofolio_BidangDanSubBidangBisnis {
+ id String @id @default(cuid())
+ isActive Boolean @default(true)
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+
+ Portofolio Portofolio? @relation(fields: [portofolioId], references: [id])
+ portofolioId String?
+ MasterBidangBisnis MasterBidangBisnis? @relation(fields: [masterBidangBisnisId], references: [id])
+ masterBidangBisnisId String?
+ MasterSubBidangBisnis MasterSubBidangBisnis? @relation(fields: [masterSubBidangBisnisId], references: [id])
+ masterSubBidangBisnisId String?
}
// ------------------- MASTER -------------------------- //
+model MasterBidangBisnis {
+ id String @id @default(uuid())
+ name String
+ slug String @default("NULL")
+ active Boolean @default(true)
+ createdAt DateTime @default(now())
+ updatedAt DateTime @default(now()) @updatedAt
+ Portofolio Portofolio[]
+ MasterSubBidangBisnis MasterSubBidangBisnis[]
+ Portofolio_BidangDanSubBidangBisnis Portofolio_BidangDanSubBidangBisnis[]
+}
+
+model MasterSubBidangBisnis {
+ id String @id @default(cuid())
+ name String
+ slug String @default("NULL")
+ isActive Boolean @default(true)
+ createdAt DateTime @default(now())
+ updatedAt DateTime @default(now()) @updatedAt
+ MasterBidangBisnis MasterBidangBisnis? @relation(fields: [masterBidangBisnisId], references: [id])
+ masterBidangBisnisId String?
+ Portofolio_BidangDanSubBidangBisnis Portofolio_BidangDanSubBidangBisnis[]
+}
+
model MasterBank {
id String @id @default(cuid())
namaBank String
@@ -166,6 +201,7 @@ model MasterBank {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
Investasi_Invoice Investasi_Invoice[]
+ EventTransaksi EventTransaksi[]
}
model MasterStatus {
@@ -177,6 +213,25 @@ model MasterStatus {
Job Job[]
}
+model MasterStatusTransaksi {
+ id String @id @default(cuid())
+ name String
+ isActive Boolean @default(true)
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+ EventTransaksi EventTransaksi[]
+}
+
+model MasterEmotions {
+ id Int @id @default(autoincrement())
+ label String
+ value String @unique
+ isActive Boolean @default(true)
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+ Sticker Sticker[] @relation("StikerEmotions")
+}
+
// -------------------- INVESTASI --------------------- //
// Table investasi / saham
model Investasi {
@@ -593,6 +648,8 @@ model Event {
Event_Peserta Event_Peserta[]
EventMaster_TipeAcara EventMaster_TipeAcara? @relation(fields: [eventMaster_TipeAcaraId], references: [id])
eventMaster_TipeAcaraId Int?
+ EventSponsor EventSponsor[]
+ EventTransaksi EventTransaksi[]
}
model EventMaster_TipeAcara {
@@ -618,6 +675,7 @@ model Event_Peserta {
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
+ isPresent Boolean @default(false)
Event Event? @relation(fields: [eventId], references: [id])
eventId String?
@@ -951,3 +1009,64 @@ model MasterKategoriApp {
name String
value String?
}
+
+// ======================= EVENT ======================= //
+
+model EventSponsor {
+ id String @id @default(cuid())
+ isActive Boolean @default(true)
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+ name String
+ isTransfer Boolean? @default(false)
+ fileName String
+ fileExt String?
+ fileId String
+
+ Author User? @relation(fields: [authorId], references: [id])
+ authorId String?
+
+ Event Event? @relation(fields: [eventId], references: [id])
+ eventId String?
+
+ EventTransaksi EventTransaksi?
+}
+
+model EventTransaksi {
+ id String @id @default(cuid())
+ isActive Boolean @default(true)
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+ nominal Int
+ status String
+ transferImageId String?
+
+ MasterBank MasterBank? @relation(fields: [masterBankId], references: [id])
+ masterBankId String?
+
+ AuthorId User? @relation(fields: [authorId], references: [id])
+ authorId String?
+
+ Event Event? @relation(fields: [eventId], references: [id])
+ eventId String?
+
+ EventSponsor EventSponsor? @relation(fields: [eventSponsorId], references: [id])
+ eventSponsorId String? @unique
+
+ MasterStatusTransaksi MasterStatusTransaksi? @relation(fields: [masterStatusTransaksiId], references: [id])
+ masterStatusTransaksiId String?
+}
+
+model Sticker {
+ id String @id @default(cuid())
+ isActive Boolean @default(true)
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+ name String?
+ fileName String?
+ fileExt String?
+ fileId String
+ jenisKelamin String?
+
+ MasterEmotions MasterEmotions[] @relation("StikerEmotions")
+}
diff --git a/prisma/seed.ts b/prisma/seed.ts
index b4eb2917..6d08e31a 100644
--- a/prisma/seed.ts
+++ b/prisma/seed.ts
@@ -1,16 +1,16 @@
-import prisma from "./../src/app/lib/prisma";
+import prisma from "../src/lib/prisma";
import { generate_seeder } from "./../src/app_modules/_global/fun/generate_seeder";
(async () => {
- console.log("start");
+ console.log("start seeder >>");
await generate_seeder();
})()
.then(() => {
- console.log("success");
+ console.log("<< success seeder");
process.exit(0);
})
.catch((e) => {
- console.error(e);
+ console.error("<< error seeder", e);
process.exit(1);
})
.finally(async () => {
diff --git a/public/aset/global/dummy-image.jpg b/public/aset/global/dummy-image.jpg
new file mode 100644
index 00000000..49a81447
Binary files /dev/null and b/public/aset/global/dummy-image.jpg differ
diff --git a/public/aset/home/home-hipmi-new.png b/public/aset/home/home-hipmi-new.png
new file mode 100644
index 00000000..968807de
Binary files /dev/null and b/public/aset/home/home-hipmi-new.png differ
diff --git a/public/aset/investasi/logo-crowd-panjang-new.png b/public/aset/investasi/logo-crowd-panjang-new.png
new file mode 100644
index 00000000..5e17ee4e
Binary files /dev/null and b/public/aset/investasi/logo-crowd-panjang-new.png differ
diff --git a/run.env.build.dev b/run.env.build.dev
new file mode 100644
index 00000000..f8351819
--- /dev/null
+++ b/run.env.build.dev
@@ -0,0 +1 @@
+nice -n 19 bun --env-file=.env run --bun build
diff --git a/run.env.build.local b/run.env.build.local
new file mode 100644
index 00000000..fd2f18a1
--- /dev/null
+++ b/run.env.build.local
@@ -0,0 +1 @@
+bun --env-file=.env.local run --bun build
\ No newline at end of file
diff --git a/run.env.dev b/run.env.dev
new file mode 100644
index 00000000..f7b13b98
--- /dev/null
+++ b/run.env.dev
@@ -0,0 +1 @@
+bun --env-file=.env run --bun dev -p 3000
\ No newline at end of file
diff --git a/run.env.local.dev b/run.env.local.dev
new file mode 100644
index 00000000..c23c65af
--- /dev/null
+++ b/run.env.local.dev
@@ -0,0 +1 @@
+bun --env-file=.env.local run --bun dev -p 3005
\ No newline at end of file
diff --git a/run.env.start.dev b/run.env.start.dev
new file mode 100644
index 00000000..9dacda79
--- /dev/null
+++ b/run.env.start.dev
@@ -0,0 +1 @@
+bun --env-file=.env run --bun start -p 3000
\ No newline at end of file
diff --git a/run.env.start.local b/run.env.start.local
new file mode 100644
index 00000000..1fc5c96b
--- /dev/null
+++ b/run.env.start.local
@@ -0,0 +1 @@
+bun --env-file=.env-local run --bun start -p 3000
\ No newline at end of file
diff --git a/run.prisma.env.local b/run.prisma.env.local
new file mode 100644
index 00000000..57a64842
--- /dev/null
+++ b/run.prisma.env.local
@@ -0,0 +1,3 @@
+bun --env-file=.env.local prisma db push
+bun --env-file=.env.local prisma db seed
+bun --env-file=.env.local run --bun build
\ No newline at end of file
diff --git a/src/app/(admin)/logs/logs.module.css b/src/app/(admin)/logs/logs.module.css
new file mode 100644
index 00000000..42dadbaa
--- /dev/null
+++ b/src/app/(admin)/logs/logs.module.css
@@ -0,0 +1,138 @@
+/* app/admin/logs/logs.module.css */
+.container {
+ padding: 24px;
+ max-width: 1200px;
+ margin: 0 auto;
+ }
+
+ .title {
+ font-size: 24px;
+ font-weight: bold;
+ margin-bottom: 16px;
+ }
+
+ .filterContainer {
+ margin-bottom: 16px;
+ }
+
+ .select {
+ padding: 8px;
+ border: 1px solid #ddd;
+ border-radius: 4px;
+ min-width: 200px;
+ }
+
+ .logsContainer {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ }
+
+ .logItem {
+ padding: 16px;
+ border-radius: 4px;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+ }
+
+ .errorLog {
+ background-color: #fef2f2;
+ }
+
+ .warnLog {
+ background-color: #fefce8;
+ }
+
+ .infoLog {
+ background-color: #ffffff;
+ }
+
+ .logHeader {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ }
+
+ .timestamp {
+ font-size: 14px;
+ color: #666;
+ }
+
+ .level {
+ padding: 4px 8px;
+ border-radius: 4px;
+ font-size: 12px;
+ font-weight: 500;
+ }
+
+ .errorLevel {
+ background-color: #fee2e2;
+ color: #991b1b;
+ }
+
+ .warnLevel {
+ background-color: #fef3c7;
+ color: #92400e;
+ }
+
+ .infoLevel {
+ background-color: #dbeafe;
+ color: #1e40af;
+ }
+
+ .message {
+ margin-top: 8px;
+ }
+
+ .metadata {
+ margin-top: 8px;
+ padding: 8px;
+ background-color: #f9fafb;
+ border-radius: 4px;
+ font-size: 14px;
+ overflow-x: auto;
+ white-space: pre-wrap;
+ }
+
+ .loading {
+ text-align: center;
+ padding: 24px;
+ color: #666;
+ }
+
+ .error {
+ color: #dc2626;
+ text-align: center;
+ padding: 24px;
+ }
+
+ /* Hover effects */
+ .logItem:hover {
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
+ }
+
+ .select:hover {
+ border-color: #999;
+ }
+
+ /* Focus states */
+ .select:focus {
+ outline: none;
+ border-color: #2563eb;
+ box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
+ }
+
+ /* Responsive adjustments */
+ @media (max-width: 768px) {
+ .container {
+ padding: 16px;
+ }
+
+ .logHeader {
+ flex-direction: column;
+ align-items: flex-start;
+ }
+
+ .metadata {
+ font-size: 12px;
+ }
+ }
\ No newline at end of file
diff --git a/src/app/(admin)/logs/page.tsx b/src/app/(admin)/logs/page.tsx
new file mode 100644
index 00000000..2ac03d42
--- /dev/null
+++ b/src/app/(admin)/logs/page.tsx
@@ -0,0 +1,106 @@
+// app/admin/logs/page.tsx
+"use client";
+
+import { useEffect, useState } from "react";
+import { format } from "date-fns";
+import styles from "./logs.module.css";
+
+interface LogEntry {
+ timestamp: string;
+ level: string;
+ message: string;
+ metadata?: any;
+}
+
+export default function LogsPage() {
+ const [logs, setLogs] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState(null);
+ const [filter, setFilter] = useState<"all" | "error" | "info" | "warn">(
+ "all"
+ );
+
+ useEffect(() => {
+ fetchLogs();
+ }, []);
+
+ async function fetchLogs() {
+ try {
+ const response = await fetch("/api/logs/view");
+ if (!response.ok) throw new Error("Failed to fetch logs");
+
+ const data = await response.json();
+ setLogs(data.logs);
+ } catch (err) {
+ setError(err instanceof Error ? err.message : "Error fetching logs");
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ const filteredLogs = logs.filter((log) =>
+ filter === "all" ? true : log.level === filter
+ );
+
+ if (loading) return Loading logs...
;
+ if (error) return Error: {error}
;
+
+ return (
+
+
System Logs
+
+
+
+
+
+
+ {filteredLogs.map((log, index) => (
+
+
+
+ {format(new Date(log.timestamp), "yyyy-MM-dd HH:mm:ss")}
+
+
+ {log.level.toUpperCase()}
+
+
+
+
{log.message}
+
+ {log.metadata && (
+
+ {JSON.stringify(log.metadata, null, 2)}
+
+ )}
+
+ ))}
+
+
+ );
+}
diff --git a/src/app/auth/_lib/decrypt.ts b/src/app/(auth)/_lib/decrypt.back.txt
similarity index 100%
rename from src/app/auth/_lib/decrypt.ts
rename to src/app/(auth)/_lib/decrypt.back.txt
diff --git a/src/app/(auth)/_lib/decrypt.ts b/src/app/(auth)/_lib/decrypt.ts
new file mode 100644
index 00000000..0883f2b3
--- /dev/null
+++ b/src/app/(auth)/_lib/decrypt.ts
@@ -0,0 +1,49 @@
+import { jwtVerify } from "jose";
+
+export async function decrypt({
+ token,
+ encodedKey,
+}: {
+ token: string;
+ encodedKey: string;
+}): Promise | null> {
+ if (!token || !encodedKey) {
+ console.error("Missing required parameters:", {
+ hasToken: !!token,
+ hasEncodedKey: !!encodedKey,
+ });
+ return null;
+ }
+
+ try {
+ const enc = new TextEncoder().encode(encodedKey);
+ const { payload } = await jwtVerify(token, enc, {
+ algorithms: ["HS256"],
+ });
+
+ if (!payload || !payload.user) {
+ console.error("Invalid payload structure:", {
+ hasPayload: !!payload,
+ hasUser: payload ? !!payload.user : false,
+ });
+ return null;
+ }
+
+ // Logging untuk debug
+ // console.log("Decrypt successful:", {
+ // payloadExists: !!payload,
+ // userExists: !!payload.user,
+ // tokenPreview: token.substring(0, 10) + "...",
+ // });
+
+ return payload.user as Record;
+ } catch (error) {
+ console.error("Token verification failed:", {
+ error,
+ tokenLength: token?.length,
+ errorName: error instanceof Error ? error.name : "Unknown error",
+ errorMessage: error instanceof Error ? error.message : String(error),
+ });
+ return null;
+ }
+}
diff --git a/src/app/auth/_lib/encrypt.ts b/src/app/(auth)/_lib/encrypt.ts
similarity index 100%
rename from src/app/auth/_lib/encrypt.ts
rename to src/app/(auth)/_lib/encrypt.ts
diff --git a/src/app/auth/_lib/session_create.ts b/src/app/(auth)/_lib/session_create.ts
similarity index 100%
rename from src/app/auth/_lib/session_create.ts
rename to src/app/(auth)/_lib/session_create.ts
diff --git a/src/app/(auth)/invalid-user/page.tsx b/src/app/(auth)/invalid-user/page.tsx
new file mode 100644
index 00000000..d214ac50
--- /dev/null
+++ b/src/app/(auth)/invalid-user/page.tsx
@@ -0,0 +1,9 @@
+import { InvalidUser } from "@/app_modules/auth";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/(user)/login/page.tsx b/src/app/(auth)/login/page.tsx
similarity index 100%
rename from src/app/(user)/login/page.tsx
rename to src/app/(auth)/login/page.tsx
diff --git a/src/app/(user)/register/page.tsx b/src/app/(auth)/register/page.tsx
similarity index 100%
rename from src/app/(user)/register/page.tsx
rename to src/app/(auth)/register/page.tsx
diff --git a/src/app/(user)/splash/page.tsx b/src/app/(auth)/splash/page.tsx
similarity index 100%
rename from src/app/(user)/splash/page.tsx
rename to src/app/(auth)/splash/page.tsx
diff --git a/src/app/(user)/validasi/page.tsx b/src/app/(auth)/validasi/page.tsx
similarity index 100%
rename from src/app/(user)/validasi/page.tsx
rename to src/app/(auth)/validasi/page.tsx
diff --git a/src/app/(auth)/waiting-room/page.tsx b/src/app/(auth)/waiting-room/page.tsx
new file mode 100644
index 00000000..4a1d4032
--- /dev/null
+++ b/src/app/(auth)/waiting-room/page.tsx
@@ -0,0 +1,14 @@
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import WaitingRoom_View from "@/app_modules/waiting_room/view";
+
+export const dynamic = "force-dynamic";
+
+export default async function Page() {
+ const userLoginId = await funGetUserIdByToken();
+
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/(not-user)/job-vacancy/[id]/page.tsx b/src/app/(not-user)/job-vacancy/[id]/page.tsx
index 33425748..13ecbc48 100644
--- a/src/app/(not-user)/job-vacancy/[id]/page.tsx
+++ b/src/app/(not-user)/job-vacancy/[id]/page.tsx
@@ -1,13 +1,10 @@
import { Job_UiNotUserView } from "@/app_modules/job/_ui";
-import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
-export default async function Page({ params }: { params: { id: string } }) {
- const jobId = params.id;
- const dataJob = await job_getOneById(jobId);
+export default async function Page() {
return (
<>
-
+
>
);
}
diff --git a/src/app/(user)/waiting-room/page.tsx b/src/app/(user)/waiting-room/page.tsx
deleted file mode 100644
index abb6e4d0..00000000
--- a/src/app/(user)/waiting-room/page.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { funGlobal_checkActivationUseById } from "@/app_modules/_global/fun/get/fun_check_activation_use_by_id";
-import WaitingRoom_View from "@/app_modules/waiting_room/view";
-
-export default async function Page() {
- const userLoginId = await funGetUserIdByToken();
- const activationUser = await funGlobal_checkActivationUseById({
- userId: userLoginId as string,
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/api/admin/collaboration/[id]/route.ts b/src/app/api/admin/collaboration/[id]/route.ts
new file mode 100644
index 00000000..47fb3f77
--- /dev/null
+++ b/src/app/api/admin/collaboration/[id]/route.ts
@@ -0,0 +1,72 @@
+import prisma from "@/lib/prisma";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ req: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+ const data = await prisma.projectCollaboration.findUnique({
+ where: {
+ id: id,
+ },
+ select: {
+ id: true,
+ isActive: true,
+ title: true,
+ lokasi: true,
+ purpose: true,
+ benefit: true,
+ createdAt: true,
+ report: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ },
+ },
+ ProjectCollaborationMaster_Industri: true,
+ ProjectCollaboration_Partisipasi: {
+ where: {
+ User: {
+ active: true,
+ },
+ },
+ select: {
+ id: true,
+ User: {
+ select: {
+ id: true,
+ Profile: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ });
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get collaboration",
+ data: data,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get collaboration >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get collaboration",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/collaboration/dashboard/[name]/route.ts b/src/app/api/admin/collaboration/dashboard/[name]/route.ts
new file mode 100644
index 00000000..0e1dda84
--- /dev/null
+++ b/src/app/api/admin/collaboration/dashboard/[name]/route.ts
@@ -0,0 +1,58 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request, { params }: {
+ params: { name: string }
+}) {
+ const { name } = params;
+ try {
+ let fixData;
+ const fixStatus = _.startCase(name);
+
+ if (fixStatus === "Publish") {
+ fixData = await prisma.projectCollaboration.count({
+ where: {
+ isActive: true,
+ isReject: false,
+ Author: {
+ active: true,
+ },
+ },
+ });
+
+ } else if (fixStatus === "Reject") {
+ fixData = await prisma.projectCollaboration.count({
+ where: {
+ isReject: true,
+ },
+ });
+
+ } else if (fixStatus === "Room") {
+ fixData = await prisma.projectCollaboration_RoomChat.count({
+ where: {
+ isActive: true,
+ },
+ });
+
+ }
+ return NextResponse.json({
+ success: true,
+ message: `Success Get Data ${fixStatus}`,
+ data: fixData,
+
+ },
+ { status: 200 }
+ )
+ } catch (error) {
+ backendLogger.error("Error get count group chat", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get data count group chat ",
+ reason: (error as Error).message
+ },
+ { status: 500 }
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/collaboration/group/[id]/route.ts b/src/app/api/admin/collaboration/group/[id]/route.ts
new file mode 100644
index 00000000..9d84ddc5
--- /dev/null
+++ b/src/app/api/admin/collaboration/group/[id]/route.ts
@@ -0,0 +1,74 @@
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+
+ const data = await prisma.projectCollaboration_RoomChat.findUnique({
+ where: {
+ id: id,
+ },
+ select: {
+ id: true,
+ name: true,
+ ProjectCollaboration: {
+ select: {
+ id: true,
+ isActive: true,
+ title: true,
+ lokasi: true,
+ purpose: true,
+ benefit: true,
+ createdAt: true,
+ ProjectCollaborationMaster_Industri: true,
+ Author: true
+ },
+ },
+ ProjectCollaboration_AnggotaRoomChat: {
+ select: {
+ User: {
+ select: {
+ username: true,
+ id: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data collaboration group",
+ data: data,
+ },
+ {
+ status: 200,
+ }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data collaboration group", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data collaboration group",
+ error: (error as Error).message,
+ },
+ {
+ status: 500,
+ }
+ );
+ }
+}
diff --git a/src/app/api/admin/collaboration/group/route.ts b/src/app/api/admin/collaboration/group/route.ts
new file mode 100644
index 00000000..bbec0db0
--- /dev/null
+++ b/src/app/api/admin/collaboration/group/route.ts
@@ -0,0 +1,146 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ let fixData;
+
+ if (!page) {
+ fixData = await prisma.projectCollaboration_RoomChat.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ isActive: true,
+ },
+ select: {
+ id: true,
+ createdAt: true,
+ isActive: true,
+ name: true,
+ ProjectCollaboration_AnggotaRoomChat: {
+ select: {
+ User: {
+ select: {
+ id: true,
+ Profile: true,
+ },
+ },
+ },
+ },
+ ProjectCollaboration: {
+ select: {
+ id: true,
+ isActive: true,
+ title: true,
+ lokasi: true,
+ purpose: true,
+ benefit: true,
+ createdAt: true,
+ report: true,
+ Author: {
+ select: {
+ id: true,
+ Profile: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ ProjectCollaborationMaster_Industri: true,
+ },
+ },
+ },
+ });
+ } else {
+ const data = await prisma.projectCollaboration_RoomChat.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ isActive: true,
+ },
+ select: {
+ id: true,
+ createdAt: true,
+ isActive: true,
+ name: true,
+ ProjectCollaboration_AnggotaRoomChat: {
+ select: {
+ User: {
+ select: {
+ id: true,
+ Profile: true,
+ },
+ },
+ },
+ },
+ ProjectCollaboration: {
+ select: {
+ id: true,
+ isActive: true,
+ title: true,
+ lokasi: true,
+ purpose: true,
+ benefit: true,
+ createdAt: true,
+ report: true,
+ Author: {
+ select: {
+ id: true,
+ Profile: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ ProjectCollaborationMaster_Industri: true,
+ },
+ },
+ },
+ });
+
+ const nCount = await prisma.projectCollaboration_RoomChat.count({
+ where: {
+ isActive: true,
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data collaboration group",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data collaboration group >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data collaboration group",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/collaboration/status/publish/route.ts b/src/app/api/admin/collaboration/status/publish/route.ts
new file mode 100644
index 00000000..cf04c496
--- /dev/null
+++ b/src/app/api/admin/collaboration/status/publish/route.ts
@@ -0,0 +1,141 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ let fixData;
+
+ if (!page) {
+ fixData = await prisma.projectCollaboration.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ isActive: true,
+ isReject: false,
+ Author: {
+ active: true,
+ },
+ },
+ select: {
+ id: true,
+ createdAt: true,
+ isActive: true,
+ title: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: true,
+ },
+ },
+ projectCollaborationMaster_IndustriId: true,
+ ProjectCollaborationMaster_Industri: true,
+ ProjectCollaboration_Partisipasi: {
+ where: {
+ User: {
+ active: true,
+ },
+ },
+ // select: {
+ // User: {
+ // select: {
+ // id: true,
+ // username: true,
+ // Profile: true,
+ // },
+ // },
+ // },
+ },
+ },
+ });
+ } else {
+ const data = await prisma.projectCollaboration.findMany({
+ skip: skipData,
+ take: takeData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ isActive: true,
+ isReject: false,
+ Author: {
+ active: true,
+ },
+ },
+ select: {
+ id: true,
+ createdAt: true,
+ isActive: true,
+ title: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: true,
+ },
+ },
+ projectCollaborationMaster_IndustriId: true,
+ ProjectCollaborationMaster_Industri: true,
+ ProjectCollaboration_Partisipasi: {
+ where: {
+ User: {
+ active: true,
+ },
+ },
+ // select: {
+ // User: {
+ // select: {
+ // id: true,
+ // username: true,
+ // Profile: true,
+ // },
+ // },
+ // },
+ },
+ },
+ });
+
+ const nCount = await prisma.projectCollaboration.count({
+ where: {
+ isActive: true,
+ isReject: false,
+ Author: {
+ active: true,
+ },
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data collaboration dashboard",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data collaboration dashboard >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data collaboration dashboard",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/collaboration/status/reject/route.ts b/src/app/api/admin/collaboration/status/reject/route.ts
new file mode 100644
index 00000000..7d43e265
--- /dev/null
+++ b/src/app/api/admin/collaboration/status/reject/route.ts
@@ -0,0 +1,143 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ let fixData;
+
+
+ if (!page) {
+ fixData = await prisma.projectCollaboration.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ isActive: false,
+ isReject: true,
+ Author: {
+ active: true,
+ },
+
+
+ },
+ select: {
+ id: true,
+ createdAt: true,
+ isActive: true,
+ title: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: true,
+ },
+ },
+ projectCollaborationMaster_IndustriId: true,
+ ProjectCollaborationMaster_Industri: true,
+ ProjectCollaboration_Partisipasi: {
+ where: {
+ User: {
+ active: true,
+ },
+ },
+ // select: {
+ // User: {
+ // select: {
+ // id: true,
+ // username: true,
+ // Profile: true,
+ // },
+ // },
+ // },
+ },
+ },
+ });
+ } else {
+ const data = await prisma.projectCollaboration.findMany({
+ skip: skipData,
+ take: takeData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ isActive: false,
+ isReject: true,
+ Author: {
+ active: true,
+ },
+ },
+ select: {
+ id: true,
+ createdAt: true,
+ isActive: true,
+ title: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: true,
+ },
+ },
+ projectCollaborationMaster_IndustriId: true,
+ ProjectCollaborationMaster_Industri: true,
+ ProjectCollaboration_Partisipasi: {
+ where: {
+ User: {
+ active: true,
+ },
+ },
+ // select: {
+ // User: {
+ // select: {
+ // id: true,
+ // username: true,
+ // Profile: true,
+ // },
+ // },
+ // },
+ },
+ },
+ });
+
+ const nCount = await prisma.projectCollaboration.count({
+ where: {
+ isActive: false,
+ isReject: true,
+ Author: {
+ active: true,
+ },
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ }
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Success get data collaboration dashboard",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data collaboration dashboard >>", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get data collaboration dashboard",
+ reason: (error as Error).message
+ },
+ { status: 500 }
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/developer/route.ts b/src/app/api/admin/developer/route.ts
new file mode 100644
index 00000000..30870c0b
--- /dev/null
+++ b/src/app/api/admin/developer/route.ts
@@ -0,0 +1,84 @@
+import _ from "lodash";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(request: Request) {
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const dataTake = 10;
+ const dataSkip = Number(page) * dataTake - dataTake;
+
+ if (!page) {
+ fixData = await prisma.user.findMany({
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ masterUserRoleId: "2",
+ username: {
+ contains: search || "",
+ mode: "insensitive",
+ },
+ },
+ });
+ } else {
+ const data = await prisma.user.findMany({
+ skip: dataSkip,
+ take: dataTake,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ masterUserRoleId: "2",
+ username: {
+ contains: search || "",
+ mode: "insensitive",
+ },
+ },
+ });
+
+ const nCount = await prisma.user.count({
+ where: {
+ masterUserRoleId: "2",
+ username: {
+ contains: search || "",
+ mode: "insensitive",
+ },
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / dataTake),
+ };
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data",
+ data: fixData,
+ },
+ {
+ status: 200,
+ }
+ );
+ } catch (error) {
+ console.error("Error get data admin", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Internal Server Error",
+ reason: (error as Error).message,
+ },
+ {
+ status: 500,
+ }
+ );
+ }
+}
diff --git a/src/app/api/admin/donasi/[id]/count/route.ts b/src/app/api/admin/donasi/[id]/count/route.ts
new file mode 100644
index 00000000..f9e3f9a1
--- /dev/null
+++ b/src/app/api/admin/donasi/[id]/count/route.ts
@@ -0,0 +1,29 @@
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+export async function GET(
+ req: Request,
+ { params }: { params: { id: string } }
+) {
+ const { id } = params;
+ try {
+ const data = await prisma.donasi_Invoice.count({
+ where: {
+ donasiId: id,
+ donasiMaster_StatusInvoiceId: "1",
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Data berhasil diambil",
+ data: data,
+ });
+ } catch (error) {
+ console.error("Error get count donasi ", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get count donasi",
+ reason: (error as Error).message,
+ });
+ }
+}
diff --git a/src/app/api/admin/donasi/[id]/donatur/route.ts b/src/app/api/admin/donasi/[id]/donatur/route.ts
new file mode 100644
index 00000000..7c1d6ece
--- /dev/null
+++ b/src/app/api/admin/donasi/[id]/donatur/route.ts
@@ -0,0 +1,111 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(req: Request,
+ { params }: { params: { id: string } }) {
+
+ try {
+ let fixData;
+ const { id } = params;
+ const { searchParams } = new URL(req.url);
+ const page = searchParams.get("page");
+ const status = searchParams.get("status");
+ const takeData = 10
+ const skipData = Number(page) * takeData - takeData;
+
+ if (!page) {
+ fixData = await prisma.donasi_Invoice.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ donasiId: id,
+ active: true,
+ },
+ select: {
+ id: true,
+ nominal: true,
+ createdAt: true,
+ Author: true,
+ DonasiMaster_Bank: true,
+ DonasiMaster_StatusInvoice: true,
+ donasiMaster_StatusInvoiceId: true,
+ imagesId: true,
+ imageId: true,
+
+ },
+ })
+ } else {
+ const fixStatus = _.startCase(status ? status : "");
+ const data = await prisma.donasi_Invoice.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+
+ donasiId: id,
+ active: true,
+ DonasiMaster_StatusInvoice: {
+ name: {
+ contains: fixStatus,
+ mode: "insensitive",
+ }
+ }
+ },
+ select: {
+ id: true,
+ nominal: true,
+ createdAt: true,
+ Author: true,
+ DonasiMaster_Bank: true,
+ DonasiMaster_StatusInvoice: true,
+ donasiMaster_StatusInvoiceId: true,
+ imagesId: true,
+ imageId: true,
+
+
+ },
+ })
+
+ const nCount = await prisma.donasi_Invoice.count({
+ where: {
+ donasiId: id,
+ active: true,
+ DonasiMaster_StatusInvoice: {
+ name: {
+ contains: fixStatus,
+ mode: "insensitive",
+ }
+ }
+ }
+ })
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData)
+ }
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Success",
+ data: fixData,
+ },
+ { status: 200 }
+ )
+ } catch (error) {
+ backendLogger.error("Error get data donatur >>", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get data donatur",
+ reason: (error as Error).message
+ },
+ { status: 500 }
+ )
+ }
+}
+
diff --git a/src/app/api/admin/donasi/[id]/pencairan/route.ts b/src/app/api/admin/donasi/[id]/pencairan/route.ts
new file mode 100644
index 00000000..f933f133
--- /dev/null
+++ b/src/app/api/admin/donasi/[id]/pencairan/route.ts
@@ -0,0 +1,64 @@
+import prisma from "@/lib/prisma";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+export async function GET(
+ req: Request,
+ { params }: { params: { id: string } }
+) {
+
+ let fixData;
+ const donasiId = params.id;
+ const { searchParams } = new URL(req.url);
+ const page = searchParams.get("page");
+ const takeData = 10
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ if (!page) {
+ fixData = await prisma.donasi_PencairanDana.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ donasiId: donasiId,
+ },
+ });
+ } else {
+ const data = await prisma.donasi_PencairanDana.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ donasiId: donasiId,
+ },
+ });
+
+ const nCount = await prisma.donasi_PencairanDana.count({
+ where: {
+ donasiId: donasiId,
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Data berhasil diambil",
+ data: fixData,
+ });
+ } catch (error) {
+ backendLogger.error("Error get pencairan donasi >>", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get pencairan donasi",
+ reason: (error as Error).message,
+ });
+ }
+}
diff --git a/src/app/api/admin/donasi/[id]/route.ts b/src/app/api/admin/donasi/[id]/route.ts
new file mode 100644
index 00000000..a2739b1e
--- /dev/null
+++ b/src/app/api/admin/donasi/[id]/route.ts
@@ -0,0 +1,57 @@
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function GET(req: Request, { params }: { params: { id: string } }) {
+
+ try {
+ const { id } = params;
+ const donasiId = id;
+ const data = await prisma.donasi.findUnique({
+ where: {
+ id: donasiId,
+ },
+ select: {
+ id: true,
+ title: true,
+ target: true,
+ active: true,
+ createdAt: true,
+ updatedAt: true,
+ publishTime: true,
+ catatan: true,
+ progres: true,
+ terkumpul: true,
+ authorId: true,
+ namaBank: true,
+ rekening: true,
+ totalPencairan: true,
+ akumulasiPencairan: true,
+ imagesId: true,
+ donasiMaster_KategoriId: true,
+ donasiMaster_DurasiId: true,
+ donasiMaster_StatusDonasiId: true,
+ Author: true,
+ imageDonasi: true,
+ CeritaDonasi: true,
+ DonasiMaster_Ketegori: true,
+ DonasiMaster_Durasi: true,
+ DonasiMaster_Status: true,
+ imageId: true,
+ }
+ })
+
+ return NextResponse.json({
+ success: true,
+ message: "Data Donasi Berhasil Diambil",
+ data: data,
+ }, { status: 200 });
+ } catch (error) {
+ backendLogger.error("Error Get Data Donasi >>", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get detail Investasi",
+ reason: (error as Error).message,
+ }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/donasi/dashboard/[name]/route.ts b/src/app/api/admin/donasi/dashboard/[name]/route.ts
new file mode 100644
index 00000000..6c4a7053
--- /dev/null
+++ b/src/app/api/admin/donasi/dashboard/[name]/route.ts
@@ -0,0 +1,38 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request, { params }: {
+ params: { name: string }
+}) {
+
+ const { name } = params;
+ try {
+ let fixData;
+ const fixStatus = _.startCase(name);
+ fixData = await prisma.donasi.count({
+ where: {
+ DonasiMaster_Status: {
+ name: fixStatus
+ },
+ }
+ });
+ return NextResponse.json({
+ success: true,
+ message: "Success get data donasi dashboard",
+ data: fixData
+ },
+ { status: 200 }
+ )
+ } catch (error) {
+ backendLogger.error("Error get data donasi dashboard >>", error);
+ return NextResponse.json({
+ success: false,
+ message: "Failed to get data donasi dashboard",
+ reason: (error as Error).message
+ },
+ { status: 500 }
+ )
+ }
+}
diff --git a/src/app/api/admin/donasi/dashboard/kategori/route.ts b/src/app/api/admin/donasi/dashboard/kategori/route.ts
new file mode 100644
index 00000000..997e0a14
--- /dev/null
+++ b/src/app/api/admin/donasi/dashboard/kategori/route.ts
@@ -0,0 +1,25 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+
+export async function GET() {
+ try {
+ const fixData = await prisma.donasiMaster_Kategori.count({});
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data donasi dashboard",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ return NextResponse.json(
+ {
+ success: true,
+ message: "gagal mendapatkan data donasi dashboard",
+ error: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/donasi/kategori/route.ts b/src/app/api/admin/donasi/kategori/route.ts
new file mode 100644
index 00000000..71b43b37
--- /dev/null
+++ b/src/app/api/admin/donasi/kategori/route.ts
@@ -0,0 +1,34 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ const method = request.method;
+ try {
+ const data = await prisma.donasiMaster_Kategori.findMany({
+ orderBy: {
+ createdAt: 'asc'
+ },
+ where: {
+
+ active: true
+
+ }
+
+ })
+ return NextResponse.json({
+ success: true,
+ message: "Success get kategori",
+ data: data
+ })
+ } catch (error) {
+ backendLogger.error("Error get kategori", error);
+ return NextResponse.json({
+ success: false,
+ message: "Failed get kategori",
+ reason: (error as Error).message
+ },
+ { status: 500 }
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/donasi/status/[name]/route.ts b/src/app/api/admin/donasi/status/[name]/route.ts
new file mode 100644
index 00000000..d6c6bfa5
--- /dev/null
+++ b/src/app/api/admin/donasi/status/[name]/route.ts
@@ -0,0 +1,122 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request,
+ { params }: { params: { name: string } }) {
+
+ const { name } = params;
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ let fixData;
+ const fixStatus = _.startCase(name);
+
+
+ if (!page) {
+ fixData = await prisma.donasi.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ DonasiMaster_Status: {
+ name: fixStatus,
+ },
+ active: true,
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ select: {
+ id: true,
+ title: true,
+ target: true,
+ authorId: true,
+ terkumpul: true,
+ imageDonasi: true,
+ DonasiMaster_Ketegori: true,
+ DonasiMaster_Durasi: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ },
+ },
+ },
+ })
+ } else {
+ const data = await prisma.donasi.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ DonasiMaster_Status: {
+ name: fixStatus,
+ },
+ active: true,
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ select: {
+ id: true,
+ title: true,
+ target: true,
+ authorId: true,
+ terkumpul: true,
+ imageDonasi: true,
+ DonasiMaster_Ketegori: true,
+ DonasiMaster_Durasi: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ },
+ },
+ },
+ })
+
+ const nCount = await prisma.donasi.count({
+ where: {
+ active: true,
+ DonasiMaster_Status: {
+ name: fixStatus
+ },
+ }
+ })
+
+
+ fixData = {
+ data: data,
+ nCount: _.ceil(nCount / takeData)
+ }
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Success",
+ data: fixData
+ },
+ { status: 200 }
+ )
+
+ } catch (error) {
+ backendLogger.error("Error geta data table donasi event dashboard>>", error)
+ return NextResponse.json({
+ success: false,
+ message: "Failed get data table donasi dashboard",
+ reason: (error as Error).message
+ },
+ { status: 500 }
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/event/[id]/peserta/route.ts b/src/app/api/admin/event/[id]/peserta/route.ts
new file mode 100644
index 00000000..a9a45acd
--- /dev/null
+++ b/src/app/api/admin/event/[id]/peserta/route.ts
@@ -0,0 +1,100 @@
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function GET(request: Request,
+ { params }: { params: { id: string } }) {
+
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get('search');
+ const page = searchParams.get('page');
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+
+ try {
+ let fixData;
+ const { id } = params;
+ const eventId = id
+
+ if (!page) {
+ fixData = await prisma.event_Peserta.findMany({
+
+ where: {
+ eventId: eventId,
+ User: {
+ username: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ }
+ }
+
+ },
+ select: {
+ isPresent: true,
+ User: {
+ include: {
+ Profile: true,
+ },
+ },
+ },
+ });
+ } else {
+ const data = await prisma.event_Peserta.findMany({
+ skip: skipData,
+ take: takeData,
+ where: {
+ eventId: eventId,
+ User: {
+ username: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ }
+ }
+ },
+ select: {
+ isPresent: true,
+ User: {
+ include: {
+ Profile: true,
+ },
+ },
+ },
+ });
+
+ const nCount = await prisma.event_Peserta.count({
+ where: {
+ eventId: eventId,
+ User: {
+ username: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ }
+ }
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+ return NextResponse.json({
+ success: true,
+ message: "Success get data event detail",
+ data: fixData,
+ },
+ { status: 200 }
+ )
+ } catch (error) {
+ backendLogger.error("Error get data event detail >>", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get data event detail",
+ reason: (error as Error).message
+ },
+ { status: 500 }
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/event/[id]/route.ts b/src/app/api/admin/event/[id]/route.ts
new file mode 100644
index 00000000..8a72e174
--- /dev/null
+++ b/src/app/api/admin/event/[id]/route.ts
@@ -0,0 +1,55 @@
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function GET(
+ req: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+ const data = await prisma.event.findUnique({
+ where: {
+ id: id,
+ },
+ include: {
+ Author: {
+ select: {
+ username: true,
+ nomor: true,
+ Profile: {
+ select: {
+ name: true,
+ alamat: true,
+ },
+ },
+ },
+ },
+ EventMaster_TipeAcara: {
+ select: {
+ name: true,
+ },
+ },
+ EventMaster_Status: true,
+ },
+ });
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data event detail",
+ data: data,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data event detail >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data event detail",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/event/dashboard/[name]/route.ts b/src/app/api/admin/event/dashboard/[name]/route.ts
new file mode 100644
index 00000000..902f8605
--- /dev/null
+++ b/src/app/api/admin/event/dashboard/[name]/route.ts
@@ -0,0 +1,44 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { name: string } }
+) {
+
+ const { name } = params;
+
+ try {
+ let fixData;
+ const fixStatus = _.startCase(name);
+ fixData = await prisma.event.count({
+ where: {
+ EventMaster_Status: {
+ name: fixStatus,
+ },
+ isArsip: false,
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data event dashboard",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data event dashboard >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed to get data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/event/dashboard/riwayat/route.ts b/src/app/api/admin/event/dashboard/riwayat/route.ts
new file mode 100644
index 00000000..522070ce
--- /dev/null
+++ b/src/app/api/admin/event/dashboard/riwayat/route.ts
@@ -0,0 +1,37 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ try {
+ let fixData;
+ fixData = await prisma.event.count({
+ where: {
+ EventMaster_Status: {
+ name: "Publish",
+ },
+ isArsip: true,
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data riwayat event dashboard",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data riwayat event dashboard >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed to get data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/event/dashboard/tipe-acara/route.ts b/src/app/api/admin/event/dashboard/tipe-acara/route.ts
new file mode 100644
index 00000000..1d4b9aa2
--- /dev/null
+++ b/src/app/api/admin/event/dashboard/tipe-acara/route.ts
@@ -0,0 +1,33 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET() {
+ try {
+ const fixData = await prisma.eventMaster_TipeAcara.count({
+ where: {
+ active: true,
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data riwayat event dashboard",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data riwayat event dashboard >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed to get data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/event/riwayat/route.ts b/src/app/api/admin/event/riwayat/route.ts
new file mode 100644
index 00000000..aedecf4e
--- /dev/null
+++ b/src/app/api/admin/event/riwayat/route.ts
@@ -0,0 +1,192 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ let fixData;
+
+ if (!page && !search) {
+ fixData = await prisma.event.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ EventMaster_Status: {
+ name: "Publish",
+ },
+ isArsip: true,
+ },
+ include: {
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ EventMaster_Status: true,
+ EventMaster_TipeAcara: true,
+ },
+ });
+ } else if (!page && search) {
+ fixData = await prisma.event.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ EventMaster_Status: {
+ name: "Publish",
+ },
+ isArsip: true,
+ title: {
+ contains: search,
+ mode: "insensitive",
+ },
+ },
+ include: {
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ EventMaster_Status: true,
+ EventMaster_TipeAcara: true,
+ },
+ });
+ } else if (page && !search) {
+ const data = await prisma.event.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ EventMaster_Status: {
+ name: "Publish",
+ },
+ isArsip: true,
+ },
+ include: {
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ EventMaster_Status: true,
+ EventMaster_TipeAcara: true,
+ },
+ });
+
+ const nCount = await prisma.event.count({
+ where: {
+ active: true,
+ isArsip: true,
+ EventMaster_Status: {
+ name: "Publish",
+ },
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ } else if (page && search) {
+ const data = await prisma.event.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ EventMaster_Status: {
+ name: "Publish",
+ },
+ isArsip: true,
+ title: {
+ contains: search,
+ mode: "insensitive",
+ },
+ },
+ include: {
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ EventMaster_Status: true,
+ EventMaster_TipeAcara: true,
+ },
+ });
+
+ const nCount = await prisma.event.count({
+ where: {
+ active: true,
+ isArsip: true,
+ EventMaster_Status: {
+ name: "Publish",
+ },
+ title: {
+ contains: search,
+ mode: "insensitive",
+ },
+ },
+ });
+
+ fixData = {
+ data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data riwayat event",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data riwayat event >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data riwayat event",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/event/status/[name]/route.ts b/src/app/api/admin/event/status/[name]/route.ts
new file mode 100644
index 00000000..f4fb0e52
--- /dev/null
+++ b/src/app/api/admin/event/status/[name]/route.ts
@@ -0,0 +1,153 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import moment from "moment";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { name: string } }
+) {
+ const { name } = params;
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ let fixData;
+ const fixStatus = _.startCase(name);
+
+ if (!page) {
+ fixData = await prisma.event.findMany({
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ active: true,
+ isArsip: false,
+ EventMaster_Status: {
+ name: fixStatus,
+ },
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ include: {
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ EventMaster_Status: true,
+ EventMaster_TipeAcara: true,
+ },
+ });
+ } else {
+ if (fixStatus === "Publish") {
+ const getAllData = await prisma.event.findMany({
+ where: {
+ active: true,
+ EventMaster_Status: {
+ name: fixStatus,
+ },
+ isArsip: false,
+ },
+ });
+
+ for (let i of getAllData) {
+ if (moment(i.tanggalSelesai).diff(moment(), "minutes") < 0) {
+ await prisma.event.update({
+ where: {
+ id: i.id,
+ },
+ data: {
+ isArsip: true,
+ },
+ });
+ }
+ }
+ }
+
+ const data = await prisma.event.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ tanggal: "asc",
+ },
+ where: {
+ active: true,
+ isArsip: false,
+ EventMaster_Status: {
+ name: fixStatus,
+ },
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ include: {
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ EventMaster_Status: true,
+ EventMaster_TipeAcara: true,
+ },
+ });
+
+ const nCount = await prisma.event.count({
+ where: {
+ active: true,
+ isArsip: false,
+ EventMaster_Status: {
+ name: fixStatus,
+ },
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: `Success get data table event ${name}`,
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data table event dashboard >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed get data table event dashboard",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/forum/[id]/komentar/route.ts b/src/app/api/admin/forum/[id]/komentar/route.ts
new file mode 100644
index 00000000..1569bf8a
--- /dev/null
+++ b/src/app/api/admin/forum/[id]/komentar/route.ts
@@ -0,0 +1,102 @@
+import _ from "lodash";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ let fixData;
+ const { id } = params;
+ const postingId = id;
+
+ if (!page) {
+ fixData = await prisma.forum_Komentar.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ forum_PostingId: postingId,
+ isActive: true,
+ komentar: {
+ contains: search ?? "",
+ mode: "insensitive",
+ },
+ },
+ include: {
+ Forum_ReportKomentar: true,
+ Author: {
+ select: {
+ username: true
+ }
+ }
+
+ },
+ });
+ } else {
+ const data = await prisma.forum_Komentar.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ forum_PostingId: postingId,
+ isActive: true,
+ komentar: {
+ contains: search ?? "",
+ mode: "insensitive",
+ },
+ },
+ include: {
+ Forum_ReportKomentar: true,
+ Author: {
+ select: {
+ username: true
+ }
+ }
+
+ },
+ });
+
+ const nCount = await prisma.forum_Komentar.count({
+ where: {
+ forum_PostingId: postingId,
+ isActive: true,
+ komentar: {
+ contains: search ?? "",
+ mode: "insensitive",
+ },
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data komentar",
+ data: fixData,
+ });
+ } catch (error) {
+ console.log("Error get data komentar", error);
+ return NextResponse.json(
+ {
+ status: false,
+ message: "Gagal mendapatkan data komentar",
+ error: error || (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/forum/[id]/report-komentar/route.ts b/src/app/api/admin/forum/[id]/report-komentar/route.ts
new file mode 100644
index 00000000..5f045ab7
--- /dev/null
+++ b/src/app/api/admin/forum/[id]/report-komentar/route.ts
@@ -0,0 +1,109 @@
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ let fixData;
+ const { id } = params;
+ const komentarId = id;
+
+ if (!page) {
+ fixData = await prisma.forum_ReportKomentar.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ forum_KomentarId: komentarId,
+ },
+ select: {
+ id: true,
+ isActive: true,
+ createdAt: true,
+ deskripsi: true,
+ ForumMaster_KategoriReport: true,
+ User: {
+ select: {
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ },
+ });
+ } else {
+ const data = await prisma.forum_ReportKomentar.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ forum_KomentarId: komentarId,
+ },
+ select: {
+ id: true,
+ isActive: true,
+ createdAt: true,
+ deskripsi: true,
+ ForumMaster_KategoriReport: true,
+ User: {
+ select: {
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ },
+ });
+
+ const nCount = await prisma.forum_ReportKomentar.count({
+ where: {
+ forum_KomentarId: komentarId,
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get detail data report komentar",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get detail data report komentar >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get detail data report komentar",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/forum/[id]/report-posting/route.ts b/src/app/api/admin/forum/[id]/report-posting/route.ts
new file mode 100644
index 00000000..12e47ce1
--- /dev/null
+++ b/src/app/api/admin/forum/[id]/report-posting/route.ts
@@ -0,0 +1,113 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request,
+ { params }: { params: { id: string } }) {
+
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get('search');
+ const page = searchParams.get('page');
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ let fixData;
+ const { id } = params;
+ const postingId = id
+
+ if (!page) {
+ fixData = await prisma.forum_ReportPosting.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ forum_PostingId: postingId,
+ },
+ select: {
+ id: true,
+ deskripsi: true,
+ createdAt: true,
+ User: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ ForumMaster_KategoriReport: {
+ select: {
+ id: true,
+ title: true,
+ deskripsi: true,
+ },
+ },
+ },
+ });
+ } else {
+ const data = await prisma.forum_ReportPosting.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ forum_PostingId: postingId,
+ },
+ select: {
+ id: true,
+ deskripsi: true,
+ createdAt: true,
+ User: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ ForumMaster_KategoriReport: {
+ select: {
+ id: true,
+ title: true,
+ deskripsi: true,
+ },
+ },
+ },
+ });
+ const nCount = await prisma.forum_ReportPosting.count({
+ where: {
+ forum_PostingId: postingId,
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+ return NextResponse.json({
+ success: true,
+ message: "Success get data forum report posting",
+ data: fixData
+ },
+ { status: 200 }
+ )
+ } catch (error) {
+ backendLogger.error("Error get data forum report posting >>", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get data forum report posting",
+ },
+ { status: 500 }
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/forum/[id]/route.ts b/src/app/api/admin/forum/[id]/route.ts
new file mode 100644
index 00000000..2c1323fa
--- /dev/null
+++ b/src/app/api/admin/forum/[id]/route.ts
@@ -0,0 +1,65 @@
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+import _ from "lodash";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+ const data = await prisma.forum_Posting.findFirst({
+ where: {
+ id: id,
+ },
+ select: {
+ id: true,
+ diskusi: true,
+ ForumMaster_StatusPosting: {
+ select: {
+ id: true,
+ status: true,
+ },
+ },
+ authorId: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ Forum_Komentar: {
+ where: {
+ isActive: true,
+ },
+ },
+ },
+ });
+
+ const result = {
+ ..._.omit(data, "Forum_Komentar"),
+ Forum_Komentar: data?.Forum_Komentar.length,
+ };
+
+ return NextResponse.json({
+ success: true,
+ message: "Success get data",
+ data: result,
+ });
+ } catch (error) {
+ console.error("Error get data forum", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data forum",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/forum/dashboard/publish/route.ts b/src/app/api/admin/forum/dashboard/publish/route.ts
new file mode 100644
index 00000000..109c1ade
--- /dev/null
+++ b/src/app/api/admin/forum/dashboard/publish/route.ts
@@ -0,0 +1,32 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET() {
+ try {
+ const fixData = await prisma.forum_Posting.count({
+ where: {
+ isActive: true,
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data forum dashboard",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data forum dashboard", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data forum dashboard",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/forum/dashboard/report_komentar/route.ts b/src/app/api/admin/forum/dashboard/report_komentar/route.ts
new file mode 100644
index 00000000..4efc7546
--- /dev/null
+++ b/src/app/api/admin/forum/dashboard/report_komentar/route.ts
@@ -0,0 +1,31 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+
+ try {
+ let fixData;
+ fixData = await prisma.forum_ReportKomentar.count({
+ where: {
+ isActive: true,
+ }
+ })
+ return NextResponse.json({
+ success: true,
+ message: "Success get data forum dashboard",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data forum dashboard", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get data forum dashboard",
+ reason: (error as Error).message
+ },
+ { status: 500 }
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/forum/dashboard/report_posting/route.ts b/src/app/api/admin/forum/dashboard/report_posting/route.ts
new file mode 100644
index 00000000..763eb1d8
--- /dev/null
+++ b/src/app/api/admin/forum/dashboard/report_posting/route.ts
@@ -0,0 +1,30 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ try {
+ let fixData;
+ fixData = await prisma.forum_ReportPosting.count({
+ where: {
+ isActive: true,
+ }
+ })
+ return NextResponse.json({
+ success: true,
+ message: "Success get data forum dashboard",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data forum dashboard", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get data forum dashboard",
+ reason: (error as Error).message
+ },
+ { status: 500 }
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/forum/komentar/[id]/route.ts b/src/app/api/admin/forum/komentar/[id]/route.ts
new file mode 100644
index 00000000..5de5f484
--- /dev/null
+++ b/src/app/api/admin/forum/komentar/[id]/route.ts
@@ -0,0 +1,45 @@
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+ const data = await prisma.forum_Komentar.findFirst({
+ where: {
+ id: id,
+ },
+ select: {
+ id: true,
+ isActive: true,
+ authorId: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ },
+ },
+ komentar: true,
+ forum_PostingId: true,
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Success get data komentar",
+ data: data,
+ });
+ } catch (error) {
+ console.error("Error get data komentar", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data komentar",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/forum/komentar/route.ts b/src/app/api/admin/forum/komentar/route.ts
new file mode 100644
index 00000000..e76249b0
--- /dev/null
+++ b/src/app/api/admin/forum/komentar/route.ts
@@ -0,0 +1,122 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ let fixData;
+
+ if (!page) {
+ fixData = await prisma.forum_ReportKomentar.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ Forum_Komentar: {
+ isActive: true,
+ komentar: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ },
+ include: {
+ ForumMaster_KategoriReport: true,
+ User: {
+ select: {
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ Forum_Komentar: {
+ select: {
+ id: true,
+ komentar: true,
+ },
+ },
+ },
+ });
+ } else {
+ const data = await prisma.forum_ReportKomentar.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ Forum_Komentar: {
+ isActive: true,
+ komentar: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ },
+ include: {
+ ForumMaster_KategoriReport: true,
+ User: {
+ select: {
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ Forum_Komentar: {
+ select: {
+ id: true,
+ komentar: true,
+ },
+ },
+ },
+ });
+ const nCount = await prisma.forum_ReportKomentar.count({
+ where: {
+ Forum_Komentar: {
+ isActive: true,
+ komentar: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ },
+ });
+
+ fixData = {
+ data: data,
+ nCount: _.ceil(nCount / takeData),
+ };
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data forum komentar",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data forum komentar", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get data forum komentar",
+ reason: (error as Error).message,
+ });
+ }
+}
diff --git a/src/app/api/admin/forum/posting/route.ts b/src/app/api/admin/forum/posting/route.ts
new file mode 100644
index 00000000..51d36ec8
--- /dev/null
+++ b/src/app/api/admin/forum/posting/route.ts
@@ -0,0 +1,153 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ let fixData;
+
+ if (!page) {
+ fixData = await prisma.forum_ReportPosting.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ Forum_Posting: {
+ isActive: true,
+ diskusi: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ },
+ select: {
+ id: true,
+ deskripsi: true,
+ createdAt: true,
+ User: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ ForumMaster_KategoriReport: {
+ select: {
+ id: true,
+ title: true,
+ deskripsi: true,
+ },
+ },
+ Forum_Posting: {
+ select: {
+ diskusi: true,
+ },
+ },
+ },
+ });
+ } else {
+ const data = await prisma.forum_ReportPosting.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ Forum_Posting: {
+ isActive: true,
+ diskusi: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ },
+ select: {
+ id: true,
+ isActive: true,
+ createdAt: true,
+ deskripsi: true,
+ forumMaster_KategoriReportId: true,
+ ForumMaster_KategoriReport: {
+ select: {
+ id: true,
+ title: true,
+ deskripsi: true,
+ },
+ },
+
+ forum_PostingId: true,
+ Forum_Posting: {
+ select: {
+ id: true,
+ diskusi: true,
+ ForumMaster_StatusPosting: {
+ select: {
+ id: true,
+ status: true,
+ },
+ },
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ },
+ },
+ },
+ },
+ userId: true,
+ User: {
+ select: {
+ id: true,
+ username: true,
+ },
+ },
+ },
+ });
+
+ const nCount = await prisma.forum_ReportPosting.count({
+ where: {
+ Forum_Posting: {
+ isActive: true,
+ diskusi: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ },
+ });
+
+ fixData = {
+ data: data,
+ nCount: _.ceil(nCount / takeData),
+ };
+ }
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data forum posting",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data forum posting >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data forum posting",
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/forum/publish/route.ts b/src/app/api/admin/forum/publish/route.ts
new file mode 100644
index 00000000..1bd4f355
--- /dev/null
+++ b/src/app/api/admin/forum/publish/route.ts
@@ -0,0 +1,119 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ let fixData;
+
+ if (!page) {
+ fixData = await prisma.forum_Posting.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ isActive: true,
+ diskusi: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ 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,
+ },
+ });
+ } else {
+ const data = await prisma.forum_Posting.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ isActive: true,
+ diskusi: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ 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,
+ },
+ });
+
+ const nCount = await prisma.forum_Posting.count({
+ where: {
+ isActive: true,
+ diskusi: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ });
+
+ fixData = {
+ data: data,
+ nCount: _.ceil(nCount / takeData),
+ };
+ }
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data table forum",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data table forum", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data table forum",
+ reason: error as Error,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/investasi/[id]/detail/route.ts b/src/app/api/admin/investasi/[id]/detail/route.ts
new file mode 100644
index 00000000..6fd0ebc9
--- /dev/null
+++ b/src/app/api/admin/investasi/[id]/detail/route.ts
@@ -0,0 +1,80 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(req: Request,
+ { params }: { params: { id: string } }) {
+
+
+
+ try {
+ const { id } = params;
+ const investasiId = id;
+ const data = await prisma.investasi.findUnique({
+ where: {
+ id: investasiId,
+ },
+ select: {
+ imageId: true,
+ prospektusFileId: true,
+ id: true,
+ author: {
+ select: {
+ id: true,
+ username: true,
+ nomor: true,
+ Profile: true,
+ },
+ },
+ title: true,
+ authorId: true,
+ hargaLembar: true,
+ targetDana: true,
+ totalLembar: true,
+ sisaLembar: true,
+ lembarTerbeli: true,
+ progress: true,
+ roi: true,
+ active: true,
+ createdAt: true,
+ updatedAt: true,
+ catatan: true,
+ imagesId: true,
+ MasterStatusInvestasi: true,
+ BeritaInvestasi: true,
+ DokumenInvestasi: true,
+ ProspektusInvestasi: true,
+ MasterPembagianDeviden: true,
+ MasterPencarianInvestor: true,
+ MasterPeriodeDeviden: true,
+ MasterProgresInvestasi: true,
+ masterStatusInvestasiId: true,
+ Investasi_Invoice: {
+ where: {
+ statusInvoiceId: "1",
+ },
+ },
+ countDown: true,
+
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Success get detail investasi",
+ data: data,
+ },
+ { status: 200 }
+ )
+ } catch (error) {
+ backendLogger.error("Error get detail investasi", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get detail investasi",
+ reason: (error as Error).message
+ },
+ { status: 500 }
+ );
+
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/investasi/[id]/detail_transaksi/route.ts b/src/app/api/admin/investasi/[id]/detail_transaksi/route.ts
new file mode 100644
index 00000000..12805fda
--- /dev/null
+++ b/src/app/api/admin/investasi/[id]/detail_transaksi/route.ts
@@ -0,0 +1,41 @@
+import prisma from "@/lib/prisma";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+export async function GET(req: Request,
+ { params }: { params: { id: string } }) {
+ try {
+ let fixData;
+ const { id } = params
+ const data = await prisma.investasi_Invoice.findUnique({
+ where: {
+ id: id
+ },
+ include: {
+ Author: true,
+ Images: true,
+ StatusInvoice: true,
+ MasterBank: true,
+ }
+ })
+
+ fixData = {
+ data: data,
+ }
+ return NextResponse.json({
+ success: true,
+ message: "Success get data detail transaksi",
+ data: fixData,
+ },
+ { status: 200 }
+ )
+ } catch (error) {
+ backendLogger.error("Error get data detail transaksi", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get data detail transaksi",
+ reason: (error as Error).message
+ },
+ { status: 500 }
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/investasi/[id]/transaksi/route.ts b/src/app/api/admin/investasi/[id]/transaksi/route.ts
new file mode 100644
index 00000000..afceafea
--- /dev/null
+++ b/src/app/api/admin/investasi/[id]/transaksi/route.ts
@@ -0,0 +1,99 @@
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ let fixData;
+ const { id } = params;
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const status = searchParams.get("status");
+ const takeData = 10
+ const skipData = Number(page) * takeData - takeData;
+
+ if (!page) {
+ fixData = await prisma.investasi_Invoice.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ investasiId: id,
+ isActive: true,
+ },
+ include: {
+ Author: true,
+ Images: true,
+ StatusInvoice: true,
+ MasterBank: true,
+ },
+ });
+ } else {
+ const fixStatus = _.startCase(status ? status : "");
+
+ const data = await prisma.investasi_Invoice.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ investasiId: id,
+ isActive: true,
+ StatusInvoice: {
+ name: {
+ contains: fixStatus,
+ mode: "insensitive",
+ },
+ },
+ },
+ include: {
+ Author: true,
+ Images: true,
+ StatusInvoice: true,
+ MasterBank: true,
+ },
+ });
+ const nCount = await prisma.investasi_Invoice.count({
+ where: {
+ investasiId: id,
+ isActive: true,
+ StatusInvoice: {
+ name: {
+ contains: fixStatus,
+ mode: "insensitive",
+ },
+ },
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get status transaksi",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Eror get status transaksi", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get status transaksi",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/investasi/dashboard/[name]/route.ts b/src/app/api/admin/investasi/dashboard/[name]/route.ts
new file mode 100644
index 00000000..a18dba8b
--- /dev/null
+++ b/src/app/api/admin/investasi/dashboard/[name]/route.ts
@@ -0,0 +1,36 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request, { params }: { params: { name: string } }) {
+
+ const { name } = params;
+ try {
+ let fixData;
+ const fixStatus = _.startCase(name);
+ fixData = await prisma.investasi.count({
+ where: {
+ MasterStatusInvestasi: {
+ name: fixStatus
+ },
+ }
+ })
+ return NextResponse.json({
+ success: true,
+ message: "Success get data investasi dashboard",
+ data: fixData,
+ },
+ { status: 200 }
+ )
+ } catch (error) {
+ backendLogger.error("Error get data investasi dashboard >>", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get data investasi dashboard",
+ reason: (error as Error).message
+ },
+ { status: 500 }
+ )
+ }
+}
diff --git a/src/app/api/admin/investasi/status/[name]/route.ts b/src/app/api/admin/investasi/status/[name]/route.ts
new file mode 100644
index 00000000..34fe14e6
--- /dev/null
+++ b/src/app/api/admin/investasi/status/[name]/route.ts
@@ -0,0 +1,138 @@
+import { prisma } from "@/lib";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ {
+ params,
+ }: {
+ params: { name: string };
+ }
+) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Method not allowed",
+ },
+ { status: 405 }
+ );
+ }
+
+ const { name } = params;
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ let fixData;
+ const fixStatus = _.startCase(name);
+
+ if (!page) {
+ fixData = await prisma.investasi.findMany({
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ active: true,
+ MasterStatusInvestasi: {
+ name: fixStatus,
+ },
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ include: {
+ MasterStatusInvestasi: true,
+ BeritaInvestasi: true,
+ DokumenInvestasi: true,
+ ProspektusInvestasi: true,
+ MasterPembagianDeviden: true,
+ MasterPencarianInvestor: true,
+ MasterPeriodeDeviden: true,
+ author: true,
+ Investasi_Invoice: {
+ where: {
+ statusInvoiceId: "2",
+ },
+ },
+ },
+ });
+ } else {
+ const data = await prisma.investasi.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ active: true,
+ MasterStatusInvestasi: {
+ name: fixStatus,
+ },
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ include: {
+ MasterStatusInvestasi: true,
+ BeritaInvestasi: true,
+ DokumenInvestasi: true,
+ ProspektusInvestasi: true,
+ MasterPembagianDeviden: true,
+ MasterPencarianInvestor: true,
+ MasterPeriodeDeviden: true,
+ author: true,
+ Investasi_Invoice: {
+ where: {
+ statusInvoiceId: "2",
+ },
+ },
+ },
+ });
+
+ const nCount = await prisma.investasi.count({
+ where: {
+ active: true,
+ MasterStatusInvestasi: {
+ name: fixStatus,
+ },
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.log(error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/job/[id]/route.ts b/src/app/api/admin/job/[id]/route.ts
new file mode 100644
index 00000000..45e4996d
--- /dev/null
+++ b/src/app/api/admin/job/[id]/route.ts
@@ -0,0 +1,53 @@
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export { GET };
+
+async function GET(request: Request, { params }: { params: { id: string } }) {
+ try {
+ const { id } = params;
+ const data = await prisma.job.findUnique({
+ where: {
+ id: id,
+ },
+ include: {
+ Author: {
+ select: {
+ username: true,
+ nomor: true,
+ Profile: {
+ select: {
+ name: true,
+ alamat: true,
+ },
+ },
+ },
+ },
+ MasterStatus: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ });
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data job-vacancy",
+ data: data,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data job-vacancy", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data job-vacancy",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/job/dashboard/[status]/route.ts b/src/app/api/admin/job/dashboard/[status]/route.ts
new file mode 100644
index 00000000..b9fda394
--- /dev/null
+++ b/src/app/api/admin/job/dashboard/[status]/route.ts
@@ -0,0 +1,40 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request, { params }: {
+ params: { status: string }
+}) {
+
+ const { status } = params;
+ try {
+ let fixData;
+ const fixStatus = _.startCase(status);
+ fixData = await prisma.job.count({
+ where: {
+ MasterStatus: {
+ name: fixStatus,
+ },
+ isArsip: false,
+ }
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Success get data job-vacancy dashboard",
+ data: fixData
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data job-vacancy dashboard", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get data job-vacancy dashboard",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/job/dashboard/arsip/route.ts b/src/app/api/admin/job/dashboard/arsip/route.ts
new file mode 100644
index 00000000..bd450b54
--- /dev/null
+++ b/src/app/api/admin/job/dashboard/arsip/route.ts
@@ -0,0 +1,35 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ const method = request.method;
+
+ try {
+ let fixData;
+ fixData = await prisma.job.count({
+ where: {
+ MasterStatus: {
+ name: "Publish"
+ },
+ isArsip: true
+ }
+ })
+ return NextResponse.json({
+ success: true,
+ message: "Success get data job-vacancy dashboard",
+ data: fixData
+ },
+ { status: 200 }
+ )
+ } catch (error) {
+ backendLogger.error("Error get data job-vacancy dashboard", error);
+ return NextResponse.json({
+ success: false,
+ message: "Error get data job-vacancy dashboard",
+ reason: (error as Error).message
+ },
+ { status: 500 }
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/job/status/[name]/route.ts b/src/app/api/admin/job/status/[name]/route.ts
new file mode 100644
index 00000000..7b91bc43
--- /dev/null
+++ b/src/app/api/admin/job/status/[name]/route.ts
@@ -0,0 +1,116 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ {
+ params,
+ }: {
+ params: { name: string };
+ }
+) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Method not allowed",
+ },
+ { status: 405 }
+ );
+ }
+ const { name } = params;
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 10
+ const skipData = Number(page) * takeData - takeData;
+
+ try {
+ let fixData;
+ const fixStatus = _.startCase(name);
+
+ if (!page) {
+ fixData = await prisma.job.findMany({
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ isActive: true,
+ isArsip: false,
+ MasterStatus: {
+ name: fixStatus,
+ },
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ include: {
+ Author: true,
+ },
+ });
+ } else {
+ const data = await prisma.job.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ isActive: true,
+ isArsip: false,
+ MasterStatus: {
+ name: fixStatus,
+ },
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ include: {
+ Author: true,
+ },
+ });
+
+ const nCount = await prisma.job.count({
+ where: {
+ isActive: true,
+ isArsip: false,
+ MasterStatus: {
+ name: fixStatus,
+ },
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Data found",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Eror get data", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Data not found",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/main_dashboard/portofolio/route.ts b/src/app/api/admin/main_dashboard/portofolio/route.ts
new file mode 100644
index 00000000..e1417cd9
--- /dev/null
+++ b/src/app/api/admin/main_dashboard/portofolio/route.ts
@@ -0,0 +1,29 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ try {
+ const data = await prisma.portofolio.count({
+ where: {
+ active: true
+ }
+ });
+ return NextResponse.json({
+ success: true,
+ message: "Data portofolio",
+ data: data
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error Get Count Portofolio Main Dashboard")
+ return NextResponse.json({
+ success: false,
+ message: "Error Get Count Portofolio Main Dashboard",
+ data: null
+ },
+ { status: 500 }
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/main_dashboard/user/route.ts b/src/app/api/admin/main_dashboard/user/route.ts
new file mode 100644
index 00000000..3f2682fa
--- /dev/null
+++ b/src/app/api/admin/main_dashboard/user/route.ts
@@ -0,0 +1,35 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ const method = request.method;
+
+ try {
+ const data = await prisma.user.count({
+ where: {
+ active: true
+ },
+
+
+ })
+ return NextResponse.json({
+ success: true,
+ message: "Data user",
+ data: data
+ },
+ { status: 200 }
+ )
+ } catch (error) {
+ backendLogger.error("Error Get Count User Main Dashboard")
+ return NextResponse.json({
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message
+ },
+ { status: 500 }
+ )
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/app/api/admin/master/bank/route.ts b/src/app/api/admin/master/bank/route.ts
new file mode 100644
index 00000000..609a6bc4
--- /dev/null
+++ b/src/app/api/admin/master/bank/route.ts
@@ -0,0 +1,32 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export { GET };
+
+async function GET(request: Request) {
+ try {
+ const data = await prisma.masterBank.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ });
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: data },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error(
+ "Error Get Master Bank >>",
+ error || (error as Error).message
+ );
+ return NextResponse.json(
+ {
+ success: false,
+ message: "API Error Get Master Bank ",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/master/bidang-bisnis/route.ts b/src/app/api/admin/master/bidang-bisnis/route.ts
new file mode 100644
index 00000000..c2802e52
--- /dev/null
+++ b/src/app/api/admin/master/bidang-bisnis/route.ts
@@ -0,0 +1,32 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export { GET };
+
+async function GET(request: Request) {
+ try {
+ const data = await prisma.masterBidangBisnis.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ });
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: data },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error(
+ "Error Get Master Bidang Bisnis >>",
+ error || (error as Error).message
+ );
+ return NextResponse.json(
+ {
+ success: false,
+ message: "API Error Get Master Bidang Bisnis ",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/notifikasi/[id]/route.ts b/src/app/api/admin/notifikasi/[id]/route.ts
new file mode 100644
index 00000000..f0595242
--- /dev/null
+++ b/src/app/api/admin/notifikasi/[id]/route.ts
@@ -0,0 +1,106 @@
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export { GET, POST };
+async function GET(request: Request, { params }: { params: { id: string } }) {
+ try {
+ let fixData;
+ const { id } = params;
+ const userLoginId = id;
+
+ if (!id) {
+ return NextResponse.json(
+ { success: false, message: "ID not provided" },
+ { status: 400 }
+ );
+ }
+
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ if (!page) {
+ fixData = await prisma.notifikasi.findMany({
+ orderBy: [
+ {
+ isRead: "asc",
+ },
+ {
+ createdAt: "desc",
+ },
+ ],
+ where: {
+ adminId: userLoginId,
+ userRoleId: "2",
+ },
+ });
+ } else {
+ fixData = await prisma.notifikasi.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: [
+ {
+ isRead: "asc",
+ },
+ {
+ createdAt: "desc",
+ },
+ ],
+ where: {
+ adminId: id,
+ userRoleId: "2",
+ },
+ });
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Data fetched successfully",
+ data: fixData,
+ });
+ } catch (error) {
+ console.error("Error fetching notifications:", error);
+ return NextResponse.json(
+ { success: false, message: "Failed to fetch notifications" },
+ { status: 500 }
+ );
+ }
+}
+
+async function POST(request: Request, { params }: { params: { id: string } }) {
+ try {
+ const { id } = params;
+ const userLoginId = id;
+
+ if (!id) {
+ return NextResponse.json(
+ { success: false, message: "ID not provided" },
+ { status: 400 }
+ );
+ }
+
+ const data = await request.json();
+
+ const updatedData = await prisma.notifikasi.updateMany({
+ where: {
+ adminId: userLoginId,
+ },
+ data: {
+ isRead: data.isRead,
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Notification updated successfully",
+ data: updatedData,
+ });
+ } catch (error) {
+ console.error("Error updating notification:", error);
+ return NextResponse.json(
+ { success: false, message: "Failed to update notification" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/notifikasi/count/route.tsx b/src/app/api/admin/notifikasi/count/route.tsx
new file mode 100644
index 00000000..1d2d8b5a
--- /dev/null
+++ b/src/app/api/admin/notifikasi/count/route.tsx
@@ -0,0 +1,46 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(request: Request) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const { searchParams } = new URL(request.url);
+ const userId = searchParams.get("id");
+
+ const data = await prisma.notifikasi.count({
+ where: {
+ adminId: userId,
+ userRoleId: "2",
+ isRead: false,
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Data fetched successfully",
+ data: data,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error("Error get count notifikasi", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed to get count notifikasi",
+ data: null,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/notifikasi/route.ts b/src/app/api/admin/notifikasi/route.ts
deleted file mode 100644
index 4847fb76..00000000
--- a/src/app/api/admin/notifikasi/route.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import adminNotifikasi_getByUserId from "@/app_modules/admin/notifikasi/fun/get/get_notifikasi_by_user_id";
-import { NextRequest, NextResponse } from "next/server";
-
-export async function GET(req: NextRequest) {
-
-
- return NextResponse.json({ success: true });
-}
diff --git a/src/app/api/admin/sticker/[id]/activation/route.ts b/src/app/api/admin/sticker/[id]/activation/route.ts
new file mode 100644
index 00000000..27146d49
--- /dev/null
+++ b/src/app/api/admin/sticker/[id]/activation/route.ts
@@ -0,0 +1,39 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export { PUT };
+
+async function PUT(request: Request, { params }: { params: { id: string } }) {
+ const method = request.method;
+ if (method !== "PUT") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const { id } = params;
+ const data = await request.json();
+
+ const sticker = await prisma.sticker.update({
+ where: {
+ id: id,
+ },
+ data: {
+ isActive: data.isActive,
+ },
+ });
+
+ return NextResponse.json(
+ { success: true, message: "Success update data sticker", data: sticker },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error("Error update data sticker", error);
+ return NextResponse.json(
+ { success: false, message: "Error update data sticker" },
+ { status: 500 }
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/admin/sticker/[id]/route.ts b/src/app/api/admin/sticker/[id]/route.ts
new file mode 100644
index 00000000..33ca6d83
--- /dev/null
+++ b/src/app/api/admin/sticker/[id]/route.ts
@@ -0,0 +1,139 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export { GET, PUT, DELETE };
+
+async function GET(request: Request, { params }: { params: { id: string } }) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const { id } = params;
+
+ const sticker = await prisma.sticker.findUnique({
+ where: {
+ id: id,
+ },
+ include: {
+ MasterEmotions: true,
+ },
+ });
+
+ return NextResponse.json(
+ { success: true, message: "Success get data sticker", data: sticker },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error("Error get data sticker", error);
+ return NextResponse.json(
+ { success: false, message: "Error get data sticker" },
+ { status: 500 }
+ );
+ }
+}
+
+async function PUT(request: Request, { params }: { params: { id: string } }) {
+ const method = request.method;
+ if (method !== "PUT") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const { id } = params;
+ const data = await request.json();
+
+ if (data.fileId) {
+ const updatedDataWithFile = await prisma.sticker.update({
+ where: {
+ id: id,
+ },
+ data: {
+ fileId: data.fileId,
+ MasterEmotions: {
+ set: data.emotions.map((value: string) => ({ value })), // ✅ replace relasi
+ },
+ jenisKelamin: data.jenisKelamin,
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Sticker updated successfully",
+ data: updatedDataWithFile,
+ });
+ }
+
+ const updatedDataWithoutFile = await prisma.sticker.update({
+ where: {
+ id: id,
+ },
+ data: {
+ MasterEmotions: {
+ set: data.emotions.map((value: string) => ({ value })), // ✅ replace relasi
+ },
+ jenisKelamin: data.jenisKelamin,
+ },
+ });
+
+ if (!updatedDataWithoutFile) {
+ return NextResponse.json(
+ { success: false, message: "Failed to update sticker" },
+ { status: 400 }
+ );
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Sticker updated successfully",
+ data: updatedDataWithoutFile,
+ });
+ } catch (error) {
+ console.error("Error updating sticker:", error);
+ return NextResponse.json(
+ { success: false, message: "Failed to update sticker" },
+ { status: 500 }
+ );
+ }
+}
+
+async function DELETE(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ const method = request.method;
+ if (method !== "DELETE") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const { id } = params;
+
+ const sticker = await prisma.sticker.delete({
+ where: {
+ id: id,
+ },
+ });
+
+ return NextResponse.json(
+ { success: true, message: "Success delete sticker", data: sticker },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error("Error delete sticker", error);
+ return NextResponse.json(
+ { success: false, message: "Error delete sticker" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/sticker/route.ts b/src/app/api/admin/sticker/route.ts
new file mode 100644
index 00000000..621ab4fa
--- /dev/null
+++ b/src/app/api/admin/sticker/route.ts
@@ -0,0 +1,113 @@
+import { prisma } from "@/lib";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export { GET, POST };
+
+interface IPostSticker {
+ fileId: string;
+ emotions: string[];
+ gender: "Laki-laki" | "Perempuan" | null;
+}
+
+async function POST(request: Request) {
+ const method = request.method;
+ if (method !== "POST") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const { fileId, emotions, gender } = await request.json();
+
+ const newStiker = await prisma.sticker.create({
+ data: {
+ fileId,
+ MasterEmotions: {
+ connect: emotions.map((value: string) => ({ value })), // id = number[]
+ },
+ jenisKelamin: gender,
+ },
+ });
+
+ if (!newStiker) {
+ return NextResponse.json(
+ { success: false, message: "Gagal membuat stiker" },
+ { status: 400 }
+ );
+ }
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil membuat stiker" },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error("Error create sticker", error);
+ return NextResponse.json(
+ { success: false, message: "Failed to create sticker" },
+ { status: 500 }
+ );
+ }
+}
+
+async function GET(request: Request) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const dataTake = 10;
+ const dataSkip = Number(page) * dataTake - dataTake;
+
+ try {
+ if (!page) {
+ fixData = await prisma.sticker.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ include: {
+ MasterEmotions: true,
+ },
+ });
+ } else {
+ const data = await prisma.sticker.findMany({
+ skip: dataSkip,
+ take: dataTake,
+
+ orderBy: {
+ createdAt: "desc",
+ },
+ include: {
+ MasterEmotions: true,
+ },
+ });
+
+ const nCount = await prisma.sticker.count({});
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / dataTake),
+ };
+ }
+
+ return NextResponse.json(
+ { success: true, message: "Success get data sticker", data: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error("Error get data sticker", error);
+ return NextResponse.json(
+ { success: false, message: "Error get data sticker" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/user/route.ts b/src/app/api/admin/user/route.ts
new file mode 100644
index 00000000..b8995dac
--- /dev/null
+++ b/src/app/api/admin/user/route.ts
@@ -0,0 +1,75 @@
+import _ from "lodash";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function GET(request: Request) {
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ if (!page) {
+ fixData = await prisma.user.findMany({
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ masterUserRoleId: "1",
+ username: {
+ contains: search || "",
+ mode: "insensitive",
+ },
+ },
+ });
+ } else {
+ const getData = await prisma.user.findMany({
+ skip: skipData,
+ take: takeData,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ masterUserRoleId: "1",
+ username: {
+ contains: search || "",
+ mode: "insensitive",
+ },
+ },
+ });
+
+ const nCount = await prisma.user.count({
+ where: {
+ masterUserRoleId: "1",
+ username: {
+ contains: search || "",
+ mode: "insensitive",
+ },
+ },
+ });
+
+ fixData = {
+ data: getData,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data",
+ data: fixData,
+ },
+ {
+ status: 200,
+ }
+ );
+ } catch (error) {
+ return NextResponse.json(
+ { success: false, message: "Internal Server Error" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/vote/[id]/kontributor/route.ts b/src/app/api/admin/vote/[id]/kontributor/route.ts
new file mode 100644
index 00000000..c36bab5e
--- /dev/null
+++ b/src/app/api/admin/vote/[id]/kontributor/route.ts
@@ -0,0 +1,67 @@
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+
+ // Validasi ID
+ if (!id) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "ID is required",
+ },
+ { status: 400 }
+ );
+ }
+
+ const data = await prisma.voting_Kontributor.findMany({
+ where: {
+ votingId: id,
+ },
+ select: {
+ Voting_DaftarNamaVote: true,
+ Author: {
+ select: {
+ username: true,
+ Profile: true,
+ },
+ },
+ },
+ });
+
+ // Penanganan data tidak ditemukan
+ if (!data) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Voting data not found",
+ },
+ { status: 404 }
+ );
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ data: data,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error fetching voting data >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error fetching voting data",
+ error: error instanceof Error ? error.message : String(error),
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/vote/[id]/route.tsx b/src/app/api/admin/vote/[id]/route.tsx
new file mode 100644
index 00000000..a2d790b7
--- /dev/null
+++ b/src/app/api/admin/vote/[id]/route.tsx
@@ -0,0 +1,63 @@
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+
+ // Validasi ID
+ if (!id) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "ID is required",
+ },
+ { status: 400 }
+ );
+ }
+
+ const fixData = await prisma.voting.findUnique({
+ where: {
+ id: id,
+ },
+ include: {
+ Author: true,
+ Voting_Status: true,
+ Voting_DaftarNamaVote: true,
+ },
+ });
+
+ // Penanganan data tidak ditemukan
+ if (!fixData) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Voting data not found",
+ },
+ { status: 404 }
+ );
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error fetching voting data >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error fetching voting data",
+ error: error instanceof Error ? error.message : String(error),
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/vote/dashboard/[name]/route.ts b/src/app/api/admin/vote/dashboard/[name]/route.ts
new file mode 100644
index 00000000..38382deb
--- /dev/null
+++ b/src/app/api/admin/vote/dashboard/[name]/route.ts
@@ -0,0 +1,62 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ {
+ params,
+ }: {
+ params: { name: string };
+ }
+) {
+ const { name } = params;
+ try {
+ let fixData;
+ const fixStatus = _.startCase(name);
+
+ if (fixStatus === "Publish") {
+ fixData = await prisma.voting.count({
+ where: {
+ Voting_Status: {
+ name: fixStatus,
+ },
+ isActive: true,
+ isArsip: false,
+ akhirVote: {
+ gte: new Date(),
+ },
+ },
+ });
+ } else {
+ fixData = await prisma.voting.count({
+ where: {
+ Voting_Status: {
+ name: fixStatus,
+ },
+ isArsip: false,
+ },
+ });
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data voting dashboard",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data voting dashboard >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data voting dashboard",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/vote/dashboard/riwayat/route.ts b/src/app/api/admin/vote/dashboard/riwayat/route.ts
new file mode 100644
index 00000000..f3943fe8
--- /dev/null
+++ b/src/app/api/admin/vote/dashboard/riwayat/route.ts
@@ -0,0 +1,40 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+
+ try {
+ let fixData;
+ fixData = await prisma.voting.count({
+ where: {
+ Voting_Status: {
+ name: "Publish",
+ },
+ isActive: true,
+ akhirVote: {
+ lte: new Date(),
+ },
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data voting dashboard",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data voting dashboard >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data voting dashboard",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/vote/status/[name]/route.ts b/src/app/api/admin/vote/status/[name]/route.ts
new file mode 100644
index 00000000..e2cd0b6b
--- /dev/null
+++ b/src/app/api/admin/vote/status/[name]/route.ts
@@ -0,0 +1,219 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import moment from "moment";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { name: string } }
+) {
+
+ try {
+ let fixData;
+ const { name } = params;
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 10
+ const skipData = Number(page) * takeData - takeData;
+
+ const fixStatus = _.startCase(name);
+
+ if (!page) {
+ fixData = await prisma.voting.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ Voting_Status: {
+ name: fixStatus,
+ },
+ isActive: true,
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ isArsip: false,
+ },
+ include: {
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ Voting_Kontributor: true,
+ Voting_DaftarNamaVote: true,
+ },
+ });
+ } else {
+ if (fixStatus === "Publish") {
+ const getAllData = await prisma.voting.findMany({
+ where: {
+ Voting_Status: {
+ name: fixStatus,
+ },
+ isActive: true,
+ isArsip: false,
+ akhirVote: {
+ gte: new Date(),
+ },
+ },
+ });
+
+ for (let i of getAllData) {
+ if (moment(i.akhirVote).diff(moment(), "minutes") < 0) {
+ await prisma.event.update({
+ where: {
+ id: i.id,
+ },
+ data: {
+ isArsip: true,
+ },
+ });
+ }
+ }
+
+ const data = await prisma.voting.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ Voting_Status: {
+ name: fixStatus,
+ },
+ isActive: true,
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ akhirVote: {
+ gte: new Date(),
+ },
+ isArsip: false,
+ },
+ include: {
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ Voting_Kontributor: true,
+ Voting_DaftarNamaVote: true,
+ },
+ });
+
+ const nCount = await prisma.voting.count({
+ where: {
+ Voting_Status: {
+ name: fixStatus,
+ },
+ isActive: true,
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ akhirVote: {
+ gte: new Date(),
+ },
+ isArsip: false,
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ } else {
+ const data = await prisma.voting.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ Voting_Status: {
+ name: fixStatus,
+ },
+ isActive: true,
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ isArsip: false,
+ },
+ include: {
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ Voting_Kontributor: true,
+ Voting_DaftarNamaVote: true,
+ },
+ });
+
+ const nCount = await prisma.voting.count({
+ where: {
+ Voting_Status: {
+ name: fixStatus,
+ },
+ isActive: true,
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ isArsip: false,
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data voting status",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data voting status ", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data voting status",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/admin/vote/status/riwayat/route.ts b/src/app/api/admin/vote/status/riwayat/route.ts
new file mode 100644
index 00000000..c2885985
--- /dev/null
+++ b/src/app/api/admin/vote/status/riwayat/route.ts
@@ -0,0 +1,123 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ if (!page) {
+ fixData = await prisma.voting.findMany({
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ voting_StatusId: "1",
+ isActive: true,
+ akhirVote: {
+ lte: new Date(),
+ },
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ include: {
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ Voting_Kontributor: true,
+ Voting_DaftarNamaVote: true,
+ },
+ });
+ } else {
+ const data = await prisma.voting.findMany({
+ skip: skipData,
+ take: takeData,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ voting_StatusId: "1",
+ isActive: true,
+ akhirVote: {
+ lte: new Date(),
+ },
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ include: {
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ Voting_Kontributor: true,
+ Voting_DaftarNamaVote: true,
+ },
+ });
+
+ const nCount = await prisma.voting.count({
+ where: {
+ voting_StatusId: "1",
+ isActive: true,
+ akhirVote: {
+ lte: new Date(),
+ },
+ title: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / takeData),
+ };
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data voting riwayat",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data voting riwayat ", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data voting riwayat",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/auth/check/[id]/route.ts b/src/app/api/auth/check/[id]/route.ts
new file mode 100644
index 00000000..44538898
--- /dev/null
+++ b/src/app/api/auth/check/[id]/route.ts
@@ -0,0 +1,30 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ if (request.method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const { id } = params;
+ const data = await prisma.kodeOtp.findFirst({
+ where: {
+ id: id as string,
+ },
+ });
+
+ return NextResponse.json(data, { status: 200 });
+ } catch (error) {
+ backendLogger.error("Error get code otp", error); //(error);
+ return NextResponse.json(null, { status: 500 });
+ }
+}
diff --git a/src/app/api/auth/check/route.ts b/src/app/api/auth/check/route.ts
deleted file mode 100644
index ff617b41..00000000
--- a/src/app/api/auth/check/route.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { prisma } from "@/app/lib";
-import { data } from "autoprefixer";
-import { NextResponse } from "next/server";
-
-export async function GET(request: Request) {
- const { searchParams } = new URL(request.url);
- const id = searchParams.get("id");
-
- try {
- const data = await prisma.kodeOtp.findFirst({
- where: {
- id: id as string,
- },
- });
- return new Response(JSON.stringify({ data }), { status: 200 });
- } catch (error) {
- console.log(error);
- }
-
- return new Response(JSON.stringify({ data: null }), { status: 404 });
-}
diff --git a/src/app/api/auth/code/[id]/route.ts b/src/app/api/auth/code/[id]/route.ts
new file mode 100644
index 00000000..f16fce90
--- /dev/null
+++ b/src/app/api/auth/code/[id]/route.ts
@@ -0,0 +1,56 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export { DELETE };
+async function DELETE(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ if (request.method !== "DELETE") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+ try {
+ // Ambil parameter id dari URL
+ const { id } = params;
+
+ if (!id) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Parameter 'id' diperlukan",
+ },
+ { status: 400 }
+ );
+ }
+
+ // Hapus data OTP
+ await prisma.kodeOtp.delete({
+ where: {
+ id: id,
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil menghapus data OTP",
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error deleting OTP:", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Terjadi kesalahan saat menghapus data OTP",
+ },
+ { status: 500 }
+ );
+ } finally {
+ await prisma.$disconnect();
+ }
+}
diff --git a/src/app/api/auth/login/route.ts b/src/app/api/auth/login/route.ts
index 3aac1607..aae133d9 100644
--- a/src/app/api/auth/login/route.ts
+++ b/src/app/api/auth/login/route.ts
@@ -1,65 +1,68 @@
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import { randomOTP } from "@/app_modules/auth/fun/rondom_otp";
+import backendLogger from "@/util/backendLogger";
import { NextResponse } from "next/server";
export async function POST(req: Request) {
- if (req.method === "POST") {
+ if (req.method !== "POST") {
+ return NextResponse.json(
+ { success: false, message: "Method Not Allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
const codeOtp = randomOTP();
const body = await req.json();
const { nomor } = body;
- try {
- const res = await fetch(
- `https://wa.wibudev.com/code?nom=${nomor}&text=HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.
+ const createOtpId = await prisma.kodeOtp.create({
+ data: {
+ nomor: nomor,
+ otp: codeOtp,
+ },
+ });
+
+ if (!createOtpId)
+ return NextResponse.json(
+ { success: false, message: "Gagal mengirim kode OTP" },
+ { status: 400 }
+ );
+
+ const res = await fetch(
+ `https://wa.wibudev.com/code?nom=${nomor}&text=HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.
\n
>> Kode OTP anda: ${codeOtp}.
`
+ );
+
+ const sendWa = await res.json();
+
+ if (sendWa.status !== "success")
+ return NextResponse.json(
+ { success: false, message: "Nomor Whatsapp Tidak Aktif" },
+ { status: 400 }
);
- const sendWa = await res.json();
- if (sendWa.status !== "success")
- return new Response(
- JSON.stringify({
- success: false,
- message: "Nomor Whatsapp Tidak Aktif",
- }),
- { status: 400 }
- );
-
- const createOtpId = await prisma.kodeOtp.create({
- data: {
- nomor: nomor,
- otp: codeOtp,
- },
- });
-
- if (!createOtpId)
- return new Response(
- JSON.stringify({
- success: false,
- message: "Gagal Membuat Kode OTP",
- }),
- { status: 400 }
- );
-
- return new Response(
- JSON.stringify({
- success: true,
- message: "Kode Verifikasi Dikirim",
- kodeId: createOtpId.id,
- }),
- { status: 200 }
- );
- } catch (error) {
- console.log(error);
- return new Response(
- JSON.stringify({
- success: false,
- message: "Server Whatsapp Error !!",
- }),
- { status: 500 }
- );
- }
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Kode verifikasi terkirim",
+ kodeId: createOtpId.id,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.log("Error Login", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Terjadi masalah saat login",
+ reason: error as Error,
+ },
+ { status: 500 }
+ );
+ } finally {
+ await prisma.$disconnect();
}
- return NextResponse.json({ success: false });
}
diff --git a/src/app/api/auth/logout/route-v.1.4.5t.xt b/src/app/api/auth/logout/route-v.1.4.5t.xt
new file mode 100644
index 00000000..82982ce6
--- /dev/null
+++ b/src/app/api/auth/logout/route-v.1.4.5t.xt
@@ -0,0 +1,38 @@
+import { cookies } from "next/headers";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET() {
+ const sessionKey = process.env.NEXT_PUBLIC_BASE_SESSION_KEY!; // Gunakan environment variable yang tidak diekspos ke client-side
+ if (!sessionKey) {
+ return NextResponse.json(
+ { success: false, message: "Session key tidak ditemukan" },
+ { status: 500 }
+ );
+ }
+
+ const cookieStore = cookies();
+ const sessionCookie = cookieStore.get(sessionKey);
+
+ if (!sessionCookie) {
+ return NextResponse.json(
+ { success: false, message: "Session tidak ditemukan" },
+ { status: 400 }
+ );
+ }
+
+ try {
+ cookieStore.delete(sessionKey);
+ return NextResponse.json(
+ { success: true, message: "Logout berhasil" },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error("Gagal menghapus cookie:", error);
+ return NextResponse.json(
+ { success: false, message: "Gagal melakukan logout" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/auth/logout/route.ts b/src/app/api/auth/logout/route.ts
index 9a5356ff..8e338459 100644
--- a/src/app/api/auth/logout/route.ts
+++ b/src/app/api/auth/logout/route.ts
@@ -1,28 +1,46 @@
-import { prisma } from "@/app/lib";
import { cookies } from "next/headers";
-export async function GET(request: Request) {
- const { searchParams } = new URL(request.url);
- const id = searchParams.get("id");
+import { NextResponse } from "next/server";
- const delToken = await prisma.userSession.delete({
- where: {
- userId: id as string,
- },
+export const dynamic = "force-dynamic";
+
+export async function GET() {
+ const sessionKey = process.env.NEXT_PUBLIC_BASE_SESSION_KEY!;
+ if (!sessionKey) {
+ return NextResponse.json(
+ { success: false, message: "Session key tidak ditemukan" },
+ { status: 500 }
+ );
+ }
+
+ const cookieStore = cookies();
+ const sessionCookie = cookieStore.get(sessionKey);
+
+ if (!sessionCookie) {
+ return NextResponse.json(
+ { success: false, message: "Session tidak ditemukan" },
+ { status: 400 }
+ );
+ }
+
+ try {
+ // Menghapus cookie dengan set maxAge 0
+ cookieStore.set({
+ name: sessionKey,
+ value: "",
+ path: "/",
+ maxAge: 0,
});
- const del = cookies().delete(process.env.NEXT_PUBLIC_BASE_SESSION_KEY!);
- return new Response(JSON.stringify({ success: true, message: "Logout Berhasil" }), {status: 200});
+ return NextResponse.json({
+ success: true,
+ message: "Logout berhasil",
+
+ });
+ } catch (error) {
+ console.error("Gagal menghapus cookie:", error);
+ return NextResponse.json(
+ { success: false, message: "Gagal melakukan logout" },
+ { status: 500 }
+ );
+ }
}
-
-// import { cookies } from "next/headers";
-// import { NextResponse } from "next/server";
-
-// export async function GET() {
-// cookies().set({
-// name: "mySession",
-// value: "",
-// maxAge: 0,
-// });
-
-// return NextResponse.json({ status: 200, message: "Logout" });
-// }
diff --git a/src/app/api/auth/register/route.ts b/src/app/api/auth/register/route.ts
index 8410af4b..59049c88 100644
--- a/src/app/api/auth/register/route.ts
+++ b/src/app/api/auth/register/route.ts
@@ -1,8 +1,17 @@
-import { sessionCreate } from "@/app/auth/_lib/session_create";
-import prisma from "@/app/lib/prisma";
+import { sessionCreate } from "@/app/(auth)/_lib/session_create";
+import prisma from "@/lib/prisma";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
export async function POST(req: Request) {
- if (req.method === "POST") {
+ if (req.method !== "POST") {
+ return NextResponse.json(
+ { success: false, message: "Method Not Allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
const { data } = await req.json();
const cekUsername = await prisma.user.findUnique({
@@ -12,58 +21,51 @@ export async function POST(req: Request) {
});
if (cekUsername)
- return new Response(
- JSON.stringify({
- success: false,
- message: "Username sudah digunakan",
- }),
- { status: 400 }
- );
+ return NextResponse.json({
+ success: false,
+ message: "Username sudah digunakan",
+ });
const createUser = await prisma.user.create({
data: {
username: data.username,
nomor: data.nomor,
+ active: false,
},
});
+ if (!createUser)
+ return NextResponse.json(
+ { success: false, message: "Gagal Registrasi" },
+ { status: 500 }
+ );
+
const token = await sessionCreate({
sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
user: createUser as any,
});
- try {
- const createUserSession = await prisma.userSession.create({
- data: {
- token: token as string,
- userId: createUser.id,
- },
- });
-
- if (!createUserSession)
- return new Response(
- JSON.stringify({
- success: false,
- message: "Gagal Membuat Session",
- }),
- { status: 400 }
- );
- } catch (error) {
- console.log(error);
- }
-
- return new Response(
- JSON.stringify({
+ return NextResponse.json(
+ {
success: true,
- message: "Berhasil Login",
- }),
-
- { status: 200 }
+ message: "Registrasi Berhasil, Anda Sedang Login",
+ token: token,
+ // data: createUser,
+ },
+ { status: 201 }
);
+ } catch (error) {
+ backendLogger.error("Error registrasi:", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Maaf, Terjadi Keselahan",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ } finally {
+ await prisma.$disconnect();
}
- return new Response(
- JSON.stringify({ success: false, message: "Method Not Allowed" }),
- { status: 405 }
- );
}
diff --git a/src/app/api/auth/resend/route.ts b/src/app/api/auth/resend/route.ts
index 3aac1607..c32f7e99 100644
--- a/src/app/api/auth/resend/route.ts
+++ b/src/app/api/auth/resend/route.ts
@@ -1,65 +1,72 @@
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import { randomOTP } from "@/app_modules/auth/fun/rondom_otp";
+import backendLogger from "@/util/backendLogger";
import { NextResponse } from "next/server";
export async function POST(req: Request) {
- if (req.method === "POST") {
+ if (req.method !== "POST") {
+ return NextResponse.json(
+ { success: false, message: "Method Not Allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
const codeOtp = randomOTP();
const body = await req.json();
const { nomor } = body;
- try {
- const res = await fetch(
- `https://wa.wibudev.com/code?nom=${nomor}&text=HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.
+ const res = await fetch(
+ `https://wa.wibudev.com/code?nom=${nomor}&text=HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.
\n
>> Kode OTP anda: ${codeOtp}.
`
- );
+ );
- const sendWa = await res.json();
- if (sendWa.status !== "success")
- return new Response(
- JSON.stringify({
- success: false,
- message: "Nomor Whatsapp Tidak Aktif",
- }),
- { status: 400 }
- );
-
- const createOtpId = await prisma.kodeOtp.create({
- data: {
- nomor: nomor,
- otp: codeOtp,
- },
- });
-
- if (!createOtpId)
- return new Response(
- JSON.stringify({
- success: false,
- message: "Gagal Membuat Kode OTP",
- }),
- { status: 400 }
- );
-
- return new Response(
- JSON.stringify({
- success: true,
- message: "Kode Verifikasi Dikirim",
- kodeId: createOtpId.id,
- }),
- { status: 200 }
- );
- } catch (error) {
- console.log(error);
- return new Response(
- JSON.stringify({
+ const sendWa = await res.json();
+ if (sendWa.status !== "success")
+ return NextResponse.json(
+ {
success: false,
- message: "Server Whatsapp Error !!",
- }),
- { status: 500 }
+ message: "Nomor Whatsapp Tidak Aktif",
+ },
+ { status: 400 }
);
- }
+
+ const createOtpId = await prisma.kodeOtp.create({
+ data: {
+ nomor: nomor,
+ otp: codeOtp,
+ },
+ });
+
+ if (!createOtpId)
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal Membuat Kode OTP",
+ },
+ { status: 400 }
+ );
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Kode Verifikasi Dikirim",
+ kodeId: createOtpId.id,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error(" Error Resend OTP", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Server Whatsapp Error !!",
+ },
+ { status: 500 }
+ );
+ } finally {
+ await prisma.$disconnect();
}
- return NextResponse.json({ success: false });
}
diff --git a/src/app/api/auth/validasi/route.ts b/src/app/api/auth/validasi/route.ts
index f865cc07..3959ad1c 100644
--- a/src/app/api/auth/validasi/route.ts
+++ b/src/app/api/auth/validasi/route.ts
@@ -1,13 +1,17 @@
-import { sessionCreate } from "@/app/auth/_lib/session_create";
-import prisma from "@/app/lib/prisma";
-import { ServerEnv } from "@/app/lib/server_env";
-import { sealData } from "iron-session";
-import { revalidatePath } from "next/cache";
-import { cookies } from "next/headers";
+import { sessionCreate } from "@/app/(auth)/_lib/session_create";
+import prisma from "@/lib/prisma";
+import backendLogger from "@/util/backendLogger";
import { NextResponse } from "next/server";
export async function POST(req: Request) {
- if (req.method === "POST") {
+ if (req.method !== "POST") {
+ return NextResponse.json(
+ { success: false, message: "Method Not Allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
const { nomor } = await req.json();
const dataUser = await prisma.user.findUnique({
@@ -23,11 +27,10 @@ export async function POST(req: Request) {
},
});
-
- if (dataUser === null)
- return new Response(
- JSON.stringify({ success: false, message: "Nomor Belum Terdaftar" }),
- { status: 404 }
+ if (dataUser == null)
+ return NextResponse.json(
+ { success: false, message: "Nomor Belum Terdaftar" },
+ { status: 200 }
);
const token = await sessionCreate({
@@ -36,72 +39,44 @@ export async function POST(req: Request) {
user: dataUser as any,
});
- const cekSessionUser = await prisma.userSession.findFirst({
- where: {
- userId: dataUser.id,
- },
- });
-
- if (cekSessionUser !== null) {
- await prisma.userSession.delete({
- where: {
- userId: dataUser.id,
- },
- });
+ if (!token) {
+ return NextResponse.json(
+ { success: false, message: "Gagal membuat session" },
+ { status: 500 }
+ );
}
-
- try {
- const createUserSession = await prisma.userSession.create({
- data: {
- token: token as string,
- userId: dataUser.id,
- },
- });
-
- if (!createUserSession)
- return new Response(
- JSON.stringify({ success: false, message: "Gagal Membuat Session" }),
- { status: 400 }
- );
- } catch (error) {
- console.log(error);
- }
-
- // if (data) {
- // const res = await sealData(
- // JSON.stringify({
- // id: data.id,
- // username: data.username,
- // }),
- // {
- // password: ServerEnv.value?.WIBU_PWD as string,
- // }
- // );
-
- // cookies().set({
- // name: "mySession",
- // value: res,
- // maxAge: 60 * 60 * 24 * 7,
- // });
-
- // revalidatePath("/dev/home");
-
- // return NextResponse.json({ status: 200, data });
- // }
-
- // return NextResponse.json({ success: true });
- return new Response(
- JSON.stringify({
+ // Buat response dengan token dalam cookie
+ const response = NextResponse.json(
+ {
success: true,
message: "Berhasil Login",
roleId: dataUser.masterUserRoleId,
active: dataUser.active,
- }),
+ token: token,
+ },
{ status: 200 }
);
+
+ // Set cookie dengan token yang sudah dipastikan tidak null
+ response.cookies.set(process.env.NEXT_PUBLIC_BASE_SESSION_KEY!, token, {
+ path: "/",
+ sameSite: "lax",
+ secure: process.env.NODE_ENV === "production",
+ maxAge: 30 * 24 * 60 * 60, // 30 hari dalam detik (1 bulan)
+ });
+
+ return response;
+ } catch (error) {
+ backendLogger.log("API Error or Server Error", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Maaf, Terjadi Keselahan",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ } finally {
+ await prisma.$disconnect();
}
- return new Response(
- JSON.stringify({ success: false, message: "Method Not Allowed" }),
- { status: 405 }
- );
}
diff --git a/src/app/api/check-cookies/route.ts b/src/app/api/check-cookies/route.ts
index b02fce67..ebc446be 100644
--- a/src/app/api/check-cookies/route.ts
+++ b/src/app/api/check-cookies/route.ts
@@ -8,7 +8,7 @@ export async function GET(req: Request) {
if (!c || !c?.value || _.isEmpty(c?.value) || _.isUndefined(c?.value)) {
return NextResponse.json({ success: false });
- // return new Response(JSON.stringify({ success: false }));
+
}
return NextResponse.json({ success: true });
}
diff --git a/src/app/api/collaboration/[id]/chat/route.ts b/src/app/api/collaboration/[id]/chat/route.ts
new file mode 100644
index 00000000..70614144
--- /dev/null
+++ b/src/app/api/collaboration/[id]/chat/route.ts
@@ -0,0 +1,72 @@
+// /app/api/collaboration/[id]/chat/route.ts
+
+import _ from "lodash";
+import { NextRequest, NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+import backendLogger from "@/util/backendLogger";
+
+export const dynamic = "force-dynamic";
+
+export { GET };
+
+async function GET(
+ request: NextRequest,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const roomId = params.id;
+ const { searchParams } = new URL(request.url);
+ const cursor = searchParams.get("cursor"); // ini adalah `id` pesan terakhir dari client
+ const takeData =5
+
+ console.log("cursor", cursor);
+
+ // Query dengan cursor
+ const messages = await prisma.projectCollaboration_Message.findMany({
+ where: {
+ projectCollaboration_RoomChatId: roomId,
+ isActive: true,
+ id: cursor ? { lt: cursor } : undefined, // ambil yang lebih lama dari cursor
+ },
+ orderBy: {
+ createdAt: "desc", // urutkan dari paling baru
+ },
+ take: takeData,
+ select: {
+ id: true,
+ createdAt: true,
+ isActive: true,
+ message: true,
+ isFile: true,
+ User: {
+ select: {
+ id: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: messages,
+ nextCursor: messages.length > 0 ? messages[messages.length - 1]?.id : null,
+ });
+ } catch (error) {
+ console.error("Error get message by room id", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/collaboration/[id]/message/route.ts b/src/app/api/collaboration/[id]/message/route.ts
new file mode 100644
index 00000000..c661c468
--- /dev/null
+++ b/src/app/api/collaboration/[id]/message/route.ts
@@ -0,0 +1,71 @@
+import _ from "lodash";
+import { NextRequest, NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+import backendLogger from "@/util/backendLogger";
+
+export const dynamic = "force-dynamic";
+
+export { GET };
+
+async function GET(
+ request: NextRequest,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const roomId = params.id;
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const dataSkip = Number(page) * takeData - takeData;
+
+ const getList = await prisma.projectCollaboration_Message.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ skip: dataSkip,
+ take: takeData,
+ where: {
+ projectCollaboration_RoomChatId: roomId,
+ },
+ select: {
+ id: true,
+ createdAt: true,
+ isActive: true,
+ message: true,
+ isFile: true,
+ User: {
+ select: {
+ id: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ },
+ });
+
+ const dataReverse = _.reverse(getList);
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: dataReverse,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error("Error get message by room id", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/collaboration/[id]/room/route.ts b/src/app/api/collaboration/[id]/room/route.ts
new file mode 100644
index 00000000..e2f69cfd
--- /dev/null
+++ b/src/app/api/collaboration/[id]/room/route.ts
@@ -0,0 +1,68 @@
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const roomId = params.id;
+ const getData = await prisma.projectCollaboration_RoomChat.findUnique({
+ where: {
+ id: roomId,
+ },
+ select: {
+ id: true,
+ name: true,
+ ProjectCollaboration: {
+ select: {
+ id: true,
+ isActive: true,
+ title: true,
+ lokasi: true,
+ purpose: true,
+ benefit: true,
+ createdAt: true,
+ ProjectCollaborationMaster_Industri: true,
+ Author: true,
+ },
+ },
+ ProjectCollaboration_AnggotaRoomChat: {
+ select: {
+ User: {
+ select: {
+ username: true,
+ id: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: getData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error("Error get room by id", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/collaboration/[id]/route.ts b/src/app/api/collaboration/[id]/route.ts
new file mode 100644
index 00000000..f65ffa8c
--- /dev/null
+++ b/src/app/api/collaboration/[id]/route.ts
@@ -0,0 +1,113 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ try {
+ let fixData;
+ const { id } = context.params;
+ const { searchParams } = new URL(request.url);
+ const kategori = searchParams.get("kategori");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const dataSkip = Number(page) * takeData - takeData;
+
+ // Buatkan api untuk list partisipasi
+
+ const userLoginId = await funGetUserIdByToken();
+
+ if (userLoginId == null) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data, user id tidak ada",
+ },
+ { status: 500 }
+ );
+ }
+
+ if (kategori == "detail") {
+ fixData = await prisma.projectCollaboration.findFirst({
+ where: {
+ id: id,
+ },
+ select: {
+ id: true,
+ isActive: true,
+ title: true,
+ lokasi: true,
+ purpose: true,
+ benefit: true,
+ createdAt: true,
+ // jumlah_partisipan: true,
+ Author: {
+ select: {
+ id: true,
+ Profile: true,
+ },
+ },
+ ProjectCollaborationMaster_Industri: true,
+ ProjectCollaboration_Partisipasi: {
+ where: {
+ isActive: true,
+ },
+ },
+ },
+ });
+ } else if (kategori == "list_partisipan") {
+ fixData = await prisma.projectCollaboration_Partisipasi.findMany({
+ take: takeData,
+ skip: dataSkip,
+ where: {
+ projectCollaborationId: id,
+ isActive: true,
+ },
+ select: {
+ id: true,
+ User: {
+ select: {
+ id: true,
+ Profile: true,
+ },
+ },
+ deskripsi_diri: true,
+ },
+ });
+ } else if (kategori == "cek_partisipasi") {
+ const cek = await prisma.projectCollaboration_Partisipasi.findFirst({
+ where: {
+ projectCollaborationId: id,
+ userId: userLoginId,
+ },
+ });
+
+ if (cek === null) {
+ fixData = false;
+ } else {
+ fixData = true;
+ }
+ }
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get collaboration by id", error);
+
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/collaboration/get/route.ts b/src/app/api/collaboration/get/route.ts
new file mode 100644
index 00000000..fed7621d
--- /dev/null
+++ b/src/app/api/collaboration/get/route.ts
@@ -0,0 +1,176 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(request: Request) {
+ try {
+ let fixData;
+
+ const { searchParams } = new URL(request.url);
+ const kategori = searchParams.get("kategori");
+ const page = searchParams.get("page");
+
+ const takeData = 5;
+ const skipData = page ? Number(page) * takeData - takeData : 0;
+
+ const userLoginId = await funGetUserIdByToken();
+
+ if (userLoginId == null) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data, user id tidak ada",
+ },
+ { status: 500 }
+ );
+ }
+
+ if (kategori == "beranda") {
+ fixData = await prisma.projectCollaboration.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ projectCollaborationMaster_StatusId: 1,
+ isActive: true,
+ },
+ select: {
+ id: true,
+ isActive: true,
+ title: true,
+ lokasi: true,
+ purpose: true,
+ benefit: true,
+ Author: {
+ select: {
+ id: true,
+ Profile: true,
+ },
+ },
+ ProjectCollaborationMaster_Industri: true,
+ ProjectCollaboration_Partisipasi: {
+ where: {
+ isActive: true,
+ },
+ },
+ },
+ });
+ } else if (kategori == "partisipasi") {
+ fixData = await prisma.projectCollaboration_Partisipasi.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ userId: userLoginId,
+ isActive: true,
+ AND: {
+ ProjectCollaboration: {
+ isActive: true,
+ },
+ },
+ },
+ select: {
+ id: true,
+ isActive: true,
+ ProjectCollaboration: {
+ select: {
+ id: true,
+ isActive: true,
+ title: true,
+ lokasi: true,
+ purpose: true,
+ benefit: true,
+ Author: {
+ select: {
+ id: true,
+ Profile: true,
+ },
+ },
+ ProjectCollaborationMaster_Industri: true,
+ ProjectCollaboration_Partisipasi: {
+ where: {
+ isActive: true,
+ },
+ },
+ },
+ },
+ },
+ });
+ } else if (kategori == "proyeksaya") {
+ fixData = await prisma.projectCollaboration.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: { createdAt: "desc" },
+ where: { userId: userLoginId, isActive: true },
+ select: {
+ id: true,
+ isActive: true,
+ title: true,
+ lokasi: true,
+ purpose: true,
+ benefit: true,
+ // jumlah_partisipan: true,
+ Author: {
+ select: {
+ id: true,
+ Profile: true,
+ },
+ },
+ ProjectCollaborationMaster_Industri: true,
+ ProjectCollaboration_Partisipasi: {
+ where: {
+ isActive: true,
+ },
+ },
+ },
+ });
+ } else if (kategori == "grup") {
+ fixData = await prisma.projectCollaboration_AnggotaRoomChat.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ userId: userLoginId as string,
+ },
+ select: {
+ ProjectCollaboration_RoomChat: {
+ select: {
+ id: true,
+ name: true,
+ isActive: true,
+ ProjectCollaboration_AnggotaRoomChat: {
+ select: {
+ User: true,
+ },
+ },
+ },
+ },
+ },
+ });
+ }
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get collaboration: ", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/collaboration/group/[id]/route.ts b/src/app/api/collaboration/group/[id]/route.ts
new file mode 100644
index 00000000..a477a713
--- /dev/null
+++ b/src/app/api/collaboration/group/[id]/route.ts
@@ -0,0 +1,82 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ try {
+ let fixData;
+ const { id } = context.params;
+ const { searchParams } = new URL(request.url);
+ const kategori = searchParams.get("kategori");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ // data room { id, grup_name}
+ if (kategori == "detail") {
+ fixData = await prisma.projectCollaboration_RoomChat.findFirst({
+ where: {
+ id: id,
+ },
+ select: {
+ id: true,
+ name: true,
+ },
+ });
+ } else if (kategori == "info_group") {
+ fixData = await prisma.projectCollaboration_RoomChat.findFirst({
+ where: {
+ id: id,
+ },
+ select: {
+ id: true,
+ name: true,
+ ProjectCollaboration: {
+ select: {
+ id: true,
+ isActive: true,
+ title: true,
+ lokasi: true,
+ purpose: true,
+ benefit: true,
+ createdAt: true,
+ ProjectCollaborationMaster_Industri: true,
+ },
+ },
+ ProjectCollaboration_AnggotaRoomChat: {
+ select: {
+ User: {
+ select: {
+ id: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ imageId: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ });
+ }
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Gagal mendapatkan data", error);
+ return NextResponse.json(
+ { success: false, message: "Gagal mendapatkan data" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/collaboration/master/route.ts b/src/app/api/collaboration/master/route.ts
new file mode 100644
index 00000000..ddc78eb7
--- /dev/null
+++ b/src/app/api/collaboration/master/route.ts
@@ -0,0 +1,20 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+export async function GET(request: Request) {
+ try {
+ const data = await prisma.projectCollaborationMaster_Industri.findMany({});
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: data },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Master Collaboration:=========>", error);
+ return NextResponse.json(
+ { success: false, message: "Gagal mendapatkan data" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/donasi/[id]/cerita-penggalang/route.ts b/src/app/api/donasi/[id]/cerita-penggalang/route.ts
new file mode 100644
index 00000000..a2f2468f
--- /dev/null
+++ b/src/app/api/donasi/[id]/cerita-penggalang/route.ts
@@ -0,0 +1,34 @@
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export { GET };
+
+async function GET(req: Request, { params }: { params: { id: string } }) {
+ try {
+ const donasiId = params.id;
+ const data = await prisma.donasi_Cerita.findFirst({
+ where: {
+ donasiId: donasiId,
+ },
+ select: {
+ id: true,
+ pembukaan: true,
+ cerita: true,
+ imageCeritaDonasi: true,
+ createdAt: true,
+ imageId: true,
+ },
+ });
+ return NextResponse.json({
+ success: true,
+ message: "Data berhasil diambil",
+ data: data,
+ });
+ } catch (error) {
+ return NextResponse.json({
+ success: false,
+ message: "Terjadi kesalahan saat mengambil data",
+ reason: error as Error,
+ });
+ }
+}
diff --git a/src/app/api/donasi/[id]/donatur/route.ts b/src/app/api/donasi/[id]/donatur/route.ts
new file mode 100644
index 00000000..7ad885b4
--- /dev/null
+++ b/src/app/api/donasi/[id]/donatur/route.ts
@@ -0,0 +1,106 @@
+import prisma from "@/lib/prisma";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ let fixData;
+ const { id } = params;
+ const { searchParams } = new URL(request.url);
+ const page = Number(searchParams.get("page"));
+ const takeData = 10;
+ const skipData = page * takeData - takeData;
+
+ if (!page) {
+ fixData = await prisma.donasi_Invoice.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ donasiId: id,
+ donasiMaster_StatusInvoiceId: "1",
+ },
+ select: {
+ id: true,
+ createdAt: true,
+ updatedAt: true,
+ nominal: true,
+ DonasiMaster_StatusInvoice: true,
+ donasiMaster_StatusInvoiceId: true,
+ Author: true,
+ Donasi: {
+ select: {
+ id: true,
+ title: true,
+ target: true,
+ progres: true,
+ authorId: true,
+ imagesId: true,
+ publishTime: true,
+ donasiMaster_KategoriId: true,
+ donasiMaster_DurasiId: true,
+ donasiMaster_StatusDonasiId: true,
+ imageDonasi: true,
+ DonasiMaster_Ketegori: true,
+ DonasiMaster_Durasi: true,
+ DonasiMaster_Status: true,
+ },
+ },
+ },
+ });
+ } else {
+ fixData = await prisma.donasi_Invoice.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ donasiId: id,
+ donasiMaster_StatusInvoiceId: "1",
+ },
+ select: {
+ id: true,
+ createdAt: true,
+ updatedAt: true,
+ nominal: true,
+ DonasiMaster_StatusInvoice: true,
+ donasiMaster_StatusInvoiceId: true,
+ Author: true,
+ Donasi: {
+ select: {
+ id: true,
+ title: true,
+ target: true,
+ progres: true,
+ authorId: true,
+ imagesId: true,
+ publishTime: true,
+ donasiMaster_KategoriId: true,
+ donasiMaster_DurasiId: true,
+ donasiMaster_StatusDonasiId: true,
+ imageDonasi: true,
+ DonasiMaster_Ketegori: true,
+ DonasiMaster_Durasi: true,
+ DonasiMaster_Status: true,
+ },
+ },
+ },
+ });
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Data berhasil diambil",
+ data: fixData,
+ });
+ } catch (error) {
+ return NextResponse.json({
+ success: false,
+ message: "Terjadi kesalahan saat mengambil data",
+ reason: error as Error,
+ });
+ }
+}
diff --git a/src/app/api/donasi/[id]/invoice/count/route.ts b/src/app/api/donasi/[id]/invoice/count/route.ts
new file mode 100644
index 00000000..a4496f2e
--- /dev/null
+++ b/src/app/api/donasi/[id]/invoice/count/route.ts
@@ -0,0 +1,31 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+ const data = await prisma.donasi_Invoice.count({
+ where: {
+ donasiId: id,
+ donasiMaster_StatusInvoiceId: {
+ equals: "1",
+ },
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Data berhasil diambil",
+ data: data,
+ });
+ } catch (error) {
+ return NextResponse.json({
+ success: false,
+ message: "Terjadi kesalahan saat mengambil data",
+ reason: (error as Error).message || error,
+ });
+ }
+}
diff --git a/src/app/api/donasi/[id]/invoice/route.ts b/src/app/api/donasi/[id]/invoice/route.ts
new file mode 100644
index 00000000..29293a2a
--- /dev/null
+++ b/src/app/api/donasi/[id]/invoice/route.ts
@@ -0,0 +1,72 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+ const data = await prisma.donasi_Invoice.findFirst({
+ where: {
+ id: id,
+ },
+ select: {
+ id: true,
+ authorId: true,
+ nominal: true,
+ donasiId: true,
+ createdAt: true,
+ donasiMaster_BankId: true,
+ donasiMaster_StatusInvoiceId: true,
+ Donasi: {
+ select: {
+ id: true,
+ title: true,
+ target: true,
+ active: true,
+ createdAt: true,
+ updatedAt: true,
+ publishTime: true,
+ catatan: true,
+ progres: true,
+ terkumpul: true,
+ authorId: true,
+ imagesId: true,
+ donasiMaster_KategoriId: true,
+ donasiMaster_DurasiId: true,
+ donasiMaster_StatusDonasiId: true,
+ Author: true,
+ imageDonasi: true,
+ CeritaDonasi: true,
+ DonasiMaster_Ketegori: true,
+ DonasiMaster_Durasi: true,
+ DonasiMaster_Status: true,
+ imageId: true,
+ },
+ },
+ DonasiMaster_Bank: true,
+ DonasiMaster_StatusInvoice: true,
+ },
+ });
+
+ if (!data) {
+ return NextResponse.json({
+ success: false,
+ message: "Data tidak ditemukan",
+ });
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Data berhasil diambil",
+ data: data,
+ });
+ } catch (error) {
+ return NextResponse.json({
+ success: false,
+ message: "Terjadi kesalahan saat mengambil data",
+ reason: (error as Error).message || error,
+ });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/donasi/[id]/pencairan-dana/route.ts b/src/app/api/donasi/[id]/pencairan-dana/route.ts
new file mode 100644
index 00000000..4456b51f
--- /dev/null
+++ b/src/app/api/donasi/[id]/pencairan-dana/route.ts
@@ -0,0 +1,52 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ let fixData;
+ const { id } = params;
+ const { searchParams } = new URL(request.url);
+ const page = Number(searchParams.get("page"));
+ const takeData = 5
+ const skipData = page * takeData - takeData;
+
+ if (!page) {
+ fixData = await prisma.donasi_PencairanDana.findMany({
+ orderBy: {
+ createdAt: "asc",
+ },
+ where: {
+ donasiId: id,
+ },
+ });
+ } else {
+ fixData = await prisma.donasi_PencairanDana.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "asc",
+ },
+ where: {
+ donasiId: id,
+ },
+ });
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Data berhasil diambil",
+ data: fixData,
+ });
+ } catch (error) {
+ return NextResponse.json({
+ success: false,
+ message: "Terjadi kesalahan saat mengambil data",
+ reason: error as Error,
+ });
+ }
+}
diff --git a/src/app/api/donasi/[id]/penggalang-dana/route.ts b/src/app/api/donasi/[id]/penggalang-dana/route.ts
new file mode 100644
index 00000000..1c4c6d23
--- /dev/null
+++ b/src/app/api/donasi/[id]/penggalang-dana/route.ts
@@ -0,0 +1,73 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+ const data = await prisma.user.findFirst({
+ where: {
+ id: id,
+ },
+ select: {
+ id: true,
+ username: true,
+ nomor: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ email: true,
+ imageId: true,
+ },
+ },
+ Donasi: {
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ donasiMaster_StatusDonasiId: "1",
+ },
+ select: {
+ id: true,
+ title: true,
+ target: true,
+ active: true,
+ createdAt: true,
+ updatedAt: true,
+ publishTime: true,
+ catatan: true,
+ authorId: true,
+ progres: true,
+ terkumpul: true,
+ imagesId: true,
+ donasiMaster_KategoriId: true,
+ donasiMaster_DurasiId: true,
+ donasiMaster_StatusDonasiId: true,
+ Author: true,
+ imageDonasi: true,
+ CeritaDonasi: true,
+ DonasiMaster_Ketegori: true,
+ DonasiMaster_Durasi: true,
+ DonasiMaster_Status: true,
+ imageId: true,
+ },
+ },
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Data berhasil diambil",
+ data: data,
+ });
+ } catch (error) {
+ return NextResponse.json({
+ success: false,
+ message: "Terjadi kesalahan saat mengambil data",
+ reason: error as Error,
+ });
+ }
+}
diff --git a/src/app/api/donasi/[id]/route.ts b/src/app/api/donasi/[id]/route.ts
new file mode 100644
index 00000000..3d5f7f47
--- /dev/null
+++ b/src/app/api/donasi/[id]/route.ts
@@ -0,0 +1,88 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+// GET ONE DATA DONASI
+export async function GET(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ try {
+ let dataFix;
+ const { id } = context.params;
+ const { searchParams } = new URL(request.url);
+ const kategori = searchParams.get("cat");
+
+ if (kategori == "semua") {
+ dataFix = await prisma.donasi.findFirst({
+ where: {
+ id: id,
+ },
+ include: {
+ Author: true,
+ imageDonasi: true,
+ CeritaDonasi: true,
+ DonasiMaster_Ketegori: true,
+ DonasiMaster_Durasi: true,
+ DonasiMaster_Status: true,
+ Donasi_Invoice: true,
+ Donasi_Kabar: true,
+ Donasi_PencairanDana: true,
+ },
+ });
+ } else if (kategori == "count") {
+ dataFix = await prisma.donasi_Invoice.count({
+ where: {
+ donasiId: id,
+ donasiMaster_StatusInvoiceId: {
+ equals: "1",
+ },
+ },
+ });
+ } else {
+ let tampil;
+ if (kategori == "author") {
+ tampil = {
+ authorId: true,
+ Author: {
+ select: {
+ username: true,
+ },
+ },
+ };
+ } else if (kategori == "cerita") {
+ tampil = {
+ id: true,
+ createdAt: true,
+ CeritaDonasi: {
+ select: {
+ cerita: true,
+ },
+ },
+ };
+ }
+
+ dataFix = await prisma.donasi.findFirst({
+ where: {
+ id: id,
+ },
+ select: tampil,
+ });
+ }
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: dataFix },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error(error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data, coba lagi nanti ",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/donasi/[id]/temporary-create/route.ts b/src/app/api/donasi/[id]/temporary-create/route.ts
new file mode 100644
index 00000000..0c286ad6
--- /dev/null
+++ b/src/app/api/donasi/[id]/temporary-create/route.ts
@@ -0,0 +1,28 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+ const data = await prisma.donasi_TemporaryCreate.findFirst({
+ where: {
+ id: id,
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Data berhasil diambil",
+ data: data,
+ });
+ } catch (error) {
+ return NextResponse.json({
+ success: false,
+ message: "Terjadi kesalahan saat mengambil data",
+ reason: error as Error,
+ });
+ }
+}
diff --git a/src/app/api/donasi/gambar/[id]/route.ts b/src/app/api/donasi/gambar/[id]/route.ts
index 1bf25d16..e881370b 100644
--- a/src/app/api/donasi/gambar/[id]/route.ts
+++ b/src/app/api/donasi/gambar/[id]/route.ts
@@ -1,4 +1,4 @@
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import fs from "fs";
import { NextRequest, NextResponse } from "next/server";
diff --git a/src/app/api/donasi/gambar_bukti_transfer/[id]/route.ts b/src/app/api/donasi/gambar_bukti_transfer/[id]/route.ts
index c560690a..3564caac 100644
--- a/src/app/api/donasi/gambar_bukti_transfer/[id]/route.ts
+++ b/src/app/api/donasi/gambar_bukti_transfer/[id]/route.ts
@@ -1,4 +1,4 @@
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import fs from "fs";
import { NextRequest, NextResponse } from "next/server";
diff --git a/src/app/api/donasi/gambar_cerita/[id]/route.ts b/src/app/api/donasi/gambar_cerita/[id]/route.ts
index 26728087..8e46967a 100644
--- a/src/app/api/donasi/gambar_cerita/[id]/route.ts
+++ b/src/app/api/donasi/gambar_cerita/[id]/route.ts
@@ -1,4 +1,4 @@
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import fs from "fs";
import { NextRequest, NextResponse } from "next/server";
diff --git a/src/app/api/donasi/gambar_kabar/[id]/route.ts b/src/app/api/donasi/gambar_kabar/[id]/route.ts
index 97c277df..07a3492b 100644
--- a/src/app/api/donasi/gambar_kabar/[id]/route.ts
+++ b/src/app/api/donasi/gambar_kabar/[id]/route.ts
@@ -1,4 +1,4 @@
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import fs from "fs";
import { NextRequest, NextResponse } from "next/server";
diff --git a/src/app/api/donasi/gambar_pencairan/[id]/route.ts b/src/app/api/donasi/gambar_pencairan/[id]/route.ts
index 69ff5739..0d1660e6 100644
--- a/src/app/api/donasi/gambar_pencairan/[id]/route.ts
+++ b/src/app/api/donasi/gambar_pencairan/[id]/route.ts
@@ -1,4 +1,4 @@
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import fs from "fs";
import { NextRequest, NextResponse } from "next/server";
diff --git a/src/app/api/donasi/kabar/[id]/list/route.ts b/src/app/api/donasi/kabar/[id]/list/route.ts
new file mode 100644
index 00000000..6bd2cd6e
--- /dev/null
+++ b/src/app/api/donasi/kabar/[id]/list/route.ts
@@ -0,0 +1,58 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ let fixData;
+ const { id } = params;
+ const { searchParams } = new URL(request.url);
+ const page = Number(searchParams.get("page"));
+ const takeData = 10;
+ const skipData = page * takeData - takeData;
+
+ if (!page) {
+ fixData = await prisma.donasi_Kabar.findMany({
+ where: {
+ donasiId: id,
+ active: true,
+ },
+ select: {
+ id: true,
+ title: true,
+ deskripsi: true,
+ createdAt: true,
+ },
+ });
+ } else {
+ fixData = await prisma.donasi_Kabar.findMany({
+ take: takeData,
+ skip: skipData,
+ where: {
+ donasiId: id,
+ active: true,
+ },
+ select: {
+ id: true,
+ title: true,
+ deskripsi: true,
+ createdAt: true,
+ },
+ });
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Data berhasil diambil",
+ data: fixData,
+ });
+ } catch (error) {
+ return NextResponse.json({
+ success: false,
+ message: "Terjadi kesalahan saat mengambil data",
+ reason: error as Error,
+ });
+ }
+}
diff --git a/src/app/api/donasi/kabar/[id]/route.ts b/src/app/api/donasi/kabar/[id]/route.ts
new file mode 100644
index 00000000..c6999e57
--- /dev/null
+++ b/src/app/api/donasi/kabar/[id]/route.ts
@@ -0,0 +1,28 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+ const data = await prisma.donasi_Kabar.findFirst({
+ where: {
+ id: id,
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Data berhasil diambil",
+ data: data,
+ });
+ } catch (error) {
+ return NextResponse.json({
+ success: false,
+ message: "Terjadi kesalahan saat mengambil data",
+ reason: error as Error,
+ });
+ }
+}
diff --git a/src/app/api/event/[id]/konfirmasi/route.ts b/src/app/api/event/[id]/konfirmasi/route.ts
new file mode 100644
index 00000000..d821a9da
--- /dev/null
+++ b/src/app/api/event/[id]/konfirmasi/route.ts
@@ -0,0 +1,98 @@
+import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const userId = searchParams.get("userId");
+
+ const checkDataEvent = await prisma.event.findUnique({
+ where: {
+ id: id,
+ },
+ select: {
+ id: true,
+ title: true,
+ tanggal: true,
+ tanggalSelesai: true,
+ lokasi: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ },
+ });
+
+ if (!checkDataEvent) {
+ return NextResponse.json(
+ { message: "Event Not Found", response: null },
+ { status: 400 }
+ );
+ }
+
+ let peserta;
+ const checkPeserta = await prisma.event_Peserta.findFirst({
+ where: {
+ userId: userId,
+ eventId: id,
+ },
+ });
+
+ if (checkPeserta) {
+ peserta = true;
+ } else {
+ peserta = false;
+ }
+
+ let kehadiran;
+ const checkKehadiran = await prisma.event_Peserta.findFirst({
+ where: {
+ userId: userId,
+ eventId: id,
+ },
+ select: {
+ isPresent: true,
+ },
+ });
+
+ if (checkKehadiran?.isPresent) {
+ kehadiran = true;
+ } else {
+ kehadiran = false;
+ }
+
+ fixData = {
+ dataEvent: checkDataEvent,
+ peserta: peserta,
+ kehadiran: kehadiran,
+ };
+
+ return NextResponse.json(
+ { message: "Event Found", res: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ return NextResponse.json(
+ {
+ message: "Error get data event",
+ response: null,
+ error: (error as Error).message || error,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/event/[id]/route.ts b/src/app/api/event/[id]/route.ts
new file mode 100644
index 00000000..81849514
--- /dev/null
+++ b/src/app/api/event/[id]/route.ts
@@ -0,0 +1,48 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ let fixData;
+ const { id } = context.params;
+
+ fixData = await prisma.event.findUnique({
+ where: {
+ id: id,
+ },
+ include: {
+ Author: {
+ include: {
+ Profile: true,
+ },
+ },
+ EventMaster_TipeAcara: true,
+ EventMaster_Status: true,
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: fixData,
+ });
+ } catch (error) {
+ return NextResponse.json(
+ { success: false, message: "Gagal mendapatkan data" },
+ { status: 500 }
+ );
+ } finally {
+ await prisma.$disconnect();
+ }
+}
diff --git a/src/app/api/event/check-kehadiran/route.ts b/src/app/api/event/check-kehadiran/route.ts
new file mode 100644
index 00000000..b0ecbf78
--- /dev/null
+++ b/src/app/api/event/check-kehadiran/route.ts
@@ -0,0 +1,23 @@
+import { event_funCheckKehadiran } from "@/app_modules/event/fun";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ const { searchParams } = new URL(request.url);
+ const userId = searchParams.get("userId");
+ const eventId = searchParams.get("eventId");
+
+ const res = await event_funCheckKehadiran({
+ eventId: eventId as string,
+ userId: userId as string,
+ });
+
+ return NextResponse.json(res, { status: 200 });
+}
diff --git a/src/app/api/event/check-peserta/route.ts b/src/app/api/event/check-peserta/route.ts
new file mode 100644
index 00000000..4333609f
--- /dev/null
+++ b/src/app/api/event/check-peserta/route.ts
@@ -0,0 +1,50 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const userId = searchParams.get("userId");
+ const eventId = searchParams.get("eventId");
+
+ const check = await prisma.event_Peserta.findFirst({
+ where: {
+ userId: userId,
+ eventId: eventId,
+ },
+ });
+
+ if (check) {
+ fixData = true;
+ } else {
+ fixData = false;
+ }
+
+ await prisma.$disconnect();
+ return NextResponse.json(
+ { success: true, message: "Success get data", data: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ await prisma.$disconnect();
+ backendLogger.error("Error get data detail event:", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/event/get-all/route.ts b/src/app/api/event/get-all/route.ts
new file mode 100644
index 00000000..33e9c89a
--- /dev/null
+++ b/src/app/api/event/get-all/route.ts
@@ -0,0 +1,12 @@
+import { event_getListAllPublish } from "@/app_modules/event/fun/get/get_list_all_publish";
+import { toNumber } from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(params: Request) {
+ const { searchParams } = new URL(params.url);
+ const page = searchParams.get("page");
+
+ const data = await event_getListAllPublish({ page: toNumber(page) });
+
+ return NextResponse.json({ data });
+}
diff --git a/src/app/api/event/get-one-by-id/route.ts b/src/app/api/event/get-one-by-id/route.ts
new file mode 100644
index 00000000..7ab66fac
--- /dev/null
+++ b/src/app/api/event/get-one-by-id/route.ts
@@ -0,0 +1,21 @@
+import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
+import { NextResponse } from "next/server";
+
+export async function GET(params: Request) {
+ const { searchParams } = new URL(params.url);
+ const eventId = searchParams.get("eventId");
+
+ const res = await event_getOneById(eventId as string);
+
+ if (!res) {
+ return NextResponse.json(
+ { message: "Event Not Found", data: null },
+ { status: 404 }
+ );
+ }
+
+ return NextResponse.json(
+ { message: "Event Found", data: res },
+ { status: 200 }
+ );
+}
diff --git a/src/app/api/event/kontribusi/route.ts b/src/app/api/event/kontribusi/route.ts
new file mode 100644
index 00000000..449ea9fa
--- /dev/null
+++ b/src/app/api/event/kontribusi/route.ts
@@ -0,0 +1,133 @@
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export { GET };
+
+async function GET(request: Request) {
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const takeData = 5;
+ const skipData = Number(page) * takeData - takeData;
+
+ const userLoginId = await funGetUserIdByToken();
+ if (!userLoginId) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: "User not found",
+ },
+ {
+ status: 401,
+ }
+ );
+ }
+
+ if (!page) {
+ fixData = await prisma.event_Peserta.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ userId: userLoginId,
+ },
+ select: {
+ id: true,
+ Event: {
+ select: {
+ id: true,
+ title: true,
+ tanggal: true,
+ deskripsi: true,
+ Author: {
+ select: {
+ Profile: true,
+ },
+ },
+ Event_Peserta: {
+ take: 5,
+ orderBy: {
+ createdAt: "desc",
+ },
+ select: {
+ id: true,
+ userId: true,
+ User: {
+ select: {
+ Profile: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ });
+ } else {
+ fixData = await prisma.event_Peserta.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ userId: userLoginId,
+ },
+ select: {
+ id: true,
+ Event: {
+ select: {
+ id: true,
+ title: true,
+ tanggal: true,
+ deskripsi: true,
+ Author: {
+ select: {
+ Profile: true,
+ },
+ },
+ Event_Peserta: {
+ take: 5,
+ orderBy: {
+ createdAt: "desc",
+ },
+ select: {
+ id: true,
+ userId: true,
+ User: {
+ select: {
+ Profile: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ });
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get kontribusi",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get kontribusi", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed get kontribusi",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/event/list-peserta/route.ts b/src/app/api/event/list-peserta/route.ts
new file mode 100644
index 00000000..be0037a6
--- /dev/null
+++ b/src/app/api/event/list-peserta/route.ts
@@ -0,0 +1,16 @@
+import { event_newGetListPesertaById } from "@/app_modules/event/fun";
+import { toNumber } from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(req: Request) {
+ const { searchParams } = new URL(req.url);
+ const eventId = searchParams.get("eventId");
+ const page = searchParams.get("page");
+
+ const res = await event_newGetListPesertaById({
+ eventId: eventId as string,
+ page: toNumber(page),
+ });
+
+ return NextResponse.json(res, { status: 200 });
+}
diff --git a/src/app/api/event/peserta/[id]/route.ts b/src/app/api/event/peserta/[id]/route.ts
new file mode 100644
index 00000000..6223fa9d
--- /dev/null
+++ b/src/app/api/event/peserta/[id]/route.ts
@@ -0,0 +1,67 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ let fixData;
+ const { id } = context.params;
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ fixData = await prisma.event_Peserta.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ eventId: id,
+ },
+ select: {
+ id: true,
+ active: true,
+ createdAt: true,
+ updatedAt: true,
+ userId: true,
+ isPresent: true,
+ User: {
+ select: {
+ Profile: true,
+ },
+ },
+ Event: true,
+ eventId: true,
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Success get data",
+ data: fixData,
+ });
+ } catch (error) {
+ backendLogger.error("Error get list data:", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed get data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/event/riwayat/[name]/route.ts b/src/app/api/event/riwayat/[name]/route.ts
new file mode 100644
index 00000000..e415dec0
--- /dev/null
+++ b/src/app/api/event/riwayat/[name]/route.ts
@@ -0,0 +1,154 @@
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export { GET };
+
+interface Props {
+ params: { name: string };
+}
+async function GET(request: Request, { params }: Props) {
+ try {
+ let fixData;
+ const { name } = params;
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const takeData = 5;
+ const skipData = Number(page) * takeData - takeData;
+
+ const userLoginId = await funGetUserIdByToken();
+ if (!userLoginId) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: "Unauthorized",
+ },
+ {
+ status: 401,
+ }
+ );
+ }
+
+ if (!page) {
+ if (name == "saya") {
+ fixData = await prisma.event.findMany({
+ orderBy: {
+ tanggal: "desc",
+ },
+ where: {
+ authorId: userLoginId,
+ eventMaster_StatusId: "1",
+ isArsip: true,
+ },
+ select: {
+ id: true,
+ title: true,
+ tanggal: true,
+ deskripsi: true,
+ active: true,
+ authorId: true,
+ Author: {
+ select: {
+ Profile: true,
+ },
+ },
+ },
+ });
+ } else if (name === "semua") {
+ fixData = await prisma.event.findMany({
+ orderBy: {
+ tanggal: "desc",
+ },
+ where: {
+ eventMaster_StatusId: "1",
+ isArsip: true,
+ },
+ select: {
+ id: true,
+ title: true,
+ tanggal: true,
+ deskripsi: true,
+ active: true,
+ authorId: true,
+ Author: {
+ select: {
+ Profile: true,
+ },
+ },
+ },
+ });
+ }
+ } else {
+ if (name == "saya") {
+ fixData = await prisma.event.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ tanggal: "desc",
+ },
+ where: {
+ authorId: userLoginId,
+ eventMaster_StatusId: "1",
+ isArsip: true,
+ },
+ select: {
+ id: true,
+ title: true,
+ tanggal: true,
+ deskripsi: true,
+ active: true,
+ authorId: true,
+ Author: {
+ select: {
+ Profile: true,
+ },
+ },
+ },
+ });
+ } else if (name === "semua") {
+ fixData = await prisma.event.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ tanggal: "desc",
+ },
+ where: {
+ eventMaster_StatusId: "1",
+ isArsip: true,
+ },
+ select: {
+ id: true,
+ title: true,
+ tanggal: true,
+ deskripsi: true,
+ active: true,
+ authorId: true,
+ Author: {
+ select: {
+ Profile: true,
+ },
+ },
+ },
+ });
+ }
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: fixData,
+ });
+ } catch (error) {
+ backendLogger.error("Error get riwayat", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/event/sponsor/[id]/route.ts b/src/app/api/event/sponsor/[id]/route.ts
new file mode 100644
index 00000000..9860ed0d
--- /dev/null
+++ b/src/app/api/event/sponsor/[id]/route.ts
@@ -0,0 +1,106 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import { IEventSponsor } from "@/app_modules/event/_lib/interface";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function POST(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ const method = request.method;
+ if (method !== "POST") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ const userLoginId = await funGetUserIdByToken();
+
+ if (!userLoginId) {
+ return NextResponse.json(
+ { success: false, message: "User not found" },
+ { status: 401 }
+ );
+ }
+
+ try {
+ let fixData;
+ const { id } = context.params;
+ const req: IEventSponsor = await request.json();
+
+ fixData = await prisma.eventSponsor.create({
+ data: {
+ eventId: id,
+ name: req.name as string,
+ fileName: req.fileName as string,
+ fileExt: req.fileExt as string,
+ fileId: req.fileId as string,
+ // authorId: userLoginId,
+ },
+ });
+
+ await prisma.$disconnect();
+ return NextResponse.json({
+ success: true,
+ message: "Success create sponsor",
+ });
+ } catch (error) {
+ await prisma.$disconnect();
+ backendLogger.error("Error create sponsor event", error);
+ return NextResponse.json(
+ { success: false, message: "Failed create sponsor" },
+ { status: 500 }
+ );
+ }
+}
+
+export async function GET(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ let fixData;
+ const { id } = context.params;
+
+ fixData = await prisma.eventSponsor.findUnique({
+ where: {
+ id: id,
+ },
+ include: {
+ Author: {
+ include: {
+ Profile: true,
+ },
+ },
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Success create sponsor",
+ data: fixData,
+ });
+ } catch (error) {
+ backendLogger.error("Error get sponsor event", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed create sponsor",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ } finally {
+ await prisma.$disconnect();
+ }
+}
diff --git a/src/app/api/event/sponsor/list/[id]/route.ts b/src/app/api/event/sponsor/list/[id]/route.ts
new file mode 100644
index 00000000..cc1f8ac9
--- /dev/null
+++ b/src/app/api/event/sponsor/list/[id]/route.ts
@@ -0,0 +1,79 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ let fixData;
+ const { id } = context.params;
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ if (!page) {
+ fixData = await prisma.eventSponsor.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ eventId: id,
+ },
+ include: {
+ Author: {
+ include: {
+ Profile: true,
+ },
+ },
+ },
+ });
+ } else {
+ fixData = await prisma.eventSponsor.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ eventId: id,
+ },
+ include: {
+ Author: {
+ include: {
+ Profile: true,
+ },
+ },
+ },
+ });
+ }
+
+ await prisma.$disconnect();
+ return NextResponse.json({
+ success: true,
+ message: "Success create sponsor",
+ data: fixData,
+ });
+ } catch (error) {
+ backendLogger.error("Error get sponsor event", error);
+ await prisma.$disconnect();
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed create sponsor",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/event/status/[name]/route.ts b/src/app/api/event/status/[name]/route.ts
new file mode 100644
index 00000000..2b3ba3ce
--- /dev/null
+++ b/src/app/api/event/status/[name]/route.ts
@@ -0,0 +1,86 @@
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { name: string } }
+) {
+ try {
+ let fixData;
+ const { name } = params;
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ const userLoginId = await funGetUserIdByToken();
+ if (!userLoginId) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: "User Unauthorized",
+ },
+ {
+ status: 401,
+ }
+ );
+ }
+
+ if (!page) {
+ fixData = await prisma.event.findMany({
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ active: true,
+ authorId: userLoginId,
+ isArsip: false,
+ },
+ include: {
+ EventMaster_Status: true,
+ },
+ });
+ } else {
+ const fixStatusName = _.startCase(name);
+
+ fixData = await prisma.event.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ active: true,
+ authorId: userLoginId,
+ isArsip: false,
+ EventMaster_Status: {
+ name: fixStatusName || name,
+ },
+ },
+ include: {
+ EventMaster_Status: true,
+ },
+ });
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Success",
+ data: fixData,
+ });
+ } catch (error) {
+ backendLogger.error("Error get data event ", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed to get data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/event/tipe-acara/route.ts b/src/app/api/event/tipe-acara/route.ts
new file mode 100644
index 00000000..93da9808
--- /dev/null
+++ b/src/app/api/event/tipe-acara/route.ts
@@ -0,0 +1,39 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const data = await prisma.eventMaster_TipeAcara.findMany({
+ orderBy: {
+ id: "asc",
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Success get tipe acara",
+ data: data,
+ });
+ } catch (error) {
+ backendLogger.error("Error get tipe acara", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed get tipe acara ",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ } finally {
+ await prisma.$disconnect();
+ }
+}
diff --git a/src/app/api/forum/[id]/komentar/route.ts b/src/app/api/forum/[id]/komentar/route.ts
new file mode 100644
index 00000000..d1cf896c
--- /dev/null
+++ b/src/app/api/forum/[id]/komentar/route.ts
@@ -0,0 +1,96 @@
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export const dynamic = "force-dynamic";
+
+export { GET };
+
+async function GET(request: Request, { params }: { params: { id: string } }) {
+ try {
+ let fixData;
+ const { id } = params;
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const takeData = 5;
+ const skipData = Number(page) * takeData - takeData;
+
+ if (!page) {
+ fixData = await prisma.forum_Komentar.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ forum_PostingId: id,
+ isActive: true,
+ },
+ select: {
+ id: true,
+ isActive: true,
+ komentar: true,
+ createdAt: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ name: true,
+ imageId: true,
+ },
+ },
+ },
+ },
+ authorId: true,
+ },
+ });
+ } else {
+ fixData = await prisma.forum_Komentar.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ forum_PostingId: id,
+ isActive: true,
+ },
+ select: {
+ id: true,
+ isActive: true,
+ komentar: true,
+ createdAt: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ name: true,
+ imageId: true,
+ },
+ },
+ },
+ },
+ authorId: true,
+ },
+ });
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: fixData,
+ });
+ } catch (error) {
+ backendLogger.error("Error Get Forum Komentar >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "API Error Get Data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/forum/[id]/report-komentar/route.ts b/src/app/api/forum/[id]/report-komentar/route.ts
new file mode 100644
index 00000000..1407a037
--- /dev/null
+++ b/src/app/api/forum/[id]/report-komentar/route.ts
@@ -0,0 +1,75 @@
+import prisma from "@/lib/prisma";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+ const data = await prisma.forum_Komentar.findFirst({
+ where: {
+ id: id,
+ },
+ select: {
+ id: true,
+ komentar: true,
+ Forum_Posting: {
+ select: {
+ id: true,
+ diskusi: true,
+ Author: {
+ select: {
+ username: true,
+ },
+ },
+ },
+ },
+
+ Forum_ReportKomentar: {
+ select: {
+ deskripsi: true,
+ ForumMaster_KategoriReport: {
+ select: {
+ id: true,
+ title: true,
+ },
+ },
+ },
+ },
+ },
+ });
+
+ const group = _.groupBy(
+ data?.Forum_ReportKomentar,
+ (v) => v.ForumMaster_KategoriReport?.title
+ );
+
+ const getKey = _.keys(group);
+ const filterGroup = getKey.map((e) => e.replace("undefined", "Lainnya"));
+
+ const allData = {
+ data: data,
+ list: filterGroup,
+ };
+
+ return NextResponse.json({
+ success: true,
+ message: "Success get data report komentar",
+ data: allData,
+ });
+ } catch (error) {
+ console.error("Error get data report komentar", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data report komentar",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/forum/[id]/report-posting/route.ts b/src/app/api/forum/[id]/report-posting/route.ts
new file mode 100644
index 00000000..4a69e48e
--- /dev/null
+++ b/src/app/api/forum/[id]/report-posting/route.ts
@@ -0,0 +1,59 @@
+import _ from "lodash";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+ const data = await prisma.forum_Posting.findFirst({
+ where: {
+ id: id,
+ },
+ select: {
+ id: true,
+ diskusi: true,
+ Forum_ReportPosting: {
+ select: {
+ id: true,
+ deskripsi: true,
+ forumMaster_KategoriReportId: true,
+ ForumMaster_KategoriReport: true,
+ },
+ },
+ },
+ });
+
+ const group = _.groupBy(
+ data?.Forum_ReportPosting,
+ (val) => val.ForumMaster_KategoriReport?.title
+ );
+ const getKey = _.keys(group);
+ const filterGroup = getKey.map((e) => e.replace("undefined", "Lainnya"));
+
+ const allData = {
+ data: data,
+ list: filterGroup,
+ };
+
+ return NextResponse.json({
+ success: true,
+ message: "Success get data report posting",
+ data: allData,
+ });
+ } catch (error) {
+ console.error("Error get data report posting", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data report posting",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/forum/[id]/route.ts b/src/app/api/forum/[id]/route.ts
new file mode 100644
index 00000000..935c8b88
--- /dev/null
+++ b/src/app/api/forum/[id]/route.ts
@@ -0,0 +1,65 @@
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export const dynamic = "force-dynamic";
+
+export { GET };
+
+async function GET(request: Request, { params }: { params: { id: string } }) {
+ try {
+ const { id } = params;
+
+ const data = await prisma.forum_Posting.findUnique({
+ where: {
+ id: id,
+ },
+ select: {
+ id: true,
+ diskusi: true,
+ isActive: true,
+ createdAt: true,
+ authorId: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: true,
+ },
+ },
+ _count: {
+ select: {
+ Forum_Komentar: {
+ where: {
+ isActive: true,
+ },
+ },
+ },
+ },
+ ForumMaster_StatusPosting: true,
+ forumMaster_StatusPostingId: true,
+ },
+ });
+
+ const fixData = {
+ ...data,
+ count: data?._count.Forum_Komentar,
+ };
+
+ return NextResponse.json({
+ success: true,
+ message: "Success get data",
+ data: fixData,
+ });
+ } catch (error) {
+ backendLogger.error("Error get data forum", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data forum",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/forum/forumku/[id]/route.ts b/src/app/api/forum/forumku/[id]/route.ts
new file mode 100644
index 00000000..c7ac8d94
--- /dev/null
+++ b/src/app/api/forum/forumku/[id]/route.ts
@@ -0,0 +1,120 @@
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export { GET };
+
+async function GET(request: Request, { params }: { params: { id: string } }) {
+ try {
+ let fixData;
+ const { id } = params;
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const takeData = 5;
+ const skipData = Number(page) * takeData - takeData;
+
+ if (!page) {
+ fixData = await prisma.forum_Posting.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ authorId: id,
+ isActive: true,
+ },
+ select: {
+ id: true,
+ diskusi: true,
+ createdAt: true,
+ isActive: true,
+ authorId: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ imageId: true,
+ },
+ },
+ },
+ },
+ Forum_Komentar: {
+ where: {
+ isActive: true,
+ },
+ },
+ ForumMaster_StatusPosting: {
+ select: {
+ id: true,
+ status: true,
+ },
+ },
+ forumMaster_StatusPostingId: true,
+ },
+ });
+ } else {
+ fixData = await prisma.forum_Posting.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ authorId: id,
+ isActive: true,
+ },
+ select: {
+ id: true,
+ diskusi: true,
+ createdAt: true,
+ isActive: true,
+ authorId: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ imageId: true,
+ },
+ },
+ },
+ },
+ Forum_Komentar: {
+ where: {
+ isActive: true,
+ },
+ },
+ ForumMaster_StatusPosting: {
+ select: {
+ id: true,
+ status: true,
+ },
+ },
+ forumMaster_StatusPostingId: true,
+ },
+ });
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: fixData,
+ });
+ } catch (error) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ error: (error as Error).message,
+ },
+ {
+ status: 500,
+ }
+ );
+ }
+}
diff --git a/src/app/api/forum/master/route.ts b/src/app/api/forum/master/route.ts
new file mode 100644
index 00000000..a2b1e1eb
--- /dev/null
+++ b/src/app/api/forum/master/route.ts
@@ -0,0 +1,32 @@
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+import backendLogger from "@/util/backendLogger";
+
+export async function GET(request: Request) {
+ try {
+ const data = await prisma.forumMaster_KategoriReport.findMany({
+ orderBy: {
+ createdAt: "asc",
+ },
+ where: {
+ isActive: true,
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: data,
+ });
+ } catch (error) {
+ backendLogger.error("Error Get Master Kategori Report >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/forum/route.ts b/src/app/api/forum/route.ts
new file mode 100644
index 00000000..6c53c6d2
--- /dev/null
+++ b/src/app/api/forum/route.ts
@@ -0,0 +1,125 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+// GET ALL DATA PORTOFOLIO BY PROFILE ID
+export async function GET(request: Request) {
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const search = searchParams.get("search");
+ const takeData = 5;
+ const skipData = Number(page) * takeData - takeData;
+
+
+ if (!page) {
+ fixData = await prisma.forum_Posting.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ isActive: true,
+ diskusi: {
+ mode: "insensitive",
+ contains: search == undefined || search == "null" ? "" : search,
+ },
+ },
+ select: {
+ id: true,
+ diskusi: true,
+ createdAt: true,
+ isActive: true,
+ authorId: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ imageId: true,
+ },
+ },
+ },
+ },
+ Forum_Komentar: {
+ where: {
+ isActive: true,
+ },
+ },
+ ForumMaster_StatusPosting: {
+ select: {
+ id: true,
+ status: true,
+ },
+ },
+ forumMaster_StatusPostingId: true,
+ },
+ });
+ } else {
+ fixData = await prisma.forum_Posting.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ isActive: true,
+ diskusi: {
+ mode: "insensitive",
+ contains: search == undefined || search == "null" ? "" : search,
+ },
+ },
+ select: {
+ id: true,
+ diskusi: true,
+ createdAt: true,
+ isActive: true,
+ authorId: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ imageId: true,
+ },
+ },
+ },
+ },
+ Forum_Komentar: {
+ where: {
+ isActive: true,
+ },
+ },
+ ForumMaster_StatusPosting: {
+ select: {
+ id: true,
+ status: true,
+ },
+ },
+ forumMaster_StatusPostingId: true,
+ },
+ });
+ }
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error(error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data, coba lagi nanti ",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/get-cookie/route.ts b/src/app/api/get-cookie/route.ts
new file mode 100644
index 00000000..8b4959b8
--- /dev/null
+++ b/src/app/api/get-cookie/route.ts
@@ -0,0 +1,15 @@
+import { cookies } from 'next/headers'
+import { NextResponse } from 'next/server';
+
+export const dynamic = "force-dynamic";
+export async function GET(request: Request) {
+ try {
+ const cookiesKey = process.env.NEXT_PUBLIC_BASE_SESSION_KEY!
+ const cookieStore = cookies();
+ const hipmiKey = cookieStore.get(cookiesKey)?.value || '';
+ return NextResponse.json({ token: hipmiKey });
+ } catch (error) {
+ console.error(error);
+ return NextResponse.json({ error }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/image/delete/route.ts b/src/app/api/image/delete/route.ts
new file mode 100644
index 00000000..42d360e3
--- /dev/null
+++ b/src/app/api/image/delete/route.ts
@@ -0,0 +1,51 @@
+import { funGetDirectoryNameByValue } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function DELETE(req: Request) {
+ const data = await req.json();
+ const id = data.fileId;
+ const dirId = data.dirId;
+
+ const keyOfDirectory = await funGetDirectoryNameByValue({
+ value: dirId,
+ });
+
+ if (req.method === "DELETE") {
+ try {
+ const res = await fetch(
+ `https://wibu-storage.wibudev.com/api/files/${id}/delete`,
+ {
+ method: "DELETE",
+ headers: {
+ Authorization: `Bearer ${process.env.WS_APIKEY}`,
+ },
+ }
+ );
+ backendLogger.info("Server status code: " + res.status);
+ const data = await res.json();
+ if (res.ok) {
+ backendLogger.info(`Success delete ${keyOfDirectory}`);
+ return NextResponse.json({ success: true });
+ } else {
+ const errorText = await res.json();
+ backendLogger.error(
+ `Failed delete ${keyOfDirectory}: ` + errorText.message
+ );
+ return NextResponse.json({
+ success: false,
+ message: errorText.message,
+ });
+ }
+ } catch (error) {
+ backendLogger.error(`Delete error ${keyOfDirectory}:`, error);
+ return NextResponse.json({
+ success: false,
+ message: "An unexpected error occurred",
+ });
+ }
+ } else {
+ backendLogger.error(`Error upload ${keyOfDirectory}: Method not allowed`);
+ return NextResponse.json({ success: false, message: "Method not allowed" });
+ }
+}
diff --git a/src/app/api/image/upload/route.ts b/src/app/api/image/upload/route.ts
new file mode 100644
index 00000000..eb11ddb0
--- /dev/null
+++ b/src/app/api/image/upload/route.ts
@@ -0,0 +1,87 @@
+import { funGetDirectoryNameByValue } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import sharp from "sharp";
+export async function POST(request: Request) {
+ const formData = await request.formData();
+ const valueOfDir = formData.get("dirId");
+ const keyOfDirectory = await funGetDirectoryNameByValue({
+ value: valueOfDir as string,
+ });
+
+ if (request.method === "POST") {
+ let fixFormData;
+ const file: any = formData.get("file");
+ const mimeType = file.type;
+ // console.log("MIME Type:", mimeType);
+
+ try {
+ if (mimeType != "application/pdf") {
+ // Resize ukuran
+ const imageBuffer = await file.arrayBuffer();
+ const resize = await sharp(imageBuffer).resize(2000).toBuffer();
+
+ // Convert buffer ke Blob
+ const blob = new Blob([resize], { type: file.type });
+
+ // Convert Blob ke File
+ const resizedFile = new File([blob], file.name, {
+ type: file.type,
+ lastModified: new Date().getTime(),
+ });
+
+ // Buat FormData baru
+ const newFormData = new FormData();
+ newFormData.append("file", resizedFile);
+ newFormData.append("dirId", formData.get("dirId") as string);
+
+ fixFormData = newFormData;
+ } else {
+ fixFormData = formData;
+ }
+
+ const res = await fetch("https://wibu-storage.wibudev.com/api/upload", {
+ method: "POST",
+ body: fixFormData,
+ headers: {
+ Authorization: `Bearer ${process.env.WS_APIKEY}`,
+ },
+ });
+
+ backendLogger.info("Server status code: " + res.status);
+ const dataRes = await res.json();
+
+ if (res.ok) {
+ backendLogger.info(
+ `Success upload ${keyOfDirectory}: ${JSON.stringify(dataRes.data)}`
+ );
+ return NextResponse.json(
+ { success: true, data: dataRes.data },
+ { status: 200 }
+ );
+ } else {
+ const errorText = await res.text();
+ backendLogger.error(`Failed upload ${keyOfDirectory}: ${errorText}`);
+ return NextResponse.json(
+ { success: false, message: errorText },
+ { status: 400 }
+ );
+ }
+ } catch (error) {
+ backendLogger.error(`Error upload ${keyOfDirectory}: ${error}`);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "An unexpected error occurred",
+ },
+ { status: 500 }
+ );
+ }
+ } else {
+ backendLogger.error(`Error upload ${keyOfDirectory}: Method not allowed`);
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+}
diff --git a/src/app/api/investasi/[id]/investor/route.ts b/src/app/api/investasi/[id]/investor/route.ts
new file mode 100644
index 00000000..30f968f9
--- /dev/null
+++ b/src/app/api/investasi/[id]/investor/route.ts
@@ -0,0 +1,76 @@
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+import _ from "lodash";
+
+export { GET };
+
+async function GET(request: Request, { params }: { params: { id: string } }) {
+ try {
+ let fixData;
+ const { id } = params;
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const takeData = 10
+ const skipData = Number(page) * takeData - takeData;
+
+ if (!page) {
+ fixData = await prisma.investasi_Invoice.findMany({
+ where: {
+ investasiId: id,
+ StatusInvoice: {
+ name: "Berhasil",
+ },
+ },
+ include: {
+ Author: {
+ select: {
+ Profile: true,
+ },
+ },
+ },
+ });
+ } else {
+ const Alldata = await prisma.investasi_Invoice.findMany({
+ skip: skipData,
+ take: takeData,
+ where: {
+ investasiId: id,
+ StatusInvoice: {
+ name: "Berhasil",
+ },
+ },
+ include: {
+ Author: {
+ select: {
+ Profile: true,
+ },
+ },
+ },
+ });
+
+ fixData = Alldata.map((e, i) => ({
+ ..._.omit(e, ["Author"]),
+ Profile: e.Author?.Profile,
+ }));
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Success get data investor",
+ data: fixData,
+ });
+ } catch (error) {
+ backendLogger.error("Error get data investor >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data investor",
+ reason: (error as Error).message,
+ },
+ {
+ status: 500,
+ }
+ );
+ }
+}
diff --git a/src/app/api/investasi/[id]/invoice/route.ts b/src/app/api/investasi/[id]/invoice/route.ts
new file mode 100644
index 00000000..df9c6e9f
--- /dev/null
+++ b/src/app/api/investasi/[id]/invoice/route.ts
@@ -0,0 +1,55 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export async function GET(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ try {
+ const { id } = context.params;
+ const data = await prisma.investasi_Invoice.findFirst({
+ where: {
+ id: id,
+ },
+ include: {
+ MasterBank: true,
+ StatusInvoice: true,
+ Investasi: {
+ include: {
+ MasterPembagianDeviden: true,
+ MasterPencarianInvestor: true,
+ MasterPeriodeDeviden: true,
+ ProspektusInvestasi: true,
+ Investasi_Invoice: {
+ where: {
+ statusInvoiceId: "1",
+ },
+ },
+ },
+ },
+ Author: {
+ include: {
+ Profile: true,
+ },
+ },
+ },
+ });
+
+ const { ...allData } = data;
+ const Investor = data?.Investasi?.Investasi_Invoice;
+ const result = { ...allData, Investor };
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data invoice",
+ data: result,
+ });
+ } catch (error) {
+ console.error("Error get invoice", error);
+ return NextResponse.json({
+ success: false,
+ message: "Gagal mendapatkan data invoice, coba lagi nanti ",
+ reason: (error as Error).message,
+ });
+ }
+}
diff --git a/src/app/api/investasi/[id]/route.ts b/src/app/api/investasi/[id]/route.ts
new file mode 100644
index 00000000..0ff6b59e
--- /dev/null
+++ b/src/app/api/investasi/[id]/route.ts
@@ -0,0 +1,53 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+// GET ONE DATA INVESTASI BY ID
+export async function GET(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ try {
+ const { id } = context.params;
+ const data = await prisma.investasi.findUnique({
+ where: {
+ id: id,
+ },
+ include: {
+ author: {
+ include: {
+ Profile: true,
+ },
+ },
+ Investasi_Invoice: {
+ where: {
+ statusInvoiceId: "1"
+ }
+ },
+ MasterStatusInvestasi: true,
+ BeritaInvestasi: true,
+ DokumenInvestasi: true,
+ ProspektusInvestasi: true,
+ MasterPembagianDeviden: true,
+ MasterPencarianInvestor: true,
+ MasterPeriodeDeviden: true,
+ MasterProgresInvestasi: true,
+ },
+ });
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error(error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data, coba lagi nanti ",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/investasi/bukti-transfer/[id]/route.ts b/src/app/api/investasi/bukti-transfer/[id]/route.ts
index 0877bb3d..34223776 100644
--- a/src/app/api/investasi/bukti-transfer/[id]/route.ts
+++ b/src/app/api/investasi/bukti-transfer/[id]/route.ts
@@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import fs from "fs";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function GET(
req: NextRequest,
diff --git a/src/app/api/investasi/dokumen/[id]/route.ts b/src/app/api/investasi/dokumen/[id]/route.ts
index e5d4c94c..07724d36 100644
--- a/src/app/api/investasi/dokumen/[id]/route.ts
+++ b/src/app/api/investasi/dokumen/[id]/route.ts
@@ -1,4 +1,4 @@
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { NextRequest, NextResponse } from "next/server";
import fs from "fs";
diff --git a/src/app/api/investasi/gambar/[id]/route.ts b/src/app/api/investasi/gambar/[id]/route.ts
index 8fce01cc..2524f254 100644
--- a/src/app/api/investasi/gambar/[id]/route.ts
+++ b/src/app/api/investasi/gambar/[id]/route.ts
@@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import fs from "fs";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function GET(
req: NextRequest,
diff --git a/src/app/api/investasi/prospektus/[id]/route.ts b/src/app/api/investasi/prospektus/[id]/route.ts
index 243b204a..a5b90324 100644
--- a/src/app/api/investasi/prospektus/[id]/route.ts
+++ b/src/app/api/investasi/prospektus/[id]/route.ts
@@ -1,4 +1,4 @@
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { NextRequest, NextResponse } from "next/server";
import fs from "fs";
diff --git a/src/app/api/investasi/route.ts b/src/app/api/investasi/route.ts
new file mode 100644
index 00000000..e60e4df9
--- /dev/null
+++ b/src/app/api/investasi/route.ts
@@ -0,0 +1,185 @@
+import { prisma } from "@/lib";
+import _ from "lodash";
+import moment from "moment";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+// GET ALL DATA INVESTASI
+export async function GET(request: Request) {
+ try {
+ let dataFix;
+ const { searchParams } = new URL(request.url);
+ const kategori = searchParams.get("cat");
+ const status = searchParams.get("status");
+ const page = searchParams.get("page");
+ const dataTake = 10;
+ const dataSkip = Number(page) * dataTake - dataTake;
+
+ if (!page) {
+ const data = await prisma.investasi.findMany({
+ where: {
+ masterStatusInvestasiId: "1",
+ masterProgresInvestasiId: "1",
+ },
+ select: {
+ id: true,
+ MasterPencarianInvestor: true,
+ countDown: true,
+ progress: true,
+ },
+ });
+
+ for (let a of data) {
+ if (
+ (a.MasterPencarianInvestor?.name as any) -
+ moment(new Date()).diff(new Date(a.countDown as any), "days") <=
+ 0
+ ) {
+ await prisma.investasi.update({
+ where: {
+ id: a.id,
+ },
+ data: {
+ masterProgresInvestasiId: "3",
+ },
+ });
+ }
+
+ if (a.progress === "100") {
+ await prisma.investasi.update({
+ where: {
+ id: a.id,
+ },
+ data: {
+ masterProgresInvestasiId: "2",
+ },
+ });
+ }
+ }
+
+ // cek data yang lewat
+ // klo ada, update status
+ const dataAwal = await prisma.investasi.findMany({
+ orderBy: [
+ {
+ masterProgresInvestasiId: "asc",
+ },
+ {
+ countDown: "desc",
+ },
+ ],
+ where: {
+ masterStatusInvestasiId: "1",
+ },
+ select: {
+ id: true,
+ imageId: true,
+ title: true,
+ progress: true,
+ countDown: true,
+ MasterPencarianInvestor: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ });
+
+ dataFix = dataAwal.map((v: any) => ({
+ ..._.omit(v, ["MasterPencarianInvestor"]),
+ pencarianInvestor: v.MasterPencarianInvestor.name,
+ }));
+ } else {
+ const data = await prisma.investasi.findMany({
+ where: {
+ masterStatusInvestasiId: "1",
+ masterProgresInvestasiId: "1",
+ },
+ select: {
+ id: true,
+ MasterPencarianInvestor: true,
+ countDown: true,
+ progress: true,
+ },
+ });
+
+ for (let a of data) {
+ if (
+ (a.MasterPencarianInvestor?.name as any) -
+ moment(new Date()).diff(new Date(a.countDown as any), "days") <=
+ 0
+ ) {
+ await prisma.investasi.update({
+ where: {
+ id: a.id,
+ },
+ data: {
+ masterProgresInvestasiId: "3",
+ },
+ });
+ }
+
+ if (a.progress === "100") {
+ await prisma.investasi.update({
+ where: {
+ id: a.id,
+ },
+ data: {
+ masterProgresInvestasiId: "2",
+ },
+ });
+ }
+ }
+
+ // cek data yang lewat
+ // klo ada, update status
+ const dataAwal = await prisma.investasi.findMany({
+ take: dataTake,
+ skip: dataSkip,
+ orderBy: [
+ {
+ masterProgresInvestasiId: "asc",
+ },
+ {
+ countDown: "desc",
+ },
+ ],
+ where: {
+ masterStatusInvestasiId: "1",
+ },
+ select: {
+ id: true,
+ imageId: true,
+ title: true,
+ progress: true,
+ countDown: true,
+ MasterPencarianInvestor: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ });
+
+ dataFix = dataAwal.map((v: any) => ({
+ ..._.omit(v, ["MasterPencarianInvestor"]),
+ pencarianInvestor: v.MasterPencarianInvestor.name,
+ }));
+ }
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: dataFix },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error(error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data, coba lagi nanti ",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/investasi/saham/[id]/route.ts b/src/app/api/investasi/saham/[id]/route.ts
new file mode 100644
index 00000000..d6e150b4
--- /dev/null
+++ b/src/app/api/investasi/saham/[id]/route.ts
@@ -0,0 +1,61 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export { GET };
+
+async function GET(request: Request, { params }: { params: { id: string } }) {
+ try {
+ const { id } = params;
+ const data = await prisma.investasi_Invoice.findFirst({
+ where: {
+ id: id,
+ },
+ include: {
+ MasterBank: true,
+ StatusInvoice: {
+ where: {
+ name: "Berhasil",
+ },
+ },
+ Investasi: {
+ include: {
+ MasterPembagianDeviden: true,
+ MasterPencarianInvestor: true,
+ MasterPeriodeDeviden: true,
+ ProspektusInvestasi: true,
+ Investasi_Invoice: {
+ where: {
+ statusInvoiceId: "1",
+ },
+ },
+ },
+ },
+ Author: {
+ include: {
+ Profile: true,
+ },
+ },
+ },
+ });
+
+ const { ...allData } = data;
+ const Investor = data?.Investasi?.Investasi_Invoice;
+ const result = { ...allData, Investor };
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mengambil data",
+ data: result,
+ });
+ } catch (error) {
+ console.log(error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mengambil data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/job/[id]/route.ts b/src/app/api/job/[id]/route.ts
new file mode 100644
index 00000000..45e4996d
--- /dev/null
+++ b/src/app/api/job/[id]/route.ts
@@ -0,0 +1,53 @@
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export { GET };
+
+async function GET(request: Request, { params }: { params: { id: string } }) {
+ try {
+ const { id } = params;
+ const data = await prisma.job.findUnique({
+ where: {
+ id: id,
+ },
+ include: {
+ Author: {
+ select: {
+ username: true,
+ nomor: true,
+ Profile: {
+ select: {
+ name: true,
+ alamat: true,
+ },
+ },
+ },
+ },
+ MasterStatus: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ });
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get data job-vacancy",
+ data: data,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data job-vacancy", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data job-vacancy",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/job/arsip/route.ts b/src/app/api/job/arsip/route.ts
new file mode 100644
index 00000000..26525965
--- /dev/null
+++ b/src/app/api/job/arsip/route.ts
@@ -0,0 +1,97 @@
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+export const dynamic = "force-dynamic";
+
+export { GET };
+
+async function GET(request: Request) {
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const dataTake = 10
+ const dataSkip = Number(page) * dataTake - dataTake;
+
+ const userLoginId = await funGetUserIdByToken();
+ if (!userLoginId) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: "Unauthorized",
+ },
+ {
+ status: 401,
+ }
+ );
+ }
+
+ if (!page) {
+ fixData = await prisma.job.findMany({
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ masterStatusId: "1",
+ isActive: true,
+ isArsip: true,
+ authorId: userLoginId,
+ },
+ select: {
+ id: true,
+ title: true,
+ isArsip: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: true,
+ },
+ },
+ },
+ });
+ } else {
+ fixData = await prisma.job.findMany({
+ take: dataTake,
+ skip: dataSkip,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ masterStatusId: "1",
+ isActive: true,
+ isArsip: true,
+ authorId: userLoginId,
+ },
+ select: {
+ id: true,
+ title: true,
+ isArsip: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: true,
+ },
+ },
+ },
+ });
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: fixData,
+ });
+
+ } catch (error) {
+ backendLogger.error("Error get data job");
+ return NextResponse.json({
+ success: false,
+ message: "Error get data job",
+ error: (error as Error).message,
+ });
+ }
+}
diff --git a/src/app/api/job/gambar/[id]/route.ts b/src/app/api/job/gambar/[id]/route.ts
deleted file mode 100644
index 0df462d1..00000000
--- a/src/app/api/job/gambar/[id]/route.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import prisma from "@/app/lib/prisma";
-import fs from "fs";
-import { NextRequest, NextResponse } from "next/server";
-import path from "path";
-const root = process.cwd();
-
-export async function GET(
- req: NextRequest,
- { params }: { params: { id: string } }
-) {
- const get = await prisma.images.findUnique({
- where: {
- id: params.id,
- },
- select: {
- url: true,
- },
- });
-
- if (!fs.existsSync(path.join(root, `public/job/${get?.url}`))) {
- const notFile = fs.readFileSync(
- path.join(root, "public/aset/global/no-file.png")
- );
- return new NextResponse(notFile, {
- headers: {
- "Content-Type": "image/png",
- },
- });
- }
- const file = fs.readFileSync(path.join(root, `public/job/${get?.url}`));
- return new NextResponse(file, {
- headers: {
- "Content-Type": "image/png",
- },
- });
-}
diff --git a/src/app/api/job/route.ts b/src/app/api/job/route.ts
new file mode 100644
index 00000000..031ba4e7
--- /dev/null
+++ b/src/app/api/job/route.ts
@@ -0,0 +1,148 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const dataTake = 10;
+ const dataSkip = Number(page) * dataTake - dataTake;
+
+ if (!page) {
+ fixData = await prisma.job.findMany({
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ masterStatusId: "1",
+ isActive: true,
+ isArsip: false,
+ title: {
+ mode: "insensitive",
+ contains: search ? search : "",
+ },
+ },
+ select: {
+ id: true,
+ title: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: true,
+ },
+ },
+ },
+ });
+ } else {
+ fixData = await prisma.job.findMany({
+ take: dataTake,
+ skip: dataSkip,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ masterStatusId: "1",
+ isActive: true,
+ isArsip: false,
+ title: {
+ mode: "insensitive",
+ contains: search ? search : "",
+ },
+ },
+ select: {
+ id: true,
+ title: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: true,
+ },
+ },
+ },
+ });
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: fixData,
+ });
+ } catch (error) {
+ backendLogger.error("Error get data job");
+ return NextResponse.json({
+ success: false,
+ message: "Error get data job",
+ error: (error as Error).message,
+ });
+ }
+}
+
+export async function POST(request: Request) {
+ if (request.method !== "POST") {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Method not allowed",
+ },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const { data } = await request.json();
+
+ const fixData = await prisma.job.create({
+ data: {
+ title: data.title,
+ content: data.content,
+ deskripsi: data.deskripsi,
+ authorId: data.authorId,
+ imageId: data.imageId ?? null,
+ },
+ select: {
+ id: true,
+ authorId: true,
+ MasterStatus: {
+ select: {
+ name: true,
+ },
+ },
+ title: true,
+ },
+ });
+
+ if (!fixData) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed created job",
+ },
+ { status: 400 }
+ );
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success created job",
+ data: fixData,
+ },
+ { status: 201 }
+ );
+ } catch (error) {
+ console.log("Error created job", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error created job",
+ error: (error as Error).message || error,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/job/status/[name]/route.ts b/src/app/api/job/status/[name]/route.ts
new file mode 100644
index 00000000..d71d0a5b
--- /dev/null
+++ b/src/app/api/job/status/[name]/route.ts
@@ -0,0 +1,87 @@
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+export async function GET(
+ request: Request,
+ { params }: { params: { name: string } }
+) {
+ try {
+ let fixData;
+ const { name } = params;
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+ const takeData = 10
+ const skipData = Number(page) * takeData - takeData;
+
+ const userLoginId = await funGetUserIdByToken();
+
+ if (!userLoginId) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: "Unauthorized",
+ },
+ {
+ status: 401,
+ }
+ );
+ }
+
+
+ if (!page) {
+ fixData = await prisma.job.findMany({
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ authorId: userLoginId,
+ isActive: true,
+ isArsip: false,
+ },
+ include: {
+ Author: true,
+ MasterStatus: true,
+ },
+ });
+ } else {
+ const fixStatusName = _.startCase(name);
+ fixData = await prisma.job.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ authorId: userLoginId,
+ isActive: true,
+ MasterStatus: {
+ name: fixStatusName || name,
+ },
+ },
+ include: {
+ Author: true,
+ MasterStatus: true,
+ },
+ });
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: fixData,
+ });
+ } catch (error) {
+ backendLogger.error("Error Get Data Job", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/logs/route.ts b/src/app/api/logs/route.ts
new file mode 100644
index 00000000..b660e323
--- /dev/null
+++ b/src/app/api/logs/route.ts
@@ -0,0 +1,71 @@
+// app/api/logs/view/route.ts
+import { NextRequest, NextResponse } from "next/server";
+import fs from "fs/promises";
+import path from "path";
+
+interface LogEntry {
+ timestamp: string;
+ level: string;
+ message: string;
+ metadata?: any;
+}
+
+async function readLogFiles(directory: string): Promise {
+ try {
+ const logPath = path.join(process.cwd(), directory);
+ const files = await fs.readdir(logPath);
+ const logFiles = files.filter((file) => file.endsWith(".log"));
+
+ const allLogs: LogEntry[] = [];
+
+ for (const file of logFiles) {
+ const filePath = path.join(logPath, file);
+ const content = await fs.readFile(filePath, "utf-8");
+
+ // Parse setiap baris log
+ const logs = content
+ .split("\n")
+ .filter(Boolean)
+ .map((line) => {
+ try {
+ return JSON.parse(line);
+ } catch (e) {
+ return null;
+ }
+ })
+ .filter(Boolean);
+
+ allLogs.push(...logs);
+ }
+
+ // Sort berdasarkan timestamp, terbaru di atas
+ return allLogs.sort(
+ (a, b) =>
+ new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()
+ );
+ } catch (error) {
+ console.error("Error reading log files:", error);
+ return [];
+ }
+}
+
+export async function GET(request: NextRequest) {
+ try {
+ // Baca logs dari frontend dan backend
+ const frontendLogs = await readLogFiles("logs/frontend");
+ const backendLogs = await readLogFiles("logs/backend");
+
+ // Gabungkan dan sort semua logs
+ const allLogs = [...frontendLogs, ...backendLogs].sort(
+ (a, b) =>
+ new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()
+ );
+
+ return NextResponse.json({ logs: allLogs });
+ } catch (error) {
+ return NextResponse.json(
+ { error: "Failed to fetch logs" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/logs/view/route.ts b/src/app/api/logs/view/route.ts
new file mode 100644
index 00000000..b660e323
--- /dev/null
+++ b/src/app/api/logs/view/route.ts
@@ -0,0 +1,71 @@
+// app/api/logs/view/route.ts
+import { NextRequest, NextResponse } from "next/server";
+import fs from "fs/promises";
+import path from "path";
+
+interface LogEntry {
+ timestamp: string;
+ level: string;
+ message: string;
+ metadata?: any;
+}
+
+async function readLogFiles(directory: string): Promise {
+ try {
+ const logPath = path.join(process.cwd(), directory);
+ const files = await fs.readdir(logPath);
+ const logFiles = files.filter((file) => file.endsWith(".log"));
+
+ const allLogs: LogEntry[] = [];
+
+ for (const file of logFiles) {
+ const filePath = path.join(logPath, file);
+ const content = await fs.readFile(filePath, "utf-8");
+
+ // Parse setiap baris log
+ const logs = content
+ .split("\n")
+ .filter(Boolean)
+ .map((line) => {
+ try {
+ return JSON.parse(line);
+ } catch (e) {
+ return null;
+ }
+ })
+ .filter(Boolean);
+
+ allLogs.push(...logs);
+ }
+
+ // Sort berdasarkan timestamp, terbaru di atas
+ return allLogs.sort(
+ (a, b) =>
+ new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()
+ );
+ } catch (error) {
+ console.error("Error reading log files:", error);
+ return [];
+ }
+}
+
+export async function GET(request: NextRequest) {
+ try {
+ // Baca logs dari frontend dan backend
+ const frontendLogs = await readLogFiles("logs/frontend");
+ const backendLogs = await readLogFiles("logs/backend");
+
+ // Gabungkan dan sort semua logs
+ const allLogs = [...frontendLogs, ...backendLogs].sort(
+ (a, b) =>
+ new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()
+ );
+
+ return NextResponse.json({ logs: allLogs });
+ } catch (error) {
+ return NextResponse.json(
+ { error: "Failed to fetch logs" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/map/[id]/portofolio/route.ts b/src/app/api/map/[id]/portofolio/route.ts
new file mode 100644
index 00000000..365a8c35
--- /dev/null
+++ b/src/app/api/map/[id]/portofolio/route.ts
@@ -0,0 +1,53 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+
+export { GET };
+
+async function GET(request: Request, { params }: { params: { id: string } }) {
+ if (request.method !== "GET") {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Method not allowed",
+ },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const { id } = params;
+
+ const data = await prisma.businessMaps.findUnique({
+ where: {
+ portofolioId: id,
+ },
+ include: {
+ Portofolio: {
+ select: {
+ id: true,
+ logoId: true,
+ },
+ },
+ },
+ });
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil mendapatkan data pin map",
+ data: data,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get pin map", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data pin map",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/map/[id]/route.ts b/src/app/api/map/[id]/route.ts
new file mode 100644
index 00000000..98c4c8e8
--- /dev/null
+++ b/src/app/api/map/[id]/route.ts
@@ -0,0 +1,74 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export { POST };
+
+async function POST(request: Request, { params }: { params: { id: string } }) {
+ if (request.method !== "POST") {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Method not allowed",
+ },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const userLoginId = await funGetUserIdByToken();
+ if (!userLoginId) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "User tidak ditemukan",
+ },
+ { status: 401 }
+ );
+ }
+
+ const { id } = params;
+ const { data } = await request.json();
+
+ const created = await prisma.businessMaps.create({
+ data: {
+ latitude: data.latitude,
+ longitude: data.longitude,
+ namePin: data.namePin,
+ imageId: data.imageId,
+ portofolioId: id,
+ authorId: userLoginId,
+ },
+ });
+
+ if (!created) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal membuat pin map",
+ },
+ { status: 400 }
+ );
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil membuat portofolio",
+ data: created,
+ },
+ { status: 201 }
+ );
+ } catch (error) {
+ backendLogger.error("Error create pin map", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal membuat pin map",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/map/foto/[id]/route.ts b/src/app/api/map/foto/[id]/route.ts
index f822b3c6..295160c8 100644
--- a/src/app/api/map/foto/[id]/route.ts
+++ b/src/app/api/map/foto/[id]/route.ts
@@ -1,4 +1,4 @@
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import fs from "fs";
import { NextRequest, NextResponse } from "next/server";
diff --git a/src/app/api/map/pin/[id]/route.ts b/src/app/api/map/pin/[id]/route.ts
index 606cb5d5..f596eeab 100644
--- a/src/app/api/map/pin/[id]/route.ts
+++ b/src/app/api/map/pin/[id]/route.ts
@@ -1,4 +1,4 @@
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import fs from "fs";
import { NextRequest, NextResponse } from "next/server";
diff --git a/src/app/api/master/admin-contact/route.ts b/src/app/api/master/admin-contact/route.ts
new file mode 100644
index 00000000..7c6f4f55
--- /dev/null
+++ b/src/app/api/master/admin-contact/route.ts
@@ -0,0 +1,32 @@
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function GET(request: Request) {
+ try {
+ const data = await prisma.nomorAdmin.findFirst({
+ where: {
+ isActive: true,
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get admin contact",
+ data: data,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get admin contact", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get admin contact",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/master/bank/route.ts b/src/app/api/master/bank/route.ts
new file mode 100644
index 00000000..f681d0f4
--- /dev/null
+++ b/src/app/api/master/bank/route.ts
@@ -0,0 +1,41 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const res = await prisma.masterBank.findMany({
+ orderBy: {
+ updatedAt: "asc",
+ },
+ where: {
+ isActive: true,
+ },
+ });
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: res },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error Get Master Bank >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "API Error Get Data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ } finally {
+ await prisma.$disconnect();
+ }
+}
diff --git a/src/app/api/master/bidang-bisnis/route.ts b/src/app/api/master/bidang-bisnis/route.ts
new file mode 100644
index 00000000..6077760a
--- /dev/null
+++ b/src/app/api/master/bidang-bisnis/route.ts
@@ -0,0 +1,34 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+
+ try {
+ let fixData;
+ fixData = await prisma.masterBidangBisnis.findMany({
+ where: {
+ active: true,
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error Get Master Bidang Bisnis >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "API Error Get Data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/master/emotions/route.ts b/src/app/api/master/emotions/route.ts
new file mode 100644
index 00000000..ad66425a
--- /dev/null
+++ b/src/app/api/master/emotions/route.ts
@@ -0,0 +1,33 @@
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export async function GET(request: Request) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const response = await prisma.masterEmotions.findMany({
+ orderBy: {
+ createdAt: "asc",
+ },
+ where: {
+ isActive: true,
+ },
+ });
+ return NextResponse.json(
+ { success: true, data: response },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error("Error fetching master emotions:", error);
+ return NextResponse.json(
+ { success: false, message: "Failed to fetch master emotions" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/master/status_transaksi/route.ts b/src/app/api/master/status_transaksi/route.ts
new file mode 100644
index 00000000..06840205
--- /dev/null
+++ b/src/app/api/master/status_transaksi/route.ts
@@ -0,0 +1,41 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const res = await prisma.masterStatusTransaksi.findMany({
+ orderBy: {
+ updatedAt: "asc",
+ },
+ where: {
+ isActive: true,
+ },
+ });
+
+ await prisma.$disconnect();
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: res },
+ { status: 200 }
+ );
+ } catch (error) {
+ await prisma.$disconnect();
+ backendLogger.error("Error Get Master Status Transaksi >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "API Error Get Data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/master/sub-bidang-bisnis/[id]/route.ts b/src/app/api/master/sub-bidang-bisnis/[id]/route.ts
new file mode 100644
index 00000000..eb6b92e4
--- /dev/null
+++ b/src/app/api/master/sub-bidang-bisnis/[id]/route.ts
@@ -0,0 +1,40 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ let fixData;
+ const { id } = params;
+
+ fixData = await prisma.masterSubBidangBisnis.findMany({
+ where: {
+ masterBidangBisnisId: id.toString(),
+ isActive: true,
+ },
+ });
+
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error Get Master Sub Bidang Bisnis >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "API Error Get Data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/master/sub-bidang-bisnis/route.ts b/src/app/api/master/sub-bidang-bisnis/route.ts
new file mode 100644
index 00000000..c9cb7aac
--- /dev/null
+++ b/src/app/api/master/sub-bidang-bisnis/route.ts
@@ -0,0 +1,33 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ try {
+ let fixData;
+ fixData = await prisma.masterSubBidangBisnis.findMany({
+ where: {
+ isActive: true,
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error Get Master Sub Bidang Bisnis >>", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "API Error Get Data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/master/tipe-acara/route.ts b/src/app/api/master/tipe-acara/route.ts
new file mode 100644
index 00000000..0aa184ee
--- /dev/null
+++ b/src/app/api/master/tipe-acara/route.ts
@@ -0,0 +1,34 @@
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function GET(request: Request) {
+ try {
+ const data = await prisma.eventMaster_TipeAcara.findMany({
+ orderBy: {
+ id: "asc",
+ },
+ where: {
+ active: true,
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: data,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error("Error Get Master Tipe Acara ", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "API Error Get Data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/middleware/route.ts b/src/app/api/middleware/route.ts
new file mode 100644
index 00000000..631ac799
--- /dev/null
+++ b/src/app/api/middleware/route.ts
@@ -0,0 +1,22 @@
+import { cookies } from "next/headers";
+import "colors";
+import { NextResponse } from "next/server";
+
+export async function GET(req: Request) {
+ // const token = req.headers.get("Authorizationx")?.split(" ")[1];
+ const SESSIONKEY = process.env.NEXT_PUBLIC_BASE_SESSION_KEY!;
+ const tokenCookies = cookies().get(SESSIONKEY)?.value;
+
+ const tokenHeader = req.headers.get("Authorization")?.split(" ")[1];
+
+ if (!tokenCookies) return NextResponse.json({ success: false });
+ return NextResponse.json({ success: true });
+
+ // return new Response(token, {
+ // status: 200,
+ // headers: {
+ // "Content-Type": "application/json",
+ // "Cache-Control": "no-store",
+ // },
+ // });
+}
diff --git a/src/app/api/mobile/user/route.ts b/src/app/api/mobile/user/route.ts
new file mode 100644
index 00000000..79fc8bcd
--- /dev/null
+++ b/src/app/api/mobile/user/route.ts
@@ -0,0 +1,46 @@
+import { decrypt } from "@/app/(auth)/_lib/decrypt";
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ try {
+ const { searchParams } = new URL(request.url);
+ const token = searchParams.get("token");
+
+ const dataUser = await decrypt({
+ token: token!,
+ encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
+ });
+
+ const id = dataUser?.id;
+ const user = await prisma.user.findUnique({
+ where: {
+ id: id as string,
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: user,
+ },
+ {
+ status: 200,
+ }
+ );
+ } catch (error) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message,
+ },
+ {
+ status: 500,
+ }
+ );
+ } finally {
+ await prisma.$disconnect();
+ }
+}
diff --git a/src/app/api/new/donasi/[id]/route.ts b/src/app/api/new/donasi/[id]/route.ts
new file mode 100644
index 00000000..ac15bc6a
--- /dev/null
+++ b/src/app/api/new/donasi/[id]/route.ts
@@ -0,0 +1,81 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+
+// GET ONE DATA DONASI
+export async function GET(request: Request, context: { params: { id: string } }) {
+ try {
+ let dataFix
+ const { id } = context.params
+ const { searchParams } = new URL(request.url)
+ const kategori = searchParams.get("cat")
+
+ if (kategori == "semua") {
+ dataFix = await prisma.donasi.findFirst({
+ where: {
+ id: id
+ },
+ include: {
+ Author: true,
+ imageDonasi: true,
+ CeritaDonasi: true,
+ DonasiMaster_Ketegori: true,
+ DonasiMaster_Durasi: true,
+ DonasiMaster_Status: true,
+ Donasi_Invoice: true,
+ Donasi_Kabar: true,
+ Donasi_PencairanDana: true,
+ },
+ });
+
+ } else if (kategori == "count") {
+ dataFix = await prisma.donasi_Invoice.count({
+ where: {
+ donasiId: id,
+ donasiMaster_StatusInvoiceId: {
+ equals: "1"
+ }
+ }
+ });
+
+ } else {
+ let tampil
+ if (kategori == "author") {
+ tampil = {
+ authorId: true,
+ Author: {
+ select: {
+ username: true
+ }
+ }
+ }
+ } else if (kategori == "cerita") {
+ tampil = {
+ id: true,
+ createdAt: true,
+ CeritaDonasi: {
+ select: {
+ cerita: true
+ }
+ }
+ }
+ }
+
+ dataFix = await prisma.donasi.findFirst({
+ where: {
+ id: id
+ },
+ select: tampil
+ })
+ }
+
+
+ return NextResponse.json({ success: true, message: "Berhasil mendapatkan data", data: dataFix }, { status: 200 });
+
+ }
+ catch (error) {
+ console.error(error);
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti ", reason: (error as Error).message, }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/new/donasi/invoice/route.ts b/src/app/api/new/donasi/invoice/route.ts
new file mode 100644
index 00000000..421487b0
--- /dev/null
+++ b/src/app/api/new/donasi/invoice/route.ts
@@ -0,0 +1,77 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+
+
+
+// GET ALL DATA DONASI SAYA (INVOICE)
+export async function GET(request: Request) {
+ try {
+ const { searchParams } = new URL(request.url)
+ const page = searchParams.get("page")
+ const dataSkip = Number(page) * 5 - 5;
+
+
+ const userLoginId = await funGetUserIdByToken()
+ if (userLoginId == null) {
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, user id tidak ada" }, { status: 500 });
+ }
+
+ const data = await prisma.donasi_Invoice.findMany({
+ take: 5,
+ skip: dataSkip,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ authorId: userLoginId,
+ },
+ select: {
+ id: true,
+ nominal: true,
+ donasiMaster_StatusInvoiceId: true,
+ DonasiMaster_StatusInvoice: {
+ select: {
+ name: true
+ }
+ },
+ Donasi: {
+ select: {
+ id: true,
+ title: true,
+ publishTime: true,
+ progres: true,
+ imageId: true,
+ DonasiMaster_Durasi: {
+ select: {
+ name: true
+ }
+ },
+ },
+ },
+ },
+ });
+
+ const dataFix = data.map((v: any) => ({
+ ..._.omit(v, ["DonasiMaster_StatusInvoice", "Donasi"]),
+ nameStatusInvoice: v.DonasiMaster_StatusInvoice.name,
+ donasiId: v.Donasi.id,
+ title: v.Donasi.title,
+ publishTime: v.Donasi.publishTime,
+ progres: v.Donasi.progres,
+ imageId: v.Donasi.imageId,
+ durasiDonasi: v.Donasi.DonasiMaster_Durasi.name
+ }))
+
+
+ return NextResponse.json({ success: true, message: "Berhasil mendapatkan data", data: dataFix }, { status: 200 });
+
+ }
+ catch (error) {
+ console.error(error);
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti ", reason: (error as Error).message, }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/new/donasi/master/route.ts b/src/app/api/new/donasi/master/route.ts
new file mode 100644
index 00000000..20fe5b24
--- /dev/null
+++ b/src/app/api/new/donasi/master/route.ts
@@ -0,0 +1,33 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+
+// GET ALL DATA MASTER UNTUK DONASI
+export async function GET(request: Request) {
+ try {
+ let dataFix
+ const { searchParams } = new URL(request.url)
+ const kategori = searchParams.get("cat")
+
+ if (kategori == "kategori") {
+ dataFix = await prisma.donasiMaster_Kategori.findMany({
+ orderBy: {
+ createdAt: "asc",
+ },
+ where: {
+ active: true,
+ }
+ })
+ } else if (kategori == "durasi") {
+ dataFix = await prisma.donasiMaster_Durasi.findMany()
+ }
+
+ return NextResponse.json({ success: true, message: "Berhasil mendapatkan data", data: dataFix }, { status: 200 });
+
+ }
+ catch (error) {
+ console.error(error);
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti ", reason: (error as Error).message, }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/new/donasi/route.ts b/src/app/api/new/donasi/route.ts
new file mode 100644
index 00000000..cfbfb540
--- /dev/null
+++ b/src/app/api/new/donasi/route.ts
@@ -0,0 +1,96 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+
+// GET ALL DATA DONASI
+export async function GET(request: Request) {
+ try {
+ let dataFix
+ const { searchParams } = new URL(request.url)
+ const kategori = searchParams.get("cat")
+ const status = searchParams.get("status")
+ const page = searchParams.get("page")
+ const dataSkip = Number(page) * 5 - 5;
+
+ if (kategori == "beranda") {
+ const data = await prisma.donasi.findMany({
+ take: 5,
+ skip: dataSkip,
+ orderBy: {
+ publishTime: "desc",
+ },
+ where: {
+ donasiMaster_StatusDonasiId: "1",
+ active: true,
+ },
+ select: {
+ id: true,
+ imageId: true,
+ title: true,
+ publishTime: true,
+ progres: true,
+ terkumpul: true,
+ DonasiMaster_Durasi: {
+ select: {
+ name: true
+ }
+ },
+
+ }
+ });
+
+ dataFix = data.map((v: any) => ({
+ ..._.omit(v, ["DonasiMaster_Durasi"]),
+ nameDonasiDurasi: v.DonasiMaster_Durasi.name
+ }))
+ } else if (kategori == "galang-dana") {
+ const userLoginId = await funGetUserIdByToken()
+ if (userLoginId == null) {
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, user id tidak ada" }, { status: 500 });
+ }
+
+ const data = await prisma.donasi.findMany({
+ take: 5,
+ skip: dataSkip,
+ where: {
+ authorId: userLoginId,
+ donasiMaster_StatusDonasiId: status,
+ active: true,
+ },
+ select: {
+ id: true,
+ title: true,
+ imagesId: true,
+ target: true,
+ progres: true,
+ publishTime: true,
+ DonasiMaster_Durasi: {
+ select: {
+ name: true
+ }
+ },
+ terkumpul: true,
+ imageId: true,
+ },
+ orderBy: {
+ updatedAt: "desc",
+ },
+ });
+
+ dataFix = data.map((v: any) => ({
+ ..._.omit(v, ["DonasiMaster_Durasi"]),
+ nameDonasiDurasi: v.DonasiMaster_Durasi.name
+ }))
+ }
+
+ return NextResponse.json({ success: true, message: "Berhasil mendapatkan data", data: dataFix }, { status: 200 });
+
+ }
+ catch (error) {
+ console.error(error);
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti ", reason: (error as Error).message, }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/new/forum/route.ts b/src/app/api/new/forum/route.ts
new file mode 100644
index 00000000..c8af9dc2
--- /dev/null
+++ b/src/app/api/new/forum/route.ts
@@ -0,0 +1,67 @@
+import { prisma } from "@/lib"
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+// GET ALL DATA PORTOFOLIO BY PROFILE ID
+export async function GET(request: Request) {
+ try {
+ const { searchParams } = new URL(request.url)
+ const page = searchParams.get("page")
+ const search = searchParams.get("search")
+ const dataSkip = Number(page) * 5 - 5;
+
+ const data = await prisma.forum_Posting.findMany({
+ take: 5,
+ skip: dataSkip,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ isActive: true,
+ diskusi: {
+ mode: "insensitive",
+ contains: (search == undefined || search == "null") ? "" : search,
+ },
+ },
+ select: {
+ id: true,
+ diskusi: true,
+ createdAt: true,
+ isActive: true,
+ authorId: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ imageId: true,
+ },
+ },
+ },
+ },
+ Forum_Komentar: {
+ where: {
+ isActive: true,
+ },
+ },
+ ForumMaster_StatusPosting: {
+ select: {
+ id: true,
+ status: true,
+ },
+ },
+ forumMaster_StatusPostingId: true,
+ },
+ });
+
+ return NextResponse.json({ success: true, message: "Berhasil mendapatkan data", data }, { status: 200 });
+
+ }
+ catch (error) {
+ console.error(error);
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti ", reason: (error as Error).message, }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/new/home/route.ts b/src/app/api/new/home/route.ts
new file mode 100644
index 00000000..640d45ef
--- /dev/null
+++ b/src/app/api/new/home/route.ts
@@ -0,0 +1,84 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+// GET DATA HOME
+export async function GET(request: Request) {
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const kategori = searchParams.get("cat");
+
+ const userLoginId = await funGetUserIdByToken();
+ if (userLoginId == null) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data, user id tidak ada",
+ },
+ { status: 500 }
+ );
+ }
+
+ if (kategori == "job") {
+ fixData = await prisma.job.findMany({
+ take: 2,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ isActive: true,
+ masterStatusId: "1",
+ },
+ select: {
+ id: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ },
+ },
+ title: true,
+ deskripsi: true,
+ },
+ });
+ } else if (kategori == "cek_profile") {
+ const data = await prisma.user.findUnique({
+ where: {
+ id: userLoginId,
+ },
+ include: {
+ Profile: {
+ select: {
+ id: true,
+ imageId: true,
+ },
+ },
+ },
+ });
+
+ fixData = {
+ profile: data?.Profile?.id,
+ imageId: data?.Profile?.imageId,
+ };
+ }
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error(error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data, coba lagi nanti ",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ } finally {
+ await prisma.$disconnect();
+ }
+}
diff --git a/src/app/api/new/investasi/[id]/route.ts b/src/app/api/new/investasi/[id]/route.ts
new file mode 100644
index 00000000..1c83c6a7
--- /dev/null
+++ b/src/app/api/new/investasi/[id]/route.ts
@@ -0,0 +1,49 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+// GET ONE DATA INVESTASI BY ID
+export async function GET(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ try {
+ const { id } = context.params;
+ const data = await prisma.investasi.findUnique({
+ where: {
+ id: id,
+ },
+ include: {
+ author: {
+ include: {
+ Profile: true,
+ },
+ },
+ Investasi_Invoice: true,
+ MasterStatusInvestasi: true,
+ BeritaInvestasi: true,
+ DokumenInvestasi: true,
+ ProspektusInvestasi: true,
+ MasterPembagianDeviden: true,
+ MasterPencarianInvestor: true,
+ MasterPeriodeDeviden: true,
+ MasterProgresInvestasi: true,
+ },
+ });
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error(error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data, coba lagi nanti ",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/new/investasi/berita/[id]/route.ts b/src/app/api/new/investasi/berita/[id]/route.ts
new file mode 100644
index 00000000..7c0f27ed
--- /dev/null
+++ b/src/app/api/new/investasi/berita/[id]/route.ts
@@ -0,0 +1,70 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ // if (request.method === "GET") {
+ // return NextResponse.json(
+ // { success: false, message: "Method not allowed" },
+ // { status: 405 }
+ // );
+ // }
+
+ try {
+ let fixData;
+ const { id } = context.params;
+ const { searchParams } = new URL(request.url);
+ const kategori: string | null = searchParams.get("kategori");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ if (!kategori) {
+ fixData = await prisma.beritaInvestasi.findFirst({
+ where: {
+ id: id,
+ },
+ include: {
+ investasi: {
+ select: {
+ authorId: true,
+ },
+ },
+ },
+ });
+ } else if (kategori == "get-all") {
+ fixData = await prisma.beritaInvestasi.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ investasiId: id,
+ active: true,
+ },
+ });
+ }
+
+ await prisma.$disconnect();
+
+ return NextResponse.json(
+ { success: true, message: "Success get data news", data: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ await prisma.$disconnect();
+ backendLogger.error("Error get data news", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed to get data, try again later",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/new/investasi/dokumen/[id]/route.ts b/src/app/api/new/investasi/dokumen/[id]/route.ts
new file mode 100644
index 00000000..b4146075
--- /dev/null
+++ b/src/app/api/new/investasi/dokumen/[id]/route.ts
@@ -0,0 +1,61 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ if (request.method === "GET") {
+ try {
+ let fixData;
+ const { id } = context.params;
+ const { searchParams } = new URL(request.url);
+ const kategori = searchParams.get("kategori");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ if (kategori == null) {
+ fixData = await prisma.dokumenInvestasi.findFirst({
+ where: {
+ id: id,
+ },
+ });
+ } else if (kategori == "get-all") {
+ fixData = await prisma.dokumenInvestasi.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ investasiId: id,
+ active: true,
+ },
+ });
+ }
+
+ await prisma.$disconnect();
+
+ return NextResponse.json(
+ { success: true, message: "Success get data document", data: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data document", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Failed to get data, try again later",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+ }
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+}
diff --git a/src/app/api/new/investasi/invoice/route.ts b/src/app/api/new/investasi/invoice/route.ts
new file mode 100644
index 00000000..3af318a1
--- /dev/null
+++ b/src/app/api/new/investasi/invoice/route.ts
@@ -0,0 +1,99 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+
+
+// GET ALL DATA INVESTASI SAYA (INVOICE)
+export async function GET(request: Request) {
+ try {
+ let dataFix
+ const { searchParams } = new URL(request.url)
+ const page = searchParams.get("page")
+ const dataSkip = Number(page) * 10 - 10;
+ const kategori = searchParams.get("cat")
+
+
+ const userLoginId = await funGetUserIdByToken()
+ if (userLoginId == null) {
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, user id tidak ada" }, { status: 500 });
+ }
+
+ if (kategori == "saham-saya") {
+ const data = await prisma.investasi_Invoice.findMany({
+ take: 10,
+ skip: dataSkip,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ authorId: userLoginId,
+ statusInvoiceId: "1",
+ isActive: true,
+ },
+ select: {
+ id: true,
+ nominal: true,
+ lembarTerbeli: true,
+ Investasi: {
+ select: {
+ title: true,
+ progress: true
+ }
+ }
+ }
+ });
+
+ dataFix = data.map((v: any) => ({
+ ..._.omit(v, ["Investasi"]),
+ title: v.Investasi.title,
+ progress: v.Investasi.progress
+ }))
+
+ } else if (kategori == "transaksi") {
+ const data = await prisma.investasi_Invoice.findMany({
+ take: 10,
+ skip: dataSkip,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ authorId: userLoginId,
+ },
+ select: {
+ id: true,
+ statusInvoiceId: true,
+ nominal: true,
+ createdAt: true,
+ StatusInvoice: {
+ select: {
+ name: true
+ }
+ },
+ Investasi: {
+ select: {
+ title: true
+ }
+ }
+ }
+ });
+
+
+ dataFix = data.map((v: any) => ({
+ ..._.omit(v, ["Investasi", "StatusInvoice"]),
+ title: v.Investasi.title,
+ statusInvoice: v.StatusInvoice.name
+ }))
+ }
+
+
+ return NextResponse.json({ success: true, message: "Berhasil mendapatkan data", data: dataFix }, { status: 200 });
+
+ }
+ catch (error) {
+ console.error(error);
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti ", reason: (error as Error).message, }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/new/investasi/master/route.ts b/src/app/api/new/investasi/master/route.ts
new file mode 100644
index 00000000..841de0f4
--- /dev/null
+++ b/src/app/api/new/investasi/master/route.ts
@@ -0,0 +1,46 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+
+// GET ALL DATA MASTER UNTUK INVESTASI
+export async function GET(request: Request) {
+ try {
+ let dataFix
+ const { searchParams } = new URL(request.url)
+ const kategori = searchParams.get("cat")
+
+ if (kategori == "pencarian-investor") {
+ dataFix = await await prisma.masterPencarianInvestor.findMany({
+ select: {
+ id: true,
+ name: true,
+ active: true,
+ },
+ });
+ } else if (kategori == "periode-deviden") {
+ dataFix = await prisma.masterPeriodeDeviden.findMany({
+ select: {
+ id: true,
+ name: true,
+ active: true,
+ },
+ });
+ } else if (kategori == "pembagian-deviden") {
+ dataFix = await prisma.masterPembagianDeviden.findMany({
+ select: {
+ id: true,
+ name: true,
+ active: true,
+ },
+ });
+ }
+
+ return NextResponse.json({ success: true, message: "Berhasil mendapatkan data", data: dataFix }, { status: 200 });
+
+ }
+ catch (error) {
+ console.error(error);
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti ", reason: (error as Error).message, }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/new/investasi/route.ts b/src/app/api/new/investasi/route.ts
new file mode 100644
index 00000000..13b7a818
--- /dev/null
+++ b/src/app/api/new/investasi/route.ts
@@ -0,0 +1,145 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import _ from "lodash";
+import moment from "moment";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+
+// GET ALL DATA INVESTASI
+export async function GET(request: Request) {
+ try {
+ let dataFix
+ const { searchParams } = new URL(request.url)
+ const kategori = searchParams.get("cat")
+ const status = searchParams.get("status")
+ const page = searchParams.get("page")
+ const dataTake = 10
+ const dataSkip = Number(page) * dataTake - dataTake;
+
+ if (kategori == "bursa") {
+ const data = await prisma.investasi.findMany({
+ where: {
+ masterStatusInvestasiId: "1",
+ masterProgresInvestasiId: "1",
+ },
+ select: {
+ id: true,
+ MasterPencarianInvestor: true,
+ countDown: true,
+ progress: true,
+ },
+ });
+
+ for (let a of data) {
+ if (
+ (a.MasterPencarianInvestor?.name as any) -
+ moment(new Date()).diff(new Date(a.countDown as any), "days") <=
+ 0
+ ) {
+ await prisma.investasi.update({
+ where: {
+ id: a.id,
+ },
+ data: {
+ masterProgresInvestasiId: "3",
+ },
+ });
+ }
+
+ if (a.progress === "100") {
+ await prisma.investasi.update({
+ where: {
+ id: a.id,
+ },
+ data: {
+ masterProgresInvestasiId: "2",
+ },
+ });
+ }
+ }
+
+ // cek data yang lewat
+ // klo ada, update status
+ const dataAwal = await prisma.investasi.findMany({
+ take: dataTake,
+ skip: dataSkip,
+ orderBy: [
+ {
+ masterProgresInvestasiId: "asc",
+ },
+ {
+ countDown: "desc",
+ },
+ ],
+ where: {
+ masterStatusInvestasiId: "1",
+ },
+ select: {
+ id: true,
+ imageId: true,
+ title: true,
+ progress: true,
+ countDown: true,
+ MasterPencarianInvestor: {
+ select: {
+ name: true
+ }
+ }
+ }
+ });
+
+ dataFix = dataAwal.map((v: any) => ({
+ ..._.omit(v, ["MasterPencarianInvestor"]),
+ pencarianInvestor: v.MasterPencarianInvestor.name
+ }))
+
+ } else if (kategori == "portofolio") {
+ const userLoginId = await funGetUserIdByToken()
+ if (userLoginId == null) {
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, user id tidak ada" }, { status: 500 });
+ }
+
+ const data = await prisma.investasi.findMany({
+ take: dataTake,
+ skip: dataSkip,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ authorId: userLoginId,
+ masterStatusInvestasiId: status,
+ },
+ select: {
+ id: true,
+ title: true,
+ targetDana: true,
+ imageId: true,
+ countDown: true,
+ updatedAt: true,
+ MasterPencarianInvestor: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ });
+
+ dataFix = data.map((v: any) => ({
+ ..._.omit(v, ["MasterPencarianInvestor"]),
+ pencarianInvestor: v.MasterPencarianInvestor.name
+ }))
+
+
+ }
+
+
+
+ return NextResponse.json({ success: true, message: "Berhasil mendapatkan data", data: dataFix }, { status: 200 });
+
+ }
+ catch (error) {
+ console.error(error);
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti ", reason: (error as Error).message, }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/new/map/[id]/route.ts b/src/app/api/new/map/[id]/route.ts
new file mode 100644
index 00000000..f5d80770
--- /dev/null
+++ b/src/app/api/new/map/[id]/route.ts
@@ -0,0 +1,76 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+export async function GET(request: Request, context: { params: { id: string } }) {
+ try {
+ const { id } = context.params
+ const data = await prisma.businessMaps.findUnique({
+ where: {
+ id: id,
+ },
+ select: {
+ namePin: true,
+ latitude: true,
+ longitude: true,
+ pinId: true,
+ imageId: true,
+ Author: {
+ select: {
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ imageId: true,
+ }
+ }
+ }
+ },
+ Portofolio: {
+ select: {
+ id: true,
+ alamatKantor: true,
+ tlpn: true,
+ deskripsi: true,
+ namaBisnis: true,
+ MasterBidangBisnis: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ }
+ });
+
+ const dataLokasi = {
+ namePin: data?.namePin,
+ latitude: data?.latitude,
+ longitude: data?.longitude,
+ pinId: data?.pinId,
+ imageId: data?.imageId,
+ }
+
+ const dataAuthor = {
+ id: data?.Author?.Profile?.id,
+ name: data?.Author?.Profile?.name,
+ imageId: data?.Author?.Profile?.imageId,
+ }
+
+ const dataBisnis = {
+ id: data?.Portofolio?.id,
+ alamatKantor: data?.Portofolio?.alamatKantor,
+ tlpn: data?.Portofolio?.tlpn,
+ deskripsi: data?.Portofolio?.deskripsi,
+ namaBisnis: data?.Portofolio?.namaBisnis,
+ bidangBisnis: data?.Portofolio?.MasterBidangBisnis?.name,
+ }
+
+ return NextResponse.json({ success: true, message: "Berhasil mendapatkan data", dataLokasi, dataAuthor, dataBisnis }, { status: 200 });
+
+ }
+ catch (error) {
+ console.error(error);
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti ", reason: (error as Error).message, }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/new/map/route.ts b/src/app/api/new/map/route.ts
new file mode 100644
index 00000000..61805cbf
--- /dev/null
+++ b/src/app/api/new/map/route.ts
@@ -0,0 +1,52 @@
+import { prisma } from "@/lib";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+// GET ALL DATA MAP
+export async function GET(request: Request) {
+ try {
+ const data = await prisma.businessMaps.findMany({
+ where: {
+ isActive: true,
+ Portofolio: {
+ NOT: {
+ logoId: null,
+ },
+ },
+ },
+ select: {
+ id: true,
+ namePin: true,
+ latitude: true,
+ longitude: true,
+ pinId: true,
+ Portofolio: {
+ select: {
+ logoId: true,
+ },
+ },
+ },
+ });
+
+ const dataFix = data.map((v: any) => ({
+ ..._.omit(v, ["Portofolio"]),
+ logoId: v.Portofolio.logoId,
+ }));
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: dataFix },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error(error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data, coba lagi nanti ",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/new/portofolio/[id]/route.ts b/src/app/api/new/portofolio/[id]/route.ts
new file mode 100644
index 00000000..4e6900ca
--- /dev/null
+++ b/src/app/api/new/portofolio/[id]/route.ts
@@ -0,0 +1,241 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+// GET ONE DATA PORTOFOLIO BY ID PORTOFOLIO
+export async function GET(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ try {
+ let dataFix;
+ const { id } = context.params;
+ const { searchParams } = new URL(request.url);
+ const kategori = searchParams.get("cat");
+
+ if (kategori == "bisnis") {
+ const data = await prisma.portofolio.findUnique({
+ where: {
+ id: id,
+ },
+ select: {
+ id_Portofolio: true,
+ namaBisnis: true,
+ alamatKantor: true,
+ tlpn: true,
+ deskripsi: true,
+ logoId: true,
+ MasterBidangBisnis: {
+ select: {
+ name: true,
+ },
+ },
+ Profile: {
+ select: {
+ userId: true,
+ },
+ },
+ Portofolio_BidangDanSubBidangBisnis: {
+ select: {
+ MasterSubBidangBisnis: {
+ select: {
+ name: true,
+ },
+ },
+ },
+ },
+ },
+ });
+
+ dataFix = {
+ id_Portofolio: data?.id_Portofolio,
+ namaBisnis: data?.namaBisnis,
+ alamatKantor: data?.alamatKantor,
+ tlpn: data?.tlpn,
+ deskripsi: data?.deskripsi,
+ logoId: data?.logoId,
+ bidangBisnis: data?.MasterBidangBisnis?.name,
+ subBidangBisnis: data?.Portofolio_BidangDanSubBidangBisnis?.map((item) => item.MasterSubBidangBisnis?.name),
+ authorId: data?.Profile?.userId,
+ };
+ } else if (kategori == "lokasi") {
+ const data = await prisma.portofolio.findUnique({
+ where: {
+ id: id,
+ },
+ select: {
+ logoId: true,
+ BusinessMaps: {
+ select: {
+ id: true,
+ namePin: true,
+ latitude: true,
+ longitude: true,
+ imageId: true,
+ pinId: true,
+ },
+ },
+ },
+ });
+
+ dataFix = {
+ mapId: data?.BusinessMaps?.id,
+ logoId: data?.logoId,
+ namePin: data?.BusinessMaps?.namePin,
+ latitude: data?.BusinessMaps?.latitude,
+ longitude: data?.BusinessMaps?.longitude,
+ imageId: data?.BusinessMaps?.imageId,
+ pinId: data?.BusinessMaps?.pinId,
+ };
+ } else if (kategori == "sosmed") {
+ const data = await prisma.portofolio.findUnique({
+ where: {
+ id: id,
+ },
+ select: {
+ Portofolio_MediaSosial: {
+ select: {
+ facebook: true,
+ twitter: true,
+ instagram: true,
+ tiktok: true,
+ youtube: true,
+ },
+ },
+ },
+ });
+
+ dataFix = {
+ facebook: data?.Portofolio_MediaSosial?.facebook,
+ twitter: data?.Portofolio_MediaSosial?.twitter,
+ instagram: data?.Portofolio_MediaSosial?.instagram,
+ tiktok: data?.Portofolio_MediaSosial?.tiktok,
+ youtube: data?.Portofolio_MediaSosial?.youtube,
+ };
+ }
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: dataFix },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error(error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data, coba lagi nanti (error: 500)",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
+
+// DELETE ONE DATA PORTOFOLIO
+export async function DELETE(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ try {
+ const { id } = context.params;
+
+ const data = await prisma.portofolio.findUnique({
+ where: {
+ id: id,
+ },
+ include: {
+ BusinessMaps: {
+ select: {
+ pinId: true,
+ imageId: true,
+ },
+ },
+ },
+ });
+
+ try {
+ const id = data?.logoId;
+ const deleteLogo = await fetch(
+ `https://wibu-storage.wibudev.com/api/files/${id}/delete`,
+ {
+ method: "DELETE",
+ headers: {
+ Authorization: `Bearer ${process.env.WS_APIKEY}`,
+ },
+ }
+ );
+
+ if (deleteLogo.ok) {
+ backendLogger.info(`Success delete logo`);
+ }
+
+ if (data?.BusinessMaps?.pinId != null) {
+ const pinId = data?.BusinessMaps?.pinId;
+ const deletePin = await fetch(
+ `https://wibu-storage.wibudev.com/api/files/${pinId}/delete`,
+ {
+ method: "DELETE",
+ headers: {
+ Authorization: `Bearer ${process.env.WS_APIKEY}`,
+ },
+ }
+ );
+
+ if (deletePin.ok) {
+ backendLogger.info(`Success delete pin`);
+ }
+
+ const imageId = data?.BusinessMaps?.imageId;
+ const deleteImage = await fetch(
+ `https://wibu-storage.wibudev.com/api/files/${imageId}/delete`,
+ {
+ method: "DELETE",
+ headers: {
+ Authorization: `Bearer ${process.env.WS_APIKEY}`,
+ },
+ }
+ );
+
+ if (deleteImage.ok) {
+ backendLogger.info(`Success delete image`);
+ }
+ }
+ } catch (error) {
+ backendLogger.error("Error delete logo", error);
+ }
+
+ const deletePortoMedsos = await prisma.portofolio_MediaSosial.delete({
+ where: {
+ portofolioId: id,
+ },
+ });
+
+ const deleteMap = await prisma.businessMaps.delete({
+ where: {
+ portofolioId: id,
+ },
+ });
+
+ const deletePortofolio = await prisma.portofolio.delete({
+ where: {
+ id: id,
+ },
+ });
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil menghapus data" },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error(error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal menghapus data, coba lagi nanti (error: 500)",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/new/portofolio/route.ts b/src/app/api/new/portofolio/route.ts
new file mode 100644
index 00000000..3a38b5a9
--- /dev/null
+++ b/src/app/api/new/portofolio/route.ts
@@ -0,0 +1,60 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+
+// GET ALL DATA PORTOFOLIO BY PROFILE ID
+export async function GET(request: Request) {
+ try {
+ let fixData
+ const { searchParams } = new URL(request.url)
+ const profile = searchParams.get("profile")
+ const kategori_halaman = searchParams.get("cat")
+ const page = searchParams.get("page")
+ const dataSkip = Number(page) * 10 - 10;
+
+ if (kategori_halaman == "profile") {
+ fixData = await prisma.portofolio.findMany({
+ take: 2,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ profileId: profile,
+ active: true,
+ },
+ select: {
+ id: true,
+ id_Portofolio: true,
+ namaBisnis: true,
+ profileId: true,
+ },
+ });
+ } else if (kategori_halaman == "portofolio") {
+ fixData = await prisma.portofolio.findMany({
+ skip: dataSkip,
+ take: 10,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ profileId: profile,
+ active: true,
+ },
+ select: {
+ id: true,
+ id_Portofolio: true,
+ namaBisnis: true,
+ profileId: true,
+ },
+ });
+ }
+
+ return NextResponse.json({ success: true, message: "Berhasil mendapatkan data", data: fixData }, { status: 200 });
+
+ }
+ catch (error) {
+ console.error(error);
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti ", reason: (error as Error).message, }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/new/user/route.ts b/src/app/api/new/user/route.ts
new file mode 100644
index 00000000..198c0071
--- /dev/null
+++ b/src/app/api/new/user/route.ts
@@ -0,0 +1,59 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+
+// GET ONE DATA USER PROFILE BY PROFILE ID
+export async function GET(request: Request) {
+ try {
+ const { searchParams } = new URL(request.url)
+ const profile = searchParams.get("profile")
+
+ const data = await prisma.profile.findUnique({
+ where: {
+ id: String(profile),
+ },
+ select: {
+ id: true,
+ name: true,
+ email: true,
+ alamat: true,
+ jenisKelamin: true,
+ imageId: true,
+ imageBackgroundId: true,
+ userId: true,
+ User: {
+ select: {
+ username: true,
+ nomor: true,
+ active: true,
+ masterUserRoleId: true
+ }
+ }
+ }
+ });
+
+ const dataFix = {
+ id: data?.userId,
+ username: data?.User?.username,
+ nomor: data?.User?.nomor,
+ active: data?.User?.active,
+ masterUserRoleId: data?.User?.masterUserRoleId,
+ idProfile: data?.id,
+ name: data?.name,
+ email: data?.email,
+ alamat: data?.alamat,
+ jenisKelamin: data?.jenisKelamin,
+ imageId: data?.imageId,
+ imageBackgroundId: data?.imageBackgroundId
+
+ }
+
+ return NextResponse.json({ success: true, message: "Berhasil mendapatkan data", data: dataFix, }, { status: 200 });
+
+ }
+ catch (error) {
+ console.error(error);
+ return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti ", reason: (error as Error).message, }, { status: 500 });
+ }
+}
\ No newline at end of file
diff --git a/src/app/api/not-user/job/[id]/route.ts b/src/app/api/not-user/job/[id]/route.ts
new file mode 100644
index 00000000..757fa07c
--- /dev/null
+++ b/src/app/api/not-user/job/[id]/route.ts
@@ -0,0 +1,25 @@
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+
+ const data = await prisma.job.findUnique({
+ where: {
+ id: id,
+ },
+ });
+
+ return NextResponse.json(data);
+ } catch (error) {
+ console.error("Error fetching job data:", error);
+ return NextResponse.json(
+ { error: "Failed to fetch job data" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/notifications/to-admin/route.ts b/src/app/api/notifications/to-admin/route.ts
new file mode 100644
index 00000000..bd1e921f
--- /dev/null
+++ b/src/app/api/notifications/to-admin/route.ts
@@ -0,0 +1,72 @@
+import { NextResponse } from "next/server";
+import {prisma} from "@/lib"
+
+interface NotificationData {
+ userId: string;
+ appId: string;
+ status: string;
+ title: string;
+ pesan: string;
+ kategoriApp: string;
+}
+
+export async function POST(request: Request) {
+ try {
+ const { data }: { data: NotificationData } = await request.json();
+
+ // Validasi input
+ if (!data || !data.userId || !data.title || !data.pesan) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Missing required fields",
+ },
+ { status: 400 }
+ );
+ }
+
+ // Ambil semua admin aktif
+ const getAdmin = await prisma.user.findMany({
+ where: {
+ active: true,
+ masterUserRoleId: "2",
+ },
+ });
+
+ // Buat notifikasi untuk semua admin secara paralel
+ const createPromises = getAdmin.map((a) =>
+ prisma.notifikasi.create({
+ data: {
+ adminId: a.id,
+ userId: data.userId,
+ appId: data.appId,
+ status: data.status,
+ title: data.title,
+ pesan: data.pesan,
+ kategoriApp: data.kategoriApp,
+ userRoleId: "2",
+ },
+ })
+ );
+
+ await Promise.all(createPromises);
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Successfully created notifications for admins",
+ },
+ { status: 201 }
+ );
+ } catch (error) {
+ console.error("Error creating notification for admin:", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error creating notification for admin",
+ error: (error as Error).message || "Unknown error",
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/notifikasi/count/route.ts b/src/app/api/notifikasi/count/route.ts
new file mode 100644
index 00000000..1a3763d1
--- /dev/null
+++ b/src/app/api/notifikasi/count/route.ts
@@ -0,0 +1,28 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(request: Request) {
+ try {
+ const userLoginId = await funGetUserIdByToken();
+
+ const count = await prisma.notifikasi.findMany({
+ where: {
+ userId: userLoginId,
+ isRead: false,
+ userRoleId: "1",
+ },
+ });
+
+ return NextResponse.json({ success: true, data: count.length });
+ } catch (error) {
+ backendLogger.error("Gagal mendapatkan data count notifikasi", error);
+ return NextResponse.json(
+ { success: false, message: "Gagal mendapatkan data" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/notifikasi/donasi/transaksi/[id]/route.ts b/src/app/api/notifikasi/donasi/transaksi/[id]/route.ts
new file mode 100644
index 00000000..925aded2
--- /dev/null
+++ b/src/app/api/notifikasi/donasi/transaksi/[id]/route.ts
@@ -0,0 +1,39 @@
+import { prisma } from "@/lib";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+
+ const data = await prisma.donasi_Invoice.findUnique({
+ where: {
+ id: id,
+ },
+ select: {
+ // DonasiMaster_Status: true,
+ DonasiMaster_StatusInvoice: true,
+ },
+ });
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil di check transaksis donasi",
+ statusTransaksi: _.lowerCase(data?.DonasiMaster_StatusInvoice?.name),
+ });
+ } catch (error) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal di check transaksis donasi",
+ reason: (error as Error).message,
+ },
+ {
+ status: 500,
+ }
+ );
+ }
+}
diff --git a/src/app/api/notifikasi/get-all-by-category/route.ts b/src/app/api/notifikasi/get-all-by-category/route.ts
new file mode 100644
index 00000000..5f770fc0
--- /dev/null
+++ b/src/app/api/notifikasi/get-all-by-category/route.ts
@@ -0,0 +1,65 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import { ICategoryapp } from "@/app_modules/notifikasi/model/interface";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+export async function GET(request: Request) {
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const category = searchParams.get("category") as ICategoryapp;
+ const page = searchParams.get("page");
+
+ const userLoginId = await funGetUserIdByToken();
+ const fixPage = _.toNumber(page);
+ const takeData = 10;
+ const skipData = fixPage * takeData - takeData;
+
+ if (category === "Semua") {
+ fixData = await prisma.notifikasi.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: [
+ {
+ isRead: "asc",
+ },
+ { createdAt: "desc" },
+ ],
+ where: {
+ userId: userLoginId,
+ userRoleId: "1",
+ },
+ });
+ } else {
+ fixData = await prisma.notifikasi.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: [
+ {
+ isRead: "asc",
+ },
+ { createdAt: "desc" },
+ ],
+ where: {
+ userId: userLoginId,
+ userRoleId: "1",
+ kategoriApp: _.upperCase(category),
+ },
+ });
+ }
+
+ return NextResponse.json(
+ { success: true, data: fixData, message: "Berhasil mendapatkan data" },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data notifikasi: " + error);
+ return NextResponse.json(
+ { success: false, message: "Gagal mendapatkan data" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/notifikasi/kategori/[name]/route.ts b/src/app/api/notifikasi/kategori/[name]/route.ts
new file mode 100644
index 00000000..e0c20d2d
--- /dev/null
+++ b/src/app/api/notifikasi/kategori/[name]/route.ts
@@ -0,0 +1,89 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import { ICategoryapp } from "@/app_modules/notifikasi/model/interface";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { name: string } }
+) {
+ try {
+ let fixData;
+ const { name } = params;
+ const { searchParams } = new URL(request.url);
+ const page = searchParams.get("page");
+
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ const userLoginId = await funGetUserIdByToken();
+ if (!userLoginId)
+ return NextResponse.json(
+ { success: false, message: "User not found" },
+ { status: 404 }
+ );
+
+ if (!page) {
+ fixData = await prisma.notifikasi.findMany({
+ orderBy: [
+ {
+ isRead: "asc",
+ },
+ { createdAt: "desc" },
+ ],
+ where: {
+ userId: userLoginId,
+ userRoleId: "1",
+ },
+ });
+ } else {
+ const fixNameKategori = _.startCase(name);
+ if (fixNameKategori === "Semua") {
+ fixData = await prisma.notifikasi.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: [
+ {
+ isRead: "asc",
+ },
+ { createdAt: "desc" },
+ ],
+ where: {
+ userId: userLoginId,
+ userRoleId: "1",
+ },
+ });
+ } else {
+ fixData = await prisma.notifikasi.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: [
+ {
+ isRead: "asc",
+ },
+ { createdAt: "desc" },
+ ],
+ where: {
+ userId: userLoginId,
+ userRoleId: "1",
+ kategoriApp: _.upperCase(name),
+ },
+ });
+ }
+ }
+
+ return NextResponse.json(
+ { success: true, data: fixData, message: "Berhasil mendapatkan data" },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data notifikasi: " + error);
+ return NextResponse.json(
+ { success: false, message: "Gagal mendapatkan data" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/notifikasi/kategori/route.ts b/src/app/api/notifikasi/kategori/route.ts
new file mode 100644
index 00000000..097601e1
--- /dev/null
+++ b/src/app/api/notifikasi/kategori/route.ts
@@ -0,0 +1,88 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import { ICategoryapp } from "@/app_modules/notifikasi/model/interface";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+export async function GET(
+ request: Request,
+) {
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const category = searchParams.get("category") as ICategoryapp;
+ const page = searchParams.get("page");
+
+ const takeData = 10;
+ const skipData = Number(page) * takeData - takeData;
+
+ const userLoginId = await funGetUserIdByToken();
+ if (!userLoginId)
+ return NextResponse.json(
+ { success: false, message: "User not found" },
+ { status: 404 }
+ );
+
+ if (!page) {
+ fixData = await prisma.notifikasi.findMany({
+ orderBy: [
+ {
+ isRead: "asc",
+ },
+ { createdAt: "desc" },
+ ],
+ where: {
+ userId: userLoginId,
+ userRoleId: "1",
+ },
+ });
+ } else {
+ const fixNameKategori = _.startCase(category);
+ if (fixNameKategori === "Semua") {
+ fixData = await prisma.notifikasi.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: [
+ {
+ isRead: "asc",
+ },
+ { createdAt: "desc" },
+ ],
+ where: {
+ userId: userLoginId,
+ userRoleId: "1",
+ },
+ });
+ } else {
+ fixData = await prisma.notifikasi.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: [
+ {
+ isRead: "asc",
+ },
+ { createdAt: "desc" },
+ ],
+ where: {
+ userId: userLoginId,
+ userRoleId: "1",
+ kategoriApp: _.upperCase(category),
+ },
+ });
+ }
+ }
+
+ return NextResponse.json(
+ { success: true, data: fixData, message: "Berhasil mendapatkan data" },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data notifikasi: " + error);
+ return NextResponse.json(
+ { success: false, message: "Gagal mendapatkan data" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/notifikasi/master/route.ts b/src/app/api/notifikasi/master/route.ts
new file mode 100644
index 00000000..7d51056f
--- /dev/null
+++ b/src/app/api/notifikasi/master/route.ts
@@ -0,0 +1,35 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(request: Request) {
+ try {
+ const data = await prisma.masterKategoriApp.findMany({
+ where: {
+ isActive: true,
+ },
+ });
+
+ data.unshift({
+ id: "0",
+ isActive: true,
+ createdAt: new Date(),
+ updatedAt: new Date(),
+ name: "Semua",
+ value: null,
+ });
+
+ return NextResponse.json(
+ { success: true, data, message: "Berhasil mendapatkan data" },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Master Notifikasi:", error);
+ return NextResponse.json(
+ { success: false, message: "Gagal mendapatkan data" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/origin-url/route.ts b/src/app/api/origin-url/route.ts
new file mode 100644
index 00000000..9b5e2eb8
--- /dev/null
+++ b/src/app/api/origin-url/route.ts
@@ -0,0 +1,6 @@
+import { NextResponse } from "next/server";
+export async function GET(req: Request) {
+ const origin = new URL(req.url).origin;
+
+ return NextResponse.json({ success: true, origin });
+}
diff --git a/src/app/api/pdf-to-image/route.ts b/src/app/api/pdf-to-image/route.ts
new file mode 100644
index 00000000..26274157
--- /dev/null
+++ b/src/app/api/pdf-to-image/route.ts
@@ -0,0 +1,283 @@
+// // app/api/pdf-to-image/route.ts
+import { execSync } from 'child_process';
+import { NextResponse } from 'next/server';
+import { PDFDocument } from 'pdf-lib';
+import { fromBuffer } from 'pdf2pic';
+
+// // Tambahkan custom error
+// class PDFConversionError extends Error {
+// constructor(message: string, public statusCode: number = 500) {
+// super(message);
+// this.name = 'PDFConversionError';
+// }
+// }
+
+// // Improve fungsi check dependencies
+// async function checkDependencies() {
+// const dependencies = [
+// { cmd: 'gm version', name: 'GraphicsMagick' },
+// { cmd: 'gs --version', name: 'Ghostscript' }
+// ];
+
+// for (const dep of dependencies) {
+// try {
+// execSync(dep.cmd);
+// } catch (error) {
+// throw new PDFConversionError(`${dep.name} tidak terinstall`, 500);
+// }
+// }
+// }
+
+// // Tambah konstanta
+// const MAX_PDF_SIZE_MB = 50;
+// const MAX_IMAGE_DIMENSION = 2000;
+// const CONVERSION_TIMEOUT_MS = 30000;
+// const MAX_PAGES = 10; // Batasan jumlah halaman
+// const DEFAULT_PAGE = 1;
+
+// // Modifikasi validateParams
+// function validateParams(pdfUrl: string | null, pages: number[]) {
+// if (!pdfUrl) {
+// throw new PDFConversionError('URL parameter wajib diisi', 400);
+// }
+// if (pages.some(p => p < 1)) {
+// throw new PDFConversionError('Nomor halaman tidak valid', 400);
+// }
+// if (pages.length > MAX_PAGES) {
+// throw new PDFConversionError(`Maksimal ${MAX_PAGES} halaman per request`, 400);
+// }
+// }
+
+// interface ConversionResult {
+// buffer: Buffer;
+// text: string;
+// density: number;
+// width: number;
+// height: number;
+// }
+
+// // Fungsi untuk validasi dan fetch PDF
+// async function fetchPDF(url: string) {
+// const controller = new AbortController();
+// const timeout = setTimeout(() => controller.abort(), 10000);
+
+// try {
+// // Validasi URL
+// const validUrl = new URL(url);
+// if (!validUrl.protocol.startsWith('http')) {
+// throw new PDFConversionError('URL tidak valid', 400);
+// }
+
+// const response = await fetch(url, {
+// signal: controller.signal,
+// headers: {
+// 'Accept': 'application/pdf',
+// 'User-Agent': 'Mozilla/5.0 (compatible; PDFConverter/1.0)'
+// }
+// });
+
+// if (!response.ok) {
+// throw new PDFConversionError(
+// `Gagal mengakses PDF: ${response.status} ${response.statusText}`,
+// response.status
+// );
+// }
+
+// const contentType = response.headers.get('content-type');
+// if (!contentType?.includes('pdf')) {
+// throw new PDFConversionError('URL bukan file PDF', 400);
+// }
+
+// return response;
+
+// } catch (error: unknown) {
+// if (error instanceof PDFConversionError) throw error;
+// if (error instanceof Error && error.name === 'AbortError') {
+// throw new PDFConversionError('Timeout saat mengunduh PDF', 504);
+// }
+// const message = error instanceof Error ? error.message : 'Unknown error';
+// throw new PDFConversionError('Gagal mengunduh PDF: ' + message, 500);
+// } finally {
+// clearTimeout(timeout);
+// }
+// }
+
+// // Tambahkan error SVG template
+// const errorImageSvg = `
+// `;
+
+// // Tambahkan SVG untuk end of page
+// const endOfPageSvg = `
+// `;
+
+// // Fungsi helper untuk set common headers
+// function setCommonHeaders(headers: Headers) {
+// headers.set('Access-Control-Allow-Origin', '*');
+// headers.set('Access-Control-Allow-Methods', 'GET, OPTIONS');
+// headers.set('Content-Security-Policy', "default-src 'self'; img-src 'self' data: blob:;");
+// headers.set('X-Content-Type-Options', 'nosniff');
+// }
+
+// // Fungsi helper untuk return error image
+// function returnErrorImage(message: string = 'Conversion failed') {
+// const response = new NextResponse(errorImageSvg, {
+// headers: {
+// 'Content-Type': 'image/svg+xml',
+// 'Cache-Control': 'no-store',
+// 'X-Error-Message': message
+// }
+// });
+// setCommonHeaders(response.headers);
+// return response;
+// }
+
+// // Fungsi helper untuk return end of page image
+// function returnEndOfPageImage() {
+// const response = new NextResponse(endOfPageSvg, {
+// headers: {
+// 'Content-Type': 'image/svg+xml',
+// 'Cache-Control': 'public, max-age=31536000',
+// 'X-Error-Message': 'End of PDF pages'
+// }
+// });
+// setCommonHeaders(response.headers);
+// return response;
+// }
+
+// // Fungsi untuk get total pages menggunakan pdf-lib
+// async function getPDFPageCount(buffer: Buffer): Promise {
+// try {
+// const pdfDoc = await PDFDocument.load(buffer);
+// return pdfDoc.getPageCount();
+// } catch (error) {
+// console.error('Error getting PDF page count:', error);
+// throw new Error('Failed to get PDF page count');
+// }
+// }
+
+// export async function GET(request: Request) {
+// let pdfBuffer: Buffer | null = null;
+// const { searchParams } = new URL(request.url);
+
+// try {
+// // Validasi parameter wajib
+// const pdfUrl = searchParams.get('url');
+// if (!pdfUrl) {
+// return NextResponse.json({
+// error: 'URL parameter wajib diisi'
+// }, { status: 400 });
+// }
+
+// // Decode URL jika perlu
+// const decodedUrl = decodeURIComponent(pdfUrl);
+
+// await checkDependencies();
+
+// const getTotalPages = searchParams.get('total') === 'true';
+
+// // Single fetch PDF dengan URL yang sudah di-decode
+// const pdfResponse = await fetchPDF(decodedUrl);
+
+// const arrayBuffer = await pdfResponse.arrayBuffer();
+// pdfBuffer = Buffer.from(arrayBuffer);
+
+// // Get total pages
+// if (getTotalPages) {
+// try {
+// const pageCount = await getPDFPageCount(pdfBuffer);
+// return Response.json({
+// totalPages: pageCount,
+// message: 'Success get total pages'
+// });
+// } catch (error) {
+// console.error('PDF parse error:', error);
+// return Response.json({
+// error: 'Gagal membaca total halaman PDF',
+// totalPages: 0
+// }, { status: 500 });
+// }
+// }
+
+// // Parse page parameter dengan lebih baik
+// const pageStr = searchParams.get('page');
+// let pageNum = 1; // Default ke halaman 1
+
+// if (pageStr) {
+// pageNum = parseInt(pageStr);
+// if (isNaN(pageNum) || pageNum < 1) {
+// return returnErrorImage('Invalid page number');
+// }
+
+// // Validasi halaman tidak melebihi total
+// const totalPages = await getPDFPageCount(pdfBuffer);
+// if (pageNum > totalPages) {
+// return returnEndOfPageImage();
+// }
+// }
+
+// const options = {
+// density: 300,
+// format: "png",
+// width: Math.min(1200, MAX_IMAGE_DIMENSION),
+// height: Math.min(1700, MAX_IMAGE_DIMENSION),
+// preserveAspectRatio: true,
+// saveFilename: "",
+// savePath: "",
+// returnBuffer: true
+// };
+
+// // Konversi single page
+// const convert = fromBuffer(pdfBuffer, options);
+// const result = await Promise.race([
+// convert(pageNum, { responseType: "buffer" }),
+// new Promise((_, reject) =>
+// setTimeout(() => reject(new PDFConversionError('Konversi timeout', 504)),
+// CONVERSION_TIMEOUT_MS)
+// )
+// ]) as ConversionResult;
+
+// if (!result?.buffer) {
+// return returnErrorImage('Konversi gagal: tidak ada output');
+// }
+
+// // Return image buffer
+// const response = new NextResponse(result.buffer, {
+// headers: {
+// 'Content-Type': 'image/png',
+// 'Content-Length': result.buffer.length.toString(),
+// 'Cache-Control': 'public, max-age=31536000'
+// }
+// });
+// setCommonHeaders(response.headers);
+// return response;
+
+// } catch (error) {
+// console.error('PDF conversion error:', error);
+
+// // Return appropriate error response
+// const errorMessage = error instanceof Error ? error.message : 'Unknown error';
+// const statusCode = error instanceof PDFConversionError ? error.statusCode : 500;
+
+// return !searchParams.get('pages') ?
+// returnErrorImage(errorMessage) :
+// NextResponse.json({ error: errorMessage }, { status: statusCode });
+// } finally {
+// pdfBuffer = null;
+// }
+// }
\ No newline at end of file
diff --git a/src/app/api/portofolio/[id]/route.ts b/src/app/api/portofolio/[id]/route.ts
new file mode 100644
index 00000000..0760c303
--- /dev/null
+++ b/src/app/api/portofolio/[id]/route.ts
@@ -0,0 +1,307 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export { GET, POST, PUT };
+
+async function GET(request: Request, { params }: { params: { id: string } }) {
+ try {
+ const { id } = params;
+
+ const data = await prisma.portofolio.findUnique({
+ where: {
+ id: id,
+ },
+ include: {
+ Portofolio_BidangDanSubBidangBisnis: {
+ select: {
+ id: true,
+ MasterSubBidangBisnis: {
+ select: {
+ id: true,
+ name: true,
+ masterBidangBisnisId: true,
+ },
+ },
+ },
+ },
+ MasterBidangBisnis: {
+ select: {
+ id: true,
+ name: true,
+ active: true,
+ },
+ },
+ Portofolio_MediaSosial: true,
+ Profile: {
+ select: {
+ userId: true,
+ User: {
+ select: {
+ id: true,
+ },
+ },
+ },
+ },
+ BusinessMaps: {
+ include: {
+ Author: true,
+ },
+ },
+ },
+ });
+
+ if (!data)
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Data tidak ditemukan",
+ },
+ { status: 404 }
+ );
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: data,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("API Error Get Data Portofolio", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "API Error Get Data Potofolio",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
+
+async function PUT(request: Request, { params }: { params: { id: string } }) {
+ if (request.method !== "PUT") {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Method not allowed",
+ },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const { id } = params;
+ const { data } = await request.json();
+
+ const checkData = await prisma.portofolio.findUnique({
+ where: { id },
+ include: {
+ Portofolio_BidangDanSubBidangBisnis: true,
+ },
+ });
+
+ if (!checkData) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Data tidak ditemukan",
+ },
+ { status: 404 }
+ );
+ }
+
+ // Update data utama portofolio
+ const updatePortofolio = await prisma.portofolio.update({
+ where: { id },
+ data: {
+ namaBisnis: data.namaBisnis,
+ alamatKantor: data.alamatKantor,
+ tlpn: data.tlpn,
+ deskripsi: data.deskripsi,
+ masterBidangBisnisId: data.masterBidangBisnisId,
+ },
+ });
+
+ const bidangBerubah =
+ checkData.masterBidangBisnisId !== data.masterBidangBisnisId;
+
+ if (bidangBerubah) {
+ // Bidang berubah → hapus semua sub bidang lama
+ await prisma.portofolio_BidangDanSubBidangBisnis.deleteMany({
+ where: { portofolioId: id },
+ });
+
+ // Tambahkan sub bidang baru
+ for (const sub of data.subBidang) {
+ await prisma.portofolio_BidangDanSubBidangBisnis.create({
+ data: {
+ portofolioId: id,
+ masterBidangBisnisId: data.masterBidangBisnisId,
+ masterSubBidangBisnisId: sub.MasterSubBidangBisnis.id,
+ },
+ });
+ }
+ } else {
+ // Bidang tidak berubah → sinkronisasi sub bidang
+
+ const existingSub = checkData.Portofolio_BidangDanSubBidangBisnis;
+
+ const incomingIds = data.subBidang.map(
+ (sub: any) => sub.MasterSubBidangBisnis.id
+ );
+
+ const existingIds = existingSub.map(
+ (item) => item.masterSubBidangBisnisId
+ );
+
+ // 1. Hapus sub bidang yang sudah tidak dipilih
+ const toDelete = existingSub.filter(
+ (item) => !incomingIds.includes(item.masterSubBidangBisnisId)
+ );
+
+ await prisma.portofolio_BidangDanSubBidangBisnis.deleteMany({
+ where: {
+ id: {
+ in: toDelete.map((item) => item.id),
+ },
+ },
+ });
+
+ // 2. Tambahkan sub bidang baru yang belum ada di DB
+ const toCreate = data.subBidang.filter(
+ (sub: any) => !existingIds.includes(sub.MasterSubBidangBisnis.id)
+ );
+
+ for (const sub of toCreate) {
+ await prisma.portofolio_BidangDanSubBidangBisnis.create({
+ data: {
+ portofolioId: id,
+ masterBidangBisnisId: data.masterBidangBisnisId,
+ masterSubBidangBisnisId: sub.MasterSubBidangBisnis.id,
+ },
+ });
+ }
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil update data",
+ data: updatePortofolio,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error update data portofolio", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error update data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
+
+
+
+async function POST(request: Request, { params }: { params: { id: string } }) {
+ if (request.method !== "POST") {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Method not allowed",
+ },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const { id } = params;
+ const { data } = await request.json();
+
+ const createPortofolio = await prisma.portofolio.create({
+ data: {
+ profileId: id,
+ id_Portofolio: "Porto" + Date.now().toString(),
+ namaBisnis: data.namaBisnis,
+ deskripsi: data.deskripsi,
+ tlpn: data.tlpn,
+ alamatKantor: data.alamatKantor,
+ masterBidangBisnisId: data.masterBidangBisnisId,
+ logoId: data.fileId,
+ },
+ });
+
+ for (let i of data.subBidang) {
+ const createSubBidang =
+ await prisma.portofolio_BidangDanSubBidangBisnis.create({
+ data: {
+ portofolioId: createPortofolio.id,
+ masterBidangBisnisId: data.masterBidangBisnisId,
+ masterSubBidangBisnisId: i.id,
+ },
+ });
+
+ if (!createSubBidang)
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal membuat sub bidang bisnis",
+ },
+ { status: 400 }
+ );
+ }
+
+ if (!createPortofolio)
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal membuat portofolio",
+ },
+ { status: 400 }
+ );
+
+ const createMedsos = await prisma.portofolio_MediaSosial.create({
+ data: {
+ portofolioId: createPortofolio.id,
+ facebook: data?.facebook,
+ instagram: data?.instagram,
+ tiktok: data?.tiktok,
+ twitter: data?.twitter,
+ youtube: data?.youtube,
+ },
+ });
+
+ if (!createMedsos)
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal menambahkan medsos",
+ },
+ { status: 400 }
+ );
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: createPortofolio,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "API Error Post Data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/portofolio/logo/[id]/route.ts b/src/app/api/portofolio/logo/[id]/route.ts
index 05134e05..08885d0b 100644
--- a/src/app/api/portofolio/logo/[id]/route.ts
+++ b/src/app/api/portofolio/logo/[id]/route.ts
@@ -1,11 +1,11 @@
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
+import backendLogger from "@/util/backendLogger";
import fs from "fs";
import { NextRequest, NextResponse } from "next/server";
-export async function GET(
- req: NextRequest,
- { params }: { params: { id: string } }
-) {
+export { GET, PUT };
+
+async function GET(req: NextRequest, { params }: { params: { id: string } }) {
const get = await prisma.images.findUnique({
where: {
id: params.id,
@@ -30,3 +30,52 @@ export async function GET(
},
});
}
+
+async function PUT(
+ request: NextRequest,
+ { params }: { params: { id: string } }
+) {
+ if (request.method !== "PUT") {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Method not allowed",
+ },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const { id } = params;
+ const portofolioId = id;
+
+ const { data } = await request.json();
+ const logoId = data;
+
+ const updatePorto = await prisma.portofolio.update({
+ where: {
+ id: portofolioId,
+ },
+ data: {
+ logoId: logoId,
+ },
+ });
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil mengubah Logo Bisnis!",
+ data: updatePorto,
+ },
+ { status: 200 } // default status: 200
+ );
+ } catch (error) {
+ backendLogger.error("API Error Update Logo Portofolio", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Internal Server Error",
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/portofolio/medsos/[id]/route.ts b/src/app/api/portofolio/medsos/[id]/route.ts
new file mode 100644
index 00000000..47bb658d
--- /dev/null
+++ b/src/app/api/portofolio/medsos/[id]/route.ts
@@ -0,0 +1,55 @@
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function PUT(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ if (request.method !== "PUT") {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Method not allowed",
+ },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const { id } = params;
+ const { data } = await request.json();
+
+ const updateData = await prisma.portofolio_MediaSosial.update({
+ where: {
+ id: id,
+ },
+ data: {
+ facebook: data.facebook,
+ instagram: data.instagram,
+ tiktok: data.tiktok,
+ twitter: data.twitter,
+ youtube: data.youtube,
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil update data",
+ data: updateData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error update data", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error update data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/profile/[id]/route.ts b/src/app/api/profile/[id]/route.ts
new file mode 100644
index 00000000..edad427e
--- /dev/null
+++ b/src/app/api/profile/[id]/route.ts
@@ -0,0 +1,110 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export { GET, PUT };
+async function GET(request: Request, { params }: { params: { id: string } }) {
+ if (request.method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ let fixData;
+ const { id } = params;
+
+ fixData = await prisma.profile.findFirst({
+ where: {
+ id: id,
+ },
+ include: {
+ User: true,
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get profile",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get profile", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get profile",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
+
+async function PUT(request: Request) {
+ if (request.method !== "PUT") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const body = await request.json();
+ const { data } = body;
+
+ const cekEmail = await prisma.profile.findUnique({
+ where: {
+ email: data.email,
+ },
+ });
+
+ if (cekEmail && cekEmail.id != data.id)
+ return NextResponse.json(
+ { success: false, message: "Email sudah digunakan" },
+ { status: 400 }
+ );
+
+ const updateData = await prisma.profile.update({
+ where: {
+ id: data.id,
+ },
+ data: {
+ name: data.name,
+ email: data.email,
+ alamat: data.alamat,
+ jenisKelamin: data.jenisKelamin,
+ },
+ });
+
+ if (!updateData) {
+ return NextResponse.json(
+ { success: false, message: "Gagal update" },
+ {
+ status: 400,
+ }
+ );
+ }
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil edit profile" },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error edit profile", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error edit profile",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ } finally {
+ await prisma.$disconnect();
+ }
+}
diff --git a/src/app/api/profile/foto/[id]/route.ts b/src/app/api/profile/foto/[id]/route.ts
index da29b38d..c92a2ae3 100644
--- a/src/app/api/profile/foto/[id]/route.ts
+++ b/src/app/api/profile/foto/[id]/route.ts
@@ -1,4 +1,4 @@
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import fs from "fs";
import { NextRequest, NextResponse } from "next/server";
diff --git a/src/app/api/profile/route.ts b/src/app/api/profile/route.ts
new file mode 100644
index 00000000..5a1c8bfe
--- /dev/null
+++ b/src/app/api/profile/route.ts
@@ -0,0 +1,83 @@
+
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export { POST };
+
+async function POST(request: Request) {
+ if (request.method !== "POST") {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Method not allowed",
+ },
+ { status: 405 }
+ );
+ }
+
+ try {
+ const { data } = await request.json();
+ const userLoginId = await funGetUserIdByToken();
+
+ if (!userLoginId) {
+ backendLogger.error("User tidak terautentikasi");
+ return NextResponse.json(
+ {
+ success: false,
+ message: "User tidak terautentikasi",
+ },
+ { status: 400 }
+ ); // Validasi user login
+ }
+
+ const existingEmail = await prisma.profile.findUnique({
+ where: {
+ email: data.email,
+ },
+ });
+
+ if (existingEmail) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Email telah digunakan",
+ },
+ { status: 409 }
+ );
+ }
+
+ const createProfile = await prisma.profile.create({
+ data: {
+ userId: userLoginId,
+ name: data.name,
+ email: data.email,
+ alamat: data.alamat,
+ jenisKelamin: data.jenisKelamin,
+ imageId: data.imageId,
+ imageBackgroundId: data.imageBackgroundId,
+ },
+ });
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil membuat profile",
+ data: createProfile,
+ },
+ { status: 201 }
+ );
+ } catch (error) {
+ backendLogger.error("Error create profile", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal membuat profile",
+ },
+ { status: 500 }
+ );
+ } finally {
+ await prisma.$disconnect();
+ }
+}
diff --git a/src/app/api/season/route.ts b/src/app/api/season/route.ts
new file mode 100644
index 00000000..6eb04b61
--- /dev/null
+++ b/src/app/api/season/route.ts
@@ -0,0 +1,65 @@
+import { NextResponse } from "next/server";
+import { decrypt } from "../../../app/(auth)/_lib/decrypt";
+import { cookies } from "next/headers";
+export const dynamic = "force-dynamic";
+
+
+interface DecryptedUser {
+ id: string;
+ [key: string]: any;
+}
+
+export async function GET(request: Request) {
+ const SESSION_KEY = process.env.NEXT_PUBLIC_BASE_SESSION_KEY;
+ const TOKEN_KEY = process.env.NEXT_PUBLIC_BASE_TOKEN_KEY;
+
+ if (!SESSION_KEY || !TOKEN_KEY) {
+ return NextResponse.json(
+ { success: false, message: "Server configuration error" },
+ { status: 500 }
+ );
+ }
+
+ try {
+ const cookieStore = cookies();
+ const sessionCookie = cookieStore.get(SESSION_KEY);
+
+ if (!sessionCookie || !sessionCookie.value) {
+ return NextResponse.json(
+ { success: false, message: "Unauthorized: No session found" },
+ { status: 401 }
+ );
+ }
+
+ const cekUser = (await decrypt({
+ token: sessionCookie.value,
+ encodedKey: TOKEN_KEY,
+ })) as DecryptedUser | null;
+
+ if (!cekUser || !cekUser.id) {
+ return NextResponse.json(
+ { success: false, message: "Unauthorized: Invalid session" },
+ { status: 401 }
+ );
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "User session retrieved successfully",
+ data: { id: cekUser.id },
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error("Error retrieving user session:", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error retrieving user session",
+ error: (error as Error).message || "Unknown error",
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/seeder/route.ts b/src/app/api/seeder/route.ts
index 024cf41a..cc1fc4ed 100644
--- a/src/app/api/seeder/route.ts
+++ b/src/app/api/seeder/route.ts
@@ -1,4 +1,4 @@
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { NextResponse } from "next/server";
import userRole from "../../../bin/seeder/user_role.json";
import bidangBisnis from "../../../bin/seeder/bidang_bisnis.json";
diff --git a/src/app/api/sticker/route.ts b/src/app/api/sticker/route.ts
new file mode 100644
index 00000000..700ea0b7
--- /dev/null
+++ b/src/app/api/sticker/route.ts
@@ -0,0 +1,92 @@
+import { prisma } from "@/lib";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export { GET };
+
+async function GET(request: Request) {
+ const method = request.method;
+ if (method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method not allowed" },
+ { status: 405 }
+ );
+ }
+
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const gender = searchParams.get("gender");
+ const page = searchParams.get("page");
+ const dataTake = 10;
+ const dataSkip = Number(page) * dataTake - dataTake;
+
+ try {
+ if (!page) {
+ // Without page
+ const getData = await prisma.sticker.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ isActive: true,
+ jenisKelamin: {
+ mode: "insensitive",
+ contains: gender ?? "",
+ },
+ },
+ include: {
+ MasterEmotions: true,
+ },
+ });
+
+ fixData = {
+ data: getData,
+ };
+ } else {
+ // With page
+ const data = await prisma.sticker.findMany({
+ skip: dataSkip,
+ take: dataTake,
+ where: {
+ isActive: true,
+ jenisKelamin: {
+ mode: "insensitive",
+ contains: gender ?? "",
+ },
+ },
+ orderBy: {
+ createdAt: "desc",
+ },
+ include: {
+ MasterEmotions: true,
+ },
+ });
+
+ const nCount = await prisma.sticker.count({
+ where: {
+ isActive: true,
+ jenisKelamin: {
+ mode: "insensitive",
+ contains: gender ?? "",
+ },
+ },
+ });
+
+ fixData = {
+ data: data,
+ nPage: _.ceil(nCount / dataTake),
+ };
+ }
+
+ return NextResponse.json(
+ { success: true, message: "Success get data sticker", res: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ console.error("Error get data sticker", error);
+ return NextResponse.json(
+ { success: false, message: "Error get data sticker" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/test-scroll/route.ts b/src/app/api/test-scroll/route.ts
index c722ba33..68ad6f7c 100644
--- a/src/app/api/test-scroll/route.ts
+++ b/src/app/api/test-scroll/route.ts
@@ -1,8 +1,11 @@
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
+import { NextResponse } from "next/server";
export async function GET(req: Request) {
const page = new URL(req.url).searchParams.get("page");
- if (!page) return new Response("page require", { status: 400 });
+ if (!page)
+ return NextResponse.json({ message: "Page not found" }, { status: 400 });
+
const res = await prisma.projectCollaboration_Message.findMany({
take: 5,
skip: +page * 5 - 5,
diff --git a/src/app/api/user-validate/route-v.1.4.5.txt b/src/app/api/user-validate/route-v.1.4.5.txt
new file mode 100644
index 00000000..ff4a3b61
--- /dev/null
+++ b/src/app/api/user-validate/route-v.1.4.5.txt
@@ -0,0 +1,67 @@
+import { decrypt } from "@/app/(auth)/_lib/decrypt";
+import { prisma } from "@/lib";
+import { cookies } from "next/headers";
+import { NextResponse } from "next/server";
+export const dynamic = "force-dynamic";
+
+export async function GET(req: Request) {
+ try {
+ const SESSIONKEY = process.env.NEXT_PUBLIC_BASE_SESSION_KEY!;
+ // const token = req.headers.get("Authorization")?.split(" ")[1]
+ const token =
+ cookies().get(SESSIONKEY)?.value ||
+ req.headers.get("Authorization")?.split(" ")[1];
+ if (!token) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Unauthorized token not found",
+ },
+ { status: 401 }
+ );
+ }
+
+ const decripted = await decrypt({
+ token: token!,
+ encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
+ });
+
+ if (!decripted) {
+ await prisma.$disconnect();
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Unauthorized",
+ },
+ { status: 401 }
+ );
+ }
+
+ const user = await prisma.user.findUnique({
+ where: {
+ id: decripted.id,
+ },
+ });
+
+ // Disconnect after successful query
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: user,
+ });
+ } catch (error) {
+ // Ensure connection is closed even if error occurs
+
+ console.error("Error in user validation:", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Terjadi kesalahan pada server",
+ },
+ { status: 500 }
+ );
+ } finally {
+ await prisma.$disconnect();
+ }
+}
diff --git a/src/app/api/user-validate/route.ts b/src/app/api/user-validate/route.ts
new file mode 100644
index 00000000..a9c8fcb7
--- /dev/null
+++ b/src/app/api/user-validate/route.ts
@@ -0,0 +1,90 @@
+import { decrypt } from "@/app/(auth)/_lib/decrypt";
+import { prisma } from "@/lib";
+import { cookies } from "next/headers";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(req: Request) {
+ try {
+ const SESSIONKEY = process.env.NEXT_PUBLIC_BASE_SESSION_KEY!;
+ const TOKENKEY = process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!;
+ const cookieStore = cookies();
+
+ const authHeader = req.headers.get("Authorization") || "";
+ const bearerToken = authHeader.startsWith("Bearer ")
+ ? authHeader.split(" ")[1]
+ : undefined;
+
+ const token = cookieStore.get(SESSIONKEY)?.value || bearerToken;
+
+ if (!token) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Unauthorized token not found",
+ },
+ { status: 401 }
+ );
+ }
+
+ const decrypted = await decrypt({
+ token,
+ encodedKey: TOKENKEY,
+ });
+
+ if (!decrypted?.id) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Unauthorized: invalid token data",
+ },
+ { status: 401 }
+ );
+ }
+
+ const user = await prisma.user.findUnique({
+ where: {
+ id: decrypted.id,
+ },
+ });
+
+ if (!user) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "User tidak ditemukan",
+ },
+ { status: 404 }
+ );
+ }
+
+ if (!user.active) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "User belum aktif",
+ data: user,
+ },
+ { status: 403 }
+ );
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: user,
+ });
+ } catch (error) {
+ console.error("Error in user validation:", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Terjadi kesalahan pada server",
+ },
+ { status: 500 }
+ );
+ } finally {
+ await prisma.$disconnect();
+ }
+}
diff --git a/src/app/api/user/[id]/route.ts b/src/app/api/user/[id]/route.ts
new file mode 100644
index 00000000..d896db13
--- /dev/null
+++ b/src/app/api/user/[id]/route.ts
@@ -0,0 +1,36 @@
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+import { prisma } from "@/lib";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const { id } = params;
+
+ const data = await prisma.user.findUnique({
+ where: {
+ id: id,
+ },
+ include: {
+ Profile: true,
+ },
+ });
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: data },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get data user", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Error get data from API ",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/user/activation/route.ts b/src/app/api/user/activation/route.ts
new file mode 100644
index 00000000..fe938c7c
--- /dev/null
+++ b/src/app/api/user/activation/route.ts
@@ -0,0 +1,53 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(request: Request) {
+ try {
+ let fixData
+ const userLoginId = await funGetUserIdByToken();
+
+ if (userLoginId == null) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data, user id tidak ada",
+ },
+ { status: 500 }
+ );
+ }
+
+ const activationUser = await prisma.user.findFirst({
+ where: {
+ id: userLoginId,
+ },
+ select: {
+ active: true,
+ },
+ });
+
+ fixData = activationUser?.active
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: fixData,
+ },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get activation user: ", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/user/all/route.ts b/src/app/api/user/all/route.ts
new file mode 100644
index 00000000..d0791952
--- /dev/null
+++ b/src/app/api/user/all/route.ts
@@ -0,0 +1,46 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ if (request.method === "GET") {
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const except_id = searchParams.get("except-id");
+
+ if (!except_id) {
+ fixData = await prisma.user.findMany({
+ where: {
+ active: true,
+ },
+ });
+ } else {
+ fixData = await prisma.user.findMany({
+ where: {
+ active: true,
+ masterUserRoleId: "1",
+ id: {
+ not: except_id,
+ },
+ },
+ });
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: fixData,
+ });
+ } catch (error) {
+ return NextResponse.json({
+ success: false,
+ message: "Gagal mendapatkan data",
+ });
+ }
+ } else {
+ return NextResponse.json({
+ success: false,
+ message: "Method not allowed",
+ });
+ }
+}
diff --git a/src/app/api/user/get-cookies/route.ts b/src/app/api/user/get-cookies/route.ts
new file mode 100644
index 00000000..812242cb
--- /dev/null
+++ b/src/app/api/user/get-cookies/route.ts
@@ -0,0 +1,24 @@
+import { decrypt } from "@/app/(auth)/_lib/decrypt";
+import _ from "lodash";
+import { cookies } from "next/headers";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET() {
+ // const data = await req.text();
+ // console.log(data);
+ const c = cookies().get(process.env.NEXT_PUBLIC_BASE_SESSION_KEY!);
+
+ if (!c || !c?.value || _.isEmpty(c?.value) || _.isUndefined(c?.value)) {
+ return NextResponse.json({ status: 401, message: "Unauthorized" });
+ }
+
+ const token = c.value;
+ const dataUser = await decrypt({
+ token: token,
+ encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
+ });
+
+ return NextResponse.json({ status: 200, message: "OK", data: dataUser });
+}
diff --git a/src/app/api/user/id/route.ts b/src/app/api/user/id/route.ts
new file mode 100644
index 00000000..43869102
--- /dev/null
+++ b/src/app/api/user/id/route.ts
@@ -0,0 +1,58 @@
+import { NextResponse } from "next/server";
+import { cookies } from "next/headers";
+import { decrypt } from "@/app/(auth)/_lib/decrypt";
+
+export async function GET() {
+ const SESSION_KEY = process.env.NEXT_PUBLIC_BASE_SESSION_KEY;
+
+ if (!SESSION_KEY) {
+ return NextResponse.json(
+ {
+ success: false,
+ error: "Session key not configured",
+ message: "Session key not configured",
+ },
+ { status: 500 }
+ );
+ }
+
+ const cookieStore = cookies();
+ const token = cookieStore.get(SESSION_KEY)?.value;
+
+ if (!token) {
+ return NextResponse.json(
+ { success: false, error: "No token found", message: "No token found" },
+ { status: 401 }
+ );
+ }
+
+ try {
+ const decoded = await decrypt({
+ token,
+ encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
+ });
+
+ if (!decoded) {
+ return NextResponse.json(
+ { success: false, error: "Invalid token", message: "Invalid token" },
+ { status: 401 }
+ );
+ }
+
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data",
+ userId: decoded.id,
+ });
+ } catch (error) {
+ console.error("Error decoding token:", error);
+ return NextResponse.json(
+ {
+ success: false,
+ error: "Failed to decode token",
+ message: "Failed to decode token",
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/user/route.ts b/src/app/api/user/route.ts
new file mode 100644
index 00000000..6eec0018
--- /dev/null
+++ b/src/app/api/user/route.ts
@@ -0,0 +1,131 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(request: Request) {
+ if (request.method !== "GET") {
+ return NextResponse.json(
+ { success: false, message: "Method Not Allowed" },
+ {
+ status: 405,
+ }
+ );
+ }
+
+ try {
+ let fixData;
+ const userLoginId = await funGetUserIdByToken();
+ if (userLoginId == null) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data, user id tidak ada",
+ },
+ { status: 500 }
+ );
+ }
+
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const page = searchParams.get("page");
+ const takeData = 15;
+ const skipData = Number(page) * takeData - takeData;
+
+ if (!page) {
+ fixData = await prisma.user.findMany({
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ MasterUserRole: {
+ name: "User",
+ },
+ active: true,
+ NOT: {
+ Profile: null,
+ },
+ Profile: {
+ name: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ },
+ include: {
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ imageId: true,
+ },
+ },
+ },
+ });
+ } else {
+ fixData = await prisma.user.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ MasterUserRole: {
+ name: "User",
+ },
+ active: true,
+ Profile: {
+ name: {
+ contains: search ? search : "",
+ mode: "insensitive",
+ },
+ },
+ NOT: {
+ Profile: null,
+ },
+ // OR: [
+ // {
+ // NOT: {
+ // id: userLoginId as string,
+ // },
+ // },
+ // ],
+ },
+ include: {
+ Profile: {
+ select: {
+ id: true,
+ name: true,
+ imageId: true,
+ },
+ },
+ },
+ });
+ }
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: fixData,
+ },
+ {
+ status: 200,
+ }
+ );
+ } catch (error) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message,
+ },
+ {
+ status: 500,
+ }
+ );
+ } finally {
+ await prisma.$disconnect();
+ }
+}
diff --git a/src/app/api/validasi/route.ts b/src/app/api/validasi/route.ts
deleted file mode 100644
index 65467cdb..00000000
--- a/src/app/api/validasi/route.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export async function GET(req: Request) {
- const auth = req.headers.get("Authorization");
- const token = auth?.split(" ")[1];
- if (!token)
- return new Response(JSON.stringify({ success: false }), { status: 401 });
- return new Response(JSON.stringify({ success: true }));
-}
diff --git a/src/app/api/validation/route.ts b/src/app/api/validation/route.ts
new file mode 100644
index 00000000..8ad6c16b
--- /dev/null
+++ b/src/app/api/validation/route.ts
@@ -0,0 +1,58 @@
+import { NextResponse } from "next/server";
+import { jwtVerify } from "jose";
+
+export async function GET(req: Request) {
+ const token = req.headers.get("Authorization")?.split(" ")[1];
+
+ if (!token) {
+ console.warn("Token is missing in /api/validation");
+ return NextResponse.json(
+ { success: false, error: "Token missing" },
+ { status: 401 }
+ );
+ }
+
+ try {
+ const secret = new TextEncoder().encode(
+ process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!
+ );
+ const { payload } = await jwtVerify(token, secret, {
+ algorithms: ["HS256"],
+ });
+
+ if (!payload || typeof payload !== "object" || !payload.user) {
+ console.warn("Invalid payload structure in /api/validation:", payload);
+ return NextResponse.json(
+ { success: false, error: "Invalid token payload" },
+ { status: 401 }
+ );
+ }
+
+ return NextResponse.json({
+ success: true,
+ user: payload.user,
+ });
+ } catch (err) {
+ console.error("Token verification failed in /api/validation:", err);
+ return NextResponse.json(
+ { success: false, error: "Invalid or expired token" },
+ { status: 401 }
+ );
+ }
+}
+
+// Optional: handle disallowed methods
+export async function POST() {
+ return NextResponse.json({ error: "Method Not Allowed" }, { status: 405 });
+}
+
+
+// ==== Versi 1.4.5 ==== //
+
+// export async function GET(req: Request) {
+// const token = req.headers.get("Authorization")?.split(" ")[1];
+
+// if (!token) return NextResponse.json({ success: false }, { status: 401 });
+
+// return NextResponse.json({ success: true });
+// }
diff --git a/src/app/api/version/route.ts b/src/app/api/version/route.ts
new file mode 100644
index 00000000..8d33bc62
--- /dev/null
+++ b/src/app/api/version/route.ts
@@ -0,0 +1,16 @@
+import { NextResponse } from "next/server";
+import packageVersion from "../../../../package.json";
+
+export async function GET(request: Request) {
+
+const version = packageVersion.version
+
+ return NextResponse.json(
+ {
+ success: true,
+ message: "Success get version",
+ data: version,
+ },
+ { status: 200 }
+ );
+}
diff --git a/src/app/api/voting/[id]/daftar-pilihan/route.ts b/src/app/api/voting/[id]/daftar-pilihan/route.ts
new file mode 100644
index 00000000..e2fbcdd4
--- /dev/null
+++ b/src/app/api/voting/[id]/daftar-pilihan/route.ts
@@ -0,0 +1,27 @@
+import { NextResponse } from "next/server";
+import prisma from "@/lib/prisma";
+
+export async function GET(
+ request: Request,
+ { params }: { params: { id: string } }
+) {
+ const { id } = params;
+ try {
+ const data = await prisma.voting_DaftarNamaVote.findMany({
+ where: {
+ votingId: id,
+ isActive: true,
+ },
+ });
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: data },
+ { status: 200 }
+ );
+ } catch (error) {
+ return NextResponse.json(
+ { success: false, message: "Gagal mendapatkan data" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/voting/[id]/route.ts b/src/app/api/voting/[id]/route.ts
new file mode 100644
index 00000000..2ee66518
--- /dev/null
+++ b/src/app/api/voting/[id]/route.ts
@@ -0,0 +1,47 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(
+ request: Request,
+ context: { params: { id: string } }
+) {
+ try {
+ let fixData;
+ const { id } = context.params;
+
+ fixData = await prisma.voting.findFirst({
+ where: {
+ id: id,
+ },
+ include: {
+ Voting_DaftarNamaVote: {
+ orderBy: {
+ createdAt: "asc",
+ },
+ where: {
+ isActive: true,
+ },
+ },
+ Author: {
+ select: {
+ Profile: true,
+ },
+ },
+ },
+ });
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Gagal mendapatkan data voting by id", error);
+ return NextResponse.json(
+ { success: false, message: "Gagal mendapatkan data" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/voting/check/route.ts b/src/app/api/voting/check/route.ts
new file mode 100644
index 00000000..82f0e26b
--- /dev/null
+++ b/src/app/api/voting/check/route.ts
@@ -0,0 +1,76 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
+import _ from "lodash";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+/**
+ *
+ * @param id | votingId
+ * @param kategori | kontribusi
+ * @returns
+ */
+export async function GET(request: Request) {
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const id = searchParams.get("id");
+ const kategori = searchParams.get("kategori");
+
+ const userLoginId = await funGetUserIdByToken();
+ if (!userLoginId) {
+ return NextResponse.json(
+ { success: false, message: "Gagal mendapatkan data, coba lagi nanti " },
+ { status: 500 }
+ );
+ }
+
+ if (kategori == "isKontributor") {
+ const cek = await prisma.voting_Kontributor.count({
+ where: {
+ authorId: userLoginId,
+ votingId: id,
+ },
+ });
+
+ if (cek > 0) {
+ fixData = true;
+ } else {
+ fixData = false;
+ }
+ } else if (kategori == "pilihan") {
+ const cekPilihan = await prisma.voting_Kontributor.findFirst({
+ where: {
+ authorId: userLoginId,
+ votingId: id,
+ },
+ select: {
+ Voting_DaftarNamaVote: {
+ select: {
+ value: true,
+ },
+ },
+ },
+ });
+
+ fixData = cekPilihan?.Voting_DaftarNamaVote?.value
+ }
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get hitung voting", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/voting/get/route.ts b/src/app/api/voting/get/route.ts
new file mode 100644
index 00000000..35fd18d9
--- /dev/null
+++ b/src/app/api/voting/get/route.ts
@@ -0,0 +1,312 @@
+import { prisma } from "@/lib";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(request: Request) {
+ try {
+ let fixData;
+
+ const { searchParams } = new URL(request.url);
+ const search = searchParams.get("search");
+ const kategori = searchParams.get("kategori");
+ const status = searchParams.get("status");
+ const page = searchParams.get("page");
+
+ const takeData = 5;
+ const skipData = Number(page) * 5 - 5;
+
+ const userLoginId = await funGetUserIdByToken();
+
+ if (userLoginId == null) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data, user id tidak ada",
+ },
+ { status: 500 }
+ );
+ }
+
+ if (kategori == "beranda" && search != null && search != "") {
+ fixData = await prisma.voting.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ voting_StatusId: "1",
+ isArsip: false,
+ isActive: true,
+ akhirVote: {
+ gte: new Date(),
+ },
+ title: {
+ contains: search,
+ mode: "insensitive",
+ },
+ },
+ select: {
+ id: true,
+ title: true,
+ isActive: true,
+ createdAt: true,
+ updatedAt: true,
+ deskripsi: true,
+ awalVote: true,
+ akhirVote: true,
+ catatan: true,
+ authorId: true,
+ voting_StatusId: true,
+ Voting_DaftarNamaVote: {
+ orderBy: {
+ createdAt: "asc",
+ },
+ include: {
+ Voting_Kontributor: {
+ include: {
+ Author: true,
+ },
+ },
+ },
+ },
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ nomor: true,
+ Profile: true,
+ },
+ },
+ },
+ });
+ } else if (kategori == "beranda") {
+ fixData = await prisma.voting.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ voting_StatusId: "1",
+ isArsip: false,
+ isActive: true,
+ akhirVote: {
+ gte: new Date(),
+ },
+ title: {
+ // contains: search,
+ mode: "insensitive",
+ },
+ },
+ select: {
+ id: true,
+ title: true,
+ isActive: true,
+ createdAt: true,
+ updatedAt: true,
+ deskripsi: true,
+ awalVote: true,
+ akhirVote: true,
+ catatan: true,
+ authorId: true,
+ voting_StatusId: true,
+ Voting_DaftarNamaVote: {
+ orderBy: {
+ createdAt: "asc",
+ },
+ include: {
+ Voting_Kontributor: {
+ include: {
+ Author: true,
+ },
+ },
+ },
+ },
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ nomor: true,
+ Profile: true,
+ },
+ },
+ },
+ });
+ } else if (kategori == "status" && status == "1") {
+ fixData = await prisma.voting.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ voting_StatusId: status,
+ authorId: userLoginId as string,
+ isActive: true,
+ akhirVote: {
+ gte: new Date(),
+ },
+ },
+ include: {
+ Voting_DaftarNamaVote: {
+ orderBy: {
+ createdAt: "asc",
+ },
+ },
+ },
+ });
+ } else if (kategori == "status" && status != "1") {
+ fixData = await prisma.voting.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ voting_StatusId: status,
+ authorId: userLoginId as string,
+ isActive: true,
+ },
+ });
+ } else if (kategori == "kontribusi") {
+ fixData = await prisma.voting_Kontributor.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ authorId: userLoginId,
+ },
+ select: {
+ id: true,
+ Voting: {
+ select: {
+ id: true,
+ title: true,
+ isActive: true,
+ awalVote: true,
+ akhirVote: true,
+ Voting_DaftarNamaVote: {
+ orderBy: {
+ createdAt: "asc",
+ },
+ },
+ Author: {
+ select: {
+ Profile: true,
+ },
+ },
+ },
+ },
+ Voting_DaftarNamaVote: true,
+ Author: true,
+ },
+ });
+ } else if (kategori == "riwayat" && status == "1") {
+ fixData = await prisma.voting.findMany({
+ take: takeData,
+ skip: skipData,
+
+ orderBy: {
+ createdAt: "asc",
+ },
+ where: {
+ voting_StatusId: "1",
+ isActive: true,
+ akhirVote: {
+ lte: new Date(),
+ },
+ },
+ select: {
+ id: true,
+ title: true,
+ isActive: true,
+ createdAt: true,
+ updatedAt: true,
+ deskripsi: true,
+ awalVote: true,
+ akhirVote: true,
+ catatan: true,
+ authorId: true,
+ voting_StatusId: true,
+ Voting_DaftarNamaVote: {
+ orderBy: {
+ createdAt: "asc",
+ },
+ },
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ nomor: true,
+ Profile: true,
+ },
+ },
+ },
+ });
+ } else if (kategori == "riwayat" && status == "2") {
+ fixData = await prisma.voting.findMany({
+ take: takeData,
+ skip: skipData,
+
+ orderBy: {
+ createdAt: "asc",
+ },
+ where: {
+ voting_StatusId: "1",
+ authorId: userLoginId as string,
+ isActive: true,
+ akhirVote: {
+ lte: new Date(),
+ },
+ },
+ select: {
+ id: true,
+ title: true,
+ isActive: true,
+ createdAt: true,
+ updatedAt: true,
+ deskripsi: true,
+ awalVote: true,
+ akhirVote: true,
+ catatan: true,
+ authorId: true,
+ voting_StatusId: true,
+ Voting_DaftarNamaVote: {
+ orderBy: {
+ createdAt: "asc",
+ },
+ },
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ nomor: true,
+ Profile: true,
+ },
+ },
+ },
+ });
+ }
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error("Error get voting: ", error);
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/voting/hasil/route.ts b/src/app/api/voting/hasil/route.ts
new file mode 100644
index 00000000..b1ad2fce
--- /dev/null
+++ b/src/app/api/voting/hasil/route.ts
@@ -0,0 +1,30 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(request: Request) {
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const id = searchParams.get("id");
+
+ fixData = await prisma.voting_DaftarNamaVote.findMany({
+ where: {
+ votingId: id,
+ },
+ });
+
+ return NextResponse.json(
+ { success: true, message: "Berhasil mendapatkan data", data: fixData },
+ { status: 200 }
+ );
+ } catch (error) {
+ backendLogger.error(error);
+ return NextResponse.json(
+ { success: false, message: "Gagal mendapatkan data" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/voting/kontributor/route.ts b/src/app/api/voting/kontributor/route.ts
new file mode 100644
index 00000000..c0d67e95
--- /dev/null
+++ b/src/app/api/voting/kontributor/route.ts
@@ -0,0 +1,46 @@
+import { prisma } from "@/lib";
+import backendLogger from "@/util/backendLogger";
+import { NextResponse } from "next/server";
+
+export const dynamic = "force-dynamic";
+
+export async function GET(request: Request) {
+ try {
+ let fixData;
+ const { searchParams } = new URL(request.url);
+ const id = searchParams.get("id");
+ const page = searchParams.get("page");
+ const takeData = 10;
+ const dataSkip = Number(page) * takeData - takeData;
+ fixData = await prisma.voting_Kontributor.findMany({
+ // take: takeData,
+ // skip: dataSkip,
+ orderBy: {
+ createdAt: "desc",
+ },
+ where: {
+ votingId: id,
+ },
+ include: {
+ Author: {
+ include: {
+ Profile: true,
+ },
+ },
+ Voting_DaftarNamaVote: {
+ select: {
+ value: true,
+ },
+ },
+ },
+ });
+
+ return NextResponse.json({ success: true, data: fixData }, { status: 200 });
+ } catch (error) {
+ backendLogger.error(error);
+ return NextResponse.json(
+ { success: false, reason: (error as Error).message || (error as Error) },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/voting/master/route.ts b/src/app/api/voting/master/route.ts
new file mode 100644
index 00000000..a270c5c1
--- /dev/null
+++ b/src/app/api/voting/master/route.ts
@@ -0,0 +1,22 @@
+import { prisma } from "@/lib";
+import { NextResponse } from "next/server";
+
+export async function GET(request: Request) {
+ try {
+ const data = await prisma.voting_Status.findMany();
+ return NextResponse.json({
+ success: true,
+ message: "Berhasil mendapatkan data",
+ data: data,
+ });
+ } catch (error) {
+ return NextResponse.json(
+ {
+ success: false,
+ message: "Gagal mendapatkan data",
+ reason: (error as Error).message,
+ },
+ { status: 500 }
+ );
+ }
+}
diff --git a/src/app/api/zz-makuro/route.ts b/src/app/api/zz-makuro/route.ts
index df7b0d72..ac94f9da 100644
--- a/src/app/api/zz-makuro/route.ts
+++ b/src/app/api/zz-makuro/route.ts
@@ -1,7 +1,7 @@
-import { headers } from "next/headers";
+import { NextResponse } from "next/server";
export async function GET(
req: Request) {
const origin = new URL(req.url).origin;
- return new Response(JSON.stringify({ success: true, origin }));
+ return NextResponse.json({ success: true, origin });
}
diff --git a/src/app/auth/api/login/route.ts b/src/app/auth/api/login/route.ts
deleted file mode 100644
index 370b5bad..00000000
--- a/src/app/auth/api/login/route.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { prisma } from "@/app/lib";
-import { sessionCreate } from "../../_lib/session_create";
-
-export async function POST(req: Request) {
- const user = await prisma.user.findUnique({
- where: {
- nomor: "6281339158911",
- },
- select: {
- id: true,
- nomor: true,
- },
- });
-
- if (!user)
- return new Response(
- JSON.stringify({ success: false, message: "User not found" }), {status: 404}
- );
-
- const token = await sessionCreate({
- sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
- encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
- user: user as any,
- });
-
- return new Response(JSON.stringify({ success: true, token }));
-}
diff --git a/src/app/auth/api/logout/route.ts b/src/app/auth/api/logout/route.ts
deleted file mode 100644
index af733975..00000000
--- a/src/app/auth/api/logout/route.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { cookies } from "next/headers";
-export async function GET() {
- const del = cookies().delete(process.env.NEXT_PUBLIC_BASE_SESSION_KEY!);
- return new Response(JSON.stringify({ success: true }));
-}
diff --git a/src/app/auth/login/page.tsx b/src/app/auth/login/page.tsx
deleted file mode 100644
index 7fe848b8..00000000
--- a/src/app/auth/login/page.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-"use client";
-import { Button } from "@mantine/core";
-import { useState } from "react";
-
-export default function Page() {
- const [loading, setLoading] = useState(false);
-
-
- async function login() {
- setLoading(true);
- try {
- const res = await fetch("/auth/api/login", {
- method: "POST",
- });
-
- const dataText = await res.text();
-
- if (!res.ok) {
- console.error(dataText);
- throw new Error(res.statusText);
- }
-
- const dataJson = JSON.parse(dataText);
- console.log(dataJson);
- // window.location.replace("/dev/home");
- } catch (error) {
- console.error(error);
- } finally {
- setLoading(false);
- }
- }
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/(user)/colab/_comp/ChatScrollArea.tsx b/src/app/dev/(user)/colab/_comp/ChatScrollArea.tsx
new file mode 100644
index 00000000..a10cfc23
--- /dev/null
+++ b/src/app/dev/(user)/colab/_comp/ChatScrollArea.tsx
@@ -0,0 +1,224 @@
+/* eslint-disable react-hooks/exhaustive-deps */
+// components/ChatScrollArea.tsx
+
+import React, { useEffect, useRef, useState } from "react";
+import { ScrollArea, Box, Button, Text } from "@mantine/core";
+import { ChatMessage } from "./interface";
+import { apiGetMessageByRoomId } from "@/app_modules/colab/_lib/api_collaboration";
+
+interface ChatScrollAreaProps {
+ initialMessages: ChatMessage[];
+ currentUserId: string;
+ chatRoomId: string;
+}
+
+export const ChatScrollArea: React.FC = ({
+ initialMessages,
+ currentUserId,
+ chatRoomId,
+}) => {
+ const [messages, setMessages] = useState(initialMessages);
+ const [hasMore, setHasMore] = useState(true);
+ const [showNewMessageIndicator, setShowNewMessageIndicator] = useState(false);
+
+ const scrollAreaRef = useRef(null);
+ const messagesEndRef = useRef(null);
+ const loaderRef = useRef(null);
+ const lastMessageIdRef = useRef(null);
+
+ // Auto scroll to bottom on first render
+ useEffect(() => {
+ scrollToBottom();
+ }, []);
+
+ // // Infinite Scroll Up - Load Older Messages
+ useEffect(() => {
+ const observer = new IntersectionObserver(
+ ([entry]) => {
+ if (entry.isIntersecting && hasMore) {
+ loadMoreMessages();
+ }
+ },
+ { root: scrollAreaRef.current }
+ );
+
+ if (loaderRef.current) observer.observe(loaderRef.current);
+ return () => observer.disconnect();
+ }, [hasMore]);
+
+ const scrollToBottom = () => {
+ setTimeout(() => {
+ if (messagesEndRef.current) {
+ messagesEndRef.current.scrollIntoView({ behavior: "auto" });
+ }
+ }, 100);
+ };
+
+ const [loadingMore, setLoadingMore] = useState(false);
+
+const loadMoreMessages = async () => {
+ console.log("Triggered loadMoreMessages");
+ console.log("Current lastMessageId:", lastMessageIdRef.current);
+
+ if (!hasMore || loadingMore) return;
+
+ setLoadingMore(true);
+ try {
+ const result = await apiGetMessageByRoomId({
+ id: chatRoomId,
+ lastMessageId: lastMessageIdRef.current || undefined,
+ });
+
+ console.log("API Response:", result);
+
+ if (!result.success || !result.data || result.data.length === 0) {
+ console.log("No more data from API");
+ setHasMore(false);
+ return;
+ }
+
+ const olderMessages = result.data;
+ const existingIds = new Set(messages.map((m) => m.id));
+ const filtered = olderMessages.filter((msg: ChatMessage) => !existingIds.has(msg.id));
+
+ console.log("Filtered Messages:", filtered);
+
+ if (filtered.length === 0) {
+ console.log("All messages already loaded");
+ setHasMore(false);
+ return;
+ }
+
+ lastMessageIdRef.current = filtered[0]?.id;
+ setMessages((prev) => [...prev, ...filtered]);
+ } catch (error) {
+ console.error("Failed to load more messages", error);
+ setHasMore(false);
+ } finally {
+ setLoadingMore(false);
+ }
+};;
+
+ // const sendMessage = async (content: string) => {
+ // try {
+ // const res = await fetch("/api/chat/send", {
+ // method: "POST",
+ // headers: {
+ // "Content-Type": "application/json",
+ // },
+ // body: JSON.stringify({
+ // content,
+ // chatRoomId,
+ // }),
+ // });
+
+ // const result = await res.json();
+
+ // if (result.success) {
+ // const newMessage = result.data;
+ // setMessages((prev) => [...prev, newMessage]);
+ // scrollToBottom();
+ // }
+ // } catch (error) {
+ // console.error("Error sending message", error);
+ // }
+ // };
+
+ // const handleScrollToBottomClick = () => {
+ // scrollToBottom();
+ // setShowNewMessageIndicator(false);
+ // };
+
+ // Simulasi menerima pesan baru (misalnya via WebSocket atau polling)
+ // const handleIncomingMessage = (newMessage: ChatMessage) => {
+ // if (newMessage.User?.id !== currentUserId) {
+ // const isScrolledToBottom =
+ // scrollAreaRef.current &&
+ // scrollAreaRef.current.scrollHeight -
+ // scrollAreaRef.current.clientHeight <=
+ // scrollAreaRef.current.scrollTop + 100;
+
+ // if (!isScrolledToBottom) {
+ // setShowNewMessageIndicator(true);
+ // } else {
+ // setMessages((prev) => [...prev, newMessage]);
+ // scrollToBottom();
+ // }
+ // } else {
+ // setMessages((prev) => [...prev, newMessage]);
+ // scrollToBottom();
+ // }
+ // };
+
+
+
+ return (
+
+ {/* Scroll Area */}
+
+
+ {hasMore && (
+
+ {loadingMore ? "Loading..." : "Load more"}
+
+ )}
+
+ {messages.map((msg) => (
+
+ {msg.message}
+
+ ))}
+
+
+
+
+
+ {/* Tombol Scroll ke Bawah jika ada pesan baru */}
+ {showNewMessageIndicator && (
+
+ )}
+
+ {/* Form Kirim Pesan */}
+
+
+ );
+};
diff --git a/src/app/dev/(user)/colab/_comp/interface.ts b/src/app/dev/(user)/colab/_comp/interface.ts
new file mode 100644
index 00000000..815613fd
--- /dev/null
+++ b/src/app/dev/(user)/colab/_comp/interface.ts
@@ -0,0 +1,17 @@
+// types/message.ts
+export interface ChatUser {
+ id: string;
+ Profile: {
+ id: string;
+ name: string;
+ };
+}
+
+export interface ChatMessage {
+ id: string;
+ message: string;
+ isActive: boolean;
+ createdAt: Date;
+ isFile?: boolean | null;
+ User: ChatUser | null;
+}
diff --git a/src/app/dev/(user)/colab/_comp/ui_chat.tsx b/src/app/dev/(user)/colab/_comp/ui_chat.tsx
new file mode 100644
index 00000000..6f452711
--- /dev/null
+++ b/src/app/dev/(user)/colab/_comp/ui_chat.tsx
@@ -0,0 +1,60 @@
+// app/chat/[id]/page.tsx
+"use client";
+
+import { apiGetMessageByRoomId } from "@/app_modules/colab/_lib/api_collaboration";
+import { useShallowEffect } from "@mantine/hooks";
+import { ChatMessage } from "./interface";
+import { useState } from "react";
+import { ChatScrollArea } from "./ChatScrollArea";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+
+export default function ChatPage({ params }: { params: { id: string } }) {
+ const roomId = params.id;
+ const [initialMessages, setInitialMessages] = useState([]);
+ const [loading, setLoading] = useState(true);
+
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ handleGetUserLoginId();
+ }, []);
+
+ async function handleGetUserLoginId() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ } else {
+ setUserLoginId(null);
+ }
+ } catch (error) {
+ setUserLoginId(null);
+ }
+ }
+
+ async function handleGetDataMessage() {
+ try {
+ const result = await apiGetMessageByRoomId({ id: roomId });
+ setInitialMessages(result.data || []);
+ } catch (error) {
+ console.error("Failed to load messages", error);
+ } finally {
+ setLoading(false);
+ }
+ }
+ useShallowEffect(() => {
+ handleGetDataMessage();
+ }, [roomId]);
+
+ if (loading || !userLoginId) {
+ return Loading chat...
;
+ }
+
+ return (
+
+ );
+}
diff --git a/src/app/dev/colab/create/layout.tsx b/src/app/dev/(user)/colab/create/layout.tsx
similarity index 100%
rename from src/app/dev/colab/create/layout.tsx
rename to src/app/dev/(user)/colab/create/layout.tsx
diff --git a/src/app/dev/(user)/colab/create/page.tsx b/src/app/dev/(user)/colab/create/page.tsx
new file mode 100644
index 00000000..6a530d6f
--- /dev/null
+++ b/src/app/dev/(user)/colab/create/page.tsx
@@ -0,0 +1,9 @@
+import { Colab_Create } from "@/app_modules/colab";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/colab/detail/group/[id]/page.tsx b/src/app/dev/(user)/colab/detail/group/[id]/page.tsx
similarity index 58%
rename from src/app/dev/colab/detail/group/[id]/page.tsx
rename to src/app/dev/(user)/colab/detail/group/[id]/page.tsx
index d93ed4f9..b127e820 100644
--- a/src/app/dev/colab/detail/group/[id]/page.tsx
+++ b/src/app/dev/(user)/colab/detail/group/[id]/page.tsx
@@ -1,13 +1,13 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import adminColab_getOneRoomChatById from "@/app_modules/admin/colab/fun/get/get_one_room_chat_by_id";
-import { Colab_GroupChatView } from "@/app_modules/colab";
+import Colab_NewGroupChatView from "@/app_modules/colab/detail/group/new_detail_group";
import colab_getMessageByRoomId from "@/app_modules/colab/fun/get/room_chat/get_message_by_room_id";
-import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
import _ from "lodash";
+export const dynamic = "force-dynamic";
export default async function Page({ params }: { params: { id: string } }) {
const roomId = params.id;
- const userLoginId = await funGetUserIdByToken();
+ // const userLoginId = await funGetUserIdByToken();
+ // const dataUserLogin = await user_getOneByUserId(userLoginId as string);
const getData = (await adminColab_getOneRoomChatById({ roomId: roomId }))
.data;
@@ -15,25 +15,20 @@ export default async function Page({ params }: { params: { id: string } }) {
"ProjectCollaboration",
"ProjectCollaboration_AnggotaRoomChat",
]);
+
let listMsg = await colab_getMessageByRoomId({ roomId: roomId, page: 1 });
- const dataUserLogin = await user_getOneByUserId(userLoginId as string);
return (
<>
- {/* */}
-
-
+ /> */}
+
+
+ {/* */}
>
);
}
diff --git a/src/app/dev/(user)/colab/detail/info-grup/[id]/page.tsx b/src/app/dev/(user)/colab/detail/info-grup/[id]/page.tsx
new file mode 100644
index 00000000..d4001193
--- /dev/null
+++ b/src/app/dev/(user)/colab/detail/info-grup/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Colab_DetailInfoGrup } from "@/app_modules/colab";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/colab/detail/main_detail/[id]/layout.tsx b/src/app/dev/(user)/colab/detail/main_detail/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/colab/detail/main_detail/[id]/layout.tsx
rename to src/app/dev/(user)/colab/detail/main_detail/[id]/layout.tsx
diff --git a/src/app/dev/(user)/colab/detail/main_detail/[id]/page.tsx b/src/app/dev/(user)/colab/detail/main_detail/[id]/page.tsx
new file mode 100644
index 00000000..baa4b1fd
--- /dev/null
+++ b/src/app/dev/(user)/colab/detail/main_detail/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Colab_MainDetail } from "@/app_modules/colab";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/colab/detail/proyek/partisipasi/[id]/layout.tsx b/src/app/dev/(user)/colab/detail/proyek/partisipasi/[id]/layout.tsx
similarity index 62%
rename from src/app/dev/colab/detail/proyek/partisipasi/[id]/layout.tsx
rename to src/app/dev/(user)/colab/detail/proyek/partisipasi/[id]/layout.tsx
index 2d9fef0e..e7cdc81a 100644
--- a/src/app/dev/colab/detail/proyek/partisipasi/[id]/layout.tsx
+++ b/src/app/dev/(user)/colab/detail/proyek/partisipasi/[id]/layout.tsx
@@ -3,7 +3,9 @@ import { LayoutColab_DetailPartisipasiProyek } from "@/app_modules/colab";
export default async function Layout({ children }: { children: any }) {
return (
<>
- {children}
+
+ {children}
+
>
);
}
diff --git a/src/app/dev/(user)/colab/detail/proyek/partisipasi/[id]/page.tsx b/src/app/dev/(user)/colab/detail/proyek/partisipasi/[id]/page.tsx
new file mode 100644
index 00000000..323e5439
--- /dev/null
+++ b/src/app/dev/(user)/colab/detail/proyek/partisipasi/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Colab_DetailPartisipasiProyek } from "@/app_modules/colab";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/colab/detail/proyek/saya/[id]/layout.tsx b/src/app/dev/(user)/colab/detail/proyek/saya/[id]/layout.tsx
similarity index 55%
rename from src/app/dev/colab/detail/proyek/saya/[id]/layout.tsx
rename to src/app/dev/(user)/colab/detail/proyek/saya/[id]/layout.tsx
index d7c38cc1..1b84d85b 100644
--- a/src/app/dev/colab/detail/proyek/saya/[id]/layout.tsx
+++ b/src/app/dev/(user)/colab/detail/proyek/saya/[id]/layout.tsx
@@ -3,19 +3,12 @@ import React from "react";
export default async function Layout({
children,
- params,
}: {
children: React.ReactNode;
- params: { id: string };
}) {
- let colabId = params.id;
-
-
return (
<>
-
- {children}
-
+ {children}
>
);
}
diff --git a/src/app/dev/(user)/colab/detail/proyek/saya/[id]/page.tsx b/src/app/dev/(user)/colab/detail/proyek/saya/[id]/page.tsx
new file mode 100644
index 00000000..e1527440
--- /dev/null
+++ b/src/app/dev/(user)/colab/detail/proyek/saya/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Colab_DetailProyekSaya } from "@/app_modules/colab";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/colab/edit/[id]/layout.tsx b/src/app/dev/(user)/colab/edit/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/colab/edit/[id]/layout.tsx
rename to src/app/dev/(user)/colab/edit/[id]/layout.tsx
diff --git a/src/app/dev/(user)/colab/edit/[id]/page.tsx b/src/app/dev/(user)/colab/edit/[id]/page.tsx
new file mode 100644
index 00000000..f92b00bd
--- /dev/null
+++ b/src/app/dev/(user)/colab/edit/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Colab_Edit } from "@/app_modules/colab";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/colab/main/beranda/page.tsx b/src/app/dev/(user)/colab/main/beranda/page.tsx
new file mode 100644
index 00000000..0a5046f4
--- /dev/null
+++ b/src/app/dev/(user)/colab/main/beranda/page.tsx
@@ -0,0 +1,9 @@
+import { Colab_Beranda } from "@/app_modules/colab";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/colab/main/grup/page.tsx b/src/app/dev/(user)/colab/main/grup/page.tsx
new file mode 100644
index 00000000..81104f95
--- /dev/null
+++ b/src/app/dev/(user)/colab/main/grup/page.tsx
@@ -0,0 +1,9 @@
+import Colab_GrupDiskus from "@/app_modules/colab/main/grup";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/colab/main/layout.tsx b/src/app/dev/(user)/colab/main/layout.tsx
new file mode 100644
index 00000000..57a49c42
--- /dev/null
+++ b/src/app/dev/(user)/colab/main/layout.tsx
@@ -0,0 +1,15 @@
+import { LayoutColab_Main } from "@/app_modules/colab";
+import React from "react";
+
+export default async function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/colab/main/proyek/page.tsx b/src/app/dev/(user)/colab/main/proyek/page.tsx
new file mode 100644
index 00000000..a1d89694
--- /dev/null
+++ b/src/app/dev/(user)/colab/main/proyek/page.tsx
@@ -0,0 +1,9 @@
+import { Colab_Proyek } from "@/app_modules/colab";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/colab/splash/page.tsx b/src/app/dev/(user)/colab/splash/page.tsx
similarity index 100%
rename from src/app/dev/colab/splash/page.tsx
rename to src/app/dev/(user)/colab/splash/page.tsx
diff --git a/src/app/dev/crowd/main/layout.tsx b/src/app/dev/(user)/crowd/main/layout.tsx
similarity index 100%
rename from src/app/dev/crowd/main/layout.tsx
rename to src/app/dev/(user)/crowd/main/layout.tsx
diff --git a/src/app/dev/crowd/main/page.tsx b/src/app/dev/(user)/crowd/main/page.tsx
similarity index 100%
rename from src/app/dev/crowd/main/page.tsx
rename to src/app/dev/(user)/crowd/main/page.tsx
diff --git a/src/app/dev/crowd/splash/page.tsx b/src/app/dev/(user)/crowd/splash/page.tsx
similarity index 100%
rename from src/app/dev/crowd/splash/page.tsx
rename to src/app/dev/(user)/crowd/splash/page.tsx
diff --git a/src/app/dev/donasi/bukti-transfer/[id]/page.tsx b/src/app/dev/(user)/donasi/bukti-transfer/[id]/page.tsx
similarity index 100%
rename from src/app/dev/donasi/bukti-transfer/[id]/page.tsx
rename to src/app/dev/(user)/donasi/bukti-transfer/[id]/page.tsx
diff --git a/src/app/dev/(user)/donasi/cerita_penggalang/[id]/layout.tsx b/src/app/dev/(user)/donasi/cerita_penggalang/[id]/layout.tsx
new file mode 100644
index 00000000..4433edeb
--- /dev/null
+++ b/src/app/dev/(user)/donasi/cerita_penggalang/[id]/layout.tsx
@@ -0,0 +1,15 @@
+import { LayoutCeritaPenggalangDonasi } from "@/app_modules/donasi";
+import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
+import React from "react";
+
+export default async function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/donasi/cerita_penggalang/[id]/page.tsx b/src/app/dev/(user)/donasi/cerita_penggalang/[id]/page.tsx
new file mode 100644
index 00000000..97f4c94f
--- /dev/null
+++ b/src/app/dev/(user)/donasi/cerita_penggalang/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { CeritaPenggalangDonasi } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/donasi/create/cerita_penggalang/[id]/layout.tsx b/src/app/dev/(user)/donasi/create/cerita_penggalang/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/create/cerita_penggalang/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/create/cerita_penggalang/[id]/layout.tsx
diff --git a/src/app/dev/(user)/donasi/create/cerita_penggalang/[id]/page.tsx b/src/app/dev/(user)/donasi/create/cerita_penggalang/[id]/page.tsx
new file mode 100644
index 00000000..b02abb33
--- /dev/null
+++ b/src/app/dev/(user)/donasi/create/cerita_penggalang/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { CreateCeritaPenggalangDonasi } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/donasi/create/create_donasi/layout.tsx b/src/app/dev/(user)/donasi/create/create_donasi/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/create/create_donasi/layout.tsx
rename to src/app/dev/(user)/donasi/create/create_donasi/layout.tsx
diff --git a/src/app/dev/(user)/donasi/create/create_donasi/page.tsx b/src/app/dev/(user)/donasi/create/create_donasi/page.tsx
new file mode 100644
index 00000000..0b0aef8c
--- /dev/null
+++ b/src/app/dev/(user)/donasi/create/create_donasi/page.tsx
@@ -0,0 +1,5 @@
+import { CreateDonasiNew } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return ;
+}
diff --git a/src/app/dev/donasi/create/create_kabar/[id]/layout.tsx b/src/app/dev/(user)/donasi/create/create_kabar/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/create/create_kabar/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/create/create_kabar/[id]/layout.tsx
diff --git a/src/app/dev/(user)/donasi/create/create_kabar/[id]/page.tsx b/src/app/dev/(user)/donasi/create/create_kabar/[id]/page.tsx
new file mode 100644
index 00000000..6de2e1ce
--- /dev/null
+++ b/src/app/dev/(user)/donasi/create/create_kabar/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Donasi_CreateKabar } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/donasi/detail/donasi_saya/[id]/layout.tsx b/src/app/dev/(user)/donasi/detail/donasi_saya/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/detail/donasi_saya/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/detail/donasi_saya/[id]/layout.tsx
diff --git a/src/app/dev/(user)/donasi/detail/donasi_saya/[id]/page.tsx b/src/app/dev/(user)/donasi/detail/donasi_saya/[id]/page.tsx
new file mode 100644
index 00000000..879f711f
--- /dev/null
+++ b/src/app/dev/(user)/donasi/detail/donasi_saya/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { DetailDonasiSaya } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/donasi/detail/draft/[id]/layout.tsx b/src/app/dev/(user)/donasi/detail/draft/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/detail/draft/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/detail/draft/[id]/layout.tsx
diff --git a/src/app/dev/(user)/donasi/detail/draft/[id]/page.tsx b/src/app/dev/(user)/donasi/detail/draft/[id]/page.tsx
new file mode 100644
index 00000000..0003b80e
--- /dev/null
+++ b/src/app/dev/(user)/donasi/detail/draft/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { DetailDraftDonasi } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/donasi/detail/kabar/[id]/layout.tsx b/src/app/dev/(user)/donasi/detail/kabar/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/detail/kabar/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/detail/kabar/[id]/layout.tsx
diff --git a/src/app/dev/(user)/donasi/detail/kabar/[id]/page.tsx b/src/app/dev/(user)/donasi/detail/kabar/[id]/page.tsx
new file mode 100644
index 00000000..b7b35179
--- /dev/null
+++ b/src/app/dev/(user)/donasi/detail/kabar/[id]/page.tsx
@@ -0,0 +1,5 @@
+import { DetailKabarDonasi } from "@/app_modules/donasi";
+
+export default async function Page({params}: {params: {id: string}}) {
+ return
+}
\ No newline at end of file
diff --git a/src/app/dev/(user)/donasi/detail/main/[id]/layout.tsx b/src/app/dev/(user)/donasi/detail/main/[id]/layout.tsx
new file mode 100644
index 00000000..d810d3cd
--- /dev/null
+++ b/src/app/dev/(user)/donasi/detail/main/[id]/layout.tsx
@@ -0,0 +1,13 @@
+import { LayoutDetailMainDonasiNew } from "@/app_modules/donasi";
+import React from "react";
+
+export default async function Layout({ children }: { children: React.ReactNode; }) {
+
+ return (
+ <>
+
+ {children}
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/donasi/detail/main/[id]/page.tsx b/src/app/dev/(user)/donasi/detail/main/[id]/page.tsx
new file mode 100644
index 00000000..c92aa864
--- /dev/null
+++ b/src/app/dev/(user)/donasi/detail/main/[id]/page.tsx
@@ -0,0 +1,9 @@
+import DetailMainDonasiNew from "@/app_modules/donasi/detail/detail_main/index_new";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/donasi/detail/publish/[id]/layout.tsx b/src/app/dev/(user)/donasi/detail/publish/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/detail/publish/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/detail/publish/[id]/layout.tsx
diff --git a/src/app/dev/(user)/donasi/detail/publish/[id]/page.tsx b/src/app/dev/(user)/donasi/detail/publish/[id]/page.tsx
new file mode 100644
index 00000000..df37bd53
--- /dev/null
+++ b/src/app/dev/(user)/donasi/detail/publish/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { DetailPublishDonasi } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/donasi/detail/reject/[id]/layout.tsx b/src/app/dev/(user)/donasi/detail/reject/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/detail/reject/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/detail/reject/[id]/layout.tsx
diff --git a/src/app/dev/(user)/donasi/detail/reject/[id]/page.tsx b/src/app/dev/(user)/donasi/detail/reject/[id]/page.tsx
new file mode 100644
index 00000000..561d04a8
--- /dev/null
+++ b/src/app/dev/(user)/donasi/detail/reject/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { DetailRejectDonasi } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/donasi/detail/review/[id]/layout.tsx b/src/app/dev/(user)/donasi/detail/review/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/detail/review/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/detail/review/[id]/layout.tsx
diff --git a/src/app/dev/(user)/donasi/detail/review/[id]/page.tsx b/src/app/dev/(user)/donasi/detail/review/[id]/page.tsx
new file mode 100644
index 00000000..8d9d7cbf
--- /dev/null
+++ b/src/app/dev/(user)/donasi/detail/review/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { DetailReviewDonasi } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/donasi/donatur/[id]/layout.tsx b/src/app/dev/(user)/donasi/donatur/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/donatur/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/donatur/[id]/layout.tsx
diff --git a/src/app/dev/(user)/donasi/donatur/[id]/page.tsx b/src/app/dev/(user)/donasi/donatur/[id]/page.tsx
new file mode 100644
index 00000000..69843197
--- /dev/null
+++ b/src/app/dev/(user)/donasi/donatur/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { DonaturDonasi } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/donasi/edit/edit_cerita/[id]/layout.tsx b/src/app/dev/(user)/donasi/edit/edit_cerita/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/edit/edit_cerita/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/edit/edit_cerita/[id]/layout.tsx
diff --git a/src/app/dev/(user)/donasi/edit/edit_cerita/[id]/page.tsx b/src/app/dev/(user)/donasi/edit/edit_cerita/[id]/page.tsx
new file mode 100644
index 00000000..c54da819
--- /dev/null
+++ b/src/app/dev/(user)/donasi/edit/edit_cerita/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { EditCeritaPenggalangDonasi } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/donasi/edit/edit_donasi/[id]/layout.tsx b/src/app/dev/(user)/donasi/edit/edit_donasi/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/edit/edit_donasi/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/edit/edit_donasi/[id]/layout.tsx
diff --git a/src/app/dev/(user)/donasi/edit/edit_donasi/[id]/page.tsx b/src/app/dev/(user)/donasi/edit/edit_donasi/[id]/page.tsx
new file mode 100644
index 00000000..c99d7fab
--- /dev/null
+++ b/src/app/dev/(user)/donasi/edit/edit_donasi/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { EditDonasiNew } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/donasi/edit/edit_rekening/[id]/layout.tsx b/src/app/dev/(user)/donasi/edit/edit_rekening/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/edit/edit_rekening/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/edit/edit_rekening/[id]/layout.tsx
diff --git a/src/app/dev/(user)/donasi/edit/edit_rekening/[id]/page.tsx b/src/app/dev/(user)/donasi/edit/edit_rekening/[id]/page.tsx
new file mode 100644
index 00000000..b607efbb
--- /dev/null
+++ b/src/app/dev/(user)/donasi/edit/edit_rekening/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Donasi_EditRekening } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/donasi/edit/kabar/[id]/page.tsx b/src/app/dev/(user)/donasi/edit/kabar/[id]/page.tsx
new file mode 100644
index 00000000..5ce340bf
--- /dev/null
+++ b/src/app/dev/(user)/donasi/edit/kabar/[id]/page.tsx
@@ -0,0 +1,11 @@
+import { Donasi_UiEditKabar } from "@/app_modules/donasi/_ui";
+
+async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/donasi/edit/update_kabar/[id]/layout.tsx b/src/app/dev/(user)/donasi/edit/update_kabar/[id]/layout.tsx
similarity index 64%
rename from src/app/dev/donasi/edit/update_kabar/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/edit/update_kabar/[id]/layout.tsx
index 03968363..7d7abf48 100644
--- a/src/app/dev/donasi/edit/update_kabar/[id]/layout.tsx
+++ b/src/app/dev/(user)/donasi/edit/update_kabar/[id]/layout.tsx
@@ -3,14 +3,12 @@ import React from "react";
export default async function Layout({
children,
- params
}: {
children: React.ReactNode;
- params: {id: string}
}) {
return (
<>
- {children}
+ {children}
>
);
}
diff --git a/src/app/dev/(user)/donasi/edit/update_kabar/[id]/page.tsx b/src/app/dev/(user)/donasi/edit/update_kabar/[id]/page.tsx
new file mode 100644
index 00000000..93278ec4
--- /dev/null
+++ b/src/app/dev/(user)/donasi/edit/update_kabar/[id]/page.tsx
@@ -0,0 +1,10 @@
+import { UpdateKabarDonasi } from "@/app_modules/donasi";
+
+export default async function Page() {
+
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/donasi/kabar/[id]/layout.tsx b/src/app/dev/(user)/donasi/kabar/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/kabar/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/kabar/[id]/layout.tsx
diff --git a/src/app/dev/(user)/donasi/kabar/[id]/page.tsx b/src/app/dev/(user)/donasi/kabar/[id]/page.tsx
new file mode 100644
index 00000000..ff47e41e
--- /dev/null
+++ b/src/app/dev/(user)/donasi/kabar/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { KabarDonasi } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/donasi/kabar/daftar/[id]/page.tsx b/src/app/dev/(user)/donasi/kabar/daftar/[id]/page.tsx
new file mode 100644
index 00000000..ce86af26
--- /dev/null
+++ b/src/app/dev/(user)/donasi/kabar/daftar/[id]/page.tsx
@@ -0,0 +1,17 @@
+import { Donasi_UiDaftarKabar } from "@/app_modules/donasi/_ui";
+
+async function Page({ params }: { params: { id: string } }) {
+ // const donasiId = params.id;
+ // const listKabar = await donasi_funGetListKabarById({
+ // page: 1,
+ // donasiId: donasiId,
+ // });
+
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/(user)/donasi/kabar/rekap/[id]/page.tsx b/src/app/dev/(user)/donasi/kabar/rekap/[id]/page.tsx
new file mode 100644
index 00000000..dead1062
--- /dev/null
+++ b/src/app/dev/(user)/donasi/kabar/rekap/[id]/page.tsx
@@ -0,0 +1,11 @@
+import { Donasi_UiRekapKabar } from "@/app_modules/donasi/_ui";
+
+async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/(user)/donasi/main/beranda/page.tsx b/src/app/dev/(user)/donasi/main/beranda/page.tsx
new file mode 100644
index 00000000..08d64509
--- /dev/null
+++ b/src/app/dev/(user)/donasi/main/beranda/page.tsx
@@ -0,0 +1,8 @@
+import { MainDonasiNew } from "@/app_modules/donasi";
+
+export default async function Page() {
+ // const listDonasi = await donasi_funGetAllPublish({ page: 1 });
+
+ // return ;
+ return
+}
diff --git a/src/app/dev/(user)/donasi/main/donasi_saya/page.tsx b/src/app/dev/(user)/donasi/main/donasi_saya/page.tsx
new file mode 100644
index 00000000..a04c7954
--- /dev/null
+++ b/src/app/dev/(user)/donasi/main/donasi_saya/page.tsx
@@ -0,0 +1,12 @@
+import DonasiSayaNew from "@/app_modules/donasi/main/donasi_saya_new";
+
+export default async function Page() {
+ // const listInvoice = await donasi_funGetAllInvoiceByAuthorId({ page: 1 });
+
+ return (
+ <>
+ {/* ; */}
+
+ >
+ )
+}
diff --git a/src/app/dev/(user)/donasi/main/galang_dana/[id]/page.tsx b/src/app/dev/(user)/donasi/main/galang_dana/[id]/page.tsx
new file mode 100644
index 00000000..c3cfa869
--- /dev/null
+++ b/src/app/dev/(user)/donasi/main/galang_dana/[id]/page.tsx
@@ -0,0 +1,23 @@
+import { GalangDanaDonasiNew } from "@/app_modules/donasi";
+
+export default async function Page({ params }: { params: { id: string } }) {
+ // const statusId = params.id;
+
+ // const listStatus = await donasi_funMasterStatusDonasi();
+ // const dataDonasi = await donasi_funGetAllStatusById({
+ // page: 1,
+ // statusId: statusId,
+ // });
+
+ return (
+ <>
+ {/* */}
+
+
+ >
+ );
+}
diff --git a/src/app/dev/donasi/main/layout.tsx b/src/app/dev/(user)/donasi/main/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/main/layout.tsx
rename to src/app/dev/(user)/donasi/main/layout.tsx
diff --git a/src/app/dev/donasi/pencairan_dana/[id]/layout.tsx b/src/app/dev/(user)/donasi/pencairan_dana/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/pencairan_dana/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/pencairan_dana/[id]/layout.tsx
diff --git a/src/app/dev/donasi/pencairan_dana/[id]/page.tsx b/src/app/dev/(user)/donasi/pencairan_dana/[id]/page.tsx
similarity index 55%
rename from src/app/dev/donasi/pencairan_dana/[id]/page.tsx
rename to src/app/dev/(user)/donasi/pencairan_dana/[id]/page.tsx
index b8c06d3a..d5a2de17 100644
--- a/src/app/dev/donasi/pencairan_dana/[id]/page.tsx
+++ b/src/app/dev/(user)/donasi/pencairan_dana/[id]/page.tsx
@@ -3,16 +3,16 @@ import { donasi_funGetListPencairanDanaById } from "@/app_modules/donasi/fun/get
import { Donasi_getTotalPencairanDanaById } from "@/app_modules/donasi/fun/get/get_pencairan_dana_by_id";
export default async function Page({ params }: { params: { id: string } }) {
- let donasiId = params.id;
- const totalAkumulasi = await Donasi_getTotalPencairanDanaById(donasiId);
- const listPencairan = await donasi_funGetListPencairanDanaById({page: 1, donasiId: donasiId});
+ // let donasiId = params.id;
+ // const totalAkumulasi = await Donasi_getTotalPencairanDanaById(donasiId);
+ // const listPencairan = await donasi_funGetListPencairanDanaById({page: 1, donasiId: donasiId});
return (
<>
>
);
diff --git a/src/app/dev/donasi/penggalang_dana/[id]/layout.tsx b/src/app/dev/(user)/donasi/penggalang_dana/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/penggalang_dana/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/penggalang_dana/[id]/layout.tsx
diff --git a/src/app/dev/(user)/donasi/penggalang_dana/[id]/page.tsx b/src/app/dev/(user)/donasi/penggalang_dana/[id]/page.tsx
new file mode 100644
index 00000000..c0aea8d6
--- /dev/null
+++ b/src/app/dev/(user)/donasi/penggalang_dana/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { PenggalangDanaDonasi } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/donasi/proses_donasi/invoice/[id]/layout.tsx b/src/app/dev/(user)/donasi/proses_donasi/invoice/[id]/layout.tsx
new file mode 100644
index 00000000..300fe0fa
--- /dev/null
+++ b/src/app/dev/(user)/donasi/proses_donasi/invoice/[id]/layout.tsx
@@ -0,0 +1,14 @@
+import { LayoutDonasi_InvoiceProses } from "@/app_modules/donasi";
+import React from "react";
+
+export default async function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/donasi/proses_donasi/invoice/[id]/page.tsx b/src/app/dev/(user)/donasi/proses_donasi/invoice/[id]/page.tsx
new file mode 100644
index 00000000..09361f5e
--- /dev/null
+++ b/src/app/dev/(user)/donasi/proses_donasi/invoice/[id]/page.tsx
@@ -0,0 +1,5 @@
+import { Donasi_InvoiceProses } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return ;
+}
diff --git a/src/app/dev/donasi/proses_donasi/masukan_donasi/[id]/layout.tsx b/src/app/dev/(user)/donasi/proses_donasi/masukan_donasi/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/donasi/proses_donasi/masukan_donasi/[id]/layout.tsx
rename to src/app/dev/(user)/donasi/proses_donasi/masukan_donasi/[id]/layout.tsx
diff --git a/src/app/dev/donasi/proses_donasi/masukan_donasi/[id]/page.tsx b/src/app/dev/(user)/donasi/proses_donasi/masukan_donasi/[id]/page.tsx
similarity index 100%
rename from src/app/dev/donasi/proses_donasi/masukan_donasi/[id]/page.tsx
rename to src/app/dev/(user)/donasi/proses_donasi/masukan_donasi/[id]/page.tsx
diff --git a/src/app/dev/(user)/donasi/proses_donasi/metode_pembayaran/[id]/layout.tsx b/src/app/dev/(user)/donasi/proses_donasi/metode_pembayaran/[id]/layout.tsx
new file mode 100644
index 00000000..e7c36204
--- /dev/null
+++ b/src/app/dev/(user)/donasi/proses_donasi/metode_pembayaran/[id]/layout.tsx
@@ -0,0 +1,14 @@
+import { LayoutDonasi_MetodePembayaran } from "@/app_modules/donasi";
+import React from "react";
+
+export default async function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/donasi/proses_donasi/metode_pembayaran/[id]/page.tsx b/src/app/dev/(user)/donasi/proses_donasi/metode_pembayaran/[id]/page.tsx
new file mode 100644
index 00000000..020c9e9f
--- /dev/null
+++ b/src/app/dev/(user)/donasi/proses_donasi/metode_pembayaran/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Donasi_MetodePembayaran } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/donasi/proses_donasi/proses_transaksi/[id]/layout.tsx b/src/app/dev/(user)/donasi/proses_donasi/proses_transaksi/[id]/layout.tsx
new file mode 100644
index 00000000..8748b2eb
--- /dev/null
+++ b/src/app/dev/(user)/donasi/proses_donasi/proses_transaksi/[id]/layout.tsx
@@ -0,0 +1,14 @@
+import { LayoutDonasi_ProsesTransaksi } from "@/app_modules/donasi";
+import React from "react";
+
+export default async function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/donasi/proses_donasi/proses_transaksi/[id]/page.tsx b/src/app/dev/(user)/donasi/proses_donasi/proses_transaksi/[id]/page.tsx
new file mode 100644
index 00000000..d800a97c
--- /dev/null
+++ b/src/app/dev/(user)/donasi/proses_donasi/proses_transaksi/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Donasi_ProsesTransaksi } from "@/app_modules/donasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/event/create/layout.tsx b/src/app/dev/(user)/event/create/layout.tsx
similarity index 100%
rename from src/app/dev/event/create/layout.tsx
rename to src/app/dev/(user)/event/create/layout.tsx
diff --git a/src/app/dev/(user)/event/create/page.tsx b/src/app/dev/(user)/event/create/page.tsx
new file mode 100644
index 00000000..32a3cec4
--- /dev/null
+++ b/src/app/dev/(user)/event/create/page.tsx
@@ -0,0 +1,5 @@
+import { Event_Create } from "@/app_modules/event";
+
+export default async function Page() {
+ return ;
+}
diff --git a/src/app/dev/(user)/event/detail/detail_sponsor/[id]/layout.tsx b/src/app/dev/(user)/event/detail/detail_sponsor/[id]/layout.tsx
new file mode 100644
index 00000000..ca263a9d
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/detail_sponsor/[id]/layout.tsx
@@ -0,0 +1,16 @@
+import { funGetUserIdByToken } from '@/app_modules/_global/fun/get';
+import LayoutEvent_DetailSponsor from '@/app_modules/event/detail/detail_sponsor/layout';
+import React from 'react';
+
+async function Layout({children} : {children: React.ReactNode}) {
+ // const userLoginId = await funGetUserIdByToken()
+ return (
+ <>
+
+ {children}
+
+ >
+ );
+}
+
+export default Layout;
diff --git a/src/app/dev/(user)/event/detail/detail_sponsor/[id]/page.tsx b/src/app/dev/(user)/event/detail/detail_sponsor/[id]/page.tsx
new file mode 100644
index 00000000..dff347af
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/detail_sponsor/[id]/page.tsx
@@ -0,0 +1,14 @@
+import { funGetUserIdByToken } from '@/app_modules/_global/fun/get';
+import DetailSponsor_Event from '@/app_modules/event/detail/detail_sponsor';
+import React from 'react';
+
+async function Page() {
+ // const userLoginId = await funGetUserIdByToken();
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/event/detail/draft/[id]/layout.tsx b/src/app/dev/(user)/event/detail/draft/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/event/detail/draft/[id]/layout.tsx
rename to src/app/dev/(user)/event/detail/draft/[id]/layout.tsx
diff --git a/src/app/dev/(user)/event/detail/draft/[id]/page.tsx b/src/app/dev/(user)/event/detail/draft/[id]/page.tsx
new file mode 100644
index 00000000..5a67a485
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/draft/[id]/page.tsx
@@ -0,0 +1,7 @@
+import { Event_DetailDraft } from "@/app_modules/event";
+
+export default async function Page() {
+ return (
+
+ );
+}
diff --git a/src/app/dev/event/detail/kontribusi/[id]/layout.tsx b/src/app/dev/(user)/event/detail/kontribusi/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/event/detail/kontribusi/[id]/layout.tsx
rename to src/app/dev/(user)/event/detail/kontribusi/[id]/layout.tsx
diff --git a/src/app/dev/(user)/event/detail/kontribusi/[id]/page.tsx b/src/app/dev/(user)/event/detail/kontribusi/[id]/page.tsx
new file mode 100644
index 00000000..80fd281b
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/kontribusi/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Event_DetailKontribusi } from "@/app_modules/event";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/event/detail/main/[id]/layout.tsx b/src/app/dev/(user)/event/detail/main/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/event/detail/main/[id]/layout.tsx
rename to src/app/dev/(user)/event/detail/main/[id]/layout.tsx
diff --git a/src/app/dev/(user)/event/detail/main/[id]/page.tsx b/src/app/dev/(user)/event/detail/main/[id]/page.tsx
new file mode 100644
index 00000000..9b47f808
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/main/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Event_DetailMain } from "@/app_modules/event";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/event/detail/peserta/[id]/layout.tsx b/src/app/dev/(user)/event/detail/peserta/[id]/layout.tsx
new file mode 100644
index 00000000..74bdbe58
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/peserta/[id]/layout.tsx
@@ -0,0 +1,10 @@
+import { LayoutEvent_Peserta } from '@/app_modules/event';
+import React from 'react';
+
+export default async function Page({ children }: { children: React.ReactNode }) {
+ return (
+
+ {children}
+
+ )
+}
diff --git a/src/app/dev/(user)/event/detail/peserta/[id]/page.tsx b/src/app/dev/(user)/event/detail/peserta/[id]/page.tsx
new file mode 100644
index 00000000..fec42f21
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/peserta/[id]/page.tsx
@@ -0,0 +1,8 @@
+import Event_DaftarPeserta from '@/app_modules/event/detail/peserta';
+
+export default async function Page() {
+ return (
+
+ )
+
+}
diff --git a/src/app/dev/event/detail/publish/[id]/layout.tsx b/src/app/dev/(user)/event/detail/publish/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/event/detail/publish/[id]/layout.tsx
rename to src/app/dev/(user)/event/detail/publish/[id]/layout.tsx
diff --git a/src/app/dev/(user)/event/detail/publish/[id]/page.tsx b/src/app/dev/(user)/event/detail/publish/[id]/page.tsx
new file mode 100644
index 00000000..e17f8fe4
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/publish/[id]/page.tsx
@@ -0,0 +1,5 @@
+import { Event_DetailPublish } from "@/app_modules/event";
+
+export default async function Page() {
+ return ;
+}
diff --git a/src/app/dev/event/detail/reject/[id]/layout.tsx b/src/app/dev/(user)/event/detail/reject/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/event/detail/reject/[id]/layout.tsx
rename to src/app/dev/(user)/event/detail/reject/[id]/layout.tsx
diff --git a/src/app/dev/(user)/event/detail/reject/[id]/page.tsx b/src/app/dev/(user)/event/detail/reject/[id]/page.tsx
new file mode 100644
index 00000000..59766cdf
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/reject/[id]/page.tsx
@@ -0,0 +1,5 @@
+import { Event_DetailReject } from "@/app_modules/event";
+
+export default async function Page() {
+ return ;
+}
diff --git a/src/app/dev/event/detail/review/[id]/layout.tsx b/src/app/dev/(user)/event/detail/review/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/event/detail/review/[id]/layout.tsx
rename to src/app/dev/(user)/event/detail/review/[id]/layout.tsx
diff --git a/src/app/dev/(user)/event/detail/review/[id]/page.tsx b/src/app/dev/(user)/event/detail/review/[id]/page.tsx
new file mode 100644
index 00000000..99b3d969
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/review/[id]/page.tsx
@@ -0,0 +1,5 @@
+import { Event_DetailReview } from "@/app_modules/event";
+
+export default async function Page() {
+ return ;
+}
diff --git a/src/app/dev/event/detail/riwayat/[id]/layout.tsx b/src/app/dev/(user)/event/detail/riwayat/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/event/detail/riwayat/[id]/layout.tsx
rename to src/app/dev/(user)/event/detail/riwayat/[id]/layout.tsx
diff --git a/src/app/dev/(user)/event/detail/riwayat/[id]/page.tsx b/src/app/dev/(user)/event/detail/riwayat/[id]/page.tsx
new file mode 100644
index 00000000..70a014a6
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/riwayat/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Event_DetailRiwayat } from "@/app_modules/event";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/event/detail/sponsor/[id]/layout.tsx b/src/app/dev/(user)/event/detail/sponsor/[id]/layout.tsx
new file mode 100644
index 00000000..957a0527
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/sponsor/[id]/layout.tsx
@@ -0,0 +1,14 @@
+import { LayoutEvent_Sponsor } from '@/app_modules/event';
+import React from 'react';
+
+function Layout({ children, }: {children: React.ReactNode}) {
+ return (
+ <>
+
+ {children}
+
+ >
+ );
+}
+
+export default Layout;
diff --git a/src/app/dev/(user)/event/detail/sponsor/[id]/page.tsx b/src/app/dev/(user)/event/detail/sponsor/[id]/page.tsx
new file mode 100644
index 00000000..d755e6bb
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/sponsor/[id]/page.tsx
@@ -0,0 +1,11 @@
+import Event_DaftarSponsor from '@/app_modules/event/detail/sponsor';
+
+function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/(user)/event/detail/sponsor/edit_sponsor/layout.tsx b/src/app/dev/(user)/event/detail/sponsor/edit_sponsor/layout.tsx
new file mode 100644
index 00000000..ed430688
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/sponsor/edit_sponsor/layout.tsx
@@ -0,0 +1,14 @@
+import Event_LayoutEditSponsor from '@/app_modules/event/detail/sponsor/edit_sponsor/layout';
+import React from 'react';
+
+function Layout({ children }: { children: React.ReactNode }) {
+ return (
+ <>
+
+ {children}
+
+ >
+ );
+}
+
+export default Layout;
diff --git a/src/app/dev/(user)/event/detail/sponsor/edit_sponsor/page.tsx b/src/app/dev/(user)/event/detail/sponsor/edit_sponsor/page.tsx
new file mode 100644
index 00000000..4b3e2fb9
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/sponsor/edit_sponsor/page.tsx
@@ -0,0 +1,12 @@
+import Event_EditSponsor from '@/app_modules/event/detail/sponsor/edit_sponsor';
+import React from 'react';
+
+function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/(user)/event/detail/sponsor/metode_pembayaran/[id]/layout.tsx b/src/app/dev/(user)/event/detail/sponsor/metode_pembayaran/[id]/layout.tsx
new file mode 100644
index 00000000..4874c821
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/sponsor/metode_pembayaran/[id]/layout.tsx
@@ -0,0 +1,14 @@
+import Event_LayoutMetodePembayaran from '@/app_modules/event/detail/sponsor/metode_pembayaran/layout';
+import React from 'react';
+
+function Layout({ children } : { children: React.ReactNode }) {
+ return (
+ <>
+
+ {children}
+
+ >
+ );
+}
+
+export default Layout;
diff --git a/src/app/dev/(user)/event/detail/sponsor/metode_pembayaran/[id]/page.tsx b/src/app/dev/(user)/event/detail/sponsor/metode_pembayaran/[id]/page.tsx
new file mode 100644
index 00000000..9e749bdd
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/sponsor/metode_pembayaran/[id]/page.tsx
@@ -0,0 +1,12 @@
+
+import Event_MetodePembayaran from '@/app_modules/event/detail/sponsor/metode_pembayaran';
+
+function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/(user)/event/detail/sponsor/nominal_sponsor/[id]/layout.tsx b/src/app/dev/(user)/event/detail/sponsor/nominal_sponsor/[id]/layout.tsx
new file mode 100644
index 00000000..d3fedd39
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/sponsor/nominal_sponsor/[id]/layout.tsx
@@ -0,0 +1,12 @@
+import Event_LayoutNominalSponsor from '@/app_modules/event/detail/sponsor/nominal_sponsor/layout';
+import React from 'react';
+
+function Layout({ children }: { children: React.ReactNode }) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
+
+export default Layout;
diff --git a/src/app/dev/(user)/event/detail/sponsor/nominal_sponsor/[id]/page.tsx b/src/app/dev/(user)/event/detail/sponsor/nominal_sponsor/[id]/page.tsx
new file mode 100644
index 00000000..1ca80c55
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/sponsor/nominal_sponsor/[id]/page.tsx
@@ -0,0 +1,12 @@
+import Event_PilihNominalSponsor from '@/app_modules/event/detail/sponsor/nominal_sponsor';
+import React from 'react';
+
+function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/(user)/event/detail/sponsor/tambah_sponsor/[id]/layout.tsx b/src/app/dev/(user)/event/detail/sponsor/tambah_sponsor/[id]/layout.tsx
new file mode 100644
index 00000000..24091745
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/sponsor/tambah_sponsor/[id]/layout.tsx
@@ -0,0 +1,12 @@
+import LayoutEvent_TambahSponsor from '@/app_modules/event/detail/tambah_sponsor/layout';
+import React from 'react';
+
+function Layout({children}: {children: React.ReactNode}) {
+ return (
+
+ {children}
+
+ );
+}
+
+export default Layout;
diff --git a/src/app/dev/(user)/event/detail/sponsor/tambah_sponsor/[id]/page.tsx b/src/app/dev/(user)/event/detail/sponsor/tambah_sponsor/[id]/page.tsx
new file mode 100644
index 00000000..f47e4cd3
--- /dev/null
+++ b/src/app/dev/(user)/event/detail/sponsor/tambah_sponsor/[id]/page.tsx
@@ -0,0 +1,12 @@
+import Event_TambahSponsor from '@/app_modules/event/detail/tambah_sponsor';
+import React from 'react';
+
+function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/vote/main/layout.tsx b/src/app/dev/(user)/event/edit/[id]/layout.tsx
similarity index 57%
rename from src/app/dev/vote/main/layout.tsx
rename to src/app/dev/(user)/event/edit/[id]/layout.tsx
index 6c2e5673..8fa6a1e9 100644
--- a/src/app/dev/vote/main/layout.tsx
+++ b/src/app/dev/(user)/event/edit/[id]/layout.tsx
@@ -1,4 +1,4 @@
-import { LayoutVote_Main } from "@/app_modules/vote";
+import { LayoutEvent_Edit } from "@/app_modules/event";
import React from "react";
export default async function Layout({
@@ -8,7 +8,7 @@ export default async function Layout({
}) {
return (
<>
- {children}
+ {children}
>
);
}
diff --git a/src/app/dev/(user)/event/edit/[id]/page.tsx b/src/app/dev/(user)/event/edit/[id]/page.tsx
new file mode 100644
index 00000000..ead792b0
--- /dev/null
+++ b/src/app/dev/(user)/event/edit/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Event_Edit } from "@/app_modules/event";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/event/invoice/[id]/layout.tsx b/src/app/dev/(user)/event/invoice/[id]/layout.tsx
new file mode 100644
index 00000000..ec04b66b
--- /dev/null
+++ b/src/app/dev/(user)/event/invoice/[id]/layout.tsx
@@ -0,0 +1,14 @@
+import Event_LayoutInvoice from '@/app_modules/event/detail/invoice/layout';
+import React from 'react';
+
+function Layout({ children }: { children: React.ReactNode }) {
+ return (
+ <>
+
+ {children}
+
+ >
+ );
+}
+
+export default Layout;
diff --git a/src/app/dev/(user)/event/invoice/[id]/page.tsx b/src/app/dev/(user)/event/invoice/[id]/page.tsx
new file mode 100644
index 00000000..1d712941
--- /dev/null
+++ b/src/app/dev/(user)/event/invoice/[id]/page.tsx
@@ -0,0 +1,14 @@
+import { funGetUserIdByToken } from '@/app_modules/_global/fun/get';
+import Event_Invoice from '@/app_modules/event/detail/invoice';
+import React from 'react';
+
+async function Page() {
+ // const userLoginId = await funGetUserIdByToken();
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/(user)/event/konfirmasi/[id]/page.tsx b/src/app/dev/(user)/event/konfirmasi/[id]/page.tsx
new file mode 100644
index 00000000..76f439c6
--- /dev/null
+++ b/src/app/dev/(user)/event/konfirmasi/[id]/page.tsx
@@ -0,0 +1,10 @@
+import UiEvent_V2_Konfirmasi from "@/app_modules/event/_ui/V2_konfirmasi";
+
+export default async function Page() {
+ return (
+ <>
+ {/* */}
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/event/main/beranda/page.tsx b/src/app/dev/(user)/event/main/beranda/page.tsx
new file mode 100644
index 00000000..5bde2a88
--- /dev/null
+++ b/src/app/dev/(user)/event/main/beranda/page.tsx
@@ -0,0 +1,10 @@
+import { Event_Beranda } from "@/app_modules/event";
+
+export default async function Page() {
+
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/event/main/kontribusi/page.tsx b/src/app/dev/(user)/event/main/kontribusi/page.tsx
similarity index 63%
rename from src/app/dev/event/main/kontribusi/page.tsx
rename to src/app/dev/(user)/event/main/kontribusi/page.tsx
index 0a883c1b..18e81ccf 100644
--- a/src/app/dev/event/main/kontribusi/page.tsx
+++ b/src/app/dev/(user)/event/main/kontribusi/page.tsx
@@ -2,11 +2,10 @@ import { Event_Kontribusi } from "@/app_modules/event";
import { event_getListKontibusiByUserId } from "@/app_modules/event/fun/get/get_list_kontribusi_by_user_id";
export default async function Page() {
- const listKontribusi = await event_getListKontibusiByUserId({page: 1})
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/(user)/event/main/layout.tsx b/src/app/dev/(user)/event/main/layout.tsx
new file mode 100644
index 00000000..3f595b15
--- /dev/null
+++ b/src/app/dev/(user)/event/main/layout.tsx
@@ -0,0 +1,15 @@
+import { LayoutEvent_Main } from "@/app_modules/event";
+import NewLayout_Event from "@/app_modules/event/main/new_layout_event";
+import React from "react";
+
+export default async function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/event/main/riwayat/[id]/page.tsx b/src/app/dev/(user)/event/main/riwayat/[id]/page.tsx
new file mode 100644
index 00000000..9ae233cc
--- /dev/null
+++ b/src/app/dev/(user)/event/main/riwayat/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Event_Riwayat } from "@/app_modules/event";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/event/main/status/[id]/page.tsx b/src/app/dev/(user)/event/main/status/[id]/page.tsx
new file mode 100644
index 00000000..1336dc64
--- /dev/null
+++ b/src/app/dev/(user)/event/main/status/[id]/page.tsx
@@ -0,0 +1,11 @@
+import { Event_StatusPage } from "@/app_modules/event";
+
+async function Page({ params }: { params: { id: string } }) {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/event/splash/page.tsx b/src/app/dev/(user)/event/splash/page.tsx
similarity index 100%
rename from src/app/dev/event/splash/page.tsx
rename to src/app/dev/(user)/event/splash/page.tsx
diff --git a/src/app/dev/forum/create/layout.tsx b/src/app/dev/(user)/forum/create/layout.tsx
similarity index 100%
rename from src/app/dev/forum/create/layout.tsx
rename to src/app/dev/(user)/forum/create/layout.tsx
diff --git a/src/app/dev/(user)/forum/create/page.tsx b/src/app/dev/(user)/forum/create/page.tsx
new file mode 100644
index 00000000..7b93d284
--- /dev/null
+++ b/src/app/dev/(user)/forum/create/page.tsx
@@ -0,0 +1,9 @@
+import { Forum_V3_Create } from "@/app_modules/forum/create/V3_create";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/forum/detail/main-detail/[id]/layout.tsx b/src/app/dev/(user)/forum/detail/main-detail/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/forum/detail/main-detail/[id]/layout.tsx
rename to src/app/dev/(user)/forum/detail/main-detail/[id]/layout.tsx
diff --git a/src/app/dev/(user)/forum/detail/main-detail/[id]/page.tsx b/src/app/dev/(user)/forum/detail/main-detail/[id]/page.tsx
new file mode 100644
index 00000000..22c306f7
--- /dev/null
+++ b/src/app/dev/(user)/forum/detail/main-detail/[id]/page.tsx
@@ -0,0 +1,9 @@
+import Forum_V3_MainDetail from "@/app_modules/forum/detail/v3_main_detail";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/forum/detail/report-komentar/[id]/page.tsx b/src/app/dev/(user)/forum/detail/report-komentar/[id]/page.tsx
new file mode 100644
index 00000000..86741044
--- /dev/null
+++ b/src/app/dev/(user)/forum/detail/report-komentar/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Forum_DetailReportKomentar } from "@/app_modules/forum";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/forum/detail/report-posting/[id]/page.tsx b/src/app/dev/(user)/forum/detail/report-posting/[id]/page.tsx
new file mode 100644
index 00000000..016415b4
--- /dev/null
+++ b/src/app/dev/(user)/forum/detail/report-posting/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Forum_DetailReportPosting } from "@/app_modules/forum";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/forum/edit/komentar/[id]/layout.tsx b/src/app/dev/(user)/forum/edit/komentar/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/forum/edit/komentar/[id]/layout.tsx
rename to src/app/dev/(user)/forum/edit/komentar/[id]/layout.tsx
diff --git a/src/app/dev/forum/edit/komentar/[id]/page.tsx b/src/app/dev/(user)/forum/edit/komentar/[id]/page.tsx
similarity index 100%
rename from src/app/dev/forum/edit/komentar/[id]/page.tsx
rename to src/app/dev/(user)/forum/edit/komentar/[id]/page.tsx
diff --git a/src/app/dev/forum/edit/posting/[id]/layout.tsx b/src/app/dev/(user)/forum/edit/posting/[id]/layout.tsx
similarity index 99%
rename from src/app/dev/forum/edit/posting/[id]/layout.tsx
rename to src/app/dev/(user)/forum/edit/posting/[id]/layout.tsx
index 058935bd..2de2df46 100644
--- a/src/app/dev/forum/edit/posting/[id]/layout.tsx
+++ b/src/app/dev/(user)/forum/edit/posting/[id]/layout.tsx
@@ -1,4 +1,3 @@
-
import { LayoutForum_EditPosting } from "@/app_modules/forum";
import React from "react";
diff --git a/src/app/dev/(user)/forum/edit/posting/[id]/page.tsx b/src/app/dev/(user)/forum/edit/posting/[id]/page.tsx
new file mode 100644
index 00000000..751030f8
--- /dev/null
+++ b/src/app/dev/(user)/forum/edit/posting/[id]/page.tsx
@@ -0,0 +1,9 @@
+import Forum_V3_EditPosting from "@/app_modules/forum/edit/posting/V3_edit_posting";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/forum/forumku/[id]/layout.tsx b/src/app/dev/(user)/forum/forumku/[id]/layout.tsx
new file mode 100644
index 00000000..8e0ddbea
--- /dev/null
+++ b/src/app/dev/(user)/forum/forumku/[id]/layout.tsx
@@ -0,0 +1,14 @@
+import { LayoutForum_Forumku } from "@/app_modules/forum";
+import React from "react";
+
+export default async function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/forum/forumku/[id]/page.tsx b/src/app/dev/(user)/forum/forumku/[id]/page.tsx
new file mode 100644
index 00000000..a0d2beba
--- /dev/null
+++ b/src/app/dev/(user)/forum/forumku/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Forum_Forumku } from "@/app_modules/forum";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/job/main/layout.tsx b/src/app/dev/(user)/forum/main/layout.tsx
similarity index 57%
rename from src/app/dev/job/main/layout.tsx
rename to src/app/dev/(user)/forum/main/layout.tsx
index 337a18bc..37465d3e 100644
--- a/src/app/dev/job/main/layout.tsx
+++ b/src/app/dev/(user)/forum/main/layout.tsx
@@ -1,4 +1,4 @@
-import { LayoutJob_Main } from "@/app_modules/job";
+import { LayoutForum_Main } from "@/app_modules/forum";
import React from "react";
export default async function Layout({
@@ -8,7 +8,7 @@ export default async function Layout({
}) {
return (
<>
- {children}
+ {children}
>
);
}
diff --git a/src/app/dev/(user)/forum/main/page.tsx b/src/app/dev/(user)/forum/main/page.tsx
new file mode 100644
index 00000000..b204a95b
--- /dev/null
+++ b/src/app/dev/(user)/forum/main/page.tsx
@@ -0,0 +1,9 @@
+import { Forum_Beranda } from "@/app_modules/forum";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/forum/report/komentar-lainnya/[id]/layout.tsx b/src/app/dev/(user)/forum/report/komentar-lainnya/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/forum/report/komentar-lainnya/[id]/layout.tsx
rename to src/app/dev/(user)/forum/report/komentar-lainnya/[id]/layout.tsx
diff --git a/src/app/dev/(user)/forum/report/komentar-lainnya/[id]/page.tsx b/src/app/dev/(user)/forum/report/komentar-lainnya/[id]/page.tsx
new file mode 100644
index 00000000..878ebfbf
--- /dev/null
+++ b/src/app/dev/(user)/forum/report/komentar-lainnya/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Forum_ReportKomentarLainnya } from "@/app_modules/forum";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/forum/report/komentar/[id]/layout.tsx b/src/app/dev/(user)/forum/report/komentar/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/forum/report/komentar/[id]/layout.tsx
rename to src/app/dev/(user)/forum/report/komentar/[id]/layout.tsx
diff --git a/src/app/dev/(user)/forum/report/komentar/[id]/page.tsx b/src/app/dev/(user)/forum/report/komentar/[id]/page.tsx
new file mode 100644
index 00000000..c1adedd2
--- /dev/null
+++ b/src/app/dev/(user)/forum/report/komentar/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Forum_ReportKomentar } from "@/app_modules/forum";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/forum/report/posting-lainnya/[id]/layout.tsx b/src/app/dev/(user)/forum/report/posting-lainnya/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/forum/report/posting-lainnya/[id]/layout.tsx
rename to src/app/dev/(user)/forum/report/posting-lainnya/[id]/layout.tsx
diff --git a/src/app/dev/(user)/forum/report/posting-lainnya/[id]/page.tsx b/src/app/dev/(user)/forum/report/posting-lainnya/[id]/page.tsx
new file mode 100644
index 00000000..5b146735
--- /dev/null
+++ b/src/app/dev/(user)/forum/report/posting-lainnya/[id]/page.tsx
@@ -0,0 +1,10 @@
+import { Forum_ReportPostingLainnya } from "@/app_modules/forum";
+
+export default async function Page() {
+
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/forum/report/posting/[id]/layout.tsx b/src/app/dev/(user)/forum/report/posting/[id]/layout.tsx
similarity index 99%
rename from src/app/dev/forum/report/posting/[id]/layout.tsx
rename to src/app/dev/(user)/forum/report/posting/[id]/layout.tsx
index b4cdf878..9b4f4591 100644
--- a/src/app/dev/forum/report/posting/[id]/layout.tsx
+++ b/src/app/dev/(user)/forum/report/posting/[id]/layout.tsx
@@ -1,4 +1,3 @@
-
import { LayoutForum_ReportPosting } from "@/app_modules/forum";
import React from "react";
diff --git a/src/app/dev/(user)/forum/report/posting/[id]/page.tsx b/src/app/dev/(user)/forum/report/posting/[id]/page.tsx
new file mode 100644
index 00000000..e81999bf
--- /dev/null
+++ b/src/app/dev/(user)/forum/report/posting/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Forum_ReportPosting } from "@/app_modules/forum";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/forum/splash/page.tsx b/src/app/dev/(user)/forum/splash/page.tsx
similarity index 100%
rename from src/app/dev/forum/splash/page.tsx
rename to src/app/dev/(user)/forum/splash/page.tsx
diff --git a/src/app/dev/(user)/home/page.tsx b/src/app/dev/(user)/home/page.tsx
new file mode 100644
index 00000000..20eece5e
--- /dev/null
+++ b/src/app/dev/(user)/home/page.tsx
@@ -0,0 +1,11 @@
+import { V3_View_Home } from "@/app_modules/home/v3_home_view";
+
+export default function PageHome() {
+ return (
+ <>
+ {/* */}
+ {/* */}
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/[id]/investor/page.tsx b/src/app/dev/(user)/investasi/[id]/investor/page.tsx
new file mode 100644
index 00000000..bca95f92
--- /dev/null
+++ b/src/app/dev/(user)/investasi/[id]/investor/page.tsx
@@ -0,0 +1,11 @@
+import { Investasi_UiListInvestor } from "@/app_modules/investasi/_ui/detail/ui_list_investor";
+
+async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/(user)/investasi/berita/[id]/page.tsx b/src/app/dev/(user)/investasi/berita/[id]/page.tsx
new file mode 100644
index 00000000..483ed39a
--- /dev/null
+++ b/src/app/dev/(user)/investasi/berita/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiDetailBerita } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/berita/daftar/[id]/page.tsx b/src/app/dev/(user)/investasi/berita/daftar/[id]/page.tsx
new file mode 100644
index 00000000..de880b81
--- /dev/null
+++ b/src/app/dev/(user)/investasi/berita/daftar/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiDaftarBerita } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/berita/rekap/[id]/page.tsx b/src/app/dev/(user)/investasi/berita/rekap/[id]/page.tsx
new file mode 100644
index 00000000..bae957ad
--- /dev/null
+++ b/src/app/dev/(user)/investasi/berita/rekap/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiRekapBerita } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/create/berita/[id]/page.tsx b/src/app/dev/(user)/investasi/create/berita/[id]/page.tsx
new file mode 100644
index 00000000..71683b93
--- /dev/null
+++ b/src/app/dev/(user)/investasi/create/berita/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiCreateBerita } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/create/dokumen/[id]/page.tsx b/src/app/dev/(user)/investasi/create/dokumen/[id]/page.tsx
new file mode 100644
index 00000000..92255f76
--- /dev/null
+++ b/src/app/dev/(user)/investasi/create/dokumen/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiCreateDocument } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/investasi/create/investasi/layout.tsx b/src/app/dev/(user)/investasi/create/investasi/layout.tsx
similarity index 100%
rename from src/app/dev/investasi/create/investasi/layout.tsx
rename to src/app/dev/(user)/investasi/create/investasi/layout.tsx
diff --git a/src/app/dev/(user)/investasi/create/investasi/page.tsx b/src/app/dev/(user)/investasi/create/investasi/page.tsx
new file mode 100644
index 00000000..f86b2291
--- /dev/null
+++ b/src/app/dev/(user)/investasi/create/investasi/page.tsx
@@ -0,0 +1,9 @@
+import { InvestasiCreateNew } from "@/app_modules/investasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/investasi/create_berita/[id]/layout.tsx b/src/app/dev/(user)/investasi/create_berita/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/investasi/create_berita/[id]/layout.tsx
rename to src/app/dev/(user)/investasi/create_berita/[id]/layout.tsx
diff --git a/src/app/dev/investasi/create_berita/[id]/page.tsx b/src/app/dev/(user)/investasi/create_berita/[id]/page.tsx
similarity index 100%
rename from src/app/dev/investasi/create_berita/[id]/page.tsx
rename to src/app/dev/(user)/investasi/create_berita/[id]/page.tsx
diff --git a/src/app/dev/(user)/investasi/detail/[id]/page.tsx b/src/app/dev/(user)/investasi/detail/[id]/page.tsx
new file mode 100644
index 00000000..83e5d9dc
--- /dev/null
+++ b/src/app/dev/(user)/investasi/detail/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiDetailMain } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/detail/portofolio/[id]/page.tsx b/src/app/dev/(user)/investasi/detail/portofolio/[id]/page.tsx
new file mode 100644
index 00000000..b4251bf8
--- /dev/null
+++ b/src/app/dev/(user)/investasi/detail/portofolio/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiDetailPortofolio } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/detail/prospektus/[id]/page.tsx b/src/app/dev/(user)/investasi/detail/prospektus/[id]/page.tsx
new file mode 100644
index 00000000..f56379ca
--- /dev/null
+++ b/src/app/dev/(user)/investasi/detail/prospektus/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiDetailProspektus } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/detail/saham/[id]/page.tsx b/src/app/dev/(user)/investasi/detail/saham/[id]/page.tsx
new file mode 100644
index 00000000..67a9eaa0
--- /dev/null
+++ b/src/app/dev/(user)/investasi/detail/saham/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiDetailSahamSaya } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/investasi/detail_berita/[id]/layout.tsx b/src/app/dev/(user)/investasi/detail_berita/[id]/layout.tsx
similarity index 91%
rename from src/app/dev/investasi/detail_berita/[id]/layout.tsx
rename to src/app/dev/(user)/investasi/detail_berita/[id]/layout.tsx
index c75c0992..558b3ec6 100644
--- a/src/app/dev/investasi/detail_berita/[id]/layout.tsx
+++ b/src/app/dev/(user)/investasi/detail_berita/[id]/layout.tsx
@@ -1,6 +1,7 @@
import { LayoutDetailBeritaInvestasi } from "@/app_modules/investasi";
import React from "react";
+ // -- DELETE SOON -- //
export default async function Layout({
children,
}: {
diff --git a/src/app/dev/investasi/detail_berita/[id]/page.tsx b/src/app/dev/(user)/investasi/detail_berita/[id]/page.tsx
similarity index 90%
rename from src/app/dev/investasi/detail_berita/[id]/page.tsx
rename to src/app/dev/(user)/investasi/detail_berita/[id]/page.tsx
index d4d0f75e..b2cf7233 100644
--- a/src/app/dev/investasi/detail_berita/[id]/page.tsx
+++ b/src/app/dev/(user)/investasi/detail_berita/[id]/page.tsx
@@ -1,10 +1,11 @@
import { DetailBeritaInvestasi } from "@/app_modules/investasi";
import getOneBeritaInvestasiById from "@/app_modules/investasi/fun/get_one_berita_by_id";
+
+ // -- DELETE SOON -- //
export default async function Page({ params }: { params: { id: string } }) {
const investasiId = params.id;
const dataBerita = await getOneBeritaInvestasiById(investasiId);
- // console.log(dataBerita)
return (
<>
@@ -15,3 +16,4 @@ export default async function Page({ params }: { params: { id: string } }) {
>
);
}
+ // -- DELETE SOON -- //
diff --git a/src/app/dev/investasi/detail_dokumen/[id]/layout.tsx b/src/app/dev/(user)/investasi/detail_dokumen/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/investasi/detail_dokumen/[id]/layout.tsx
rename to src/app/dev/(user)/investasi/detail_dokumen/[id]/layout.tsx
diff --git a/src/app/dev/investasi/detail_dokumen/[id]/page.tsx b/src/app/dev/(user)/investasi/detail_dokumen/[id]/page.tsx
similarity index 94%
rename from src/app/dev/investasi/detail_dokumen/[id]/page.tsx
rename to src/app/dev/(user)/investasi/detail_dokumen/[id]/page.tsx
index cd2202ee..86a19745 100644
--- a/src/app/dev/investasi/detail_dokumen/[id]/page.tsx
+++ b/src/app/dev/(user)/investasi/detail_dokumen/[id]/page.tsx
@@ -1,3 +1,4 @@
+// -- DELETE SOON -- //
import { DetailDokumenInvestasi } from "@/app_modules/investasi";
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
diff --git a/src/app/dev/investasi/detail_portofolio/draft/[id]/page.tsx b/src/app/dev/(user)/investasi/detail_portofolio/draft/[id]/page.tsx
similarity index 100%
rename from src/app/dev/investasi/detail_portofolio/draft/[id]/page.tsx
rename to src/app/dev/(user)/investasi/detail_portofolio/draft/[id]/page.tsx
diff --git a/src/app/dev/investasi/detail_portofolio/publish/[id]/page.tsx b/src/app/dev/(user)/investasi/detail_portofolio/publish/[id]/page.tsx
similarity index 100%
rename from src/app/dev/investasi/detail_portofolio/publish/[id]/page.tsx
rename to src/app/dev/(user)/investasi/detail_portofolio/publish/[id]/page.tsx
diff --git a/src/app/dev/investasi/detail_prospektus/[id]/layout.tsx b/src/app/dev/(user)/investasi/detail_prospektus/[id]/layout.tsx
similarity index 91%
rename from src/app/dev/investasi/detail_prospektus/[id]/layout.tsx
rename to src/app/dev/(user)/investasi/detail_prospektus/[id]/layout.tsx
index 49640fcf..d47ce20a 100644
--- a/src/app/dev/investasi/detail_prospektus/[id]/layout.tsx
+++ b/src/app/dev/(user)/investasi/detail_prospektus/[id]/layout.tsx
@@ -1,3 +1,4 @@
+// -- DELETE SOON -- //
import { LayoutDetailPropektus } from "@/app_modules/investasi";
import React from "react";
diff --git a/src/app/dev/investasi/detail_prospektus/[id]/page.tsx b/src/app/dev/(user)/investasi/detail_prospektus/[id]/page.tsx
similarity index 94%
rename from src/app/dev/investasi/detail_prospektus/[id]/page.tsx
rename to src/app/dev/(user)/investasi/detail_prospektus/[id]/page.tsx
index 492bdad5..3c61ee9a 100644
--- a/src/app/dev/investasi/detail_prospektus/[id]/page.tsx
+++ b/src/app/dev/(user)/investasi/detail_prospektus/[id]/page.tsx
@@ -1,6 +1,6 @@
import { DetailPropektus } from "@/app_modules/investasi";
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
-
+// -- DELETE SOON -- //
export default async function Page({ params }: { params: { id: string } }) {
const dataInvestasi = await getOneInvestasiById(params.id);
diff --git a/src/app/dev/investasi/dialog_page/create/layout.tsx b/src/app/dev/(user)/investasi/dialog_page/create/layout.tsx
similarity index 100%
rename from src/app/dev/investasi/dialog_page/create/layout.tsx
rename to src/app/dev/(user)/investasi/dialog_page/create/layout.tsx
diff --git a/src/app/dev/investasi/dialog_page/create/page.tsx b/src/app/dev/(user)/investasi/dialog_page/create/page.tsx
similarity index 100%
rename from src/app/dev/investasi/dialog_page/create/page.tsx
rename to src/app/dev/(user)/investasi/dialog_page/create/page.tsx
diff --git a/src/app/dev/(user)/investasi/dokumen/daftar/[id]/page.tsx b/src/app/dev/(user)/investasi/dokumen/daftar/[id]/page.tsx
new file mode 100644
index 00000000..2478ddae
--- /dev/null
+++ b/src/app/dev/(user)/investasi/dokumen/daftar/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiDaftarDokmen } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/dokumen/rekap/[id]/page.tsx b/src/app/dev/(user)/investasi/dokumen/rekap/[id]/page.tsx
new file mode 100644
index 00000000..596336ea
--- /dev/null
+++ b/src/app/dev/(user)/investasi/dokumen/rekap/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiRekapDokumen } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/edit/[id]/page.tsx b/src/app/dev/(user)/investasi/edit/[id]/page.tsx
new file mode 100644
index 00000000..76a5e468
--- /dev/null
+++ b/src/app/dev/(user)/investasi/edit/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiEditInvestasiNew } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/edit/dokumen/[id]/page.tsx b/src/app/dev/(user)/investasi/edit/dokumen/[id]/page.tsx
new file mode 100644
index 00000000..6be72e19
--- /dev/null
+++ b/src/app/dev/(user)/investasi/edit/dokumen/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiEditDokumen } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/edit/prospektus/[id]/page.tsx b/src/app/dev/(user)/investasi/edit/prospektus/[id]/page.tsx
new file mode 100644
index 00000000..4c09a503
--- /dev/null
+++ b/src/app/dev/(user)/investasi/edit/prospektus/[id]/page.tsx
@@ -0,0 +1,10 @@
+import { Investasi_UiEditProspektus } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/investasi/edit_berita/[id]/layout.tsx b/src/app/dev/(user)/investasi/edit_berita/[id]/layout.tsx
similarity index 91%
rename from src/app/dev/investasi/edit_berita/[id]/layout.tsx
rename to src/app/dev/(user)/investasi/edit_berita/[id]/layout.tsx
index 68855271..81e5ce4d 100644
--- a/src/app/dev/investasi/edit_berita/[id]/layout.tsx
+++ b/src/app/dev/(user)/investasi/edit_berita/[id]/layout.tsx
@@ -1,6 +1,8 @@
import { LayoutEditBeritaInvestasi } from "@/app_modules/investasi";
import React from "react";
+// -- DELETE SOON -- //
+
export default async function Layout({children}: { children: React.ReactNode }) {
return<>
{children}
diff --git a/src/app/dev/investasi/edit_berita/[id]/page.tsx b/src/app/dev/(user)/investasi/edit_berita/[id]/page.tsx
similarity index 94%
rename from src/app/dev/investasi/edit_berita/[id]/page.tsx
rename to src/app/dev/(user)/investasi/edit_berita/[id]/page.tsx
index 245f1308..613ce4d3 100644
--- a/src/app/dev/investasi/edit_berita/[id]/page.tsx
+++ b/src/app/dev/(user)/investasi/edit_berita/[id]/page.tsx
@@ -1,6 +1,6 @@
import { EditBeritaInvestasi } from "@/app_modules/investasi";
import getOneBeritaInvestasiById from "@/app_modules/investasi/fun/get_one_berita_by_id";
-
+// -- DELETE SOON -- //
export default async function Page({params}: {params: {id: string}}) {
const dataBerita = await getOneBeritaInvestasiById(params.id)
// console.log(dataBerita)
diff --git a/src/app/dev/investasi/edit_intro/[id]/layout.tsx b/src/app/dev/(user)/investasi/edit_intro/[id]/layout.tsx
similarity index 91%
rename from src/app/dev/investasi/edit_intro/[id]/layout.tsx
rename to src/app/dev/(user)/investasi/edit_intro/[id]/layout.tsx
index 9ffdc3cd..07277f05 100644
--- a/src/app/dev/investasi/edit_intro/[id]/layout.tsx
+++ b/src/app/dev/(user)/investasi/edit_intro/[id]/layout.tsx
@@ -1,3 +1,4 @@
+// -- DELETE SOON -- //
import { LayoutEditIntroInvestasi } from "@/app_modules/investasi";
import React from "react";
diff --git a/src/app/dev/investasi/edit_intro/[id]/page.tsx b/src/app/dev/(user)/investasi/edit_intro/[id]/page.tsx
similarity index 97%
rename from src/app/dev/investasi/edit_intro/[id]/page.tsx
rename to src/app/dev/(user)/investasi/edit_intro/[id]/page.tsx
index b726841c..31e92a5a 100644
--- a/src/app/dev/investasi/edit_intro/[id]/page.tsx
+++ b/src/app/dev/(user)/investasi/edit_intro/[id]/page.tsx
@@ -1,3 +1,5 @@
+// -- DELETE SOON -- //
+
import { EditIntroInvestasi } from "@/app_modules/investasi";
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
import getPembagianDeviden from "@/app_modules/investasi/fun/master/get_pembagian_deviden";
diff --git a/src/app/dev/(user)/investasi/file-view/dokumen/[id]/page.tsx b/src/app/dev/(user)/investasi/file-view/dokumen/[id]/page.tsx
new file mode 100644
index 00000000..22aa6e7c
--- /dev/null
+++ b/src/app/dev/(user)/investasi/file-view/dokumen/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiFileViewDokumen } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/file-view/prospektus/[id]/page.tsx b/src/app/dev/(user)/investasi/file-view/prospektus/[id]/page.tsx
new file mode 100644
index 00000000..dd56c9a0
--- /dev/null
+++ b/src/app/dev/(user)/investasi/file-view/prospektus/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiFileView } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/investasi/list_edit_berita/[id]/layout.tsx b/src/app/dev/(user)/investasi/list_edit_berita/[id]/layout.tsx
similarity index 60%
rename from src/app/dev/investasi/list_edit_berita/[id]/layout.tsx
rename to src/app/dev/(user)/investasi/list_edit_berita/[id]/layout.tsx
index f6361a2c..1ebbe92f 100644
--- a/src/app/dev/investasi/list_edit_berita/[id]/layout.tsx
+++ b/src/app/dev/(user)/investasi/list_edit_berita/[id]/layout.tsx
@@ -1,16 +1,20 @@
+// -- DELETE Or UPDATE SOON -- //
+
import { LayoutListEditBeritaInvestasi } from "@/app_modules/investasi";
import React from "react";
export default async function Layout({
children,
- params
+ params,
}: {
children: React.ReactNode;
params: { id: string };
}) {
return (
<>
- {children}
+
+ {children}
+
>
);
}
diff --git a/src/app/dev/investasi/list_edit_berita/[id]/page.tsx b/src/app/dev/(user)/investasi/list_edit_berita/[id]/page.tsx
similarity index 92%
rename from src/app/dev/investasi/list_edit_berita/[id]/page.tsx
rename to src/app/dev/(user)/investasi/list_edit_berita/[id]/page.tsx
index 4f5a9e8c..8023d326 100644
--- a/src/app/dev/investasi/list_edit_berita/[id]/page.tsx
+++ b/src/app/dev/(user)/investasi/list_edit_berita/[id]/page.tsx
@@ -1,3 +1,5 @@
+// -- DELETE Or UPDATE SOON -- //
+
import { ListEditBeritaInvestasi } from "@/app_modules/investasi";
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
diff --git a/src/app/dev/investasi/main/layout.tsx b/src/app/dev/(user)/investasi/main/layout.tsx
similarity index 100%
rename from src/app/dev/investasi/main/layout.tsx
rename to src/app/dev/(user)/investasi/main/layout.tsx
diff --git a/src/app/dev/(user)/investasi/main/page.tsx b/src/app/dev/(user)/investasi/main/page.tsx
new file mode 100644
index 00000000..ad4bbaa5
--- /dev/null
+++ b/src/app/dev/(user)/investasi/main/page.tsx
@@ -0,0 +1,11 @@
+import { Investasi_ViewBerandaNew } from "@/app_modules/investasi/_ui";
+
+async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/(user)/investasi/main/portofolio/[id]/page.tsx b/src/app/dev/(user)/investasi/main/portofolio/[id]/page.tsx
new file mode 100644
index 00000000..b63e022f
--- /dev/null
+++ b/src/app/dev/(user)/investasi/main/portofolio/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiPortofolioNew } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/main/saham_saya/page.tsx b/src/app/dev/(user)/investasi/main/saham_saya/page.tsx
new file mode 100644
index 00000000..ff5f97ef
--- /dev/null
+++ b/src/app/dev/(user)/investasi/main/saham_saya/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_ViewSahamSayaNew } from "@/app_modules/investasi/_view/main/view_saham_saya_new";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/main/transaksi/page.tsx b/src/app/dev/(user)/investasi/main/transaksi/page.tsx
new file mode 100644
index 00000000..47174371
--- /dev/null
+++ b/src/app/dev/(user)/investasi/main/transaksi/page.tsx
@@ -0,0 +1,11 @@
+
+import { Investasi_ViewDaftarTransaksiNew } from "@/app_modules/investasi/_view/main/view_transaksi_new";
+
+export default async function Page() {
+
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/investasi/proses_transaksi/[id]/layout.tsx b/src/app/dev/(user)/investasi/proses_transaksi/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/investasi/proses_transaksi/[id]/layout.tsx
rename to src/app/dev/(user)/investasi/proses_transaksi/[id]/layout.tsx
diff --git a/src/app/dev/investasi/proses_transaksi/[id]/page.tsx b/src/app/dev/(user)/investasi/proses_transaksi/[id]/page.tsx
similarity index 100%
rename from src/app/dev/investasi/proses_transaksi/[id]/page.tsx
rename to src/app/dev/(user)/investasi/proses_transaksi/[id]/page.tsx
diff --git a/src/app/dev/(user)/investasi/status-transaksi/berhasil/[id]/page.tsx b/src/app/dev/(user)/investasi/status-transaksi/berhasil/[id]/page.tsx
new file mode 100644
index 00000000..12ad32af
--- /dev/null
+++ b/src/app/dev/(user)/investasi/status-transaksi/berhasil/[id]/page.tsx
@@ -0,0 +1,11 @@
+import { Investasi_UiTransaksiBerhasil } from "@/app_modules/investasi/_ui";
+
+export default async function Page({params}: {params: {id: string}}) {
+ const invoiceId = params.id;
+ // const dataTransaksi = await investasi_funGetOneInvoiceById({ invoiceId });
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/investasi/status-transaksi/gagal/[id]/page.tsx b/src/app/dev/(user)/investasi/status-transaksi/gagal/[id]/page.tsx
similarity index 69%
rename from src/app/dev/investasi/status-transaksi/gagal/[id]/page.tsx
rename to src/app/dev/(user)/investasi/status-transaksi/gagal/[id]/page.tsx
index b13315c3..63411009 100644
--- a/src/app/dev/investasi/status-transaksi/gagal/[id]/page.tsx
+++ b/src/app/dev/(user)/investasi/status-transaksi/gagal/[id]/page.tsx
@@ -4,14 +4,13 @@ import { Investasi_UiTransaksiGagal } from "@/app_modules/investasi/_ui/status_t
export default async function Page({ params }: { params: { id: string } }) {
const invoiceId = params.id;
- const dataTransaksi = await investasi_funGetOneInvoiceById({ invoiceId });
- const nomorAdmin = await funGlobal_getNomorAdmin();
+ // const dataTransaksi = await investasi_funGetOneInvoiceById({ invoiceId });
+ // const nomorAdmin = await funGlobal_getNomorAdmin();
return (
<>
>
);
diff --git a/src/app/dev/investasi/status_pesanan/[id]/layout.tsx b/src/app/dev/(user)/investasi/status_pesanan/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/investasi/status_pesanan/[id]/layout.tsx
rename to src/app/dev/(user)/investasi/status_pesanan/[id]/layout.tsx
diff --git a/src/app/dev/investasi/status_pesanan/[id]/page.tsx b/src/app/dev/(user)/investasi/status_pesanan/[id]/page.tsx
similarity index 86%
rename from src/app/dev/investasi/status_pesanan/[id]/page.tsx
rename to src/app/dev/(user)/investasi/status_pesanan/[id]/page.tsx
index 5180bca2..816a7539 100644
--- a/src/app/dev/investasi/status_pesanan/[id]/page.tsx
+++ b/src/app/dev/(user)/investasi/status_pesanan/[id]/page.tsx
@@ -1,4 +1,4 @@
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { StatusPesananInvetsatsi } from "@/app_modules/investasi";
import getOneTransaksiByIdInvestasi from "@/app_modules/investasi/fun/get_one_transaksi_by_id";
import getTransaksiByIdInvestasi from "@/app_modules/investasi/fun/get_transaksi_investasi";
diff --git a/src/app/dev/(user)/investasi/transaksi/invoice/[id]/page.tsx b/src/app/dev/(user)/investasi/transaksi/invoice/[id]/page.tsx
new file mode 100644
index 00000000..1bc408ad
--- /dev/null
+++ b/src/app/dev/(user)/investasi/transaksi/invoice/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiInvoice } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/transaksi/metode-pembayaran/[id]/page.tsx b/src/app/dev/(user)/investasi/transaksi/metode-pembayaran/[id]/page.tsx
new file mode 100644
index 00000000..f7a1b6fd
--- /dev/null
+++ b/src/app/dev/(user)/investasi/transaksi/metode-pembayaran/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiMetodePembayaran } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/transaksi/pembelian/[id]/page.tsx b/src/app/dev/(user)/investasi/transaksi/pembelian/[id]/page.tsx
new file mode 100644
index 00000000..a2d96c56
--- /dev/null
+++ b/src/app/dev/(user)/investasi/transaksi/pembelian/[id]/page.tsx
@@ -0,0 +1,10 @@
+import { Investasi_UiProsesPembelian } from "@/app_modules/investasi/_ui";
+
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/investasi/transaksi/proses-transaksi/[id]/page.tsx b/src/app/dev/(user)/investasi/transaksi/proses-transaksi/[id]/page.tsx
new file mode 100644
index 00000000..38ae995b
--- /dev/null
+++ b/src/app/dev/(user)/investasi/transaksi/proses-transaksi/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Investasi_UiProsesTransaksi } from "@/app_modules/investasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/investasi/upload_dokumen/[id]/layout.tsx b/src/app/dev/(user)/investasi/upload_dokumen/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/investasi/upload_dokumen/[id]/layout.tsx
rename to src/app/dev/(user)/investasi/upload_dokumen/[id]/layout.tsx
diff --git a/src/app/dev/investasi/upload_dokumen/[id]/page.tsx b/src/app/dev/(user)/investasi/upload_dokumen/[id]/page.tsx
similarity index 100%
rename from src/app/dev/investasi/upload_dokumen/[id]/page.tsx
rename to src/app/dev/(user)/investasi/upload_dokumen/[id]/page.tsx
diff --git a/src/app/dev/investasi/upload_prospektus/[id]/layout.tsx b/src/app/dev/(user)/investasi/upload_prospektus/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/investasi/upload_prospektus/[id]/layout.tsx
rename to src/app/dev/(user)/investasi/upload_prospektus/[id]/layout.tsx
diff --git a/src/app/dev/investasi/upload_prospektus/[id]/page.tsx b/src/app/dev/(user)/investasi/upload_prospektus/[id]/page.tsx
similarity index 100%
rename from src/app/dev/investasi/upload_prospektus/[id]/page.tsx
rename to src/app/dev/(user)/investasi/upload_prospektus/[id]/page.tsx
diff --git a/src/app/dev/job/create/layout.tsx b/src/app/dev/(user)/job/create/layout.tsx
similarity index 65%
rename from src/app/dev/job/create/layout.tsx
rename to src/app/dev/(user)/job/create/layout.tsx
index e8e52d98..9272a8cd 100644
--- a/src/app/dev/job/create/layout.tsx
+++ b/src/app/dev/(user)/job/create/layout.tsx
@@ -1,11 +1,7 @@
import { LayoutJob_Create } from "@/app_modules/job";
import React from "react";
-export default async function Layout({
- children,
-}: {
- children: React.ReactNode;
-}) {
+export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
{children}
diff --git a/src/app/dev/job/create/page.tsx b/src/app/dev/(user)/job/create/page.tsx
similarity index 72%
rename from src/app/dev/job/create/page.tsx
rename to src/app/dev/(user)/job/create/page.tsx
index 94c001b8..78a6d357 100644
--- a/src/app/dev/job/create/page.tsx
+++ b/src/app/dev/(user)/job/create/page.tsx
@@ -1,6 +1,6 @@
import { Job_Create } from "@/app_modules/job";
-export default async function Page() {
+export default function Page() {
return (
<>
diff --git a/src/app/dev/job/detail/arsip/[id]/layout.tsx b/src/app/dev/(user)/job/detail/arsip/[id]/layout.tsx
similarity index 67%
rename from src/app/dev/job/detail/arsip/[id]/layout.tsx
rename to src/app/dev/(user)/job/detail/arsip/[id]/layout.tsx
index 835b852d..9ea9ae3f 100644
--- a/src/app/dev/job/detail/arsip/[id]/layout.tsx
+++ b/src/app/dev/(user)/job/detail/arsip/[id]/layout.tsx
@@ -1,11 +1,7 @@
import { LayoutJob_DetailArsip } from "@/app_modules/job";
import React from "react";
-export default async function Layout({
- children,
-}: {
- children: React.ReactNode;
-}) {
+export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
{children}
diff --git a/src/app/dev/(user)/job/detail/arsip/[id]/page.tsx b/src/app/dev/(user)/job/detail/arsip/[id]/page.tsx
new file mode 100644
index 00000000..44944aac
--- /dev/null
+++ b/src/app/dev/(user)/job/detail/arsip/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Job_DetailArsip } from "@/app_modules/job";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/job/detail/draft/[id]/layout.tsx b/src/app/dev/(user)/job/detail/draft/[id]/layout.tsx
new file mode 100644
index 00000000..0f48d9cb
--- /dev/null
+++ b/src/app/dev/(user)/job/detail/draft/[id]/layout.tsx
@@ -0,0 +1,14 @@
+import { LayoutJob_DetailDraft } from "@/app_modules/job";
+import React from "react";
+
+export default function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/job/detail/draft/[id]/page.tsx b/src/app/dev/(user)/job/detail/draft/[id]/page.tsx
new file mode 100644
index 00000000..9a3680f7
--- /dev/null
+++ b/src/app/dev/(user)/job/detail/draft/[id]/page.tsx
@@ -0,0 +1,9 @@
+import Job_DetailDraft from "@/app_modules/job/detail/draft/view";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/job/detail/main/[id]/layout.tsx b/src/app/dev/(user)/job/detail/main/[id]/layout.tsx
similarity index 85%
rename from src/app/dev/job/detail/main/[id]/layout.tsx
rename to src/app/dev/(user)/job/detail/main/[id]/layout.tsx
index 4e757aed..0f2012dd 100644
--- a/src/app/dev/job/detail/main/[id]/layout.tsx
+++ b/src/app/dev/(user)/job/detail/main/[id]/layout.tsx
@@ -1,7 +1,7 @@
import { LayoutJob_MainDetail } from "@/app_modules/job";
import React from "react";
-export default async function Layout({
+export default function Layout({
children,
}: {
children: React.ReactNode;
diff --git a/src/app/dev/(user)/job/detail/main/[id]/page.tsx b/src/app/dev/(user)/job/detail/main/[id]/page.tsx
new file mode 100644
index 00000000..40799780
--- /dev/null
+++ b/src/app/dev/(user)/job/detail/main/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Job_MainDetail } from "@/app_modules/job";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/job/detail/publish/[id]/layout.tsx b/src/app/dev/(user)/job/detail/publish/[id]/layout.tsx
similarity index 86%
rename from src/app/dev/job/detail/publish/[id]/layout.tsx
rename to src/app/dev/(user)/job/detail/publish/[id]/layout.tsx
index 204d05d8..8077d8be 100644
--- a/src/app/dev/job/detail/publish/[id]/layout.tsx
+++ b/src/app/dev/(user)/job/detail/publish/[id]/layout.tsx
@@ -1,7 +1,7 @@
import { LayoutJob_DetailPublish } from "@/app_modules/job";
import React from "react";
-export default async function Layout({
+export default function Layout({
children,
}: {
children: React.ReactNode;
diff --git a/src/app/dev/(user)/job/detail/publish/[id]/page.tsx b/src/app/dev/(user)/job/detail/publish/[id]/page.tsx
new file mode 100644
index 00000000..eab8c78b
--- /dev/null
+++ b/src/app/dev/(user)/job/detail/publish/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Job_DetailPublish } from "@/app_modules/job";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/job/detail/reject/[id]/layout.tsx b/src/app/dev/(user)/job/detail/reject/[id]/layout.tsx
similarity index 85%
rename from src/app/dev/job/detail/reject/[id]/layout.tsx
rename to src/app/dev/(user)/job/detail/reject/[id]/layout.tsx
index f7ed9999..0840e170 100644
--- a/src/app/dev/job/detail/reject/[id]/layout.tsx
+++ b/src/app/dev/(user)/job/detail/reject/[id]/layout.tsx
@@ -1,7 +1,7 @@
import { LayoutJob_DetailReject } from "@/app_modules/job";
import React from "react";
-export default async function Layout({
+export default function Layout({
children,
}: {
children: React.ReactNode;
diff --git a/src/app/dev/(user)/job/detail/reject/[id]/page.tsx b/src/app/dev/(user)/job/detail/reject/[id]/page.tsx
new file mode 100644
index 00000000..149f146d
--- /dev/null
+++ b/src/app/dev/(user)/job/detail/reject/[id]/page.tsx
@@ -0,0 +1,9 @@
+import Job_DetailReject from "@/app_modules/job/detail/reject/view";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/job/detail/review/[id]/layout.tsx b/src/app/dev/(user)/job/detail/review/[id]/layout.tsx
similarity index 85%
rename from src/app/dev/job/detail/review/[id]/layout.tsx
rename to src/app/dev/(user)/job/detail/review/[id]/layout.tsx
index ad8216c2..f7791c42 100644
--- a/src/app/dev/job/detail/review/[id]/layout.tsx
+++ b/src/app/dev/(user)/job/detail/review/[id]/layout.tsx
@@ -1,7 +1,7 @@
import { LayoutJob_DetailReview } from "@/app_modules/job";
import React from "react";
-export default async function Layout({
+export default function Layout({
children,
}: {
children: React.ReactNode;
diff --git a/src/app/dev/(user)/job/detail/review/[id]/page.tsx b/src/app/dev/(user)/job/detail/review/[id]/page.tsx
new file mode 100644
index 00000000..aa2b66b3
--- /dev/null
+++ b/src/app/dev/(user)/job/detail/review/[id]/page.tsx
@@ -0,0 +1,9 @@
+import Job_DetailReview from "@/app_modules/job/detail/review/view";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/job/edit/[id]/layout.tsx b/src/app/dev/(user)/job/edit/[id]/layout.tsx
similarity index 64%
rename from src/app/dev/job/edit/[id]/layout.tsx
rename to src/app/dev/(user)/job/edit/[id]/layout.tsx
index f2024656..719cd2e0 100644
--- a/src/app/dev/job/edit/[id]/layout.tsx
+++ b/src/app/dev/(user)/job/edit/[id]/layout.tsx
@@ -1,11 +1,7 @@
import { LayoutJob_Edit } from "@/app_modules/job";
import React from "react";
-export default async function Layout({
- children,
-}: {
- children: React.ReactNode;
-}) {
+export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
{children}
diff --git a/src/app/dev/(user)/job/edit/[id]/page.tsx b/src/app/dev/(user)/job/edit/[id]/page.tsx
new file mode 100644
index 00000000..e4d5e95d
--- /dev/null
+++ b/src/app/dev/(user)/job/edit/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Job_Edit } from "@/app_modules/job";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/job/main/arsip/page.tsx b/src/app/dev/(user)/job/main/arsip/page.tsx
new file mode 100644
index 00000000..fe90c783
--- /dev/null
+++ b/src/app/dev/(user)/job/main/arsip/page.tsx
@@ -0,0 +1,9 @@
+import { Job_Arsip } from "@/app_modules/job";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/job/main/beranda/page.tsx b/src/app/dev/(user)/job/main/beranda/page.tsx
new file mode 100644
index 00000000..7a2bd101
--- /dev/null
+++ b/src/app/dev/(user)/job/main/beranda/page.tsx
@@ -0,0 +1,9 @@
+import { Job_ViewBeranda } from "@/app_modules/job";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/job/main/layout.tsx b/src/app/dev/(user)/job/main/layout.tsx
new file mode 100644
index 00000000..d9815394
--- /dev/null
+++ b/src/app/dev/(user)/job/main/layout.tsx
@@ -0,0 +1,15 @@
+import NewLayoutJob_Main from "@/app_modules/job/main/new_layout";
+import React from "react";
+
+export default function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {/* {children} */}
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/job/main/status/[id]/page.tsx b/src/app/dev/(user)/job/main/status/[id]/page.tsx
new file mode 100644
index 00000000..3033a4e5
--- /dev/null
+++ b/src/app/dev/(user)/job/main/status/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Job_Status } from "@/app_modules/job";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/job/non_user_view/[id]/layout.tsx b/src/app/dev/(user)/job/non_user_view/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/job/non_user_view/[id]/layout.tsx
rename to src/app/dev/(user)/job/non_user_view/[id]/layout.tsx
diff --git a/src/app/dev/job/non_user_view/[id]/page.tsx b/src/app/dev/(user)/job/non_user_view/[id]/page.tsx
similarity index 100%
rename from src/app/dev/job/non_user_view/[id]/page.tsx
rename to src/app/dev/(user)/job/non_user_view/[id]/page.tsx
diff --git a/src/app/dev/job/splash/page.tsx b/src/app/dev/(user)/job/splash/page.tsx
similarity index 74%
rename from src/app/dev/job/splash/page.tsx
rename to src/app/dev/(user)/job/splash/page.tsx
index 9e3d7f07..124f2255 100644
--- a/src/app/dev/job/splash/page.tsx
+++ b/src/app/dev/(user)/job/splash/page.tsx
@@ -1,6 +1,6 @@
import { Job_ViewSplash } from "@/app_modules/job";
-export default async function Page() {
+export default function Page() {
return (
<>
diff --git a/src/app/dev/(user)/katalog/[id]/layout.tsx b/src/app/dev/(user)/katalog/[id]/layout.tsx
new file mode 100644
index 00000000..9e9bf3e5
--- /dev/null
+++ b/src/app/dev/(user)/katalog/[id]/layout.tsx
@@ -0,0 +1,9 @@
+import { LayoutKatalogNew } from "@/app_modules/katalog/main";
+
+export default function Layout({ children }: { children: any }) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/katalog/[id]/page.tsx b/src/app/dev/(user)/katalog/[id]/page.tsx
new file mode 100644
index 00000000..949476ce
--- /dev/null
+++ b/src/app/dev/(user)/katalog/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { ViewKatalogNew } from "@/app_modules/katalog";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/map/create/[id]/page.tsx b/src/app/dev/(user)/map/create/[id]/page.tsx
new file mode 100644
index 00000000..68b93418
--- /dev/null
+++ b/src/app/dev/(user)/map/create/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Map_CreateNewPin } from "@/app_modules/map/view";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/map/custom-pin/[id]/page.tsx b/src/app/dev/(user)/map/custom-pin/[id]/page.tsx
new file mode 100644
index 00000000..51bf28a8
--- /dev/null
+++ b/src/app/dev/(user)/map/custom-pin/[id]/page.tsx
@@ -0,0 +1,10 @@
+import { Map_CustomPin } from "@/app_modules/map/view";
+
+const mapboxToken = process.env.MAPBOX_TOKEN!;
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/map/edit/[id]/page.tsx b/src/app/dev/(user)/map/edit/[id]/page.tsx
new file mode 100644
index 00000000..d837ee54
--- /dev/null
+++ b/src/app/dev/(user)/map/edit/[id]/page.tsx
@@ -0,0 +1,10 @@
+import { Map_EditPin } from "@/app_modules/map/view";
+
+const mapboxToken = process.env.MAPBOX_TOKEN!;
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/map/main/page.tsx b/src/app/dev/(user)/map/main/page.tsx
new file mode 100644
index 00000000..67a8552e
--- /dev/null
+++ b/src/app/dev/(user)/map/main/page.tsx
@@ -0,0 +1,10 @@
+import { Map_ViewNew } from "@/app_modules/map/view/main_view_new";
+
+const mapboxToken = process.env.MAPBOX_TOKEN!;
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/map/splash/page.tsx b/src/app/dev/(user)/map/splash/page.tsx
similarity index 73%
rename from src/app/dev/map/splash/page.tsx
rename to src/app/dev/(user)/map/splash/page.tsx
index 70882ba9..d5213f4c 100644
--- a/src/app/dev/map/splash/page.tsx
+++ b/src/app/dev/(user)/map/splash/page.tsx
@@ -1,7 +1,7 @@
import { Map_Splash } from "@/app_modules/map/view";
-export default async function Page() {
+export default function Page() {
return (
<>
diff --git a/src/app/dev/(user)/notifikasi/collaboration/page.tsx b/src/app/dev/(user)/notifikasi/collaboration/page.tsx
new file mode 100644
index 00000000..ca9f64eb
--- /dev/null
+++ b/src/app/dev/(user)/notifikasi/collaboration/page.tsx
@@ -0,0 +1,9 @@
+import { Notifikasi_UiMain } from "@/app_modules/notifikasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/notifikasi/donasi/page.tsx b/src/app/dev/(user)/notifikasi/donasi/page.tsx
new file mode 100644
index 00000000..e18a8246
--- /dev/null
+++ b/src/app/dev/(user)/notifikasi/donasi/page.tsx
@@ -0,0 +1,12 @@
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import { Notifikasi_UiMain } from "@/app_modules/notifikasi/_ui";
+
+export default async function Page() {
+ const userLoginId = await funGetUserIdByToken();
+
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/notifikasi/event/page.tsx b/src/app/dev/(user)/notifikasi/event/page.tsx
new file mode 100644
index 00000000..d4f0d3a1
--- /dev/null
+++ b/src/app/dev/(user)/notifikasi/event/page.tsx
@@ -0,0 +1,9 @@
+import Notifikasi_UiMain from "@/app_modules/notifikasi/_ui/ui_notifikasi";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/notifikasi/forum/page.tsx b/src/app/dev/(user)/notifikasi/forum/page.tsx
new file mode 100644
index 00000000..ca9f64eb
--- /dev/null
+++ b/src/app/dev/(user)/notifikasi/forum/page.tsx
@@ -0,0 +1,9 @@
+import { Notifikasi_UiMain } from "@/app_modules/notifikasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/notifikasi/investasi/page.tsx b/src/app/dev/(user)/notifikasi/investasi/page.tsx
new file mode 100644
index 00000000..ca9f64eb
--- /dev/null
+++ b/src/app/dev/(user)/notifikasi/investasi/page.tsx
@@ -0,0 +1,9 @@
+import { Notifikasi_UiMain } from "@/app_modules/notifikasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/notifikasi/job/page.tsx b/src/app/dev/(user)/notifikasi/job/page.tsx
new file mode 100644
index 00000000..ca9f64eb
--- /dev/null
+++ b/src/app/dev/(user)/notifikasi/job/page.tsx
@@ -0,0 +1,9 @@
+import { Notifikasi_UiMain } from "@/app_modules/notifikasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/notifikasi/layout.tsx b/src/app/dev/(user)/notifikasi/layout.tsx
new file mode 100644
index 00000000..180b94cc
--- /dev/null
+++ b/src/app/dev/(user)/notifikasi/layout.tsx
@@ -0,0 +1,30 @@
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, { UI_NewChildren, UI_NewHeader } from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { UIChildrenNotifikasi } from "@/app_modules/notifikasi/_ui/ui_new_layout_notifikasi";
+
+export default async function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {/* }
+ >
+ {children}
+ */}
+
+
+
+
+
+
+
+ {children}
+
+
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/notifikasi/semua/page.tsx b/src/app/dev/(user)/notifikasi/semua/page.tsx
new file mode 100644
index 00000000..aca69d02
--- /dev/null
+++ b/src/app/dev/(user)/notifikasi/semua/page.tsx
@@ -0,0 +1,11 @@
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import { Notifikasi_UiMain } from "@/app_modules/notifikasi/_ui";
+
+export default async function Page() {
+ const userLoginId = await funGetUserIdByToken();
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/notifikasi/voting/page.tsx b/src/app/dev/(user)/notifikasi/voting/page.tsx
new file mode 100644
index 00000000..ca9f64eb
--- /dev/null
+++ b/src/app/dev/(user)/notifikasi/voting/page.tsx
@@ -0,0 +1,9 @@
+import { Notifikasi_UiMain } from "@/app_modules/notifikasi/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/portofolio/create/[id]/layout.tsx b/src/app/dev/(user)/portofolio/create/[id]/layout.tsx
new file mode 100644
index 00000000..f85ba783
--- /dev/null
+++ b/src/app/dev/(user)/portofolio/create/[id]/layout.tsx
@@ -0,0 +1,10 @@
+import { CreatePortofolioLayout } from "@/app_modules/katalog/portofolio";
+import React from "react";
+
+export default function Layout({ children }: { children: React.ReactNode }) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/portofolio/create/[id]/page.tsx b/src/app/dev/(user)/portofolio/create/[id]/page.tsx
new file mode 100644
index 00000000..94c12680
--- /dev/null
+++ b/src/app/dev/(user)/portofolio/create/[id]/page.tsx
@@ -0,0 +1,10 @@
+import Portofolio_V3_Create from "@/app_modules/katalog/portofolio/create/new_create";
+
+export default function Page() {
+ return (
+ <>
+ {/* */}
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/portofolio/daftar-portofolio/[id]/page.tsx b/src/app/dev/(user)/portofolio/daftar-portofolio/[id]/page.tsx
new file mode 100644
index 00000000..28e8e756
--- /dev/null
+++ b/src/app/dev/(user)/portofolio/daftar-portofolio/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { ListDetailPortofolioNew } from "@/app_modules/katalog/portofolio";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/portofolio/edit/data/[id]/layout.tsx b/src/app/dev/(user)/portofolio/edit/data/[id]/layout.tsx
similarity index 87%
rename from src/app/dev/portofolio/edit/data/[id]/layout.tsx
rename to src/app/dev/(user)/portofolio/edit/data/[id]/layout.tsx
index d7afbec8..086540a6 100644
--- a/src/app/dev/portofolio/edit/data/[id]/layout.tsx
+++ b/src/app/dev/(user)/portofolio/edit/data/[id]/layout.tsx
@@ -1,7 +1,7 @@
import { LayoutPortofolio_EditDataBisnis } from "@/app_modules/katalog/portofolio";
import React from "react";
-export default async function Layout({
+export default function Layout({
children,
}: {
children: React.ReactNode;
diff --git a/src/app/dev/(user)/portofolio/edit/data/[id]/page.tsx b/src/app/dev/(user)/portofolio/edit/data/[id]/page.tsx
new file mode 100644
index 00000000..991d3519
--- /dev/null
+++ b/src/app/dev/(user)/portofolio/edit/data/[id]/page.tsx
@@ -0,0 +1,10 @@
+import Portofolio_V3_EditDataBisnis from "@/app_modules/katalog/portofolio/edit/data/ui_new_edit_data";
+
+export default function Page() {
+ return (
+ <>
+ {/* */}
+
+ >
+ );
+}
diff --git a/src/app/dev/portofolio/edit/logo/[id]/layout.tsx b/src/app/dev/(user)/portofolio/edit/logo/[id]/layout.tsx
similarity index 88%
rename from src/app/dev/portofolio/edit/logo/[id]/layout.tsx
rename to src/app/dev/(user)/portofolio/edit/logo/[id]/layout.tsx
index 32425b82..0cc6189d 100644
--- a/src/app/dev/portofolio/edit/logo/[id]/layout.tsx
+++ b/src/app/dev/(user)/portofolio/edit/logo/[id]/layout.tsx
@@ -1,7 +1,7 @@
import { LayoutPortofolio_EditLogoBisnis } from "@/app_modules/katalog/portofolio";
import React from "react";
-export default async function Layout({
+export default function Layout({
children,
}: {
children: React.ReactNode;
diff --git a/src/app/dev/(user)/portofolio/edit/logo/[id]/page.tsx b/src/app/dev/(user)/portofolio/edit/logo/[id]/page.tsx
new file mode 100644
index 00000000..2c734e11
--- /dev/null
+++ b/src/app/dev/(user)/portofolio/edit/logo/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Portofolio_EditLogoBisnis } from "@/app_modules/katalog/portofolio";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/portofolio/edit/medsos/[id]/layout.tsx b/src/app/dev/(user)/portofolio/edit/medsos/[id]/layout.tsx
similarity index 87%
rename from src/app/dev/portofolio/edit/medsos/[id]/layout.tsx
rename to src/app/dev/(user)/portofolio/edit/medsos/[id]/layout.tsx
index 095732f9..52e7048d 100644
--- a/src/app/dev/portofolio/edit/medsos/[id]/layout.tsx
+++ b/src/app/dev/(user)/portofolio/edit/medsos/[id]/layout.tsx
@@ -1,7 +1,7 @@
import { LayoutPortofolio_EditMedsosBisnis } from "@/app_modules/katalog/portofolio";
import React from "react";
-export default async function Layout({
+export default function Layout({
children,
}: {
children: React.ReactNode;
diff --git a/src/app/dev/(user)/portofolio/edit/medsos/[id]/page.tsx b/src/app/dev/(user)/portofolio/edit/medsos/[id]/page.tsx
new file mode 100644
index 00000000..13bda6bb
--- /dev/null
+++ b/src/app/dev/(user)/portofolio/edit/medsos/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Portofolio_EditMedsosBisnis } from "@/app_modules/katalog/portofolio";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/portofolio/main/[id]/layout.tsx b/src/app/dev/(user)/portofolio/main/[id]/layout.tsx
new file mode 100644
index 00000000..d514ed1e
--- /dev/null
+++ b/src/app/dev/(user)/portofolio/main/[id]/layout.tsx
@@ -0,0 +1,9 @@
+import { PortofolioLayoutNew } from "@/app_modules/katalog/portofolio";
+
+export default function Layout({ children }: { children: any }) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/portofolio/main/[id]/page.tsx b/src/app/dev/(user)/portofolio/main/[id]/page.tsx
new file mode 100644
index 00000000..dc4954d3
--- /dev/null
+++ b/src/app/dev/(user)/portofolio/main/[id]/page.tsx
@@ -0,0 +1,10 @@
+import { Portofolio_UiDetailNew } from "@/app_modules/katalog/portofolio";
+
+const mapboxToken = process.env.MAPBOX_TOKEN!;
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/profile/create/layout.tsx b/src/app/dev/(user)/profile/create/layout.tsx
similarity index 100%
rename from src/app/dev/profile/create/layout.tsx
rename to src/app/dev/(user)/profile/create/layout.tsx
diff --git a/src/app/dev/profile/create/page.tsx b/src/app/dev/(user)/profile/create/page.tsx
similarity index 75%
rename from src/app/dev/profile/create/page.tsx
rename to src/app/dev/(user)/profile/create/page.tsx
index 26cf870f..ef90717f 100644
--- a/src/app/dev/profile/create/page.tsx
+++ b/src/app/dev/(user)/profile/create/page.tsx
@@ -1,6 +1,6 @@
import { CreateProfile } from "@/app_modules/katalog/profile";
-export default async function Page() {
+export default function Page() {
return (
<>
diff --git a/src/app/dev/profile/edit/[id]/layout.tsx b/src/app/dev/(user)/profile/edit/[id]/layout.tsx
similarity index 57%
rename from src/app/dev/profile/edit/[id]/layout.tsx
rename to src/app/dev/(user)/profile/edit/[id]/layout.tsx
index dfe00c95..9b8d49f1 100644
--- a/src/app/dev/profile/edit/[id]/layout.tsx
+++ b/src/app/dev/(user)/profile/edit/[id]/layout.tsx
@@ -1,12 +1,6 @@
import { EditProfileLayout } from "@/app_modules/katalog/profile";
-export default async function Layout({
- children,
- params,
-}: {
- children: any;
- params: { id: string };
-}) {
+export default function Layout({ children }: { children: any }) {
return (
<>
{children}
diff --git a/src/app/dev/(user)/profile/edit/[id]/page.tsx b/src/app/dev/(user)/profile/edit/[id]/page.tsx
new file mode 100644
index 00000000..bbd2c348
--- /dev/null
+++ b/src/app/dev/(user)/profile/edit/[id]/page.tsx
@@ -0,0 +1,9 @@
+import EditProfile from "@/app_modules/katalog/profile/edit/view";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/profile/upload/background/[id]/layout.tsx b/src/app/dev/(user)/profile/upload/background/[id]/layout.tsx
similarity index 75%
rename from src/app/dev/profile/upload/background/[id]/layout.tsx
rename to src/app/dev/(user)/profile/upload/background/[id]/layout.tsx
index 11f4cf1b..0a75f4af 100644
--- a/src/app/dev/profile/upload/background/[id]/layout.tsx
+++ b/src/app/dev/(user)/profile/upload/background/[id]/layout.tsx
@@ -1,11 +1,7 @@
import LayoutProfile_UpdateFotoBackground from "@/app_modules/katalog/profile/upload/foto_background/layout";
import React from "react";
-export default async function Layout({
- children,
-}: {
- children: React.ReactNode;
-}) {
+export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
diff --git a/src/app/dev/(user)/profile/upload/background/[id]/page.tsx b/src/app/dev/(user)/profile/upload/background/[id]/page.tsx
new file mode 100644
index 00000000..30dd9aa9
--- /dev/null
+++ b/src/app/dev/(user)/profile/upload/background/[id]/page.tsx
@@ -0,0 +1,9 @@
+import Profile_UpdateFotoBackground from "@/app_modules/katalog/profile/upload/foto_background";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/profile/upload/foto/[id]/layout.tsx b/src/app/dev/(user)/profile/upload/foto/[id]/layout.tsx
similarity index 69%
rename from src/app/dev/profile/upload/foto/[id]/layout.tsx
rename to src/app/dev/(user)/profile/upload/foto/[id]/layout.tsx
index 5613eabd..a10335a4 100644
--- a/src/app/dev/profile/upload/foto/[id]/layout.tsx
+++ b/src/app/dev/(user)/profile/upload/foto/[id]/layout.tsx
@@ -1,11 +1,7 @@
import { UploadFotoProfileLayout } from "@/app_modules/katalog/profile";
import React from "react";
-export default async function Layout({
- children,
-}: {
- children: React.ReactNode;
-}) {
+export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
{children}
diff --git a/src/app/dev/(user)/profile/upload/foto/[id]/page.tsx b/src/app/dev/(user)/profile/upload/foto/[id]/page.tsx
new file mode 100644
index 00000000..da130aac
--- /dev/null
+++ b/src/app/dev/(user)/profile/upload/foto/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { UploadFotoProfile } from "@/app_modules/katalog/profile";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/splash/admin/page.tsx b/src/app/dev/(user)/splash/admin/page.tsx
similarity index 100%
rename from src/app/dev/splash/admin/page.tsx
rename to src/app/dev/(user)/splash/admin/page.tsx
diff --git a/src/app/dev/user-not-active/page.tsx b/src/app/dev/(user)/user-not-active/page.tsx
similarity index 100%
rename from src/app/dev/user-not-active/page.tsx
rename to src/app/dev/(user)/user-not-active/page.tsx
diff --git a/src/app/dev/(user)/user-search/page.tsx b/src/app/dev/(user)/user-search/page.tsx
new file mode 100644
index 00000000..f534479b
--- /dev/null
+++ b/src/app/dev/(user)/user-search/page.tsx
@@ -0,0 +1,5 @@
+import { UserSearch_MainView } from "@/app_modules/user_search";
+
+export default async function Page() {
+ return ;
+}
diff --git a/src/app/dev/vote/create/layout.tsx b/src/app/dev/(user)/vote/create/layout.tsx
similarity index 100%
rename from src/app/dev/vote/create/layout.tsx
rename to src/app/dev/(user)/vote/create/layout.tsx
diff --git a/src/app/dev/vote/create/page.tsx b/src/app/dev/(user)/vote/create/page.tsx
similarity index 100%
rename from src/app/dev/vote/create/page.tsx
rename to src/app/dev/(user)/vote/create/page.tsx
diff --git a/src/app/dev/(user)/vote/detail/daftar-kontributor/[id]/page.tsx b/src/app/dev/(user)/vote/detail/daftar-kontributor/[id]/page.tsx
new file mode 100644
index 00000000..97d0e1d5
--- /dev/null
+++ b/src/app/dev/(user)/vote/detail/daftar-kontributor/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Voting_UiDetailKontributorVoting } from "@/app_modules/vote/_ui";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/vote/detail/draft/[id]/layout.tsx b/src/app/dev/(user)/vote/detail/draft/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/vote/detail/draft/[id]/layout.tsx
rename to src/app/dev/(user)/vote/detail/draft/[id]/layout.tsx
diff --git a/src/app/dev/(user)/vote/detail/draft/[id]/page.tsx b/src/app/dev/(user)/vote/detail/draft/[id]/page.tsx
new file mode 100644
index 00000000..72e78acd
--- /dev/null
+++ b/src/app/dev/(user)/vote/detail/draft/[id]/page.tsx
@@ -0,0 +1,10 @@
+import { Vote_DetailDraft } from "@/app_modules/vote";
+
+export default async function Page() {
+
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/detail/kontribusi/[id]/layout.tsx b/src/app/dev/(user)/vote/detail/kontribusi/[id]/layout.tsx
new file mode 100644
index 00000000..ca76dac8
--- /dev/null
+++ b/src/app/dev/(user)/vote/detail/kontribusi/[id]/layout.tsx
@@ -0,0 +1,14 @@
+import { LayoutVote_DetailKontribusi } from "@/app_modules/vote";
+import React from "react";
+
+export default async function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/detail/kontribusi/[id]/page.tsx b/src/app/dev/(user)/vote/detail/kontribusi/[id]/page.tsx
new file mode 100644
index 00000000..06ad3e1d
--- /dev/null
+++ b/src/app/dev/(user)/vote/detail/kontribusi/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Vote_DetailKontribusi } from "@/app_modules/vote";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/detail/main/[id]/layout.tsx b/src/app/dev/(user)/vote/detail/main/[id]/layout.tsx
new file mode 100644
index 00000000..6e978bef
--- /dev/null
+++ b/src/app/dev/(user)/vote/detail/main/[id]/layout.tsx
@@ -0,0 +1,14 @@
+import { LayoutVote_MainDetail } from "@/app_modules/vote";
+import React from "react";
+
+export default async function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/detail/main/[id]/page.tsx b/src/app/dev/(user)/vote/detail/main/[id]/page.tsx
new file mode 100644
index 00000000..6f1307de
--- /dev/null
+++ b/src/app/dev/(user)/vote/detail/main/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Vote_MainDetail } from "@/app_modules/vote";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/detail/publish/[id]/layout.tsx b/src/app/dev/(user)/vote/detail/publish/[id]/layout.tsx
new file mode 100644
index 00000000..52d87354
--- /dev/null
+++ b/src/app/dev/(user)/vote/detail/publish/[id]/layout.tsx
@@ -0,0 +1,14 @@
+import { LayoutVote_DetailPublish } from "@/app_modules/vote";
+import React from "react";
+
+export default async function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/detail/publish/[id]/page.tsx b/src/app/dev/(user)/vote/detail/publish/[id]/page.tsx
new file mode 100644
index 00000000..36b9389e
--- /dev/null
+++ b/src/app/dev/(user)/vote/detail/publish/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Vote_DetailPublish } from "@/app_modules/vote";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/detail/reject/[id]/layout.tsx b/src/app/dev/(user)/vote/detail/reject/[id]/layout.tsx
new file mode 100644
index 00000000..be22a097
--- /dev/null
+++ b/src/app/dev/(user)/vote/detail/reject/[id]/layout.tsx
@@ -0,0 +1,14 @@
+import { LayoutVote_DetailReject } from "@/app_modules/vote";
+import React from "react";
+
+export default async function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/detail/reject/[id]/page.tsx b/src/app/dev/(user)/vote/detail/reject/[id]/page.tsx
new file mode 100644
index 00000000..ed28eb42
--- /dev/null
+++ b/src/app/dev/(user)/vote/detail/reject/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Vote_DetailReject } from "@/app_modules/vote";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/vote/detail/review/[id]/layout.tsx b/src/app/dev/(user)/vote/detail/review/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/vote/detail/review/[id]/layout.tsx
rename to src/app/dev/(user)/vote/detail/review/[id]/layout.tsx
diff --git a/src/app/dev/(user)/vote/detail/review/[id]/page.tsx b/src/app/dev/(user)/vote/detail/review/[id]/page.tsx
new file mode 100644
index 00000000..6c820b2a
--- /dev/null
+++ b/src/app/dev/(user)/vote/detail/review/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Vote_DetailReview } from "@/app_modules/vote";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/vote/detail/riwayat_saya/[id]/layout.tsx b/src/app/dev/(user)/vote/detail/riwayat_saya/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/vote/detail/riwayat_saya/[id]/layout.tsx
rename to src/app/dev/(user)/vote/detail/riwayat_saya/[id]/layout.tsx
diff --git a/src/app/dev/(user)/vote/detail/riwayat_saya/[id]/page.tsx b/src/app/dev/(user)/vote/detail/riwayat_saya/[id]/page.tsx
new file mode 100644
index 00000000..56807551
--- /dev/null
+++ b/src/app/dev/(user)/vote/detail/riwayat_saya/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Vote_DetailRiwayatSaya } from "@/app_modules/vote";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/detail/semua_riwayat/[id]/layout.tsx b/src/app/dev/(user)/vote/detail/semua_riwayat/[id]/layout.tsx
new file mode 100644
index 00000000..4723aa9d
--- /dev/null
+++ b/src/app/dev/(user)/vote/detail/semua_riwayat/[id]/layout.tsx
@@ -0,0 +1,14 @@
+import { LayoutVote_DetailSemuaRiwayat } from "@/app_modules/vote";
+import React from "react";
+
+export default async function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/detail/semua_riwayat/[id]/page.tsx b/src/app/dev/(user)/vote/detail/semua_riwayat/[id]/page.tsx
new file mode 100644
index 00000000..e4637b7d
--- /dev/null
+++ b/src/app/dev/(user)/vote/detail/semua_riwayat/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Vote_DetailSemuaRiwayat } from "@/app_modules/vote";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/vote/edit/[id]/layout.tsx b/src/app/dev/(user)/vote/edit/[id]/layout.tsx
similarity index 100%
rename from src/app/dev/vote/edit/[id]/layout.tsx
rename to src/app/dev/(user)/vote/edit/[id]/layout.tsx
diff --git a/src/app/dev/(user)/vote/edit/[id]/page.tsx b/src/app/dev/(user)/vote/edit/[id]/page.tsx
new file mode 100644
index 00000000..afceaf2e
--- /dev/null
+++ b/src/app/dev/(user)/vote/edit/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Vote_Edit } from "@/app_modules/vote";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/main/beranda/page.tsx b/src/app/dev/(user)/vote/main/beranda/page.tsx
new file mode 100644
index 00000000..4c507454
--- /dev/null
+++ b/src/app/dev/(user)/vote/main/beranda/page.tsx
@@ -0,0 +1,10 @@
+import { Vote_Beranda } from "@/app_modules/vote";
+
+export default async function Page() {
+
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/main/kontribusi/page.tsx b/src/app/dev/(user)/vote/main/kontribusi/page.tsx
new file mode 100644
index 00000000..2074ba5a
--- /dev/null
+++ b/src/app/dev/(user)/vote/main/kontribusi/page.tsx
@@ -0,0 +1,9 @@
+import { Vote_Kontribusi } from "@/app_modules/vote";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/main/layout.tsx b/src/app/dev/(user)/vote/main/layout.tsx
new file mode 100644
index 00000000..2833de29
--- /dev/null
+++ b/src/app/dev/(user)/vote/main/layout.tsx
@@ -0,0 +1,16 @@
+import { LayoutVote_Main } from "@/app_modules/vote";
+import NewLayout_Voting from "@/app_modules/vote/main/new_layout_voting";
+import React from "react";
+
+export default async function Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {/* {children} */}
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/main/riwayat/[id]/page.tsx b/src/app/dev/(user)/vote/main/riwayat/[id]/page.tsx
new file mode 100644
index 00000000..2730d771
--- /dev/null
+++ b/src/app/dev/(user)/vote/main/riwayat/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Vote_Riwayat } from "@/app_modules/vote";
+
+export default async function Page({ params }: { params: { id: string } }) {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/(user)/vote/main/status/[id]/page.tsx b/src/app/dev/(user)/vote/main/status/[id]/page.tsx
new file mode 100644
index 00000000..afed972f
--- /dev/null
+++ b/src/app/dev/(user)/vote/main/status/[id]/page.tsx
@@ -0,0 +1,9 @@
+import { Vote_Status } from "@/app_modules/vote";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/vote/splash/page.tsx b/src/app/dev/(user)/vote/splash/page.tsx
similarity index 100%
rename from src/app/dev/vote/splash/page.tsx
rename to src/app/dev/(user)/vote/splash/page.tsx
diff --git a/src/app/dev/admin/app-information/bidang-bisnis/create/page.tsx b/src/app/dev/admin/app-information/bidang-bisnis/create/page.tsx
new file mode 100644
index 00000000..d9993c7c
--- /dev/null
+++ b/src/app/dev/admin/app-information/bidang-bisnis/create/page.tsx
@@ -0,0 +1,9 @@
+import AdminAppInformation_ViewCreateBidangBisnis from "@/app_modules/admin/app_info/view/view_create_bidang";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/admin/app-information/bidang-bisnis/page.tsx b/src/app/dev/admin/app-information/bidang-bisnis/page.tsx
new file mode 100644
index 00000000..f794d9db
--- /dev/null
+++ b/src/app/dev/admin/app-information/bidang-bisnis/page.tsx
@@ -0,0 +1,11 @@
+import { AdminAppInformation_ViewKategoriPortofolio } from "@/app_modules/admin/app_info/view";
+import { AdminAppInformation_V3_ViewKategoriBidangBisnis } from "@/app_modules/admin/app_info/view/new_kategori_bidang_bisnis";
+
+export default function Page() {
+ return (
+ <>
+
+ {/* */}
+ >
+ );
+}
diff --git a/src/app/dev/admin/app-information/info-bank/page.tsx b/src/app/dev/admin/app-information/info-bank/page.tsx
new file mode 100644
index 00000000..22642c1a
--- /dev/null
+++ b/src/app/dev/admin/app-information/info-bank/page.tsx
@@ -0,0 +1,5 @@
+import { AdminAppInformation_ViewInfoBank } from "@/app_modules/admin/app_info/view";
+
+export default function Page() {
+ return ;
+}
diff --git a/src/app/dev/admin/app-information/layout.tsx b/src/app/dev/admin/app-information/layout.tsx
new file mode 100644
index 00000000..17050b24
--- /dev/null
+++ b/src/app/dev/admin/app-information/layout.tsx
@@ -0,0 +1,9 @@
+import AdminAppInformation_Layout from "@/app_modules/admin/app_info/ui/ui_layout_admin_app";
+
+export default function Layout({ children }: { children: React.ReactNode }) {
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/app/dev/admin/app-information/main/page.tsx b/src/app/dev/admin/app-information/main/page.tsx
index 42c3b5de..ae28eee7 100644
--- a/src/app/dev/admin/app-information/main/page.tsx
+++ b/src/app/dev/admin/app-information/main/page.tsx
@@ -1,20 +1,9 @@
-import { adminAppInformation_funGetBidangBisnis } from "@/app_modules/admin/app_info/fun";
-import adminAppInformation_getMasterBank from "@/app_modules/admin/app_info/fun/master/get_list_bank";
-import adminAppInformation_getNomorAdmin from "@/app_modules/admin/app_info/fun/master/get_nomor_admin";
import { AdminAppInformation_UiMain } from "@/app_modules/admin/app_info/ui";
export default async function Page() {
- const nomorAdmin = await adminAppInformation_getNomorAdmin();
- const listBank = await adminAppInformation_getMasterBank();
- const dataBidangBisnis = await adminAppInformation_funGetBidangBisnis()
-
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/app-information/sticker/[id]/page.tsx b/src/app/dev/admin/app-information/sticker/[id]/page.tsx
new file mode 100644
index 00000000..288ef4f6
--- /dev/null
+++ b/src/app/dev/admin/app-information/sticker/[id]/page.tsx
@@ -0,0 +1,9 @@
+import AdminAppInformation_ViewStickerDetail from "@/app_modules/admin/app_info/view/sticker/view_detail_sticker";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/admin/app-information/sticker/create/page.tsx b/src/app/dev/admin/app-information/sticker/create/page.tsx
new file mode 100644
index 00000000..a1d9cd83
--- /dev/null
+++ b/src/app/dev/admin/app-information/sticker/create/page.tsx
@@ -0,0 +1,9 @@
+import AdminAppInformation_ViewCreateSticker from "@/app_modules/admin/app_info/view/sticker/view_create_sticker";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/admin/app-information/sticker/page.tsx b/src/app/dev/admin/app-information/sticker/page.tsx
new file mode 100644
index 00000000..a9f1668d
--- /dev/null
+++ b/src/app/dev/admin/app-information/sticker/page.tsx
@@ -0,0 +1,9 @@
+import AdminAppInformation_ViewSticker from "@/app_modules/admin/app_info/view/sticker/view_stiker";
+
+export default function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/admin/colab/dashboard/page.tsx b/src/app/dev/admin/colab/dashboard/page.tsx
index 033b565f..dc5b302b 100644
--- a/src/app/dev/admin/colab/dashboard/page.tsx
+++ b/src/app/dev/admin/colab/dashboard/page.tsx
@@ -4,16 +4,13 @@ import adminColab_countIsPublish from "@/app_modules/admin/colab/fun/count/count
import adminColab_countIsReject from "@/app_modules/admin/colab/fun/count/count_reject";
export default async function Page() {
- const countPublish = await adminColab_countIsPublish();
- const countRoom = await adminColab_countGroupChat();
- const countReject = await adminColab_countIsReject()
+ // const countPublish = await adminColab_countIsPublish();
+ // const countRoom = await adminColab_countGroupChat();
+ // const countReject = await adminColab_countIsReject()
return (
<>
>
);
diff --git a/src/app/dev/admin/colab/detail/group/[id]/page.tsx b/src/app/dev/admin/colab/detail/group/[id]/page.tsx
new file mode 100644
index 00000000..1e03a6ff
--- /dev/null
+++ b/src/app/dev/admin/colab/detail/group/[id]/page.tsx
@@ -0,0 +1,11 @@
+import DetailGroup from "@/app_modules/admin/colab/detail/detail_group";
+
+async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/admin/colab/detail/publish/[id]/page.tsx b/src/app/dev/admin/colab/detail/publish/[id]/page.tsx
new file mode 100644
index 00000000..9004c86c
--- /dev/null
+++ b/src/app/dev/admin/colab/detail/publish/[id]/page.tsx
@@ -0,0 +1,11 @@
+import DetailPublish from '@/app_modules/admin/colab/detail/detail_publish';
+
+function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/admin/colab/detail/reject/[id]/page.tsx b/src/app/dev/admin/colab/detail/reject/[id]/page.tsx
new file mode 100644
index 00000000..a81cf94e
--- /dev/null
+++ b/src/app/dev/admin/colab/detail/reject/[id]/page.tsx
@@ -0,0 +1,11 @@
+import DetailReject from "@/app_modules/admin/colab/detail/detail_reject";
+
+async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/admin/colab/sub-menu/group/page.tsx b/src/app/dev/admin/colab/sub-menu/group/page.tsx
index 8b499f57..115e6fc5 100644
--- a/src/app/dev/admin/colab/sub-menu/group/page.tsx
+++ b/src/app/dev/admin/colab/sub-menu/group/page.tsx
@@ -1,12 +1,9 @@
import { AdminColab_TableGroup } from "@/app_modules/admin/colab";
-import adminColab_getListAllGroupChat from "@/app_modules/admin/colab/fun/get/get_list_all_group_chat";
export default async function Page() {
- const listGroup = await adminColab_getListAllGroupChat({page: 1})
-
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/colab/sub-menu/publish/page.tsx b/src/app/dev/admin/colab/sub-menu/publish/page.tsx
index 902b50c3..df606eb3 100644
--- a/src/app/dev/admin/colab/sub-menu/publish/page.tsx
+++ b/src/app/dev/admin/colab/sub-menu/publish/page.tsx
@@ -1,12 +1,9 @@
import { AdminColab_TablePublish } from "@/app_modules/admin/colab";
-import adminColab_getListAllPublish from "@/app_modules/admin/colab/fun/get/get_list_all_publish";
export default async function Page() {
- const listData = await adminColab_getListAllPublish({ page: 1 });
-
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/colab/sub-menu/reject/page.tsx b/src/app/dev/admin/colab/sub-menu/reject/page.tsx
index 11e5c047..98928960 100644
--- a/src/app/dev/admin/colab/sub-menu/reject/page.tsx
+++ b/src/app/dev/admin/colab/sub-menu/reject/page.tsx
@@ -1,12 +1,11 @@
import { AdminColab_TableRejected } from "@/app_modules/admin/colab";
-import adminColab_getListAllRejected from "@/app_modules/admin/colab/fun/get/get_list_all_reject";
export default async function Page() {
- const listReject = await adminColab_getListAllRejected({page: 1})
+
return (
<>
-
+
>
);
}
\ No newline at end of file
diff --git a/src/app/dev/admin/developer/page.tsx b/src/app/dev/admin/developer/page.tsx
index 609d4b10..eed9b4b5 100644
--- a/src/app/dev/admin/developer/page.tsx
+++ b/src/app/dev/admin/developer/page.tsx
@@ -1,15 +1,12 @@
import AdminDeveloper from "@/app_modules/admin/developer";
-import adminDeveloper_funGetListAllAdmin from "@/app_modules/admin/developer/fun/get/fun_get_list_all_admin";
-import adminDeveloper_funGetListAllUser from "@/app_modules/admin/developer/fun/get/fun_get_list_all_user";
-import _ from "lodash";
export default async function Page() {
- const listUser = await adminDeveloper_funGetListAllUser({ page: 1 });
- const listAdmin = await adminDeveloper_funGetListAllAdmin({ page: 1 });
+ // const listUser = await adminDeveloper_funGetListAllUser({ page: 1 });
+ // const listAdmin = await adminDeveloper_funGetListAllAdmin({ page: 1 });
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/donasi/detail/publish/[id]/page.tsx b/src/app/dev/admin/donasi/detail/publish/[id]/page.tsx
index 6407215a..7e45a457 100644
--- a/src/app/dev/admin/donasi/detail/publish/[id]/page.tsx
+++ b/src/app/dev/admin/donasi/detail/publish/[id]/page.tsx
@@ -1,30 +1,11 @@
import { AdminDonasi_DetailPublish } from "@/app_modules/admin/donasi";
import { AdminDonasi_funCountDonatur } from "@/app_modules/admin/donasi/fun/count/fun_count_donatur";
-import { adminDonasi_getListDonatur } from "@/app_modules/admin/donasi/fun/get/get_list_donatur_by_id";
import { AdminDonasi_getListPencairanDana } from "@/app_modules/admin/donasi/fun/get/get_list_pencairan_dana_by_id";
-import { AdminDonasi_getOneById } from "@/app_modules/admin/donasi/fun/get/get_one_by_id";
-import adminDonasi_getMasterStatus from "@/app_modules/admin/donasi/fun/master/get_status_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let donasiId = params.id;
- const dataPublish = await AdminDonasi_getOneById(params.id);
- const countDonatur = await AdminDonasi_funCountDonatur(params.id);
- const listMasterStatus = await adminDonasi_getMasterStatus();
- const listDonatur = await adminDonasi_getListDonatur({
- donasiId: donasiId,
- page: 1,
- });
- const listPencairan = await AdminDonasi_getListPencairanDana(params.id);
+export default async function Page() {
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/donasi/detail/reject/[id]/page.tsx b/src/app/dev/admin/donasi/detail/reject/[id]/page.tsx
index 515f1c91..22bc1ac5 100644
--- a/src/app/dev/admin/donasi/detail/reject/[id]/page.tsx
+++ b/src/app/dev/admin/donasi/detail/reject/[id]/page.tsx
@@ -1,12 +1,12 @@
import { AdminDonasi_DetailReject } from "@/app_modules/admin/donasi";
import { AdminDonasi_getOneById } from "@/app_modules/admin/donasi/fun/get/get_one_by_id";
-export default async function Page({ params }: { params: { id: string } }) {
- const dataReject = await AdminDonasi_getOneById(params.id);
+export default async function Page() {
+ // const dataReject = await AdminDonasi_getOneById(params.id);
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/donasi/detail/review/[id]/page.tsx b/src/app/dev/admin/donasi/detail/review/[id]/page.tsx
index 230bfefc..73ac4bd5 100644
--- a/src/app/dev/admin/donasi/detail/review/[id]/page.tsx
+++ b/src/app/dev/admin/donasi/detail/review/[id]/page.tsx
@@ -1,8 +1,5 @@
import { AdminDonasi_DetailReview } from "@/app_modules/admin/donasi";
-import { AdminDonasi_getOneById } from "@/app_modules/admin/donasi/fun/get/get_one_by_id";
-export default async function Page({ params }: { params: { id: string } }) {
- const dataReview = await AdminDonasi_getOneById(params.id);
-
- return ;
+export default async function Page() {
+ return ;
}
diff --git a/src/app/dev/admin/donasi/main/page.tsx b/src/app/dev/admin/donasi/main/page.tsx
index 63f2c0ce..48821986 100644
--- a/src/app/dev/admin/donasi/main/page.tsx
+++ b/src/app/dev/admin/donasi/main/page.tsx
@@ -2,18 +2,14 @@ import { AdminDonasi_Main } from "@/app_modules/admin/donasi";
import AdminDonasi_funCountByStatus from "@/app_modules/admin/donasi/fun/count/fun_count_donasi_by_status";
export default async function Page() {
- const countPublish = await AdminDonasi_funCountByStatus("1");
- const countReview = await AdminDonasi_funCountByStatus("2");
- const countDraft = await AdminDonasi_funCountByStatus("3");
- const countReject = await AdminDonasi_funCountByStatus("4");
+
return (
<>
>
);
diff --git a/src/app/dev/admin/donasi/pencairan_dana/[id]/page.tsx b/src/app/dev/admin/donasi/pencairan_dana/[id]/page.tsx
index 10c8d4b7..d6229c17 100644
--- a/src/app/dev/admin/donasi/pencairan_dana/[id]/page.tsx
+++ b/src/app/dev/admin/donasi/pencairan_dana/[id]/page.tsx
@@ -1,18 +1,29 @@
import { AdminDonasi_PencairanDana } from "@/app_modules/admin/donasi";
import { AdminDonasi_getOneById } from "@/app_modules/admin/donasi/fun/get/get_one_by_id";
-export default async function Page({ params }: { params: { id: string } }) {
- let donasiId = params.id;
- const dataDonasi = await AdminDonasi_getOneById(donasiId);
- const danaTerkumpul = dataDonasi?.terkumpul;
- const totalPencairan = dataDonasi?.totalPencairan
-
+export default async function Page() {
return (
);
}
+
+// import { AdminDonasi_PencairanDana } from "@/app_modules/admin/donasi";
+// import { AdminDonasi_getOneById } from "@/app_modules/admin/donasi/fun/get/get_one_by_id";
+
+// export default async function Page({ params }: { params: { id: string } }) {
+// let donasiId = params.id;
+// const dataDonasi = await AdminDonasi_getOneById(donasiId);
+// const danaTerkumpul = dataDonasi?.terkumpul;
+// const totalPencairan = dataDonasi?.totalPencairan
+
+
+// return (
+//
+// );
+// }
diff --git a/src/app/dev/admin/donasi/sub-menu/kategori/page.tsx b/src/app/dev/admin/donasi/sub-menu/kategori/page.tsx
index 86c84d44..d1f397ff 100644
--- a/src/app/dev/admin/donasi/sub-menu/kategori/page.tsx
+++ b/src/app/dev/admin/donasi/sub-menu/kategori/page.tsx
@@ -2,11 +2,10 @@ import { AdminDonasi_TableKategori } from "@/app_modules/admin/donasi";
import adminDonasi_getMasterKategori from "@/app_modules/admin/donasi/fun/master/get_list_kategori";
export default async function Page() {
- const listKategori = await adminDonasi_getMasterKategori();
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/donasi/sub-menu/publish/page.tsx b/src/app/dev/admin/donasi/sub-menu/publish/page.tsx
index a0171588..45c8e7e9 100644
--- a/src/app/dev/admin/donasi/sub-menu/publish/page.tsx
+++ b/src/app/dev/admin/donasi/sub-menu/publish/page.tsx
@@ -1,12 +1,9 @@
import { AdminDonasi_TablePublish } from "@/app_modules/admin/donasi";
-import adminDonasi_getListPublish from "@/app_modules/admin/donasi/fun/get/get_list_publish";
export default async function Page() {
- const listPublish = await adminDonasi_getListPublish({
- page: 1,
- });
- // console.log(listPublish)
- return<>
-
+ return (
+ <>
+
>
-}
\ No newline at end of file
+ );
+}
diff --git a/src/app/dev/admin/donasi/sub-menu/reject/page.tsx b/src/app/dev/admin/donasi/sub-menu/reject/page.tsx
index 76c38ec8..e20a80d9 100644
--- a/src/app/dev/admin/donasi/sub-menu/reject/page.tsx
+++ b/src/app/dev/admin/donasi/sub-menu/reject/page.tsx
@@ -2,11 +2,10 @@ import { AdminDonasi_TableReject } from "@/app_modules/admin/donasi";
import adminDonasi_getListReject from "@/app_modules/admin/donasi/fun/get/get_list_reject";
export default async function Page() {
- const dataReject = await adminDonasi_getListReject({ page: 1 });
- // console.log(dataReject)
+
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/donasi/sub-menu/review/page.tsx b/src/app/dev/admin/donasi/sub-menu/review/page.tsx
index 6e25d7fe..3dbe1714 100644
--- a/src/app/dev/admin/donasi/sub-menu/review/page.tsx
+++ b/src/app/dev/admin/donasi/sub-menu/review/page.tsx
@@ -1,8 +1,6 @@
import { AdminDonasi_TableReview } from "@/app_modules/admin/donasi";
-import adminDonasi_getListReview from "@/app_modules/admin/donasi/fun/get/get_list_review";
export default async function Page() {
- const listReview = await adminDonasi_getListReview({page: 1});
- // console.log(listReview);
- return ;
+
+ return ;
}
diff --git a/src/app/dev/admin/event/[id]/page.tsx b/src/app/dev/admin/event/[id]/page.tsx
new file mode 100644
index 00000000..40905d23
--- /dev/null
+++ b/src/app/dev/admin/event/[id]/page.tsx
@@ -0,0 +1,11 @@
+import { AdminEvent_UiNewDetail } from "@/app_modules/admin/event/_ui/ui_new_detail";
+
+async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/admin/event/child/riwayat/page.tsx b/src/app/dev/admin/event/child/riwayat/page.tsx
index a6923bad..084fede7 100644
--- a/src/app/dev/admin/event/child/riwayat/page.tsx
+++ b/src/app/dev/admin/event/child/riwayat/page.tsx
@@ -1,12 +1,10 @@
import { AdminEvent_Riwayat } from "@/app_modules/admin/event";
-import { adminEvent_funGetListAllRiwayat } from "@/app_modules/admin/event/fun/get/get_list_all_riwayat";
export default async function Page() {
- const listRiwayat = await adminEvent_funGetListAllRiwayat({ page: 1 });
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/event/child/tipe_acara/page.tsx b/src/app/dev/admin/event/child/tipe_acara/page.tsx
index b905136e..1ad22c10 100644
--- a/src/app/dev/admin/event/child/tipe_acara/page.tsx
+++ b/src/app/dev/admin/event/child/tipe_acara/page.tsx
@@ -1,12 +1,11 @@
import { AdminEvent_DetailTipeAcara } from "@/app_modules/admin/event";
-import { AdminEvent_getListTipeAcara } from "@/app_modules/admin/event/fun/get/get_list_tipe_acara";
export default async function Page() {
- const listTipe = await AdminEvent_getListTipeAcara()
+ // const listTipe = await AdminEvent_getListTipeAcara()
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/event/detail/detail_sponsor/page.tsx b/src/app/dev/admin/event/detail/detail_sponsor/page.tsx
new file mode 100644
index 00000000..8da4fe25
--- /dev/null
+++ b/src/app/dev/admin/event/detail/detail_sponsor/page.tsx
@@ -0,0 +1,11 @@
+import AdminEvent_DetailSponsor from '@/app_modules/admin/event/table_status/detail_sponsor';
+
+function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/admin/event/detail/peserta/[id]/page.tsx b/src/app/dev/admin/event/detail/peserta/[id]/page.tsx
index 7038c519..18969dac 100644
--- a/src/app/dev/admin/event/detail/peserta/[id]/page.tsx
+++ b/src/app/dev/admin/event/detail/peserta/[id]/page.tsx
@@ -1,13 +1,10 @@
import { AdminEvent_UiDetailPeserta } from "@/app_modules/admin/event/_ui";
-import { adminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id";
-export default async function Page({ params }: { params: { id: string } }) {
- const eventId = params.id;
- const dataPeserta = await adminEvent_getListPesertaById({ eventId, page: 1 });
+export default async function Page(){
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/event/detail/publish/[id]/page.tsx b/src/app/dev/admin/event/detail/publish/[id]/page.tsx
new file mode 100644
index 00000000..da2f5681
--- /dev/null
+++ b/src/app/dev/admin/event/detail/publish/[id]/page.tsx
@@ -0,0 +1,12 @@
+import AdminEvent_DetailPublish from '@/app_modules/admin/event/table_status/detail_publish';
+import React from 'react';
+
+function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/admin/event/main/page.tsx b/src/app/dev/admin/event/main/page.tsx
index abd71c1e..21e83625 100644
--- a/src/app/dev/admin/event/main/page.tsx
+++ b/src/app/dev/admin/event/main/page.tsx
@@ -1,26 +1,9 @@
import { AdminEvent_Main } from "@/app_modules/admin/event";
-import AdminEvent_funCountByStatusId from "@/app_modules/admin/event/fun/count/fun_count_event_by_status_id";
-import { AdminEvent_funCountRiwayat } from "@/app_modules/admin/event/fun/count/fun_count_riwayat";
-import { AdminEvent_funCountTipeAcara } from "@/app_modules/admin/event/fun/count/fun_count_tipe_acara";
export default async function Page() {
- const countPublish = await AdminEvent_funCountByStatusId("1");
- const countReview = await AdminEvent_funCountByStatusId("2");
- const countDraft = await AdminEvent_funCountByStatusId("3");
- const countReject = await AdminEvent_funCountByStatusId("4");
- const countTipeAcara = await AdminEvent_funCountTipeAcara();
- const countRiwayat = await AdminEvent_funCountRiwayat();
-
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/event/table/publish/page.tsx b/src/app/dev/admin/event/table/publish/page.tsx
index a7c514dc..3e1641c4 100644
--- a/src/app/dev/admin/event/table/publish/page.tsx
+++ b/src/app/dev/admin/event/table/publish/page.tsx
@@ -1,12 +1,9 @@
import { AdminEvent_TablePublish } from "@/app_modules/admin/event";
-import { adminEvent_funGetListPublish } from "@/app_modules/admin/event/fun";
async function Page() {
- const listPublish = await adminEvent_funGetListPublish({ page: 1 });
-
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/event/table/reject/page.tsx b/src/app/dev/admin/event/table/reject/page.tsx
index 236885b6..9cdeb92d 100644
--- a/src/app/dev/admin/event/table/reject/page.tsx
+++ b/src/app/dev/admin/event/table/reject/page.tsx
@@ -1,12 +1,10 @@
import { AdminEvent_TableReject } from "@/app_modules/admin/event";
-import { adminEvent_funGetListReject } from "@/app_modules/admin/event/fun";
export default async function Page() {
- const listReject = await adminEvent_funGetListReject({ page: 1 });
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/event/table/review/page.tsx b/src/app/dev/admin/event/table/review/page.tsx
index 3167dd30..b88afd26 100644
--- a/src/app/dev/admin/event/table/review/page.tsx
+++ b/src/app/dev/admin/event/table/review/page.tsx
@@ -1,12 +1,10 @@
import { AdminEvent_TableReview } from "@/app_modules/admin/event";
-import { adminEvent_funGetListReview } from "@/app_modules/admin/event/fun";
export default async function Page() {
- const listReview = await adminEvent_funGetListReview({ page: 1 });
-
+
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/forum/detail/[id]/page.tsx b/src/app/dev/admin/forum/detail/[id]/page.tsx
index 69063651..3466102b 100644
--- a/src/app/dev/admin/forum/detail/[id]/page.tsx
+++ b/src/app/dev/admin/forum/detail/[id]/page.tsx
@@ -1,26 +1,9 @@
import { AdminForum_LihatSemuaKomentar } from "@/app_modules/admin/forum";
-import adminForum_countKomentarByPostingId from "@/app_modules/admin/forum/fun/count/fun_count_komentar_by_id";
-import { adminForum_getListKomentarById } from "@/app_modules/admin/forum/fun/get/get_list_komentar_by_id";
-import { adminForum_getOnePostingById } from "@/app_modules/admin/forum/fun/get/get_one_posting_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let postingId = params.id;
-
- const listKomentar = await adminForum_getListKomentarById({
- postingId: postingId,
- page: 1,
- });
- const dataPosting = await adminForum_getOnePostingById(postingId);
- const countKomentar = await adminForum_countKomentarByPostingId({postingId: postingId})
-
+export default async function Page() {
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/forum/main/page.tsx b/src/app/dev/admin/forum/main/page.tsx
index 9be61059..ffd816d2 100644
--- a/src/app/dev/admin/forum/main/page.tsx
+++ b/src/app/dev/admin/forum/main/page.tsx
@@ -1,23 +1,13 @@
import { AdminForum_Main } from "@/app_modules/admin/forum";
-import { adminForum_countLaporanKomentar } from "@/app_modules/admin/forum/fun/count/fun_count_laporan_komentar";
-import { adminForum_countLaporanPosting } from "@/app_modules/admin/forum/fun/count/fun_count_laporan_posting";
-import { adminForum_countPublish } from "@/app_modules/admin/forum/fun/count/fun_count_publish";
export default async function Page() {
-// await new Promise((a, b) => {
-// setTimeout(a, 4000);
-// });
- const countPublish = await adminForum_countPublish();
- const countLaporanPosting = await adminForum_countLaporanPosting()
- const countLaporanKomentar = await adminForum_countLaporanKomentar();
+ // await new Promise((a, b) => {
+ // setTimeout(a, 4000);
+ // });
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/forum/sub-detail/report-komentar/[id]/page.tsx b/src/app/dev/admin/forum/sub-detail/report-komentar/[id]/page.tsx
index 94f2bd0f..17c6f084 100644
--- a/src/app/dev/admin/forum/sub-detail/report-komentar/[id]/page.tsx
+++ b/src/app/dev/admin/forum/sub-detail/report-komentar/[id]/page.tsx
@@ -1,23 +1,21 @@
import { AdminForum_HasilReportKomentar } from "@/app_modules/admin/forum";
-import { adminForum_getListReportKomentarbyId } from "@/app_modules/admin/forum/fun/get/get_list_report_komentar_by_id";
-import adminForum_funGetOneKomentarById from "@/app_modules/admin/forum/fun/get/get_one_komentar_by_id";
export default async function Page({ params }: { params: { id: string } }) {
- let komentarId = params.id;
- const listReport = await adminForum_getListReportKomentarbyId({
- komentarId: komentarId,
- page: 1,
- });
- const dataKomentar = await adminForum_funGetOneKomentarById({
- komentarId: komentarId,
- });
+ // let komentarId = params.id;
+ // const listReport = await adminForum_getListReportKomentarbyId({
+ // komentarId: komentarId,
+ // page: 1,
+ // });
+ // const dataKomentar = await adminForum_funGetOneKomentarById({
+ // komentarId: komentarId,
+ // });
return (
<>
>
);
diff --git a/src/app/dev/admin/forum/sub-detail/report-posting/[id]/page.tsx b/src/app/dev/admin/forum/sub-detail/report-posting/[id]/page.tsx
index a40c7fed..4d4fa163 100644
--- a/src/app/dev/admin/forum/sub-detail/report-posting/[id]/page.tsx
+++ b/src/app/dev/admin/forum/sub-detail/report-posting/[id]/page.tsx
@@ -3,19 +3,19 @@ import { adminForum_getListReportPostingById } from "@/app_modules/admin/forum/f
import { adminForum_getOnePostingById } from "@/app_modules/admin/forum/fun/get/get_one_posting_by_id";
export default async function Page({ params }: { params: { id: string } }) {
- let postingId = params.id;
- const listReport = await adminForum_getListReportPostingById({
- postingId: postingId,
- page: 1,
- });
+ // let postingId = params.id;
+ // const listReport = await adminForum_getListReportPostingById({
+ // postingId: postingId,
+ // page: 1,
+ // });
- const dataPosting = await adminForum_getOnePostingById(postingId);
+ // const dataPosting = await adminForum_getOnePostingById(postingId);
return (
<>
>
);
diff --git a/src/app/dev/admin/forum/sub-menu/posting/page.tsx b/src/app/dev/admin/forum/sub-menu/posting/page.tsx
index c6457777..bec91655 100644
--- a/src/app/dev/admin/forum/sub-menu/posting/page.tsx
+++ b/src/app/dev/admin/forum/sub-menu/posting/page.tsx
@@ -1,12 +1,9 @@
import { AdminForum_TablePublish } from "@/app_modules/admin/forum";
-import { adminForum_getListPosting } from "@/app_modules/admin/forum/fun/get/get_list_publish";
export default async function Page() {
- const listPublish = await adminForum_getListPosting({page: 1});
-
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/forum/sub-menu/report-komentar/page.tsx b/src/app/dev/admin/forum/sub-menu/report-komentar/page.tsx
index dfff6d5b..52063831 100644
--- a/src/app/dev/admin/forum/sub-menu/report-komentar/page.tsx
+++ b/src/app/dev/admin/forum/sub-menu/report-komentar/page.tsx
@@ -1,12 +1,10 @@
-import adminForum_funGetAllReportKomentar from "@/app_modules/admin/forum/fun/get/get_all_report_komentar";
import AdminForum_TableReportKomentar from "@/app_modules/admin/forum/sub_menu/table_report_komentar";
export default async function Page() {
- const listData = await adminForum_funGetAllReportKomentar({ page: 1 });
-
+
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/forum/sub-menu/report-posting/page.tsx b/src/app/dev/admin/forum/sub-menu/report-posting/page.tsx
index 9d2e6dfb..82dd172e 100644
--- a/src/app/dev/admin/forum/sub-menu/report-posting/page.tsx
+++ b/src/app/dev/admin/forum/sub-menu/report-posting/page.tsx
@@ -1,12 +1,9 @@
import { AdminForum_TableReportPosting } from "@/app_modules/admin/forum";
-import adminForum_funGetAllReportPosting from "@/app_modules/admin/forum/fun/get/get_all_report_posting";
export default async function Page() {
- const listData = await adminForum_funGetAllReportPosting({ page: 1 });
-
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/investasi/detail/publish/[id]/page.tsx b/src/app/dev/admin/investasi/detail/publish/[id]/page.tsx
index b87747e9..6bbcffbc 100644
--- a/src/app/dev/admin/investasi/detail/publish/[id]/page.tsx
+++ b/src/app/dev/admin/investasi/detail/publish/[id]/page.tsx
@@ -1,26 +1,19 @@
import { AdminInvestasi_DetailPublish } from "@/app_modules/admin/investasi";
-import {
- adminInvestasi_funGetAllTransaksiById,
- adminInvestasi_getStatusInvestasi,
-} from "@/app_modules/admin/investasi/fun";
-import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- const dataInvestasi = await getOneInvestasiById(investasiId);
- const statusTransaksi = await adminInvestasi_getStatusInvestasi();
- const dataTransaksi = await adminInvestasi_funGetAllTransaksiById({
- investasiId,
- page: 1,
- });
+export default async function Page() {
+
+ // export default async function Page({ params }: { params: { id: string } }) {
+ // const investasiId = params.id;
+ // const dataInvestasi = await getOneInvestasiById(investasiId);
+ // const statusTransaksi = await adminInvestasi_getStatusInvestasi();
+ // const dataTransaksi = await adminInvestasi_funGetAllTransaksiById({
+ // investasiId,
+ // page: 1,
+ // });
return (
<>
-
>
);
diff --git a/src/app/dev/admin/investasi/detail/reject/[id]/page.tsx b/src/app/dev/admin/investasi/detail/reject/[id]/page.tsx
index d2a2743c..aa425741 100644
--- a/src/app/dev/admin/investasi/detail/reject/[id]/page.tsx
+++ b/src/app/dev/admin/investasi/detail/reject/[id]/page.tsx
@@ -2,12 +2,12 @@ import { AdminInvestasi_DetailReject } from "@/app_modules/admin/investasi";
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- const dataInvestasi = await getOneInvestasiById(investasiId);
+ // const investasiId = params.id;
+ // const dataInvestasi = await getOneInvestasiById(investasiId);
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/investasi/detail/review/[id]/page.tsx b/src/app/dev/admin/investasi/detail/review/[id]/page.tsx
index 840957b1..b19f6d87 100644
--- a/src/app/dev/admin/investasi/detail/review/[id]/page.tsx
+++ b/src/app/dev/admin/investasi/detail/review/[id]/page.tsx
@@ -1,13 +1,12 @@
import { Admin_KonfirmasiInvestasi } from "@/app_modules/admin/investasi";
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- const dataInvestasi = await getOneInvestasiById(investasiId);
+export default async function Page() {
+
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/investasi/detail/transaksi/[id]/page.tsx b/src/app/dev/admin/investasi/detail/transaksi/[id]/page.tsx
new file mode 100644
index 00000000..c5d00c4c
--- /dev/null
+++ b/src/app/dev/admin/investasi/detail/transaksi/[id]/page.tsx
@@ -0,0 +1,11 @@
+import DetailTransaksi from "@/app_modules/admin/investasi/_view/detail/view_detail_transaksi";
+
+function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/admin/investasi/konfirmasi/[id]/page.tsx b/src/app/dev/admin/investasi/konfirmasi/[id]/page.tsx
index 96111822..b31fb4a0 100644
--- a/src/app/dev/admin/investasi/konfirmasi/[id]/page.tsx
+++ b/src/app/dev/admin/investasi/konfirmasi/[id]/page.tsx
@@ -1,14 +1,9 @@
import { Admin_KonfirmasiInvestasi } from "@/app_modules/admin/investasi";
-import { adminInvestasi_getOneById } from "@/app_modules/admin/investasi/fun";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- const dataInvestasi = await adminInvestasi_getOneById({investasiId});
- // console.log(dataUser)
+export default async function Page() {
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/investasi/main/page.tsx b/src/app/dev/admin/investasi/main/page.tsx
index fdeee026..a58c0d4c 100644
--- a/src/app/dev/admin/investasi/main/page.tsx
+++ b/src/app/dev/admin/investasi/main/page.tsx
@@ -1,32 +1,9 @@
import { Admin_Investasi } from "@/app_modules/admin/investasi";
-import Admin_CountStatusInvestasi from "@/app_modules/admin/investasi/fun/count_status";
-import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
-import Admin_getPublishProgresInvestasi from "@/app_modules/admin/investasi/fun/get_publish_progres";
-import Admin_getTotalInvestasiByUser from "@/app_modules/admin/investasi/fun/get_total_investasi_by_user";
export default async function Page() {
- const listInvestasi = await Admin_funGetAllInvestasi();
- const countDraft = await Admin_CountStatusInvestasi(1);
- const countReview = await Admin_CountStatusInvestasi(2);
- const countPublish = await Admin_CountStatusInvestasi(3);
- const countReject = await Admin_CountStatusInvestasi(4);
- const totalInvestasiByUser = await Admin_getTotalInvestasiByUser()
- const publishProgres = await Admin_getPublishProgresInvestasi()
- // console.log(targetTerbesar)
-
return (
<>
-
- {/* {JSON.stringify(totalInvestasiByUser, null,2)} */}
+
>
);
}
diff --git a/src/app/dev/admin/investasi/sub-menu/publish/page.tsx b/src/app/dev/admin/investasi/sub-menu/publish/page.tsx
index 02de99d3..f5089589 100644
--- a/src/app/dev/admin/investasi/sub-menu/publish/page.tsx
+++ b/src/app/dev/admin/investasi/sub-menu/publish/page.tsx
@@ -1,12 +1,9 @@
import { Admin_TablePublishInvestasi } from "@/app_modules/admin/investasi";
-import { adminInvestasi_funGetAllPublish } from "@/app_modules/admin/investasi/fun/get/get_all_publish";
export default async function Page() {
- const listInvestasi = await adminInvestasi_funGetAllPublish({page: 1});
-
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/investasi/sub-menu/reject/page.tsx b/src/app/dev/admin/investasi/sub-menu/reject/page.tsx
index 9f4af9e0..2d832e4b 100644
--- a/src/app/dev/admin/investasi/sub-menu/reject/page.tsx
+++ b/src/app/dev/admin/investasi/sub-menu/reject/page.tsx
@@ -2,10 +2,10 @@ import { Admin_TableRejectInvestasi } from "@/app_modules/admin/investasi";
import { adminInvestasi_funGetAllReject } from "@/app_modules/admin/investasi/fun/get/get_all_reject";
export default async function Page() {
- const dataInvestsi = await adminInvestasi_funGetAllReject({page: 1});
+
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/investasi/sub-menu/review/page.tsx b/src/app/dev/admin/investasi/sub-menu/review/page.tsx
index 454397aa..08e46f1f 100644
--- a/src/app/dev/admin/investasi/sub-menu/review/page.tsx
+++ b/src/app/dev/admin/investasi/sub-menu/review/page.tsx
@@ -1,11 +1,9 @@
import { Admin_TableReviewInvestasi } from "@/app_modules/admin/investasi";
-import { adminInvestasi_funGetAllReview } from "@/app_modules/admin/investasi/fun/get/get_all_review";
export default async function Page() {
- const dataInvestsi = await adminInvestasi_funGetAllReview({ page: 1 });
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/investasi/table_status/publish/page.tsx b/src/app/dev/admin/investasi/table_status/publish/page.tsx
deleted file mode 100644
index 1d9f989c..00000000
--- a/src/app/dev/admin/investasi/table_status/publish/page.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Admin_TablePublishInvestasi } from "@/app_modules/admin/investasi";
-import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
-
-export default async function Page() {
- const listInvestasi = await Admin_funGetAllInvestasi();
-
- return<>
-
- >
-}
\ No newline at end of file
diff --git a/src/app/dev/admin/investasi/table_status/reject/page.tsx b/src/app/dev/admin/investasi/table_status/reject/page.tsx
deleted file mode 100644
index 55092f60..00000000
--- a/src/app/dev/admin/investasi/table_status/reject/page.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Admin_TableRejectInvestasi } from "@/app_modules/admin/investasi";
-import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
-
-export default async function Page() {
- const dataInvestsi = await Admin_funGetAllInvestasi()
- return <>
-
-
- >
-}
\ No newline at end of file
diff --git a/src/app/dev/admin/investasi/table_status/review/page.tsx b/src/app/dev/admin/investasi/table_status/review/page.tsx
deleted file mode 100644
index 350245f7..00000000
--- a/src/app/dev/admin/investasi/table_status/review/page.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { Admin_TableReviewInvestasi } from "@/app_modules/admin/investasi";
-import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
-
-export default async function Page() {
- const dataInvestsi = await Admin_funGetAllInvestasi()
- return <>
-
- >
-}
\ No newline at end of file
diff --git a/src/app/dev/admin/job/[id]/page.tsx b/src/app/dev/admin/job/[id]/page.tsx
new file mode 100644
index 00000000..770dba26
--- /dev/null
+++ b/src/app/dev/admin/job/[id]/page.tsx
@@ -0,0 +1,11 @@
+import { AdminJob_ViewDetailPublish } from "@/app_modules/admin/job/_view/detail";
+
+async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/admin/job/child/publish/page.tsx b/src/app/dev/admin/job/child/publish/page.tsx
index 28a18d68..9b422249 100644
--- a/src/app/dev/admin/job/child/publish/page.tsx
+++ b/src/app/dev/admin/job/child/publish/page.tsx
@@ -1,13 +1,9 @@
import { AdminJob_TablePublish } from "@/app_modules/admin/job";
-import adminJob_getListPublish from "@/app_modules/admin/job/fun/get/get_list_publish";
-import { AdminJob_getListTableByStatusId } from "@/app_modules/admin/job/fun/get/get_list_table_by_status_id";
export default async function Page() {
- const listPublish = await adminJob_getListPublish({page: 1})
-
- return (
- <>
-
- >
- );
-}
\ No newline at end of file
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/admin/job/child/reject/page.tsx b/src/app/dev/admin/job/child/reject/page.tsx
index 79160dd7..19d5cadd 100644
--- a/src/app/dev/admin/job/child/reject/page.tsx
+++ b/src/app/dev/admin/job/child/reject/page.tsx
@@ -1,13 +1,9 @@
import { AdminJob_TableReject } from "@/app_modules/admin/job";
-import adminJob_getListReject from "@/app_modules/admin/job/fun/get/get_list_reject";
-import { AdminJob_getListTableByStatusId } from "@/app_modules/admin/job/fun/get/get_list_table_by_status_id";
export default async function Page() {
- const listReject = await adminJob_getListReject({ page: 1 });
-
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/job/child/review/page.tsx b/src/app/dev/admin/job/child/review/page.tsx
index 84fd487f..bafef54f 100644
--- a/src/app/dev/admin/job/child/review/page.tsx
+++ b/src/app/dev/admin/job/child/review/page.tsx
@@ -1,12 +1,10 @@
import { AdminJob_TableReview } from "@/app_modules/admin/job";
-import adminJob_getListReview from "@/app_modules/admin/job/fun/get/get_list_review";
export default async function Page() {
- const dataReview = await adminJob_getListReview({ page: 1 });
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/job/main/page.tsx b/src/app/dev/admin/job/main/page.tsx
index 140eb795..ab68e029 100644
--- a/src/app/dev/admin/job/main/page.tsx
+++ b/src/app/dev/admin/job/main/page.tsx
@@ -1,23 +1,9 @@
import { AdminJob_Main } from "@/app_modules/admin/job";
-import { AdminJob_funCountStatusByStatusId } from "@/app_modules/admin/job/fun/count/fun_count_job_by_status_id";
export default async function Page() {
- const countPublish = await AdminJob_funCountStatusByStatusId("1")
- const countReview = await AdminJob_funCountStatusByStatusId("2");
- const countReject = await AdminJob_funCountStatusByStatusId("4");
- const countArsip = await AdminJob_funCountStatusByStatusId("0")
-
-
-
-
- return (
- <>
-
- >
- );
-}
\ No newline at end of file
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/admin/layout.tsx b/src/app/dev/admin/layout.tsx
index 212636a4..bbbd7411 100644
--- a/src/app/dev/admin/layout.tsx
+++ b/src/app/dev/admin/layout.tsx
@@ -5,8 +5,10 @@ import adminNotifikasi_countNotifikasi from "@/app_modules/admin/notifikasi/fun/
import adminNotifikasi_getByUserId from "@/app_modules/admin/notifikasi/fun/get/get_notifikasi_by_user_id";
import React from "react";
import versionUpdate from "../../../../package.json";
+import { redirect } from "next/navigation";
+import { Admin_V3_MainLayout } from "@/app_modules/admin/_components_v3/main_layout";
-export default async function Layout({
+export default async function Layout({
children,
}: {
children: React.ReactNode;
@@ -14,20 +16,32 @@ export default async function Layout({
const userLoginId = await funGetUserIdByToken();
const version = versionUpdate.version;
- const dataUser = await funGlobal_getUserById({ userId: userLoginId as string});
- const listNotifikasi = await adminNotifikasi_getByUserId({page: 1});
- const countNotifikasi = await adminNotifikasi_countNotifikasi();
+ // const listNotifikasi = await adminNotifikasi_getByUserId({ page: 1 });
+ // const countNotifikasi = await adminNotifikasi_countNotifikasi();
+
+ // const dataUser = await funGlobal_getUserById({
+ // userId: userLoginId as string,
+ // });
+ // if (dataUser?.masterUserRoleId == "1") return redirect("/dev/home");
return (
<>
-
{children}
-
+ */}
+
+
+ {children}
+
>
);
}
diff --git a/src/app/dev/admin/main/dashboard/page.tsx b/src/app/dev/admin/main/dashboard/page.tsx
index e046e03a..d7f84c83 100644
--- a/src/app/dev/admin/main/dashboard/page.tsx
+++ b/src/app/dev/admin/main/dashboard/page.tsx
@@ -1,14 +1,9 @@
import { AdminMain } from "@/app_modules/admin/main_dashboard";
-import { AdminMainDashboard_CountPOrtofolio } from "@/app_modules/admin/main_dashboard/fun/count/fun_count_portofolio";
-import { AdminMainDashboard_CountUser } from "@/app_modules/admin/main_dashboard/fun/count/fun_count_user";
export default async function Page() {
- const countUser = await AdminMainDashboard_CountUser();
- const countPorto = await AdminMainDashboard_CountPOrtofolio();
-
// await new Promise((a, b) => {
// setTimeout(a, 4000);
// });
- return ;
+ return ;
}
diff --git a/src/app/dev/admin/user-access/page.tsx b/src/app/dev/admin/user-access/page.tsx
index ed337fdd..bbba6357 100644
--- a/src/app/dev/admin/user-access/page.tsx
+++ b/src/app/dev/admin/user-access/page.tsx
@@ -1,12 +1,9 @@
import { AdminUserAccess_View } from "@/app_modules/admin/user-access";
-import adminUserAccess_getListUser from "@/app_modules/admin/user-access/fun/get/get_list_all_user";
export default async function Page() {
- const listUser = await adminUserAccess_getListUser({ page: 1 });
-
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/vote/[id]/page.tsx b/src/app/dev/admin/vote/[id]/page.tsx
new file mode 100644
index 00000000..28b62c71
--- /dev/null
+++ b/src/app/dev/admin/vote/[id]/page.tsx
@@ -0,0 +1,11 @@
+import { AdminVote_DetailVoting } from "@/app_modules/admin/vote/detail/detail_voting";
+
+async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/dev/admin/vote/child/riwayat/page.tsx b/src/app/dev/admin/vote/child/riwayat/page.tsx
index df211c60..32d281ea 100644
--- a/src/app/dev/admin/vote/child/riwayat/page.tsx
+++ b/src/app/dev/admin/vote/child/riwayat/page.tsx
@@ -1,13 +1,9 @@
import { AdminVote_Riwayat } from "@/app_modules/admin/vote";
-import { adminVote_funGetListRiwayat } from "@/app_modules/admin/vote/fun";
-import { AdminVote_getListTableByStatusId } from "@/app_modules/admin/vote/fun/get/get_list_table_by_status_id";
export default async function Page() {
- const dataVote = await adminVote_funGetListRiwayat({page: 1});
-
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/vote/child/table_publish/page.tsx b/src/app/dev/admin/vote/child/table_publish/page.tsx
index 485a1e7b..94d2b239 100644
--- a/src/app/dev/admin/vote/child/table_publish/page.tsx
+++ b/src/app/dev/admin/vote/child/table_publish/page.tsx
@@ -1,13 +1,9 @@
import { AdminVote_TablePublish } from "@/app_modules/admin/vote";
-import { AdminVote_getListTableByStatusId } from "@/app_modules/admin/vote/fun/get/get_list_table_by_status_id";
-import { adminVote_funGetListPublish } from "@/app_modules/admin/vote/fun/get/status/get_list_publish";
export default async function Page() {
- const dataVote = await adminVote_funGetListPublish({page: 1});
-
- return (
- <>
-
- >
- );
-}
\ No newline at end of file
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/dev/admin/vote/child/table_reject/page.tsx b/src/app/dev/admin/vote/child/table_reject/page.tsx
index a941804b..7d26522b 100644
--- a/src/app/dev/admin/vote/child/table_reject/page.tsx
+++ b/src/app/dev/admin/vote/child/table_reject/page.tsx
@@ -1,11 +1,9 @@
import { AdminVote_TableReject } from "@/app_modules/admin/vote";
-import { adminVote_funGetListReject } from "@/app_modules/admin/vote/fun";
export default async function Page() {
- const dataVote = await adminVote_funGetListReject({ page: 1 });
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/vote/child/table_review/page.tsx b/src/app/dev/admin/vote/child/table_review/page.tsx
index 2ce5111a..d6417422 100644
--- a/src/app/dev/admin/vote/child/table_review/page.tsx
+++ b/src/app/dev/admin/vote/child/table_review/page.tsx
@@ -1,12 +1,9 @@
import { AdminVote_TableReview } from "@/app_modules/admin/vote";
-import { adminVote_funGetListReview } from "@/app_modules/admin/vote/fun";
export default async function Page() {
- const listVote = await adminVote_funGetListReview({ page: 1 });
-
return (
<>
-
+
>
);
}
diff --git a/src/app/dev/admin/vote/main/page.tsx b/src/app/dev/admin/vote/main/page.tsx
index 6fefc7ff..cf2dd932 100644
--- a/src/app/dev/admin/vote/main/page.tsx
+++ b/src/app/dev/admin/vote/main/page.tsx
@@ -2,18 +2,18 @@ import { AdminVote_Main } from "@/app_modules/admin/vote";
import AdminVote_funCountByStatusId from "@/app_modules/admin/vote/fun/count/fun_count_vote_by_status_id";
export default async function Page() {
- const countPublish = await AdminVote_funCountByStatusId("1");
- const countReview = await AdminVote_funCountByStatusId("2");
- const countDraft = await AdminVote_funCountByStatusId("0");
- const countReject = await AdminVote_funCountByStatusId("4");
+ // const countPublish = await AdminVote_funCountByStatusId("1");
+ // const countReview = await AdminVote_funCountByStatusId("2");
+ // const countDraft = await AdminVote_funCountByStatusId("0");
+ // const countReject = await AdminVote_funCountByStatusId("4");
return (
<>
>
);
diff --git a/src/app/dev/auth/login/page.tsx b/src/app/dev/auth/login/page.tsx
deleted file mode 100644
index 9485d7d1..00000000
--- a/src/app/dev/auth/login/page.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Login } from "@/app_modules/auth";
-import versionUpdate from "../../../../../package.json";
-import { funCheckCookies } from "@/app_modules/_global/fun/get/fun_check_cookies";
-import { redirect } from "next/navigation";
-
-export default async function Page() {
- const version = versionUpdate.version;
-
- // const checkCookies = await funCheckCookies();
- // console.log(checkCookies, "ini halaman login");
- // if (!checkCookies) return redirect("/");
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/auth/register/[id]/page.tsx b/src/app/dev/auth/register/[id]/page.tsx
deleted file mode 100644
index 04eebc10..00000000
--- a/src/app/dev/auth/register/[id]/page.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { Register } from "@/app_modules/auth";
-import { auth_getCodeOtpByNumber } from "@/app_modules/auth/fun/get_kode_otp_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let otpId = params.id;
- const dataOtp = await auth_getCodeOtpByNumber({ kodeId: otpId });
- return ;
-}
diff --git a/src/app/dev/auth/splash/page.tsx b/src/app/dev/auth/splash/page.tsx
deleted file mode 100644
index 7ca33735..00000000
--- a/src/app/dev/auth/splash/page.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { SplashScreen } from "@/app_modules/auth";
-
-export default async function PageSplash() {
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/auth/validasi/[id]/page.tsx b/src/app/dev/auth/validasi/[id]/page.tsx
deleted file mode 100644
index eb5cb931..00000000
--- a/src/app/dev/auth/validasi/[id]/page.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { Validasi } from "@/app_modules/auth";
-import { auth_getCodeOtpByNumber } from "@/app_modules/auth/fun/get_kode_otp_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let kodeId = params.id;
- const dataOtp = await auth_getCodeOtpByNumber({ kodeId: kodeId });
-
- return ;
-}
diff --git a/src/app/dev/check-cookies/page.tsx b/src/app/dev/check-cookies/page.tsx
deleted file mode 100644
index b56d1956..00000000
--- a/src/app/dev/check-cookies/page.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
-import { RouterHome } from "@/app/lib/router_hipmi/router_home";
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { funGlobal_getUserById } from "@/app_modules/_global/fun/get/fun_get_user_by_id";
-import { CheckCookies_UiView } from "@/app_modules/check_cookies";
-import { redirect } from "next/navigation";
-
-export default async function Page() {
- // const userLoginId = await funGetUserIdByToken();
- // const dataUser = await funGlobal_getUserById({ userId: userLoginId });
-
- // if (dataUser?.masterUserRoleId === "1") {
- // return redirect(RouterHome.main_home);
- // }
-
- // if (dataUser?.masterUserRoleId !== "1") {
- // return redirect(RouterAdminDashboard.splash_admin);
- // }
-
- // return ;
-}
diff --git a/src/app/dev/colab/create/page.tsx b/src/app/dev/colab/create/page.tsx
deleted file mode 100644
index f1d84a65..00000000
--- a/src/app/dev/colab/create/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Colab_Create } from "@/app_modules/colab";
-import colab_funGetMasterIndustri from "@/app_modules/colab/fun/master/fun_get_master_industri";
-
-export default async function Page() {
- const listIndustri = await colab_funGetMasterIndustri();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/colab/detail/info-grup/[id]/page.tsx b/src/app/dev/colab/detail/info-grup/[id]/page.tsx
deleted file mode 100644
index 375df71c..00000000
--- a/src/app/dev/colab/detail/info-grup/[id]/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import prisma from "@/app/lib/prisma";
-import { Colab_DetailInfoGrup } from "@/app_modules/colab";
-import colab_getListAnggotaByRoomId from "@/app_modules/colab/fun/get/room_chat/get_list_anggota_by_room_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let roomId = params.id;
- const dataRoom = await colab_getListAnggotaByRoomId(roomId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/colab/detail/main_detail/[id]/page.tsx b/src/app/dev/colab/detail/main_detail/[id]/page.tsx
deleted file mode 100644
index 9d3958da..00000000
--- a/src/app/dev/colab/detail/main_detail/[id]/page.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { Colab_MainDetail } from "@/app_modules/colab";
-import colab_funCekPartisipasiById from "@/app_modules/colab/fun/get/cek_partisipasi_by_user_id";
-import colab_getListPartisipanByColabId from "@/app_modules/colab/fun/get/get_list_partisipan_by_id";
-import colab_getOneCollaborationById from "@/app_modules/colab/fun/get/get_one_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let colabId = params.id;
- const userLoginId = await funGetUserIdByToken();
-
- const dataColab = await colab_getOneCollaborationById(colabId);
- const listPartisipan = await colab_getListPartisipanByColabId(colabId);
- const cekPartisipan = await colab_funCekPartisipasiById(colabId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/colab/detail/proyek/partisipasi/[id]/page.tsx b/src/app/dev/colab/detail/proyek/partisipasi/[id]/page.tsx
deleted file mode 100644
index 68b18d99..00000000
--- a/src/app/dev/colab/detail/proyek/partisipasi/[id]/page.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Colab_DetailPartisipasiProyek } from "@/app_modules/colab";
-import colab_getListPartisipanByColabId from "@/app_modules/colab/fun/get/get_list_partisipan_by_id";
-import colab_getOneCollaborationById from "@/app_modules/colab/fun/get/get_one_by_id";
-
-export default async function Page({params}: {params: {id: string}}) {
- const colabId = params.id
- const dataColab = await colab_getOneCollaborationById(colabId)
- const listPartisipan = await colab_getListPartisipanByColabId(colabId)
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/colab/detail/proyek/saya/[id]/page.tsx b/src/app/dev/colab/detail/proyek/saya/[id]/page.tsx
deleted file mode 100644
index 2c5d724f..00000000
--- a/src/app/dev/colab/detail/proyek/saya/[id]/page.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Colab_DetailProyekSaya } from "@/app_modules/colab";
-import colab_getListPartisipanByColabId from "@/app_modules/colab/fun/get/get_list_partisipan_by_id";
-import colab_getOneCollaborationById from "@/app_modules/colab/fun/get/get_one_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const colabId = params.id;
- const dataColab = await colab_getOneCollaborationById(colabId);
- const listPartisipan = await colab_getListPartisipanByColabId(colabId);
-
- return (
- <>
- {/* {JSON.stringify(listPartisipan, null,2)} */}
-
- >
- );
-}
diff --git a/src/app/dev/colab/edit/[id]/page.tsx b/src/app/dev/colab/edit/[id]/page.tsx
deleted file mode 100644
index 40849fef..00000000
--- a/src/app/dev/colab/edit/[id]/page.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Colab_Edit } from "@/app_modules/colab";
-import colab_getOneCollaborationById from "@/app_modules/colab/fun/get/get_one_by_id";
-import colab_funGetMasterIndustri from "@/app_modules/colab/fun/master/fun_get_master_industri";
-import _ from "lodash";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const colabId = params.id;
- const dataColab = await colab_getOneCollaborationById(colabId);
- const selectedData = _.omit(dataColab, [
- "ProjectCollaboration_Partisipasi",
- "Author",
- ]);
-// console.log(selectedData);
-const listIndustri = await colab_funGetMasterIndustri()
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/colab/main/beranda/page.tsx b/src/app/dev/colab/main/beranda/page.tsx
deleted file mode 100644
index c5143fa7..00000000
--- a/src/app/dev/colab/main/beranda/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { Colab_Beranda } from "@/app_modules/colab";
-import colab_getListAllProyek from "@/app_modules/colab/fun/get/get_list_all_proyek";
-
-export default async function Page() {
- const listData = await colab_getListAllProyek({ page: 1 });
- const userLoginId = await funGetUserIdByToken();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/colab/main/grup/page.tsx b/src/app/dev/colab/main/grup/page.tsx
deleted file mode 100644
index 2d9237a9..00000000
--- a/src/app/dev/colab/main/grup/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import colab_getListRoomChatByAuthorId from "@/app_modules/colab/fun/get/room_chat/get_list_room_by_author_id";
-import Colab_GrupDiskus from "@/app_modules/colab/main/grup";
-
-export default async function Page() {
- const listRoom = await colab_getListRoomChatByAuthorId({page: 1});
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/colab/main/layout.tsx b/src/app/dev/colab/main/layout.tsx
deleted file mode 100644
index 1405cf35..00000000
--- a/src/app/dev/colab/main/layout.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { LayoutColab_Main } from "@/app_modules/colab";
-import colab_CekNotifikasi from "@/app_modules/colab/fun/get/cek_notifikasi";
-import React from "react";
-
-export default async function Layout({
- children,
-}: {
- children: React.ReactNode;
-}) {
- const cekNotif = await colab_CekNotifikasi();
-
- return (
- <>
- {children}
- >
- );
-}
diff --git a/src/app/dev/colab/main/proyek/page.tsx b/src/app/dev/colab/main/proyek/page.tsx
deleted file mode 100644
index abb00e7e..00000000
--- a/src/app/dev/colab/main/proyek/page.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Colab_Proyek } from "@/app_modules/colab";
-import colab_getListPartisipasiProyekByAuthorId from "@/app_modules/colab/fun/get/pasrtisipan/get_list_partisipasi_proyek_by_author_id";
-import colab_getListAllProyekSayaByAuthorId from "@/app_modules/colab/fun/get/pasrtisipan/get_list_proyek_saya_by_author_id";
-
-export default async function Page() {
- const listPartisipasiProyek = await colab_getListPartisipasiProyekByAuthorId({page: 1})
- const listProyekSaya = await colab_getListAllProyekSayaByAuthorId({page: 1})
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/cerita_penggalang/[id]/layout.tsx b/src/app/dev/donasi/cerita_penggalang/[id]/layout.tsx
deleted file mode 100644
index 12339470..00000000
--- a/src/app/dev/donasi/cerita_penggalang/[id]/layout.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { LayoutCeritaPenggalangDonasi } from "@/app_modules/donasi";
-import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
-import React from "react";
-
-export default async function Layout({
- children,
- params,
-}: {
- children: React.ReactNode;
- params: { id: string };
-}) {
- const dataDonasi = await Donasi_getOneById(params.id);
- const statusDonasiId = dataDonasi?.donasiMaster_StatusDonasiId;
- return (
- <>
-
- {children}
-
- >
- );
-}
diff --git a/src/app/dev/donasi/cerita_penggalang/[id]/page.tsx b/src/app/dev/donasi/cerita_penggalang/[id]/page.tsx
deleted file mode 100644
index b9518bed..00000000
--- a/src/app/dev/donasi/cerita_penggalang/[id]/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { CeritaPenggalangDonasi } from "@/app_modules/donasi";
-import Donasi_getCeritaByDonasiId from "@/app_modules/donasi/fun/get/get_cerita_penggalang";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const dataCerita = await Donasi_getCeritaByDonasiId(params.id);
- // console.log(dataCerita)
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/create/cerita_penggalang/[id]/page.tsx b/src/app/dev/donasi/create/cerita_penggalang/[id]/page.tsx
deleted file mode 100644
index 18757e91..00000000
--- a/src/app/dev/donasi/create/cerita_penggalang/[id]/page.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { CreateCeritaPenggalangDonasi } from "@/app_modules/donasi";
-import { Donasi_getTemporaryCreate } from "@/app_modules/donasi/fun/get/get_temporary_create";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const getTemporaryCreate = await Donasi_getTemporaryCreate(params.id);
- const userLoginId = await funGetUserIdByToken();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/create/create_donasi/page.tsx b/src/app/dev/donasi/create/create_donasi/page.tsx
deleted file mode 100644
index 2202dfdf..00000000
--- a/src/app/dev/donasi/create/create_donasi/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { CreateDonasi } from "@/app_modules/donasi";
-import {
- Donasi_getMasterDurasi,
- Donasi_getMasterKategori,
-} from "@/app_modules/donasi/fun";
-
-export default async function Page() {
- const masterKategori = await Donasi_getMasterKategori();
- const masterDurasi = await Donasi_getMasterDurasi();
-
- return (
-
- );
-}
diff --git a/src/app/dev/donasi/create/create_kabar/[id]/page.tsx b/src/app/dev/donasi/create/create_kabar/[id]/page.tsx
deleted file mode 100644
index a9404a35..00000000
--- a/src/app/dev/donasi/create/create_kabar/[id]/page.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Donasi_CreateKabar } from "@/app_modules/donasi";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const donasiId = params.id;
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/detail/donasi_saya/[id]/page.tsx b/src/app/dev/donasi/detail/donasi_saya/[id]/page.tsx
deleted file mode 100644
index 270ca0ca..00000000
--- a/src/app/dev/donasi/detail/donasi_saya/[id]/page.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { DetailDonasiSaya } from "@/app_modules/donasi";
-import { Donasi_getCountDonatur } from "@/app_modules/donasi/fun/count/get_count_donatur";
-import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
-import { Donasi_getOneInvoiceById } from "@/app_modules/donasi/fun/get/get_one_invoice_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let invoiceId = params.id;
- const dataDonasi = await Donasi_getOneInvoiceById(invoiceId);
- const countDonatur= await Donasi_getCountDonatur(dataDonasi?.donasiId as any)
-
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/detail/draft/[id]/page.tsx b/src/app/dev/donasi/detail/draft/[id]/page.tsx
deleted file mode 100644
index f15353f6..00000000
--- a/src/app/dev/donasi/detail/draft/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { DetailDraftDonasi } from "@/app_modules/donasi";
-import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const donasiId = params.id
- const dataDonasi = await Donasi_getOneById(donasiId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/detail/kabar/[id]/page.tsx b/src/app/dev/donasi/detail/kabar/[id]/page.tsx
deleted file mode 100644
index d67b5aec..00000000
--- a/src/app/dev/donasi/detail/kabar/[id]/page.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { DetailKabarDonasi } from "@/app_modules/donasi";
-import { Donasi_getOneKabar } from "@/app_modules/donasi/fun/get/get_one_kabar";
-
-export default async function Page({params}: {params: {id: string}}) {
-
- let kabarId = params.id
- const dataDonasi = await Donasi_getOneKabar(kabarId)
-
- return
-}
\ No newline at end of file
diff --git a/src/app/dev/donasi/detail/main/[id]/layout.tsx b/src/app/dev/donasi/detail/main/[id]/layout.tsx
deleted file mode 100644
index ad394a61..00000000
--- a/src/app/dev/donasi/detail/main/[id]/layout.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { LayoutDetailMainDonasi } from "@/app_modules/donasi";
-import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
-import React from "react";
-
-export default async function Layout({
- children,
- params,
-}: {
- children: React.ReactNode;
- params: { id: string };
-}) {
- const donasiId = params.id;
- const getData = await Donasi_getOneById(donasiId);
- const authorId = getData?.authorId;
- const userLoginId = await funGetUserIdByToken();
-
- return (
- <>
-
- {children}
-
- >
- );
-}
diff --git a/src/app/dev/donasi/detail/main/[id]/page.tsx b/src/app/dev/donasi/detail/main/[id]/page.tsx
deleted file mode 100644
index 6ea7e94c..00000000
--- a/src/app/dev/donasi/detail/main/[id]/page.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { DetailMainDonasi } from "@/app_modules/donasi";
-import { Donasi_getCountDonatur } from "@/app_modules/donasi/fun/count/get_count_donatur";
-import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let donasiId = params.id;
- const userLoginId = await funGetUserIdByToken();
-
- const dataDonasi = await Donasi_getOneById(donasiId);
- const countDonatur = await Donasi_getCountDonatur(donasiId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/detail/publish/[id]/page.tsx b/src/app/dev/donasi/detail/publish/[id]/page.tsx
deleted file mode 100644
index 0e354cb5..00000000
--- a/src/app/dev/donasi/detail/publish/[id]/page.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { DetailPublishDonasi } from "@/app_modules/donasi";
-import { Donasi_getCountDonatur } from "@/app_modules/donasi/fun/count/get_count_donatur";
-import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const dataPublish = await Donasi_getOneById(params.id);
- const countDonatur = await Donasi_getCountDonatur(params.id);
- const userLoginId = await funGetUserIdByToken();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/detail/reject/[id]/page.tsx b/src/app/dev/donasi/detail/reject/[id]/page.tsx
deleted file mode 100644
index a3dfed4b..00000000
--- a/src/app/dev/donasi/detail/reject/[id]/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { DetailRejectDonasi } from "@/app_modules/donasi";
-import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
-
-export default async function Page({params}: {params: {id: string}}) {
- let donasiId= params.id
- const dataReject = await Donasi_getOneById(donasiId)
- const fileIdImageCerita = dataReject?.CeritaDonasi?.imageId
-
- return (
- <>
-
- >
- );
-}
\ No newline at end of file
diff --git a/src/app/dev/donasi/detail/review/[id]/page.tsx b/src/app/dev/donasi/detail/review/[id]/page.tsx
deleted file mode 100644
index c7a4279b..00000000
--- a/src/app/dev/donasi/detail/review/[id]/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { DetailReviewDonasi } from "@/app_modules/donasi";
-import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const dataDonasi = await Donasi_getOneById(params.id);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/donatur/[id]/page.tsx b/src/app/dev/donasi/donatur/[id]/page.tsx
deleted file mode 100644
index 37ecb4e6..00000000
--- a/src/app/dev/donasi/donatur/[id]/page.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { DonaturDonasi } from "@/app_modules/donasi";
-import { donasi_funGetListDonaturById } from "@/app_modules/donasi/fun/get/get_list_donatur";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const donasiId = params.id;
- const listDonatur = await donasi_funGetListDonaturById({
- page: 1,
- donasiId: donasiId,
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/edit/edit_cerita/[id]/page.tsx b/src/app/dev/donasi/edit/edit_cerita/[id]/page.tsx
deleted file mode 100644
index c1997262..00000000
--- a/src/app/dev/donasi/edit/edit_cerita/[id]/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { EditCeritaPenggalangDonasi } from "@/app_modules/donasi";
-import Donasi_getCeritaByDonasiId from "@/app_modules/donasi/fun/get/get_cerita_penggalang";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const dataCerita = await Donasi_getCeritaByDonasiId(params.id)
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/edit/edit_donasi/[id]/page.tsx b/src/app/dev/donasi/edit/edit_donasi/[id]/page.tsx
deleted file mode 100644
index cb62d88a..00000000
--- a/src/app/dev/donasi/edit/edit_donasi/[id]/page.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { EditDonasi } from "@/app_modules/donasi";
-import { Donasi_getMasterDurasi, Donasi_getMasterKategori } from "@/app_modules/donasi/fun";
-import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
-
-export default async function Page({params}: {params: {id: string}}) {
- const dataDonasi = await Donasi_getOneById(params.id)
- const masterKategori = await Donasi_getMasterKategori()
- const masterDurasi = await Donasi_getMasterDurasi()
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/edit/edit_rekening/[id]/page.tsx b/src/app/dev/donasi/edit/edit_rekening/[id]/page.tsx
deleted file mode 100644
index 69f198dc..00000000
--- a/src/app/dev/donasi/edit/edit_rekening/[id]/page.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Donasi_EditRekening } from "@/app_modules/donasi";
-import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let donasiId = params.id;
- const data = await Donasi_getOneById(donasiId);
- const dataDonasi = {
- id: data?.id,
- namaBank: data?.namaBank,
- rekening: data?.rekening,
- };
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/edit/kabar/[id]/page.tsx b/src/app/dev/donasi/edit/kabar/[id]/page.tsx
deleted file mode 100644
index d8990352..00000000
--- a/src/app/dev/donasi/edit/kabar/[id]/page.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Donasi_UiEditKabar } from "@/app_modules/donasi/_ui";
-import { Donasi_getOneKabar } from "@/app_modules/donasi/fun/get/get_one_kabar";
-import React from "react";
-
-async function Page({ params }: { params: { id: string } }) {
- const kabarId = params.id;
- const dataKabar = await Donasi_getOneKabar(kabarId);
-
- return (
- <>
-
- >
- );
-}
-
-export default Page;
diff --git a/src/app/dev/donasi/edit/update_kabar/[id]/page.tsx b/src/app/dev/donasi/edit/update_kabar/[id]/page.tsx
deleted file mode 100644
index d89232dd..00000000
--- a/src/app/dev/donasi/edit/update_kabar/[id]/page.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import { UpdateKabarDonasi } from "@/app_modules/donasi";
-import { Donasi_getOneKabar } from "@/app_modules/donasi/fun/get/get_one_kabar";
-
-export default async function Page({params}: {params: {id: string}}) {
- let kabarId = params.id
- const dataKabar = await Donasi_getOneKabar(kabarId)
-
- return<>
-
- >
-}
\ No newline at end of file
diff --git a/src/app/dev/donasi/kabar/[id]/page.tsx b/src/app/dev/donasi/kabar/[id]/page.tsx
deleted file mode 100644
index 555f77bf..00000000
--- a/src/app/dev/donasi/kabar/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { KabarDonasi } from "@/app_modules/donasi";
-import { Donasi_getOneKabar } from "@/app_modules/donasi/fun/get/get_one_kabar";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let kabarId = params.id;
- const dataDonasi = await Donasi_getOneKabar(kabarId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/kabar/daftar/[id]/page.tsx b/src/app/dev/donasi/kabar/daftar/[id]/page.tsx
deleted file mode 100644
index 3c942ef6..00000000
--- a/src/app/dev/donasi/kabar/daftar/[id]/page.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Donasi_UiDaftarKabar } from "@/app_modules/donasi/_ui";
-import { donasi_funGetListKabarById } from "@/app_modules/donasi/fun/get/get_list_kabar";
-
-async function Page({ params }: { params: { id: string } }) {
- const donasiId = params.id;
- const listKabar = await donasi_funGetListKabarById({
- page: 1,
- donasiId: donasiId,
- });
-
- return (
- <>
-
- >
- );
-}
-
-export default Page;
diff --git a/src/app/dev/donasi/kabar/rekap/[id]/page.tsx b/src/app/dev/donasi/kabar/rekap/[id]/page.tsx
deleted file mode 100644
index ceb97bab..00000000
--- a/src/app/dev/donasi/kabar/rekap/[id]/page.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Donasi_UiRekapKabar } from "@/app_modules/donasi/_ui";
-import { donasi_funGetListKabarById } from "@/app_modules/donasi/fun/get/get_list_kabar";
-
-async function Page({ params }: { params: { id: string } }) {
- const donasiId = params.id;
- const listKabar = await donasi_funGetListKabarById({
- page: 1,
- donasiId: donasiId,
- });
-
- return (
- <>
-
- >
- );
-}
-
-export default Page;
diff --git a/src/app/dev/donasi/main/beranda/page.tsx b/src/app/dev/donasi/main/beranda/page.tsx
deleted file mode 100644
index 21e01bd7..00000000
--- a/src/app/dev/donasi/main/beranda/page.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { MainDonasi } from "@/app_modules/donasi";
-import { donasi_funGetAllPublish } from "@/app_modules/donasi/fun/get/get_list_beranda";
-
-export default async function Page() {
- const listDonasi = await donasi_funGetAllPublish({ page: 1 });
- // console.log(listDonasi)
- return ;
-}
diff --git a/src/app/dev/donasi/main/donasi_saya/page.tsx b/src/app/dev/donasi/main/donasi_saya/page.tsx
deleted file mode 100644
index bbb25e4a..00000000
--- a/src/app/dev/donasi/main/donasi_saya/page.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { DonasiSayaDonasi } from "@/app_modules/donasi";
-import { donasi_funGetAllInvoiceByAuthorId } from "@/app_modules/donasi/fun/get/get_all_invoice_by_author_id";
-
-export default async function Page() {
- const listInvoice = await donasi_funGetAllInvoiceByAuthorId({ page: 1 });
-
- return ;
-}
diff --git a/src/app/dev/donasi/main/galang_dana/[id]/page.tsx b/src/app/dev/donasi/main/galang_dana/[id]/page.tsx
deleted file mode 100644
index e663633a..00000000
--- a/src/app/dev/donasi/main/galang_dana/[id]/page.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { PostingDonasi } from "@/app_modules/donasi";
-import { donasi_funGetAllStatusById } from "@/app_modules/donasi/fun";
-import { donasi_funMasterStatusDonasi } from "@/app_modules/donasi/fun/master/get_status_donasi";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const statusId = params.id;
-
- const listStatus = await donasi_funMasterStatusDonasi();
- const dataDonasi = await donasi_funGetAllStatusById({
- page: 1,
- statusId: statusId,
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/penggalang_dana/[id]/page.tsx b/src/app/dev/donasi/penggalang_dana/[id]/page.tsx
deleted file mode 100644
index a5f4c564..00000000
--- a/src/app/dev/donasi/penggalang_dana/[id]/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { PenggalangDanaDonasi } from "@/app_modules/donasi";
-import { Donasi_getAuthorById } from "@/app_modules/donasi/fun/get/get_author_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let authorId = params.id;
- const dataPenggalang = await Donasi_getAuthorById(authorId);
-
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/proses_donasi/invoice/[id]/layout.tsx b/src/app/dev/donasi/proses_donasi/invoice/[id]/layout.tsx
deleted file mode 100644
index fb862b01..00000000
--- a/src/app/dev/donasi/proses_donasi/invoice/[id]/layout.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { LayoutDonasi_InvoiceProses } from "@/app_modules/donasi";
-import React from "react";
-
-export default async function Layout({children}: {children: React.ReactNode}) {
- return<>
- {children}
- >
-}
\ No newline at end of file
diff --git a/src/app/dev/donasi/proses_donasi/invoice/[id]/page.tsx b/src/app/dev/donasi/proses_donasi/invoice/[id]/page.tsx
deleted file mode 100644
index 291b81f7..00000000
--- a/src/app/dev/donasi/proses_donasi/invoice/[id]/page.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { Donasi_InvoiceProses } from "@/app_modules/donasi";
-import { Donasi_getOneInvoiceById } from "@/app_modules/donasi/fun/get/get_one_invoice_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let invoiceId = params.id;
- const dataInvoice = await Donasi_getOneInvoiceById(invoiceId);
-
- return ;
-}
diff --git a/src/app/dev/donasi/proses_donasi/metode_pembayaran/[id]/layout.tsx b/src/app/dev/donasi/proses_donasi/metode_pembayaran/[id]/layout.tsx
deleted file mode 100644
index 8e35d0c8..00000000
--- a/src/app/dev/donasi/proses_donasi/metode_pembayaran/[id]/layout.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { LayoutDonasi_MetodePembayaran } from "@/app_modules/donasi";
-import React from "react";
-
-export default async function Layout({children}: {children: React.ReactNode}) {
- return<>
- {children}
- >
-}
\ No newline at end of file
diff --git a/src/app/dev/donasi/proses_donasi/metode_pembayaran/[id]/page.tsx b/src/app/dev/donasi/proses_donasi/metode_pembayaran/[id]/page.tsx
deleted file mode 100644
index 99490dec..00000000
--- a/src/app/dev/donasi/proses_donasi/metode_pembayaran/[id]/page.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { Donasi_MetodePembayaran } from "@/app_modules/donasi";
-import { Donasi_getMasterBank } from "@/app_modules/donasi/fun/master/get_bank";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let donasiId = params.id;
- const listBank = await Donasi_getMasterBank();
- const userLoginId = await funGetUserIdByToken();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/donasi/proses_donasi/proses_transaksi/[id]/layout.tsx b/src/app/dev/donasi/proses_donasi/proses_transaksi/[id]/layout.tsx
deleted file mode 100644
index ffd6310d..00000000
--- a/src/app/dev/donasi/proses_donasi/proses_transaksi/[id]/layout.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { LayoutDonasi_ProsesTransaksi } from "@/app_modules/donasi";
-import React from "react";
-
-export default async function Layout({children}:{children: React.ReactNode}) {
- return<>
- {children}
- >
-}
\ No newline at end of file
diff --git a/src/app/dev/donasi/proses_donasi/proses_transaksi/[id]/page.tsx b/src/app/dev/donasi/proses_donasi/proses_transaksi/[id]/page.tsx
deleted file mode 100644
index 3976b1aa..00000000
--- a/src/app/dev/donasi/proses_donasi/proses_transaksi/[id]/page.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { Donasi_ProsesTransaksi } from "@/app_modules/donasi";
-import { Donasi_getOneInvoiceById } from "@/app_modules/donasi/fun/get/get_one_invoice_by_id";
-import { donasi_getOneStatusInvoiceById } from "@/app_modules/donasi/fun/get/get_one_status_invoice_by_id";
-import donasi_getMasterNomorAdmin from "@/app_modules/donasi/fun/master/get_nomor_admin";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let invoiceId = params.id;
- const nomorAdmin = await donasi_getMasterNomorAdmin();
- const statusInvoice = await donasi_getOneStatusInvoiceById({invoiceId: invoiceId})
- // console.log(statusInvoice)
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/event/create/page.tsx b/src/app/dev/event/create/page.tsx
deleted file mode 100644
index 5363ccb1..00000000
--- a/src/app/dev/event/create/page.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { Event_Create } from "@/app_modules/event";
-import { Event_getMasterTipeAcara } from "@/app_modules/event/fun/master/get_tipe_acara";
-
-export default async function Page() {
- const userLoginId = await funGetUserIdByToken();
- const listTipeAcara = await Event_getMasterTipeAcara();
-
- return (
-
- );
-}
diff --git a/src/app/dev/event/detail/draft/[id]/page.tsx b/src/app/dev/event/detail/draft/[id]/page.tsx
deleted file mode 100644
index 87f94b9e..00000000
--- a/src/app/dev/event/detail/draft/[id]/page.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Event_DetailDraft } from "@/app_modules/event";
-import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const eventId = params.id;
- const dataEvent = await event_getOneById(eventId);
- return (
-
- );
-}
diff --git a/src/app/dev/event/detail/kontribusi/[id]/page.tsx b/src/app/dev/event/detail/kontribusi/[id]/page.tsx
deleted file mode 100644
index 5678dc7a..00000000
--- a/src/app/dev/event/detail/kontribusi/[id]/page.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { Event_DetailKontribusi } from "@/app_modules/event";
-import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id";
-import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id";
-import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let eventId = params.id;
- const dataEvent = await event_getOneById(eventId);
- const listKontributor = await Event_getListPesertaById(eventId);
- const totalPeserta = await Event_countTotalPesertaById(eventId)
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/event/detail/main/[id]/page.tsx b/src/app/dev/event/detail/main/[id]/page.tsx
deleted file mode 100644
index 9f42a181..00000000
--- a/src/app/dev/event/detail/main/[id]/page.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { Event_DetailMain } from "@/app_modules/event";
-import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id";
-import { Event_CekUserJoinById } from "@/app_modules/event/fun/get/cek_user_join_by_id";
-import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id";
-import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let eventId = params.id;
- const userLoginId : any= await funGetUserIdByToken();
-
- const dataEvent = await event_getOneById(eventId);
- const listPeserta = await Event_getListPesertaById(eventId);
- const isJoin = await Event_CekUserJoinById(eventId, userLoginId);
- const totalPeserta = await Event_countTotalPesertaById(eventId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/event/detail/publish/[id]/page.tsx b/src/app/dev/event/detail/publish/[id]/page.tsx
deleted file mode 100644
index 4388c255..00000000
--- a/src/app/dev/event/detail/publish/[id]/page.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { Event_DetailPublish } from "@/app_modules/event";
-import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id";
-import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id";
-import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let eventId = params.id;
- const dataEvent = await event_getOneById(eventId);
- const listPeserta = await Event_getListPesertaById(eventId);
- const totalPeserta = await Event_countTotalPesertaById(eventId);
-
-
- return (
-
- );
-}
diff --git a/src/app/dev/event/detail/reject/[id]/page.tsx b/src/app/dev/event/detail/reject/[id]/page.tsx
deleted file mode 100644
index 9a8c6fd1..00000000
--- a/src/app/dev/event/detail/reject/[id]/page.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { Event_DetailReject } from "@/app_modules/event";
-import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
-
-export default async function Page({params}: {params: {id: string}}) {
- let eventId = params.id
- const dataEvent = await event_getOneById(eventId)
-
- return ;
-}
diff --git a/src/app/dev/event/detail/review/[id]/page.tsx b/src/app/dev/event/detail/review/[id]/page.tsx
deleted file mode 100644
index 8ac802ff..00000000
--- a/src/app/dev/event/detail/review/[id]/page.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Event_DetailReview } from "@/app_modules/event";
-import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
-
-
-export default async function Page({params}: {params: {id: string}}) {
- let eventId = params.id
- const dataEvent = await event_getOneById(eventId)
-
- return ;
-}
diff --git a/src/app/dev/event/detail/riwayat/[id]/page.tsx b/src/app/dev/event/detail/riwayat/[id]/page.tsx
deleted file mode 100644
index 2f506396..00000000
--- a/src/app/dev/event/detail/riwayat/[id]/page.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-
-import { Event_DetailRiwayat } from "@/app_modules/event";
-import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id";
-import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id";
-import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let eventId = params.id;
- const dataEvent = await event_getOneById(eventId);
- const listPeserta = await Event_getListPesertaById(eventId);
- const totalPeserta = await Event_countTotalPesertaById(eventId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/event/edit/[id]/layout.tsx b/src/app/dev/event/edit/[id]/layout.tsx
deleted file mode 100644
index 2288974b..00000000
--- a/src/app/dev/event/edit/[id]/layout.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { LayoutEvent_Edit } from "@/app_modules/event";
-import React from "react";
-
-export default async function Layout({children}: {children: React.ReactNode}) {
- return <>
- {children}
- >
-}
\ No newline at end of file
diff --git a/src/app/dev/event/edit/[id]/page.tsx b/src/app/dev/event/edit/[id]/page.tsx
deleted file mode 100644
index e1991957..00000000
--- a/src/app/dev/event/edit/[id]/page.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { Event_Edit } from "@/app_modules/event";
-import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
-import { Event_getMasterTipeAcara } from "@/app_modules/event/fun/master/get_tipe_acara";
-import _ from "lodash";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let eventId = params.id;
- const data = await event_getOneById(eventId);
- const dataEvent = _.omit(data, [
- "Author",
- "EventMaster_Status",
- "Event_Peserta",
- "createdAt",
- "updatedAt",
- "active",
- ]);
-
- const listTipeAcara = await Event_getMasterTipeAcara()
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/event/main/beranda/page.tsx b/src/app/dev/event/main/beranda/page.tsx
deleted file mode 100644
index e5201847..00000000
--- a/src/app/dev/event/main/beranda/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Event_Beranda } from "@/app_modules/event";
-import { event_getListAllPublish } from "@/app_modules/event/fun/get/get_list_all_publish";
-
-export default async function Page() {
- const dataEvent = await event_getListAllPublish({ page: 1 });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/event/main/layout.tsx b/src/app/dev/event/main/layout.tsx
deleted file mode 100644
index f7a4ce5d..00000000
--- a/src/app/dev/event/main/layout.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { LayoutEvent_Main } from "@/app_modules/event";
-import React from "react";
-
-export default async function Layout({children}:{children: React.ReactNode}) {
- return<>
- {children}
- >
-}
\ No newline at end of file
diff --git a/src/app/dev/event/main/riwayat/[id]/page.tsx b/src/app/dev/event/main/riwayat/[id]/page.tsx
deleted file mode 100644
index 024aa414..00000000
--- a/src/app/dev/event/main/riwayat/[id]/page.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import { Event_Riwayat } from "@/app_modules/event";
-import { event_getListRiwayatSaya } from "@/app_modules/event/fun/get/riwayat/get_list_riwayat_saya";
-import { event_getListSemuaRiwayat } from "@/app_modules/event/fun/get/riwayat/get_list_semua_riwayat";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let statusRiwayatId = params.id;
-
- const dataSemuaRiwayat = await event_getListSemuaRiwayat({ page: 1 });
- const dataRiwayatSaya = await event_getListRiwayatSaya({ page: 1 });
-
- if (statusRiwayatId == "1") {
- return (
- <>
-
- >
- );
- }
-
- if (statusRiwayatId == "2") {
- return (
- <>
-
- >
- );
- }
-}
diff --git a/src/app/dev/event/main/status/[id]/page.tsx b/src/app/dev/event/main/status/[id]/page.tsx
deleted file mode 100644
index b2c2c353..00000000
--- a/src/app/dev/event/main/status/[id]/page.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { Event_StatusPage } from "@/app_modules/event";
-import {
- event_getAllByStatusId,
- event_getMasterStatus,
-} from "@/app_modules/event/fun";
-
-async function Page({ params }: { params: { id: string } }) {
- let statusId = params.id;
- const listStatus = await event_getMasterStatus();
-
- const dataStatus = await event_getAllByStatusId({
- page: 1,
- statusId: statusId,
- });
-
- return (
- <>
-
- >
- );
-}
-
-export default Page;
diff --git a/src/app/dev/forum/create/page.tsx b/src/app/dev/forum/create/page.tsx
deleted file mode 100644
index 68e10889..00000000
--- a/src/app/dev/forum/create/page.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { Forum_Create } from "@/app_modules/forum";
-
-export default async function Page() {
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/forum/detail/main-detail/[id]/page.tsx b/src/app/dev/forum/detail/main-detail/[id]/page.tsx
deleted file mode 100644
index c47d7783..00000000
--- a/src/app/dev/forum/detail/main-detail/[id]/page.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import Forum_MainDetail from "@/app_modules/forum/detail/main_detail";
-import { forum_countTotalKomenById } from "@/app_modules/forum/fun/count/count_total_komentar_by_id";
-import { forum_funGetAllKomentarById } from "@/app_modules/forum/fun/get/get_all_komentar_by_id";
-import { forum_getOnePostingById } from "@/app_modules/forum/fun/get/get_one_posting_by_id";
-import { redirect } from "next/navigation";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let postingId = params.id;
- const userLoginId = await funGetUserIdByToken();
-
- const dataPosting = await forum_getOnePostingById(postingId);
- const listKomentar = await forum_funGetAllKomentarById({
- postingId: postingId,
- page: 1,
- });
-
- // dataPosting?.isActive === false && redirect(RouterForum.beranda);
-
- const countKomentar = await forum_countTotalKomenById(postingId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/forum/detail/report-komentar/[id]/page.tsx b/src/app/dev/forum/detail/report-komentar/[id]/page.tsx
deleted file mode 100644
index afb7f262..00000000
--- a/src/app/dev/forum/detail/report-komentar/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Forum_DetailReportKomentar } from "@/app_modules/forum";
-import forum_funGetOneReportKomentarById from "@/app_modules/forum/fun/get/get_one_report_komentar_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const komentarId = params.id;
- const dataKomentar = await forum_funGetOneReportKomentarById({ komentarId: komentarId });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/forum/detail/report-posting/[id]/page.tsx b/src/app/dev/forum/detail/report-posting/[id]/page.tsx
deleted file mode 100644
index faa3d24a..00000000
--- a/src/app/dev/forum/detail/report-posting/[id]/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Forum_DetailReportPosting } from "@/app_modules/forum";
-import forum_funGetOneReportedPostingById from "@/app_modules/forum/fun/get/get_one_posting_reported_by_id";
-
-export default async function Page({params}: {params: {id: string}}) {
- const postingId = params.id
- const dataPosting = await forum_funGetOneReportedPostingById({postingId: postingId})
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/forum/edit/komentar/[id]/loading.tsx b/src/app/dev/forum/edit/komentar/[id]/loading.tsx
deleted file mode 100644
index 380b3fcd..00000000
--- a/src/app/dev/forum/edit/komentar/[id]/loading.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-
-export default async function Page() {
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/forum/edit/posting/[id]/page.tsx b/src/app/dev/forum/edit/posting/[id]/page.tsx
deleted file mode 100644
index 292059f4..00000000
--- a/src/app/dev/forum/edit/posting/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Forum_EditPosting } from "@/app_modules/forum";
-import { forum_getOnePostingById } from "@/app_modules/forum/fun/get/get_one_posting_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let postingId = params.id;
- const dataPosting = await forum_getOnePostingById(postingId)
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/forum/forumku/[id]/layout.tsx b/src/app/dev/forum/forumku/[id]/layout.tsx
deleted file mode 100644
index 1043a279..00000000
--- a/src/app/dev/forum/forumku/[id]/layout.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { LayoutForum_Forumku } from "@/app_modules/forum";
-import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
-import React from "react";
-
-export default async function Layout({
- children,
- params,
-}: {
- children: React.ReactNode;
- params: { id: string };
-}) {
- const authorId = params.id;
- const dataAuthor = await user_getOneByUserId(authorId);
-
- return (
- <>
-
- {children}
-
- >
- );
-}
diff --git a/src/app/dev/forum/forumku/[id]/page.tsx b/src/app/dev/forum/forumku/[id]/page.tsx
deleted file mode 100644
index b4d4391f..00000000
--- a/src/app/dev/forum/forumku/[id]/page.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { Forum_Forumku } from "@/app_modules/forum";
-import { forum_countPostingByAuthorId } from "@/app_modules/forum/fun/count/count_posting_by_author_id";
-import { forum_getAllPostingByAuhtorId } from "@/app_modules/forum/fun/get/get_list_posting_by_author_id";
-import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
-import _ from "lodash";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const authorId = params.id;
- const userLoginId = await funGetUserIdByToken();
-
- const dataAuthor = await user_getOneByUserId(authorId);
- const auhtorSelectedData = _.omit(dataAuthor, [
- "Profile.email",
- "Profile.alamat",
- "Profile.jenisKelamin",
- "Profile.createdAt",
- "Profile.updatedAt",
- "Profile.imagesBackgroundId",
- ]);
- // console.log(dataAuthor)
- // console.log(auhtorSelectedData)
-
- // await new Promise((a, b) => {
- // setTimeout(a, 1000);
- // });
-
- const dataPosting = await forum_getAllPostingByAuhtorId({
- authorId: authorId,
- page: 1,
- });
- const totalPosting = await forum_countPostingByAuthorId(authorId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/forum/main/layout.tsx b/src/app/dev/forum/main/layout.tsx
deleted file mode 100644
index 12a9fc28..00000000
--- a/src/app/dev/forum/main/layout.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { LayoutForum_Main } from "@/app_modules/forum";
-import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
-import React from "react";
-
-export default async function Layout({
- children,
-}: {
- children: React.ReactNode;
-}) {
- const userLoginId = await funGetUserIdByToken();
- const dataAuthor = await user_getOneByUserId(userLoginId as string);
-
- return (
- <>
-
- {children}
-
- >
- );
-}
diff --git a/src/app/dev/forum/main/page.tsx b/src/app/dev/forum/main/page.tsx
deleted file mode 100644
index 45b09bac..00000000
--- a/src/app/dev/forum/main/page.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { Forum_Beranda } from "@/app_modules/forum";
-import { forum_new_getAllPosting } from "@/app_modules/forum/fun/get/new_get_all_posting";
-
-export default async function Page() {
- const userLoginId = await funGetUserIdByToken();
- const listForum = await forum_new_getAllPosting({ page: 1 });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/forum/report/komentar-lainnya/[id]/page.tsx b/src/app/dev/forum/report/komentar-lainnya/[id]/page.tsx
deleted file mode 100644
index 4e39744a..00000000
--- a/src/app/dev/forum/report/komentar-lainnya/[id]/page.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { Forum_ReportKomentarLainnya } from "@/app_modules/forum";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let komentarId = params.id;
- const userLoginId = await funGetUserIdByToken();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/forum/report/komentar/[id]/page.tsx b/src/app/dev/forum/report/komentar/[id]/page.tsx
deleted file mode 100644
index e88c332d..00000000
--- a/src/app/dev/forum/report/komentar/[id]/page.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { Forum_ReportKomentar } from "@/app_modules/forum";
-import { forum_getMasterKategoriReport } from "@/app_modules/forum/fun/master/get_master_kategori_report";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let komentarId = params.id;
- const userLoginId = await funGetUserIdByToken();
-
- const listReport = await forum_getMasterKategoriReport();
-
-
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/forum/report/posting-lainnya/[id]/page.tsx b/src/app/dev/forum/report/posting-lainnya/[id]/page.tsx
deleted file mode 100644
index d376be6e..00000000
--- a/src/app/dev/forum/report/posting-lainnya/[id]/page.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { Forum_ReportPostingLainnya } from "@/app_modules/forum";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let postingId = params.id;
- const userLoginId = await funGetUserIdByToken();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/forum/report/posting/[id]/page.tsx b/src/app/dev/forum/report/posting/[id]/page.tsx
deleted file mode 100644
index 4cecc0da..00000000
--- a/src/app/dev/forum/report/posting/[id]/page.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { Forum_ReportPosting } from "@/app_modules/forum";
-import { forum_getMasterKategoriReport } from "@/app_modules/forum/fun/master/get_master_kategori_report";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let postingId = params.id;
- const userLoginId = await funGetUserIdByToken();
-
- const listReport = await forum_getMasterKategoriReport();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/home/page.tsx b/src/app/dev/home/page.tsx
deleted file mode 100644
index 9e8826a8..00000000
--- a/src/app/dev/home/page.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { HomeView } from "@/app_modules/home";
-import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
-import { job_getTwoForHomeView } from "@/app_modules/job/fun/get/get_two_for_home_view";
-import notifikasi_countUserNotifikasi from "@/app_modules/notifikasi/fun/count/fun_count_by_id";
-
-import { cookies } from "next/headers";
-import { redirect } from "next/navigation";
-
-export default async function PageHome() {
- const userLoginId = await funGetUserIdByToken();
- const dataUser = await user_getOneByUserId(userLoginId as string);
- const dataJob = await job_getTwoForHomeView();
- const countNotifikasi = await notifikasi_countUserNotifikasi();
-
- // console.log(userLoginId, "ini di home");
- // console.log(dataUser, "ini di home");
-
- // if (dataUser?.active === false) {
- // return redirect(RouterHome.home_user_non_active);
- // }
- if (dataUser?.masterUserRoleId === "2" || dataUser?.masterUserRoleId === "3")
- return redirect(RouterAdminDashboard.main_admin);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/berita/[id]/page.tsx b/src/app/dev/investasi/berita/[id]/page.tsx
deleted file mode 100644
index 6e6e573d..00000000
--- a/src/app/dev/investasi/berita/[id]/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { investasi_funGetOneBeritaById } from "@/app_modules/investasi/_fun";
-import { Investasi_UiDetailBerita } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const beritaId = params.id;
- const dataBerita = await investasi_funGetOneBeritaById({ beritaId });
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/berita/daftar/[id]/page.tsx b/src/app/dev/investasi/berita/daftar/[id]/page.tsx
deleted file mode 100644
index 62d40827..00000000
--- a/src/app/dev/investasi/berita/daftar/[id]/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { investasi_funGetBeritaById } from "@/app_modules/investasi/_fun";
-import { Investasi_UiDaftarBerita } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- const dataBerita = await investasi_funGetBeritaById({ investasiId });
-
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/berita/rekap/[id]/page.tsx b/src/app/dev/investasi/berita/rekap/[id]/page.tsx
deleted file mode 100644
index 7075e1b7..00000000
--- a/src/app/dev/investasi/berita/rekap/[id]/page.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { investasi_funGetBeritaById } from "@/app_modules/investasi/_fun";
-import { Investasi_UiRekapBerita } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- const dataBerita = await investasi_funGetBeritaById({ investasiId });
-
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/create/berita/[id]/page.tsx b/src/app/dev/investasi/create/berita/[id]/page.tsx
deleted file mode 100644
index b4d9a4f6..00000000
--- a/src/app/dev/investasi/create/berita/[id]/page.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Investasi_UiCreateBerita } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/create/dokumen/[id]/page.tsx b/src/app/dev/investasi/create/dokumen/[id]/page.tsx
deleted file mode 100644
index 66a66f7c..00000000
--- a/src/app/dev/investasi/create/dokumen/[id]/page.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import { Investasi_UiCreateDocument } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/create/investasi/page.tsx b/src/app/dev/investasi/create/investasi/page.tsx
deleted file mode 100644
index ba8af421..00000000
--- a/src/app/dev/investasi/create/investasi/page.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { InvestasiCreate } from "@/app_modules/investasi";
-import getPembagianDeviden from "@/app_modules/investasi/fun/master/get_pembagian_deviden";
-import getPencarianInvestor from "@/app_modules/investasi/fun/master/get_pencarian_investor";
-import getPeriodeDeviden from "@/app_modules/investasi/fun/master/get_periode_deviden";
-import getStatusInvestasi from "@/app_modules/investasi/fun/master/get_status_investasi";
-
-export default async function Page() {
-
- const pencarianInvestor = await getPencarianInvestor();
- const periodeDeviden = await getPeriodeDeviden();
- const pembagianDeviden = await getPembagianDeviden();
- const statusInvestasi = await getStatusInvestasi();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/detail/[id]/page.tsx b/src/app/dev/investasi/detail/[id]/page.tsx
deleted file mode 100644
index 24d16617..00000000
--- a/src/app/dev/investasi/detail/[id]/page.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { investasi_funGetOneInvestasiById } from "@/app_modules/investasi/_fun";
-import { Investasi_UiDetailMain } from "@/app_modules/investasi/_ui";
-
-
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- const userLoginId = await funGetUserIdByToken();
-
- const dataInvestasi = await investasi_funGetOneInvestasiById({ investasiId });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/detail/portofolio/[id]/page.tsx b/src/app/dev/investasi/detail/portofolio/[id]/page.tsx
deleted file mode 100644
index 5b9ff1a6..00000000
--- a/src/app/dev/investasi/detail/portofolio/[id]/page.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { investasi_funGetOneInvestasiById } from "@/app_modules/investasi/_fun";
-import { Investasi_UiDetailPortofolio } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- const userLoginId = await funGetUserIdByToken();
-
- const dataPortofolio = await investasi_funGetOneInvestasiById({
- investasiId,
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/detail/prospektus/[id]/page.tsx b/src/app/dev/investasi/detail/prospektus/[id]/page.tsx
deleted file mode 100644
index a42503a5..00000000
--- a/src/app/dev/investasi/detail/prospektus/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { investasi_funGetOneInvestasiById } from "@/app_modules/investasi/_fun";
-import { Investasi_UiDetailProspektus } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- const dataInvestasi = await investasi_funGetOneInvestasiById({ investasiId });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/detail/saham/[id]/page.tsx b/src/app/dev/investasi/detail/saham/[id]/page.tsx
deleted file mode 100644
index 0b3edcea..00000000
--- a/src/app/dev/investasi/detail/saham/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { investasi_funGetOneInvoiceById } from "@/app_modules/investasi/_fun/get/fun_get_one_invoice_by_id";
-import { Investasi_UiDetailSahamSaya } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const invoiceId = params.id;
- const dataSaham = await investasi_funGetOneInvoiceById({ invoiceId });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/dialog_page/create/loading.tsx b/src/app/dev/investasi/dialog_page/create/loading.tsx
deleted file mode 100644
index d8a1c040..00000000
--- a/src/app/dev/investasi/dialog_page/create/loading.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-
-export default async function Page() {
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/dokumen/daftar/[id]/page.tsx b/src/app/dev/investasi/dokumen/daftar/[id]/page.tsx
deleted file mode 100644
index e9337215..00000000
--- a/src/app/dev/investasi/dokumen/daftar/[id]/page.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import {
- investasi_funGetAllDocumentById
-} from "@/app_modules/investasi/_fun";
-import { Investasi_UiDaftarDokmen } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- const dataDokumen = await investasi_funGetAllDocumentById({
- investasiId: investasiId,
- page: 1,
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/dokumen/rekap/[id]/page.tsx b/src/app/dev/investasi/dokumen/rekap/[id]/page.tsx
deleted file mode 100644
index 074777ab..00000000
--- a/src/app/dev/investasi/dokumen/rekap/[id]/page.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { investasi_funGetAllDocumentById } from "@/app_modules/investasi/_fun";
-import { Investasi_UiRekapDokumen } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- const dataDokumen = await investasi_funGetAllDocumentById({
- investasiId,
- page: 1,
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/edit/[id]/page.tsx b/src/app/dev/investasi/edit/[id]/page.tsx
deleted file mode 100644
index 5d91e4d2..00000000
--- a/src/app/dev/investasi/edit/[id]/page.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { investasi_funGetOneInvestasiById } from "@/app_modules/investasi/_fun";
-import { Investasi_UiEditInvestasi } from "@/app_modules/investasi/_ui";
-import getPembagianDeviden from "@/app_modules/investasi/fun/master/get_pembagian_deviden";
-import getPencarianInvestor from "@/app_modules/investasi/fun/master/get_pencarian_investor";
-import getPeriodeDeviden from "@/app_modules/investasi/fun/master/get_periode_deviden";
-import _ from "lodash";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- // console.log(investasiId);
-
- const allData = await investasi_funGetOneInvestasiById({ investasiId });
- const dataInvestasi = _.omit(allData, [
- "BeritaInvestasi",
- "DokumenInvestasi",
- "MasterPembagianDeviden",
- "MasterPencarianInvestor",
- "MasterProgresInvestasi",
- "MasterStatusInvestasi",
- "ProspektusInvestasi",
- "MasterPeriodeDeviden",
- "author",
- ]);
-
- const listPencarian = await getPencarianInvestor();
- const listPeriode = await getPeriodeDeviden();
- const listPembagian = await getPembagianDeviden();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/edit/dokumen/[id]/page.tsx b/src/app/dev/investasi/edit/dokumen/[id]/page.tsx
deleted file mode 100644
index 95da1b64..00000000
--- a/src/app/dev/investasi/edit/dokumen/[id]/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { investasi_funGetOneDocumentById } from "@/app_modules/investasi/_fun";
-import { Investasi_UiEditDokumen } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const documentId = params.id;
- const dataDokumen = await investasi_funGetOneDocumentById({ documentId });
-
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/edit/prospektus/[id]/page.tsx b/src/app/dev/investasi/edit/prospektus/[id]/page.tsx
deleted file mode 100644
index 519debdf..00000000
--- a/src/app/dev/investasi/edit/prospektus/[id]/page.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import { Investasi_UiEditProspektus } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/edit_dokumen/[id]/layout.tsx b/src/app/dev/investasi/edit_dokumen/[id]/layout.tsx
deleted file mode 100644
index e051bfc5..00000000
--- a/src/app/dev/investasi/edit_dokumen/[id]/layout.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { LayoutEditDokumenInvestasi } from "@/app_modules/investasi";
-import React from "react";
-
-export default async function Layout({children, params}: {children: React.ReactNode, params: {id: string}}) {
- return<>
- {children}
- >
-}
\ No newline at end of file
diff --git a/src/app/dev/investasi/edit_dokumen/[id]/page.tsx b/src/app/dev/investasi/edit_dokumen/[id]/page.tsx
deleted file mode 100644
index b7100cfe..00000000
--- a/src/app/dev/investasi/edit_dokumen/[id]/page.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { EditDokumenInvestasi } from "@/app_modules/investasi";
-import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
-
-export default async function Page({params}: {params: {id: string}}) {
- const dataInvestasi = await getOneInvestasiById(params.id)
- // console.log(dataInvestasi)
- return<>
-
- >
-}
\ No newline at end of file
diff --git a/src/app/dev/investasi/edit_prospektus/[id]/layout.tsx b/src/app/dev/investasi/edit_prospektus/[id]/layout.tsx
deleted file mode 100644
index 0c6a45a1..00000000
--- a/src/app/dev/investasi/edit_prospektus/[id]/layout.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { LayoutEditProspektusInvestasi } from "@/app_modules/investasi";
-import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
-import React from "react";
-
-export default async function Layout({
- children,
- params,
-}: {
- children: React.ReactNode;
- params: { id: string };
-}) {
- const dataInvestasi = await getOneInvestasiById(params.id);
-
- return (
- <>
-
- {children}
-
- >
- );
-}
diff --git a/src/app/dev/investasi/edit_prospektus/[id]/page.tsx b/src/app/dev/investasi/edit_prospektus/[id]/page.tsx
deleted file mode 100644
index 521d1475..00000000
--- a/src/app/dev/investasi/edit_prospektus/[id]/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { EditProspektusInvestasi } from "@/app_modules/investasi";
-import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const dataInvestasi = await getOneInvestasiById(params.id);
-// console.log(dataInvestasi);
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/file-view/dokumen/[id]/page.tsx b/src/app/dev/investasi/file-view/dokumen/[id]/page.tsx
deleted file mode 100644
index 446fef71..00000000
--- a/src/app/dev/investasi/file-view/dokumen/[id]/page.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import { Investasi_UiFileViewDokumen } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const dokumenId = params.id;
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/file-view/prospektus/[id]/page.tsx b/src/app/dev/investasi/file-view/prospektus/[id]/page.tsx
deleted file mode 100644
index 25de80fd..00000000
--- a/src/app/dev/investasi/file-view/prospektus/[id]/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { investasi_funGetProspekById } from "@/app_modules/investasi/_fun";
-import { Investasi_UiFileView } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const pospektusId = params.id;
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/main/page.tsx b/src/app/dev/investasi/main/page.tsx
deleted file mode 100644
index bc3fe278..00000000
--- a/src/app/dev/investasi/main/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Investasi_UiBeranda } from "@/app_modules/investasi/_ui";
-import { investasi_funGetAllPublish } from "@/app_modules/investasi/fun/get_all_investasi";
-
-export default async function Page() {
- const allData = await investasi_funGetAllPublish({ page: 1 });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/main/portofolio/[id]/page.tsx b/src/app/dev/investasi/main/portofolio/[id]/page.tsx
deleted file mode 100644
index b8378bd8..00000000
--- a/src/app/dev/investasi/main/portofolio/[id]/page.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { investasi_funGetPortofolioByStatusId } from "@/app_modules/investasi/_fun";
-import { Investasi_UiPortofolio } from "@/app_modules/investasi/_ui";
-import getStatusInvestasi from "@/app_modules/investasi/fun/master/get_status_investasi";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const statusId = params.id;
- const listStatus = await getStatusInvestasi();
- const dataPortofolio = await investasi_funGetPortofolioByStatusId({
- page: 1,
- statusId: statusId,
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/main/saham_saya/page.tsx b/src/app/dev/investasi/main/saham_saya/page.tsx
deleted file mode 100644
index fcf6570f..00000000
--- a/src/app/dev/investasi/main/saham_saya/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { investasi_funGetSuccessTransactionById } from "@/app_modules/investasi/_fun";
-import { Investasi_UiSahamSaya } from "@/app_modules/investasi/_ui";
-
-export default async function Page() {
- const dataSaham = await investasi_funGetSuccessTransactionById({ page: 1 });
-
- return (
- <>
- {/* */}
-
- >
- );
-}
diff --git a/src/app/dev/investasi/main/transaksi/page.tsx b/src/app/dev/investasi/main/transaksi/page.tsx
deleted file mode 100644
index 78150c82..00000000
--- a/src/app/dev/investasi/main/transaksi/page.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import getListAllTransaksiById_Investasi from "@/app_modules/investasi/fun/get_list_all_transaksi_by_id";
-import getMaster_StatusTransaksiInvestasi from "@/app_modules/investasi/fun/master/get_status_transaksi";
-
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { investasi_funGetTransaksiByUserId } from "@/app_modules/investasi/_fun";
-import { Investasi_UiDaftarTransaksi } from "@/app_modules/investasi/_ui";
-
-export default async function Page() {
- const userLoginId = await funGetUserIdByToken();
-
- const statusTransaksi = await getMaster_StatusTransaksiInvestasi();
- const listTransaksi = await getListAllTransaksiById_Investasi(
- userLoginId as string
- );
-
- // NEW
- const dataTransaksi = await investasi_funGetTransaksiByUserId({ page: 1 });
-
- return (
- <>
- {/* */}
-
- >
- );
-}
diff --git a/src/app/dev/investasi/status-transaksi/berhasil/[id]/page.tsx b/src/app/dev/investasi/status-transaksi/berhasil/[id]/page.tsx
deleted file mode 100644
index 6015c0e9..00000000
--- a/src/app/dev/investasi/status-transaksi/berhasil/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { StatusTransaksiInvestasi } from "@/app_modules/investasi";
-import { investasi_funGetOneInvoiceById } from "@/app_modules/investasi/_fun/get/fun_get_one_invoice_by_id";
-import { Investasi_UiTransaksiBerhasil } from "@/app_modules/investasi/_ui";
-
-export default async function Page({params}: {params: {id: string}}) {
- const invoiceId = params.id;
- const dataTransaksi = await investasi_funGetOneInvoiceById({ invoiceId });
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/transaksi/invoice/[id]/page.tsx b/src/app/dev/investasi/transaksi/invoice/[id]/page.tsx
deleted file mode 100644
index 11d9fd8f..00000000
--- a/src/app/dev/investasi/transaksi/invoice/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { investasi_funGetOneInvoiceById } from "@/app_modules/investasi/_fun/get/fun_get_one_invoice_by_id";
-import { Investasi_UiInvoice } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const invoiceId = params.id;
- const dataInvoice = await investasi_funGetOneInvoiceById({ invoiceId: invoiceId });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/transaksi/metode-pembayaran/[id]/page.tsx b/src/app/dev/investasi/transaksi/metode-pembayaran/[id]/page.tsx
deleted file mode 100644
index 7553f2ef..00000000
--- a/src/app/dev/investasi/transaksi/metode-pembayaran/[id]/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { funGlobal_getAllBank } from "@/app_modules/_global/fun/get/fun_get_all_bank";
-import { Investasi_UiMetodePembayaran } from "@/app_modules/investasi/_ui";
-import getMaster_NamaBank from "@/app_modules/investasi/fun/master/get_nama_bank";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- const listBank = await funGlobal_getAllBank();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/transaksi/pembelian/[id]/page.tsx b/src/app/dev/investasi/transaksi/pembelian/[id]/page.tsx
deleted file mode 100644
index ff9e0b90..00000000
--- a/src/app/dev/investasi/transaksi/pembelian/[id]/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { investasi_funGetOneInvestasiById } from "@/app_modules/investasi/_fun";
-import { Investasi_UiProsesPembelian } from "@/app_modules/investasi/_ui";
-
-
-export default async function Page({ params }: { params: { id: string } }) {
- const investasiId = params.id;
- const dataInvestasi = await investasi_funGetOneInvestasiById({ investasiId });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/investasi/transaksi/proses-transaksi/[id]/page.tsx b/src/app/dev/investasi/transaksi/proses-transaksi/[id]/page.tsx
deleted file mode 100644
index 7fb5988e..00000000
--- a/src/app/dev/investasi/transaksi/proses-transaksi/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { funGlobal_getNomorAdmin } from "@/app_modules/_global/fun/get";
-import { Investasi_UiProsesTransaksi } from "@/app_modules/investasi/_ui";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const invoiceId = params.id;
- const nomorAdmin = await funGlobal_getNomorAdmin();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/job/detail/arsip/[id]/page.tsx b/src/app/dev/job/detail/arsip/[id]/page.tsx
deleted file mode 100644
index b37f2fd6..00000000
--- a/src/app/dev/job/detail/arsip/[id]/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Job_DetailArsip } from "@/app_modules/job";
-import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
-
-export default async function Page({params}:{params: {id: string}}) {
- let jobId = params.id
- const dataJob = await job_getOneById(jobId)
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/job/detail/draft/[id]/layout.tsx b/src/app/dev/job/detail/draft/[id]/layout.tsx
deleted file mode 100644
index 27205e01..00000000
--- a/src/app/dev/job/detail/draft/[id]/layout.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { LayoutJob_DetailDraft } from "@/app_modules/job";
-import React from "react";
-
-export default async function Layout({
- children,
- params
-}: {
- children: React.ReactNode;
- params: {id: string}
-}) {
- let jobId = params.id
- return (
- <>
- {children}
- >
- );
-}
diff --git a/src/app/dev/job/detail/draft/[id]/page.tsx b/src/app/dev/job/detail/draft/[id]/page.tsx
deleted file mode 100644
index 646e6ab3..00000000
--- a/src/app/dev/job/detail/draft/[id]/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import Job_DetailDraft from "@/app_modules/job/detail/draft/view";
-import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
-
-
-export default async function Page({params}: {params: {id: string}}) {
- let jobId = params.id
- const dataJob = await job_getOneById(jobId)
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/job/detail/main/[id]/page.tsx b/src/app/dev/job/detail/main/[id]/page.tsx
deleted file mode 100644
index 2928fe5d..00000000
--- a/src/app/dev/job/detail/main/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Job_MainDetail } from "@/app_modules/job";
-import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const idJob = params.id;
- const dataJob = await job_getOneById(idJob);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/job/detail/publish/[id]/page.tsx b/src/app/dev/job/detail/publish/[id]/page.tsx
deleted file mode 100644
index 6dd30830..00000000
--- a/src/app/dev/job/detail/publish/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Job_DetailPublish } from "@/app_modules/job";
-import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
-
-export default async function Page({params}: {params: {id: string}}) {
- let jobId = params.id
- const dataJob = await job_getOneById(jobId)
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/job/detail/reject/[id]/page.tsx b/src/app/dev/job/detail/reject/[id]/page.tsx
deleted file mode 100644
index cd6f0206..00000000
--- a/src/app/dev/job/detail/reject/[id]/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-
-import Job_DetailReject from "@/app_modules/job/detail/reject/view";
-import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
-
-export default async function Page({params}: {params: {id: string}}) {
- let jobId = params.id
- const dataJob = await job_getOneById(jobId)
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/job/detail/review/[id]/page.tsx b/src/app/dev/job/detail/review/[id]/page.tsx
deleted file mode 100644
index 6dda171e..00000000
--- a/src/app/dev/job/detail/review/[id]/page.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import Job_DetailReview from "@/app_modules/job/detail/review/view";
-import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
-import React from "react";
-
-export default async function Page({
- params,
-}: {
- params: { id: React.ReactNode };
-}) {
- let jobId = params.id;
- const dataJob = await job_getOneById(jobId)
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/job/edit/[id]/page.tsx b/src/app/dev/job/edit/[id]/page.tsx
deleted file mode 100644
index baba6e04..00000000
--- a/src/app/dev/job/edit/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Job_Edit } from "@/app_modules/job";
-import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let jobId = params.id;
- const dataJob = await job_getOneById(jobId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/job/main/arsip/page.tsx b/src/app/dev/job/main/arsip/page.tsx
deleted file mode 100644
index f46dce88..00000000
--- a/src/app/dev/job/main/arsip/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Job_Arsip } from "@/app_modules/job";
-import { job_getAllArsipById } from "@/app_modules/job/fun/get/get_all_arsip";
-
-export default async function Page() {
- const dataJob = await job_getAllArsipById({ page: 1 });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/job/main/beranda/page.tsx b/src/app/dev/job/main/beranda/page.tsx
deleted file mode 100644
index 1a4bce82..00000000
--- a/src/app/dev/job/main/beranda/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Job_ViewBeranda } from "@/app_modules/job";
-import { job_getAllListPublish } from "@/app_modules/job/fun/get/get_all_publish";
-
-export default async function Page() {
- const listJob = await job_getAllListPublish({ page: 1 });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/job/main/status/[id]/page.tsx b/src/app/dev/job/main/status/[id]/page.tsx
deleted file mode 100644
index 7ba51670..00000000
--- a/src/app/dev/job/main/status/[id]/page.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Job_Status } from "@/app_modules/job";
-import { job_funGetAllByStatusId } from "@/app_modules/job/fun";
-import { job_funGetMasterStatus } from "@/app_modules/job/fun/get/get_master_status";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let statusId = params.id;
-
- const dataJob = await job_funGetAllByStatusId({
- page: 1,
- statusId: statusId,
- });
- const listStatus = await job_funGetMasterStatus();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/katalog/[id]/layout.tsx b/src/app/dev/katalog/[id]/layout.tsx
deleted file mode 100644
index fd0d7fd4..00000000
--- a/src/app/dev/katalog/[id]/layout.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { KatalogLayout } from "@/app_modules/katalog/main";
-import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile";
-
-export default async function Layout({
- children,
- params,
-}: {
- children: any;
- params: { id: string };
-}) {
- const profileId = params.id;
- const dataProfile = await Profile_getOneProfileAndUserById(profileId);
- const authorId = dataProfile?.userId;
-
- const userLoginId = await funGetUserIdByToken();
-
- return (
- <>
-
- {children}
-
- >
- );
-}
diff --git a/src/app/dev/katalog/[id]/page.tsx b/src/app/dev/katalog/[id]/page.tsx
deleted file mode 100644
index 24cccdab..00000000
--- a/src/app/dev/katalog/[id]/page.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { Katalog_MainView } from "@/app_modules/katalog";
-import { funGetListPortofolio } from "@/app_modules/katalog/portofolio/fun/get/get_list_portofolio";
-import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let profileId = params.id;
- const userLoginId = await funGetUserIdByToken();
-
- const listPorto = await funGetListPortofolio(profileId);
- const dataProfile = await Profile_getOneProfileAndUserById(profileId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/layout.tsx b/src/app/dev/layout.tsx
index 0ea9defe..ea8277bf 100644
--- a/src/app/dev/layout.tsx
+++ b/src/app/dev/layout.tsx
@@ -1,36 +1,25 @@
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { funGlobal_getUserById } from "@/app_modules/_global/fun/get/fun_get_user_by_id";
-import { redirect } from "next/navigation";
-import { RealtimeProvider } from "../lib";
-import { ServerEnv } from "../lib/server_env";
-import { RouterAdminDashboard } from "../lib/router_hipmi/router_admin";
-import { funGlobal_checkActivationUseById } from "@/app_modules/_global/fun/get/fun_check_activation_use_by_id";
+import { RealtimeProvider } from "../../lib";
+import { ServerEnv } from "../../lib/server_env";
+export const dynamic = "force-dynamic";
export default async function Layout({
children,
}: {
children: React.ReactNode;
}) {
- const userLoginId = await funGetUserIdByToken();
- const activationUser = await funGlobal_checkActivationUseById({
- userId: userLoginId as string,
- });
+ // const userId = await funGetUserIdByToken();
- if (activationUser == false) return redirect("/waiting-room");
-
return (
<>
{children}
- {/*
- {children}
- */}
>
);
}
diff --git a/src/app/dev/map/create/[id]/page.tsx b/src/app/dev/map/create/[id]/page.tsx
deleted file mode 100644
index 5a27ae8e..00000000
--- a/src/app/dev/map/create/[id]/page.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Map_CreateNewPin } from "@/app_modules/map/view";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let portofolioId = params.id;
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/map/custom-pin/[id]/page.tsx b/src/app/dev/map/custom-pin/[id]/page.tsx
deleted file mode 100644
index 40347ba6..00000000
--- a/src/app/dev/map/custom-pin/[id]/page.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { map_funGetOneBusinessMapByPortofolioId } from "@/app_modules/map/fun/get/fun_get_one_by_portofolio_id";
-import { Map_CustomPin } from "@/app_modules/map/view";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const portofolioId = params.id;
- const dataMap = await map_funGetOneBusinessMapByPortofolioId({
- portofolioId: portofolioId,
- });
-
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/map/edit/[id]/page.tsx b/src/app/dev/map/edit/[id]/page.tsx
deleted file mode 100644
index 13a5758d..00000000
--- a/src/app/dev/map/edit/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { map_funGetOneBusinessMapByPortofolioId } from "@/app_modules/map/fun/get/fun_get_one_by_portofolio_id";
-import { Map_EditPin } from "@/app_modules/map/view";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const portofolioId = params.id;
- const dataMap = await map_funGetOneBusinessMapByPortofolioId({portofolioId: portofolioId})
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/map/main/page.tsx b/src/app/dev/map/main/page.tsx
deleted file mode 100644
index 8b1b6fd6..00000000
--- a/src/app/dev/map/main/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { map_funGetAllMap } from "@/app_modules/map/fun/get/fun_get_all_map";
-import { Map_View } from "@/app_modules/map/view";
-
-const mapboxToken = process.env.MAPBOX_TOKEN!;
-export default async function Page() {
- const dataMap = await map_funGetAllMap();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/notifikasi/collaboration/page.tsx b/src/app/dev/notifikasi/collaboration/page.tsx
deleted file mode 100644
index 78f26b83..00000000
--- a/src/app/dev/notifikasi/collaboration/page.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import {
- Notifikasi_UiCollaboration
-} from "@/app_modules/notifikasi/_ui";
-import notifikasi_getByUserId from "@/app_modules/notifikasi/fun/get/get_notifiaksi_by_id";
-
-export default async function Page() {
- const listNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: "Collaboration",
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/notifikasi/donasi/page.tsx b/src/app/dev/notifikasi/donasi/page.tsx
deleted file mode 100644
index 9af63325..00000000
--- a/src/app/dev/notifikasi/donasi/page.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Notifikasi_UiDonasi } from "@/app_modules/notifikasi/_ui";
-import notifikasi_getByUserId from "@/app_modules/notifikasi/fun/get/get_notifiaksi_by_id";
-
-export default async function Page() {
- const listNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: "Donasi",
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/notifikasi/event/page.tsx b/src/app/dev/notifikasi/event/page.tsx
deleted file mode 100644
index fa2ce235..00000000
--- a/src/app/dev/notifikasi/event/page.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Notifikasi_UiEvent } from "@/app_modules/notifikasi/_ui";
-import notifikasi_getByUserId from "@/app_modules/notifikasi/fun/get/get_notifiaksi_by_id";
-
-export default async function Page() {
- const listNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: "Event",
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/notifikasi/forum/page.tsx b/src/app/dev/notifikasi/forum/page.tsx
deleted file mode 100644
index a27ffea2..00000000
--- a/src/app/dev/notifikasi/forum/page.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Notifikasi_UiForum } from "@/app_modules/notifikasi/_ui";
-import notifikasi_getByUserId from "@/app_modules/notifikasi/fun/get/get_notifiaksi_by_id";
-
-export default async function Page() {
- const listNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: "Forum",
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/notifikasi/investasi/page.tsx b/src/app/dev/notifikasi/investasi/page.tsx
deleted file mode 100644
index d5704862..00000000
--- a/src/app/dev/notifikasi/investasi/page.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Notifikasi_UiDonasi, Notifikasi_UiInvestasi } from "@/app_modules/notifikasi/_ui";
-import notifikasi_getByUserId from "@/app_modules/notifikasi/fun/get/get_notifiaksi_by_id";
-
-export default async function Page() {
- const listNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: "Investasi",
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/notifikasi/job/page.tsx b/src/app/dev/notifikasi/job/page.tsx
deleted file mode 100644
index 029dbb80..00000000
--- a/src/app/dev/notifikasi/job/page.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Notifikasi_UiJob } from "@/app_modules/notifikasi/_ui";
-import notifikasi_getByUserId from "@/app_modules/notifikasi/fun/get/get_notifiaksi_by_id";
-
-export default async function Page() {
- const listNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: "Job",
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/notifikasi/layout.tsx b/src/app/dev/notifikasi/layout.tsx
deleted file mode 100644
index 8b1e90fc..00000000
--- a/src/app/dev/notifikasi/layout.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { UIGlobal_LayoutHeaderTamplate } from "@/app_modules/_global/ui";
-import { Notifikasi_UiNewLayout } from "@/app_modules/notifikasi/_ui";
-import { notifikasi_funGetKategoriApp } from "@/app_modules/notifikasi/fun/get/fun_get_kategori_app";
-
-export default async function Layout({
- children,
-}: {
- children: React.ReactNode;
-}) {
- const masterKategori = await notifikasi_funGetKategoriApp();
-
- return (
- <>
- }
- masterKategori={masterKategori}
- >
- {children}
-
- >
- );
-}
diff --git a/src/app/dev/notifikasi/semua/page.tsx b/src/app/dev/notifikasi/semua/page.tsx
deleted file mode 100644
index f9fad445..00000000
--- a/src/app/dev/notifikasi/semua/page.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Notifikasi_UiAll } from "@/app_modules/notifikasi/_ui";
-import notifikasi_getByUserId from "@/app_modules/notifikasi/fun/get/get_notifiaksi_by_id";
-
-export default async function Page() {
- const listNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: "Semua",
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/notifikasi/voting/page.tsx b/src/app/dev/notifikasi/voting/page.tsx
deleted file mode 100644
index 1dd4b042..00000000
--- a/src/app/dev/notifikasi/voting/page.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Notifikasi_UiVoting } from "@/app_modules/notifikasi/_ui";
-import notifikasi_getByUserId from "@/app_modules/notifikasi/fun/get/get_notifiaksi_by_id";
-
-export default async function Page() {
- const listNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: "Voting",
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/portofolio/create/[id]/layout.tsx b/src/app/dev/portofolio/create/[id]/layout.tsx
deleted file mode 100644
index 537ae898..00000000
--- a/src/app/dev/portofolio/create/[id]/layout.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { CreatePortofolioLayout } from "@/app_modules/katalog/portofolio";
-import React from "react";
-
-export default async function Layout({
- children,
- params,
-}: {
- children: React.ReactNode;
- params: { id: string };
-}) {
- return (
- <>
-
- {children}
-
- >
- );
-}
diff --git a/src/app/dev/portofolio/create/[id]/page.tsx b/src/app/dev/portofolio/create/[id]/page.tsx
deleted file mode 100644
index 652a81d1..00000000
--- a/src/app/dev/portofolio/create/[id]/page.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { CreatePortofolio } from "@/app_modules/katalog/portofolio";
-import { Portofolio_getMasterBidangBisnis } from "@/app_modules/katalog/portofolio/fun/master/get_bidang_bisnis";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const profileId = params.id;
- const bidangBisnis = await Portofolio_getMasterBidangBisnis();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/portofolio/daftar-portofolio/[id]/page.tsx b/src/app/dev/portofolio/daftar-portofolio/[id]/page.tsx
deleted file mode 100644
index 45a30f23..00000000
--- a/src/app/dev/portofolio/daftar-portofolio/[id]/page.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Portofolio_ViewListDetail } from "@/app_modules/katalog/portofolio";
-import { portofolio_funGetAllDaftarByid } from "@/app_modules/katalog/portofolio/fun/get/get_all_portofolio";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const profileId = params.id;
- const dataPortofolio = await portofolio_funGetAllDaftarByid({
- profileId,
- page: 1,
- });
-
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/portofolio/edit/data/[id]/page.tsx b/src/app/dev/portofolio/edit/data/[id]/page.tsx
deleted file mode 100644
index 6d23121d..00000000
--- a/src/app/dev/portofolio/edit/data/[id]/page.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Portofolio_EditDataBisnis } from "@/app_modules/katalog/portofolio";
-import { portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
-import { Portofolio_getMasterBidangBisnis } from "@/app_modules/katalog/portofolio/fun/master/get_bidang_bisnis";
-import _ from "lodash";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let portoId = params.id;
- const data = await portofolio_getOneById(portoId);
- const dataPorto = _.omit(data, [
- "Logo",
- "Portofolio_MediaSosial",
- "Portofolio_MediaSosial",
- "logoId",
- "profileId",
- ]);
-
- const listBidang = await Portofolio_getMasterBidangBisnis()
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/portofolio/edit/logo/[id]/page.tsx b/src/app/dev/portofolio/edit/logo/[id]/page.tsx
deleted file mode 100644
index 11d25a47..00000000
--- a/src/app/dev/portofolio/edit/logo/[id]/page.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { Portofolio_EditLogoBisnis } from "@/app_modules/katalog/portofolio";
-import { portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
-import _ from "lodash";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let portoId = params.id;
- const dataPorto = await portofolio_getOneById(portoId).then((res) =>
- _.omit(res, [
- "Logo",
- "MasterBidangBisnis",
- "Portofolio_MediaSosial",
- "active",
- "alamatKantor",
- "deskripsi",
- "masterBidangBisnisId",
- "profileId",
- "tlpn",
- "namaBisnis"
- ])
- );
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/portofolio/edit/medsos/[id]/page.tsx b/src/app/dev/portofolio/edit/medsos/[id]/page.tsx
deleted file mode 100644
index c65bcd2a..00000000
--- a/src/app/dev/portofolio/edit/medsos/[id]/page.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Portofolio_EditMedsosBisnis } from "@/app_modules/katalog/portofolio";
-import { Portofolio_geOnetMedsosById } from "@/app_modules/katalog/portofolio/fun/get/get_one_medsos_by_id";
-import _ from "lodash";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let portoId = params.id;
- const dataMedsos = await Portofolio_geOnetMedsosById(portoId).then((res) =>
- _.omit(res, ["active", "createdAt", "updatedAt", "portofolioId"])
- );
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/portofolio/main/[id]/layout.tsx b/src/app/dev/portofolio/main/[id]/layout.tsx
deleted file mode 100644
index 42f4bc01..00000000
--- a/src/app/dev/portofolio/main/[id]/layout.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { PortofolioLayout } from "@/app_modules/katalog/portofolio";
-import { portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
-
-export default async function Layout({
- children,
- params,
-}: {
- children: any;
- params: { id: string };
-}) {
- let portoId = params.id;
- const getPorto = await portofolio_getOneById(portoId);
- const userLoginId = await funGetUserIdByToken();
-
- return (
- <>
-
- {children}
-
- >
- );
-}
diff --git a/src/app/dev/portofolio/main/[id]/page.tsx b/src/app/dev/portofolio/main/[id]/page.tsx
deleted file mode 100644
index 61d37c14..00000000
--- a/src/app/dev/portofolio/main/[id]/page.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { ViewPortofolio } from "@/app_modules/katalog/portofolio";
-import { portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
-
-const mapboxToken = process.env.MAPBOX_TOKEN!;
-export default async function Page({ params }: { params: { id: string } }) {
- const portofolioId = params.id;
- const dataPortofolio = await portofolio_getOneById(portofolioId);
- const userLoginId = await funGetUserIdByToken();
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/profile/edit/[id]/page.tsx b/src/app/dev/profile/edit/[id]/page.tsx
deleted file mode 100644
index 53e6ca6d..00000000
--- a/src/app/dev/profile/edit/[id]/page.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-
-import EditProfile from "@/app_modules/katalog/profile/edit/view";
-import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let profileId = params.id
- const dataProfile = await Profile_getOneProfileAndUserById(profileId)
-
- return (
- <>
- {/* {JSON.stringify(data)} */}
-
- >
- );
-}
diff --git a/src/app/dev/profile/upload/background/[id]/page.tsx b/src/app/dev/profile/upload/background/[id]/page.tsx
deleted file mode 100644
index ef64703e..00000000
--- a/src/app/dev/profile/upload/background/[id]/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Profile_getOneById } from "@/app_modules/katalog/profile/fun/get/get_one_profile"
-import Profile_UpdateFotoBackground from "@/app_modules/katalog/profile/upload/foto_background"
-
-export default async function Page({params}:{params: {id: string}}) {
- let profileId = params.id
- const dataProfile = await Profile_getOneById(profileId)
-
- return <>
-
- >
-
-}
\ No newline at end of file
diff --git a/src/app/dev/profile/upload/foto/[id]/page.tsx b/src/app/dev/profile/upload/foto/[id]/page.tsx
deleted file mode 100644
index ea595412..00000000
--- a/src/app/dev/profile/upload/foto/[id]/page.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import { UploadFotoProfile } from "@/app_modules/katalog/profile";
-import { Profile_getOneById } from "@/app_modules/katalog/profile/fun/get/get_one_profile";
-
-export default async function Page({params}: {params: {id: string}}) {
- let profileId = params.id
- const dataProfile = await Profile_getOneById(profileId)
-
- return <>
-
- >
-}
\ No newline at end of file
diff --git a/src/app/dev/user-search/page.tsx b/src/app/dev/user-search/page.tsx
deleted file mode 100644
index 7305259d..00000000
--- a/src/app/dev/user-search/page.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { UserSearch_MainView } from "@/app_modules/user_search";
-import { userSearch_getAllUser } from "@/app_modules/user_search/fun/get/get_all_user";
-
-export default async function Page() {
- const listUser = await userSearch_getAllUser({ page: 1 });
-
- return ;
-}
diff --git a/src/app/dev/vote/detail/daftar-kontributor/[id]/page.tsx b/src/app/dev/vote/detail/daftar-kontributor/[id]/page.tsx
deleted file mode 100644
index 451b4a9a..00000000
--- a/src/app/dev/vote/detail/daftar-kontributor/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Voting_UiDetailKontributorVoting } from "@/app_modules/vote/_ui";
-import { Vote_getListKontributorById } from "@/app_modules/vote/fun/get/get_list_kontributor_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const votingId = params.id;
- const listKontributor = await Vote_getListKontributorById(votingId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/draft/[id]/page.tsx b/src/app/dev/vote/detail/draft/[id]/page.tsx
deleted file mode 100644
index 6403bd9f..00000000
--- a/src/app/dev/vote/detail/draft/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Vote_DetailDraft } from "@/app_modules/vote";
-import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const voteId = params.id;
- const dataVote = await voting_funGetOneVotingbyId(voteId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/kontribusi/[id]/layout.tsx b/src/app/dev/vote/detail/kontribusi/[id]/layout.tsx
deleted file mode 100644
index 99ce0157..00000000
--- a/src/app/dev/vote/detail/kontribusi/[id]/layout.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { LayoutVote_DetailKontribusi } from "@/app_modules/vote";
-import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id";
-import React from "react";
-
-export default async function Layout({
- children,
- params,
-}: {
- children: React.ReactNode;
- params: { id: string };
-}) {
- const votingId = params.id;
- const userLoginId = await funGetUserIdByToken();
- const dataVoting = await voting_funGetOneVotingbyId(votingId);
-
- return (
- <>
-
- {children}
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/kontribusi/[id]/page.tsx b/src/app/dev/vote/detail/kontribusi/[id]/page.tsx
deleted file mode 100644
index d42fc576..00000000
--- a/src/app/dev/vote/detail/kontribusi/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Vote_DetailKontribusi } from "@/app_modules/vote";
-import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let voteId = params.id;
- const dataVote = await voting_funGetOneVotingbyId(voteId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/main/[id]/layout.tsx b/src/app/dev/vote/detail/main/[id]/layout.tsx
deleted file mode 100644
index 52e73baa..00000000
--- a/src/app/dev/vote/detail/main/[id]/layout.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { LayoutVote_MainDetail } from "@/app_modules/vote";
-import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id";
-import React from "react";
-
-export default async function Layout({
- children,
- params,
-}: {
- children: React.ReactNode;
- params: { id: string };
-}) {
- const votingId = params.id;
- const userLoginId = await funGetUserIdByToken();
- const dataVoting = await voting_funGetOneVotingbyId(votingId);
-
- return (
- <>
-
- {children}
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/main/[id]/page.tsx b/src/app/dev/vote/detail/main/[id]/page.tsx
deleted file mode 100644
index cd88b898..00000000
--- a/src/app/dev/vote/detail/main/[id]/page.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { Vote_MainDetail } from "@/app_modules/vote";
-import { Vote_cekKontributorById } from "@/app_modules/vote/fun/get/cek_kontributor_by_id";
-import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id";
-import { Vote_getHasilVoteById } from "@/app_modules/vote/fun/get/get_list_hasil_by_id";
-import { Vote_getListKontributorById } from "@/app_modules/vote/fun/get/get_list_kontributor_by_id";
-import { Vote_getOnePilihanVotingByUserId } from "@/app_modules/vote/fun/get/get_one_pilihan_voting_by_user_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const voteId = params.id;
- const userLoginId = await funGetUserIdByToken();
-
- const dataVote = await voting_funGetOneVotingbyId(voteId);
- const hasilVoting = await Vote_getHasilVoteById(voteId as any);
- const isKontributor = await Vote_cekKontributorById(voteId);
- const pilihanKontributor = await Vote_getOnePilihanVotingByUserId(voteId);
- const listKontributor = await Vote_getListKontributorById(voteId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/publish/[id]/layout.tsx b/src/app/dev/vote/detail/publish/[id]/layout.tsx
deleted file mode 100644
index e2359ded..00000000
--- a/src/app/dev/vote/detail/publish/[id]/layout.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { LayoutVote_DetailPublish } from "@/app_modules/vote";
-import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id";
-import React from "react";
-
-export default async function Layout({
- children,
- params,
-}: {
- children: React.ReactNode;
- params: { id: string };
-}) {
- const votingId = params.id;
- const userLoginId = await funGetUserIdByToken();
-
- const dataVoting = await voting_funGetOneVotingbyId(votingId);
-
- return (
- <>
-
- {children}
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/publish/[id]/page.tsx b/src/app/dev/vote/detail/publish/[id]/page.tsx
deleted file mode 100644
index df0477dc..00000000
--- a/src/app/dev/vote/detail/publish/[id]/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Vote_DetailPublish } from "@/app_modules/vote";
-import { Vote_getListKontributorById } from "@/app_modules/vote/fun/get/get_list_kontributor_by_id";
-import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let voteId = params.id;
- const dataVote = await voting_funGetOneVotingbyId(voteId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/reject/[id]/layout.tsx b/src/app/dev/vote/detail/reject/[id]/layout.tsx
deleted file mode 100644
index 469f132a..00000000
--- a/src/app/dev/vote/detail/reject/[id]/layout.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { LayoutVote_DetailReject } from "@/app_modules/vote";
-import React from "react";
-
-export default async function Layout({children}: {children: React.ReactNode}) {
- return<>
- {children}
- >
-}
\ No newline at end of file
diff --git a/src/app/dev/vote/detail/reject/[id]/page.tsx b/src/app/dev/vote/detail/reject/[id]/page.tsx
deleted file mode 100644
index e7b2ea93..00000000
--- a/src/app/dev/vote/detail/reject/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Vote_DetailReject } from "@/app_modules/vote";
-import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let voteId = params.id;
- const dataVote = await voting_funGetOneVotingbyId(voteId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/review/[id]/page.tsx b/src/app/dev/vote/detail/review/[id]/page.tsx
deleted file mode 100644
index f0febb86..00000000
--- a/src/app/dev/vote/detail/review/[id]/page.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Vote_DetailReview } from "@/app_modules/vote";
-import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let voteId = params.id;
- const dataVote = await voting_funGetOneVotingbyId(voteId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/riwayat_saya/[id]/page.tsx b/src/app/dev/vote/detail/riwayat_saya/[id]/page.tsx
deleted file mode 100644
index f4542ad0..00000000
--- a/src/app/dev/vote/detail/riwayat_saya/[id]/page.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Vote_DetailRiwayatSaya } from "@/app_modules/vote";
-import { Vote_getListKontributorById } from "@/app_modules/vote/fun/get/get_list_kontributor_by_id";
-import { Vote_getOnePublishbyId } from "@/app_modules/vote/fun/get/get_one_publish_by_id";
-
-export default async function Page({params}: {params: {id: string}}) {
- let voteId = params.id;
- const dataVote = await Vote_getOnePublishbyId(voteId);
- const listKontributor = await Vote_getListKontributorById(voteId);
-
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/semua_riwayat/[id]/layout.tsx b/src/app/dev/vote/detail/semua_riwayat/[id]/layout.tsx
deleted file mode 100644
index 29d02c51..00000000
--- a/src/app/dev/vote/detail/semua_riwayat/[id]/layout.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import { LayoutVote_DetailSemuaRiwayat } from "@/app_modules/vote";
-import React from "react";
-
-export default async function Layout({
- children,
- params,
-}: {
- children: React.ReactNode;
- params: { id: string };
-}) {
- const votingId = params.id;
- const userLoginId = await funGetUserIdByToken();
-
- return (
- <>
-
- {children}
-
- >
- );
-}
diff --git a/src/app/dev/vote/detail/semua_riwayat/[id]/page.tsx b/src/app/dev/vote/detail/semua_riwayat/[id]/page.tsx
deleted file mode 100644
index 6d943acd..00000000
--- a/src/app/dev/vote/detail/semua_riwayat/[id]/page.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Vote_DetailSemuaRiwayat } from "@/app_modules/vote";
-import { Vote_getListKontributorById } from "@/app_modules/vote/fun/get/get_list_kontributor_by_id";
-import { Vote_getOnePublishbyId } from "@/app_modules/vote/fun/get/get_one_publish_by_id";
-
-
-export default async function Page({params}: {params: {id: string}}) {
- let voteId = params.id
- const dataVote = await Vote_getOnePublishbyId(voteId)
- const listKontributor = await Vote_getListKontributorById(voteId)
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/edit/[id]/page.tsx b/src/app/dev/vote/edit/[id]/page.tsx
deleted file mode 100644
index a5fb255e..00000000
--- a/src/app/dev/vote/edit/[id]/page.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { Vote_Edit } from "@/app_modules/vote";
-import { Vote_getListDaftarNamaById } from "@/app_modules/vote/fun/get/get_list_daftar_vote_by_id";
-import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id";
-import _ from "lodash";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let voteId = params.id;
- const dataVote = await voting_funGetOneVotingbyId(voteId);
- const data = _.omit(dataVote, ["Voting_DaftarNamaVote"]);
- const listDaftarVote = await Vote_getListDaftarNamaById(voteId);
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/main/beranda/page.tsx b/src/app/dev/vote/main/beranda/page.tsx
deleted file mode 100644
index 28904aca..00000000
--- a/src/app/dev/vote/main/beranda/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Vote_Beranda } from "@/app_modules/vote";
-import { vote_getAllListPublish } from "@/app_modules/vote/fun/get/get_all_list_publish";
-
-export default async function Page() {
- const dataVote = await vote_getAllListPublish({ page: 1 });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/main/kontribusi/page.tsx b/src/app/dev/vote/main/kontribusi/page.tsx
deleted file mode 100644
index 31e1f35f..00000000
--- a/src/app/dev/vote/main/kontribusi/page.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import { Vote_Kontribusi } from "@/app_modules/vote";
-import { vote_getAllListKontribusiByAuthorId } from "@/app_modules/vote/fun/get/get_list_kontribusi_by_author_id";
-
-export default async function Page() {
- const dataKontribusi = await vote_getAllListKontribusiByAuthorId({ page: 1 });
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/dev/vote/main/riwayat/[id]/page.tsx b/src/app/dev/vote/main/riwayat/[id]/page.tsx
deleted file mode 100644
index 10988a8f..00000000
--- a/src/app/dev/vote/main/riwayat/[id]/page.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { Vote_Riwayat } from "@/app_modules/vote";
-import { vote_getAllListRiwayat } from "@/app_modules/vote/fun/get/get_all_list_riwayat";
-import { Vote_getAllListRiwayatSaya as vote_getAllListRiwayatSaya } from "@/app_modules/vote/fun/get/get_all_list_riwayat_saya";
-
-export default async function Page({ params }: { params: { id: string } }) {
- let statusRiwayatId = params.id;
-
- const listRiwayat = await vote_getAllListRiwayat({ page: 1 });
- const listRiwayatSaya = await vote_getAllListRiwayatSaya({ page: 1 });
-
- if (statusRiwayatId == "1") {
- return (
- <>
-
- >
- );
- }
- if (statusRiwayatId == "2") {
- return (
- <>
-
- >
- );
- }
-
- // return (
- // <>
- //
- // >
- // );
-}
diff --git a/src/app/dev/vote/main/status/[id]/page.tsx b/src/app/dev/vote/main/status/[id]/page.tsx
deleted file mode 100644
index 9e3fa9a2..00000000
--- a/src/app/dev/vote/main/status/[id]/page.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { Vote_Status } from "@/app_modules/vote";
-import {
- vote_funGetAllByStatusId,
- voting_getMasterStatus,
-} from "@/app_modules/vote/fun";
-
-export default async function Page({ params }: { params: { id: string } }) {
- const statusId = params.id;
-
- const listStatus = await voting_getMasterStatus();
- const dataVoting = await vote_funGetAllByStatusId({
- page: 1,
- statusId: statusId,
- });
-
- return (
- <>
-
- >
- );
-}
diff --git a/src/app/emotion.tsx b/src/app/emotion.tsx
index 303639ae..22d5cd2f 100644
--- a/src/app/emotion.tsx
+++ b/src/app/emotion.tsx
@@ -1,10 +1,8 @@
"use client";
+import { MainColor } from "@/app_modules/_global/color";
// import './globals.css'
import { CacheProvider } from "@emotion/react";
-import {
- MantineProvider,
- useEmotionCache
-} from "@mantine/core";
+import { MantineProvider, useEmotionCache } from "@mantine/core";
import { Notifications } from "@mantine/notifications";
import { Provider } from "jotai";
import { useServerInsertedHTML } from "next/navigation";
@@ -30,9 +28,16 @@ export default function RootStyleRegistry({
return (
+
HIPMI
-
+
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 29bdfe8f..a126e831 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -1,8 +1,8 @@
import RootStyleRegistry from "./emotion";
// import "./globals.css";
import dotenv from "dotenv";
-import { ServerEnv } from "./lib/server_env";
-import { TokenProvider } from "./lib/token";
+import { ServerEnv } from "../lib/server_env";
+import { TokenProvider } from "../lib/token";
dotenv.config({
path: ".env",
});
diff --git a/src/app/lib/prisma.ts b/src/app/lib/prisma.ts
deleted file mode 100644
index 553b19ad..00000000
--- a/src/app/lib/prisma.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { PrismaClient } from '@prisma/client'
-
-const prismaClientSingleton = () => {
- return new PrismaClient()
-}
-
-type PrismaClientSingleton = ReturnType
-
-const globalForPrisma = globalThis as unknown as {
- prisma: PrismaClientSingleton | undefined
-}
-
-const prisma = globalForPrisma.prisma ?? prismaClientSingleton()
-
-export default prisma
-
-if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma
\ No newline at end of file
diff --git a/src/app/lib/realtime_provider.tsx b/src/app/lib/realtime_provider.tsx
deleted file mode 100644
index 6468a0a0..00000000
--- a/src/app/lib/realtime_provider.tsx
+++ /dev/null
@@ -1,209 +0,0 @@
-"use client";
-
-import { useShallowEffect } from "@mantine/hooks";
-import { useAtom } from "jotai";
-import { WibuRealtime } from "wibu-pkg";
-import {
- gs_admin_ntf,
- gs_adminDonasi_triggerReview,
- gs_adminEvent_triggerReview,
- gs_adminJob_triggerReview,
- gs_adminVoting_triggerReview,
- gs_donasiTriggerBeranda,
- gs_eventTriggerBeranda,
- gs_jobTiggerBeranda,
- gs_realtimeData,
- gs_user_ntf,
- gs_votingTiggerBeranda,
- IRealtimeData,
-} from "./global_state";
-
-// const WIBU_REALTIME_TOKEN: string | undefined =
-// process.env.NEXT_PUBLIC_WIBU_REALTIME_TOKEN;
-
-// Pasang tipe data di package WibuRealtime sebagai type adata setData
-export type TypeNotification = {
- type: "message" | "notification" | "trigger";
- pushNotificationTo: "ADMIN" | "USER";
- dataMessage?: IRealtimeData;
- userLoginId?: string;
-};
-
-export default function RealtimeProvider({
- userLoginId,
- WIBU_REALTIME_TOKEN,
-}: {
- userLoginId: string;
- WIBU_REALTIME_TOKEN: string;
-}) {
- const [dataRealtime, setDataRealtime] = useAtom(gs_realtimeData);
- const [newAdminNtf, setNewAdminNtf] = useAtom(gs_admin_ntf);
- const [newUserNtf, setNewUserNtf] = useAtom(gs_user_ntf);
-
- // JOB
- const [isTriggerJobBeranda, setIsTriggerJobBeranda] =
- useAtom(gs_jobTiggerBeranda);
- const [isAdminJob_TriggerReview, setIsAdminJob_TriggerReview] = useAtom(
- gs_adminJob_triggerReview
- );
-
- // EVENT
- const [isTriggerEventBeranda, setIsTriggerEventBeranda] = useAtom(
- gs_eventTriggerBeranda
- );
- const [isAdminEvent_TriggerReview, setIsAdminEvent_TriggerReview] = useAtom(
- gs_adminEvent_triggerReview
- );
-
- // VOTING
- const [isTriggerVotingBeranda, setIsTriggerVotingBeranda] = useAtom(
- gs_votingTiggerBeranda
- );
- const [isAdminVoting_TriggerReview, setIsAdminVoting_TriggerReview] = useAtom(
- gs_adminVoting_triggerReview
- );
-
- // DONASI
- const [isAdminDonasi_TriggerReview, setIsAdminDonasi_TriggerReview] = useAtom(
- gs_adminDonasi_triggerReview
- );
- const [isTriggerDonasiBeranda, setIsTriggerDonasiBeranda] = useAtom(
- gs_donasiTriggerBeranda
- );
-
- useShallowEffect(() => {
- // if (WIBU_REALTIME_TOKEN === undefined) return alert("gak dapet key");
- try {
- WibuRealtime.init({
- project: "hipmi",
- WIBU_REALTIME_TOKEN: WIBU_REALTIME_TOKEN,
- onData(data: TypeNotification) {
- if (
- data.type == "notification" &&
- data.pushNotificationTo == "ADMIN"
- ) {
- setNewAdminNtf((e) => e + 1);
- }
-
- // Notifikasi ke semua user , yang datanya di acc admin
- if (
- data.type == "notification" &&
- data.pushNotificationTo == "USER" &&
- data.dataMessage?.userId == userLoginId
- ) {
- setNewUserNtf((e) => e + 1);
- setDataRealtime(data.dataMessage as any);
- }
-
- // ---------------------- JOB ------------------------- //
- if (
- data.type == "trigger" &&
- data.pushNotificationTo == "ADMIN" &&
- data.dataMessage?.kategoriApp == "JOB"
- ) {
- setIsAdminJob_TriggerReview(true);
- }
-
- if (
- data.type == "trigger" &&
- data.pushNotificationTo == "USER" &&
- data.dataMessage?.kategoriApp == "JOB" &&
- data.dataMessage.status == "Publish"
- ) {
- setIsTriggerJobBeranda(true);
- }
- // ---------------------- JOB ------------------------- //
-
- // ---------------------- EVENT ------------------------- //
- if (
- data.type == "trigger" &&
- data.pushNotificationTo == "ADMIN" &&
- data.dataMessage?.kategoriApp == "EVENT"
- ) {
- setIsAdminEvent_TriggerReview(true);
- }
-
- if (
- data.type == "trigger" &&
- data.pushNotificationTo == "USER" &&
- data.dataMessage?.kategoriApp == "EVENT" &&
- data.dataMessage.status == "Publish"
- ) {
- setIsTriggerEventBeranda(true);
- }
-
- if (
- data.type == "notification" &&
- data.pushNotificationTo == "USER" &&
- data.dataMessage?.status == "Peserta Event" &&
- userLoginId !== data.dataMessage?.userId
- ) {
- setNewUserNtf((e) => e + 1);
- }
- // ---------------------- EVENT ------------------------- //
-
- // ---------------------- VOTING ------------------------- //
- if (
- data.type == "trigger" &&
- data.pushNotificationTo == "ADMIN" &&
- data.dataMessage?.kategoriApp == "VOTING"
- ) {
- setIsAdminVoting_TriggerReview(true);
- }
-
- if (
- data.type == "trigger" &&
- data.pushNotificationTo == "USER" &&
- data.dataMessage?.kategoriApp == "VOTING" &&
- data.dataMessage.status == "Publish"
- ) {
- setIsTriggerVotingBeranda(true);
- }
-
- if (
- data.type == "notification" &&
- data.pushNotificationTo == "USER" &&
- data.dataMessage?.status == "Voting Masuk" &&
- userLoginId !== data.dataMessage?.userId
- ) {
- setNewUserNtf((e) => e + 1);
- }
- // ---------------------- VOTING ------------------------- //
-
- // ---------------------- DONASI ------------------------- //
- if (
- data.type == "trigger" &&
- data.pushNotificationTo == "ADMIN" &&
- data.dataMessage?.kategoriApp == "DONASI"
- ) {
- setIsAdminDonasi_TriggerReview(true);
- }
-
- if (
- data.type == "trigger" &&
- data.pushNotificationTo == "USER" &&
- data.dataMessage?.kategoriApp == "DONASI" &&
- data.dataMessage.status == "Publish"
- ) {
- setIsTriggerDonasiBeranda(true);
- }
-
- // if (
- // data.type == "notification" &&
- // data.pushNotificationTo == "ADMIN" &&
- // data.dataMessage?.status == "Menunggu" &&
- // userLoginId !== data.dataMessage?.userId
- // ) {
- // console.log("yes");
- // }
-
- // ---------------------- DONASI ------------------------- //
- },
- });
- } catch (error) {
- console.log(error);
- }
- }, []);
-
- return null;
-}
diff --git a/src/app/lib/router_admin/router_app_information.ts b/src/app/lib/router_admin/router_app_information.ts
deleted file mode 100644
index 07575544..00000000
--- a/src/app/lib/router_admin/router_app_information.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export const RouterAdminAppInformation = {
- main: "/dev/admin/app-information/main",
-};
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 3a1f99a2..6fc3a06d 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -2,11 +2,14 @@
import { SplashScreen } from "@/app_modules/auth";
import { useShallowEffect } from "@mantine/hooks";
+import { useRouter } from "next/navigation";
export default function Page() {
+ const router = useRouter();
useShallowEffect(() => {
setTimeout(() => {
- window.location.replace("/dev/home");
+ // window.location.replace("/dev/home");
+ router.replace("/dev/home", { scroll: false });
}, 1000);
}, []);
diff --git a/src/app/zCoba/home/page.tsx b/src/app/zCoba/home/page.tsx
new file mode 100644
index 00000000..437474b1
--- /dev/null
+++ b/src/app/zCoba/home/page.tsx
@@ -0,0 +1,10 @@
+import ClientLayout from "./v2_coba_tamplate";
+import ViewV2 from "./v2_view";
+
+export default async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/app/zCoba/home/test_children.tsx b/src/app/zCoba/home/test_children.tsx
new file mode 100644
index 00000000..e3a96278
--- /dev/null
+++ b/src/app/zCoba/home/test_children.tsx
@@ -0,0 +1,127 @@
+"use client";
+
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import {
+ listMenuHomeBody,
+ menuHomeJob,
+} from "@/app_modules/home/component/list_menu_home";
+import {
+ ActionIcon,
+ Box,
+ Group,
+ Image,
+ Paper,
+ SimpleGrid,
+ Stack,
+ Text
+} from "@mantine/core";
+import { IconUserSearch } from "@tabler/icons-react";
+
+export function Test_Children() {
+ return (
+ <>
+
+
+
+ {Array.from(new Array(2)).map((e, i) => (
+
+
+ {listMenuHomeBody.map((e, i) => (
+ {}}
+ >
+
+
+ {e.icon}
+
+
+ {e.name}
+
+
+
+ ))}
+
+
+ {/* Job View */}
+
+ {}}>
+
+
+ {menuHomeJob.icon}
+
+
+ {menuHomeJob.name}
+
+
+
+ {Array.from({ length: 2 }).map((e, i) => (
+
+
+
+
+
+
+
+ nama {i}
+
+
+ judulnya {i}
+
+
+
+
+ ))}
+
+
+
+
+ ))}
+
+ >
+ );
+}
diff --git a/src/app/zCoba/home/test_footer.tsx b/src/app/zCoba/home/test_footer.tsx
new file mode 100644
index 00000000..baa2368a
--- /dev/null
+++ b/src/app/zCoba/home/test_footer.tsx
@@ -0,0 +1,75 @@
+"use client"
+
+import { MainColor } from "@/app_modules/_global/color";
+import { listMenuHomeFooter } from "@/app_modules/home";
+import {
+ ActionIcon,
+ Box,
+ Center,
+ SimpleGrid,
+ Stack,
+ Text,
+} from "@mantine/core";
+import { IconUserCircle } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+
+export default function Test_FooterHome() {
+ const router = useRouter();
+
+ return (
+
+
+ {listMenuHomeFooter.map((e) => (
+
+ {
+ console.log("test")
+ }}
+ >
+
+ {e.icon}
+
+
+ {e.name}
+
+
+
+ ))}
+
+
+
+
+ console.log("test")
+ }
+ >
+
+
+
+ Profile
+
+
+
+
+
+ );
+}
diff --git a/src/app/zCoba/home/test_header.tsx b/src/app/zCoba/home/test_header.tsx
new file mode 100644
index 00000000..df65017a
--- /dev/null
+++ b/src/app/zCoba/home/test_header.tsx
@@ -0,0 +1,130 @@
+"use client";
+
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import {
+ Header,
+ Group,
+ ActionIcon,
+ Text,
+ Title,
+ Box,
+ Loader,
+} from "@mantine/core";
+import { IconArrowLeft, IconChevronLeft } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import React, { useState } from "react";
+
+
+export default function Test_LayoutHeaderTamplate({
+ title,
+ posotion,
+ // left button
+ hideButtonLeft,
+ iconLeft,
+ routerLeft,
+ customButtonLeft,
+ // right button
+ iconRight,
+ routerRight,
+ customButtonRight,
+ backgroundColor,
+}: {
+ title: string;
+ posotion?: any;
+ // left button
+ hideButtonLeft?: boolean;
+ iconLeft?: any;
+ routerLeft?: any;
+ customButtonLeft?: React.ReactNode;
+ // right button
+ iconRight?: any;
+ routerRight?: any;
+ customButtonRight?: React.ReactNode;
+ backgroundColor?: string;
+}) {
+ const router = useRouter();
+ const [isLoading, setIsLoading] = useState(false);
+ const [isRightLoading, setRightLoading] = useState(false);
+
+ return (
+ <>
+
+
+ {hideButtonLeft ? (
+
+ ) : customButtonLeft ? (
+ customButtonLeft
+ ) : (
+ {
+ setIsLoading(true);
+ routerLeft === undefined
+ ? router.back()
+ : router.push(routerLeft, { scroll: false });
+ }}
+ >
+ {/* PAKE LOADING SAAT KLIK BACK */}
+ {/* {isLoading ? (
+
+ ) : iconLeft ? (
+ iconLeft
+ ) : (
+
+ )} */}
+
+
+ {/* GA PAKE LOADING SAAT KLIK BACK */}
+ {iconLeft ? (
+ iconLeft
+ ) : (
+
+ )}
+
+ )}
+
+
+ {title}
+
+
+ {customButtonRight ? (
+ customButtonRight
+ ) : iconRight === undefined ? (
+
+ ) : routerRight === undefined ? (
+ {iconRight}
+ ) : (
+ {
+ setRightLoading(true);
+ router.push(routerRight);
+ }}
+ >
+ {isRightLoading ? (
+
+ ) : (
+ iconRight
+ )}
+
+ )}
+
+
+ >
+ );
+}
diff --git a/src/app/zCoba/home/test_tamplate.tsx b/src/app/zCoba/home/test_tamplate.tsx
new file mode 100644
index 00000000..ff55f50a
--- /dev/null
+++ b/src/app/zCoba/home/test_tamplate.tsx
@@ -0,0 +1,127 @@
+"use client";
+
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import {
+ BackgroundImage,
+ Box,
+ Container,
+ rem,
+ ScrollArea,
+} from "@mantine/core";
+
+export function Test_Tamplate({
+ children,
+ header,
+ footer,
+}: {
+ children: React.ReactNode;
+ header: React.ReactNode;
+ footer?: React.ReactNode;
+}) {
+ return (
+ <>
+
+
+ {/* */}
+
+
+ {children}
+
+
+ {/* */}
+
+
+ >
+ );
+}
+
+export function TestHeader({ header }: { header: React.ReactNode }) {
+ return (
+ <>
+
+ {header}
+
+ >
+ );
+}
+
+export function TestChildren({
+ children,
+ footer,
+}: {
+ children: React.ReactNode;
+ footer: React.ReactNode;
+}) {
+ return (
+ <>
+
+ {children}
+
+ >
+ );
+}
+
+function TestFooter({ footer }: { footer: React.ReactNode }) {
+ return (
+ <>
+ {footer ? (
+
+
+ {footer}
+
+
+ ) : (
+ ""
+ )}
+ >
+ );
+}
diff --git a/src/app/zCoba/home/v2_children.tsx b/src/app/zCoba/home/v2_children.tsx
new file mode 100644
index 00000000..7942ba69
--- /dev/null
+++ b/src/app/zCoba/home/v2_children.tsx
@@ -0,0 +1,26 @@
+"use client";
+
+import { Box, ScrollArea } from "@mantine/core";
+
+export function V2_Children({
+ children,
+ height,
+}: {
+ children: React.ReactNode;
+ height?: number;
+}) {
+ return (
+ <>
+
+ {children}
+ {/*
+ */}
+
+ >
+ );
+}
diff --git a/src/app/zCoba/home/v2_coba_tamplate.tsx b/src/app/zCoba/home/v2_coba_tamplate.tsx
new file mode 100644
index 00000000..58fec604
--- /dev/null
+++ b/src/app/zCoba/home/v2_coba_tamplate.tsx
@@ -0,0 +1,159 @@
+"use client";
+
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import {
+ ActionIcon,
+ BackgroundImage, // Import BackgroundImage dari Mantine
+ Box,
+ Button,
+ Container,
+ Group,
+ Text,
+ Title,
+} from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { createStyles } from "@mantine/styles";
+import { IconBell, IconSearch } from "@tabler/icons-react";
+import { ReactNode, useEffect, useState } from "react";
+
+// Styling langsung didefinisikan di dalam komponen
+const useStyles = createStyles((theme) => ({
+ pageContainer: {
+ display: "flex",
+ flexDirection: "column",
+ minHeight: "100dvh", // dynamic viewport height untuk mobile
+ width: "100%",
+ maxWidth: "500px", // Batasi lebar maksimum
+ margin: "0 auto", // Pusatkan layout
+ boxShadow: "0 0 10px rgba(0, 0, 0, 0.1)", // Tambahkan shadow untuk efek mobile-like
+ backgroundColor: MainColor.darkblue, // Warna latar belakang fallback
+
+ [`@media (max-width: 768px)`]: {
+ maxWidth: "100%", // Pada layar mobile, gunakan lebar penuh
+ boxShadow: "none", // Hilangkan shadow pada mobile
+ },
+ },
+
+ header: {
+ position: "sticky",
+ top: 0,
+ width: "100%",
+ maxWidth: "500px", // Batasi lebar header sesuai container
+ margin: "0 auto", // Pusatkan header
+ backgroundColor: MainColor.darkblue,
+ boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)",
+ zIndex: 1000, // Pastikan z-index tinggi
+ transition: "all 0.3s ease",
+ color: MainColor.yellow,
+ },
+
+ scrolled: {
+ boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
+ },
+
+ headerContainer: {
+ height: "8vh",
+ display: "flex",
+ alignItems: "center",
+ padding: "0 16px", // Padding untuk mobile view
+
+ [`@media (max-width: 768px)`]: {
+ height: "8vh",
+ },
+ borderBottom: `1px solid ${AccentColor.blue}`,
+ borderBottomLeftRadius: "10px",
+ borderBottomRightRadius: "10px",
+ },
+
+ content: {
+ flex: 1,
+ width: "100%",
+ overflowY: "auto", // Izinkan scrolling pada konten
+ paddingBottom: "15vh", // Sesuaikan dengan tinggi footer
+ },
+
+ footer: {
+ width: "100%",
+ backgroundColor: MainColor.darkblue,
+ borderTop: `1px solid ${AccentColor.blue}`,
+ height: "10vh", // Tinggi footer
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ position: "fixed",
+ bottom: 0,
+ left: "50%", // Pusatkan footer
+ transform: "translateX(-50%)", // Pusatkan footer
+ maxWidth: "500px", // Batasi lebar footer
+ color: MainColor.white,
+ borderTopLeftRadius: "10px",
+ borderTopRightRadius: "10px",
+ },
+}));
+
+interface ClientLayoutProps {
+ children: ReactNode;
+}
+
+export default function ClientLayout({ children }: ClientLayoutProps) {
+ const [scrolled, setScrolled] = useState(false);
+ const { classes, cx } = useStyles();
+
+ // Effect untuk mendeteksi scroll
+ useEffect(() => {
+ function handleScroll() {
+ if (window.scrollY > 10) {
+ setScrolled(true);
+ } else {
+ setScrolled(false);
+ }
+ }
+
+ window.addEventListener("scroll", handleScroll);
+ return () => window.removeEventListener("scroll", handleScroll);
+ }, []);
+
+ return (
+
+ {/* Header - tetap di atas */}
+
+
+
+
+
+
+ Home Test
+
+
+
+
+
+
+
+ {/* Konten utama - bisa di-scroll */}
+
+ {children}
+
+
+ {/* Footer - tetap di bawah */}
+
+
+
+ © 2025 Nama Perusahaan
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/src/app/zCoba/home/v2_header.tsx b/src/app/zCoba/home/v2_header.tsx
new file mode 100644
index 00000000..38a72361
--- /dev/null
+++ b/src/app/zCoba/home/v2_header.tsx
@@ -0,0 +1,42 @@
+"use client";
+
+import { MainColor } from "@/app_modules/_global/color";
+import { ActionIcon, Box, Group, Title } from "@mantine/core";
+import { IconBell, IconChevronLeft } from "@tabler/icons-react";
+
+export function V2_Header() {
+ return (
+ <>
+
+
+ {}}
+ >
+
+
+
+
+ Test Tamplate
+
+
+ {}}>
+
+
+
+
+ >
+ );
+}
diff --git a/src/app/zCoba/home/v2_home_view.tsx b/src/app/zCoba/home/v2_home_view.tsx
new file mode 100644
index 00000000..90e0fc9a
--- /dev/null
+++ b/src/app/zCoba/home/v2_home_view.tsx
@@ -0,0 +1,127 @@
+"use client";
+
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import {
+ listMenuHomeBody,
+ menuHomeJob,
+} from "@/app_modules/home/component/list_menu_home";
+import {
+ Box,
+ Stack,
+ SimpleGrid,
+ Paper,
+ ActionIcon,
+ Group,
+ Image,
+ Text,
+} from "@mantine/core";
+import { IconUserSearch } from "@tabler/icons-react";
+
+export function V2_HomeView() {
+ return (
+ <>
+
+
+
+ {Array.from(new Array(2)).map((e, i) => (
+
+
+ {listMenuHomeBody.map((e, i) => (
+ {}}
+ >
+
+
+ {e.icon}
+
+
+ {e.name}
+
+
+
+ ))}
+
+
+ {/* Job View */}
+
+ {}}>
+
+
+ {menuHomeJob.icon}
+
+
+ {menuHomeJob.name}
+
+
+
+ {Array.from({ length: 2 }).map((e, i) => (
+
+
+
+
+
+
+
+ nama {i}
+
+
+ judulnya {i}
+
+
+
+
+ ))}
+
+
+
+
+ ))}
+
+ >
+ );
+}
diff --git a/src/app/zCoba/home/v2_view.tsx b/src/app/zCoba/home/v2_view.tsx
new file mode 100644
index 00000000..34b8933f
--- /dev/null
+++ b/src/app/zCoba/home/v2_view.tsx
@@ -0,0 +1,117 @@
+// app/page.tsx
+"use client";
+
+import {
+ Badge,
+ Box,
+ Button,
+ Card,
+ Group,
+ Image,
+ Paper,
+ Stack,
+ Text,
+ Title,
+} from "@mantine/core";
+import ClientLayout from "./v2_coba_tamplate";
+
+export default function ViewV2() {
+ return (
+
+
+
+ Selamat Datang
+
+
+
+ Aplikasi dengan layout yang dioptimalkan untuk tampilan mobile
+
+
+
+ {[...Array(5)].map((_, index) => (
+
+
+
+
+
+
+ Produk {index + 1}
+
+ Baru
+
+
+
+
+ Deskripsi produk yang singkat dan padat untuk tampilan mobile.
+ Fokus pada informasi penting saja.
+
+
+
+
+ ))}
+
+
+
+ {[...Array(5)].map((_, index) => (
+
+ Test
+
+ ))}
+
+
+ {[...Array(5)].map((_, index) => (
+
+ Test
+
+ ))}
+
+
+
+ Promo Spesial
+
+
+ Dapatkan diskon 20% untuk pembelian pertama
+
+
+
+
+
+ );
+}
diff --git a/src/app/zCoba/page.tsx b/src/app/zCoba/page.tsx
index f07fb56c..8c65e79c 100644
--- a/src/app/zCoba/page.tsx
+++ b/src/app/zCoba/page.tsx
@@ -1,18 +1,60 @@
-import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-import Coba_TestLoading from "@/app_modules/zCoba";
+"use client";
-export default async function Page() {
- await new Promise((a, b) => {
- setTimeout(a, 3000);
+import { MainColor } from "@/app_modules/_global/color";
+import {
+ Avatar,
+ Button,
+ Center,
+ FileButton,
+ Paper,
+ Stack,
+} from "@mantine/core";
+import { IconCamera } from "@tabler/icons-react";
+import { useState } from "react";
+import { DIRECTORY_ID } from "../../lib";
+
+export default function Page() {
+ const [data, setData] = useState({
+ name: "bagas",
+ hobi: [
+ {
+ id: "1",
+ name: "mancing",
+ },
+ {
+ id: "2",
+ name: "game",
+ },
+ ],
});
- const userLoginId = await funGetUserIdByToken();
-
return (
<>
- {/* */}
-
- {/* */}
+
+ {JSON.stringify(data, null, 2)}
+
+
+
>
);
}
diff --git a/src/app/zCoba/pdf/_view.tsx b/src/app/zCoba/pdf/_view.tsx
new file mode 100644
index 00000000..fc7378ef
--- /dev/null
+++ b/src/app/zCoba/pdf/_view.tsx
@@ -0,0 +1,46 @@
+"use client";
+
+import { Button } from "@mantine/core";
+
+interface DownloadButtonProps {
+ fileUrl: string;
+ fileName: string;
+}
+
+export default function Coba() {
+ const fileUrl =
+ "https://wibu-storage.wibudev.com/api/pdf-to-image?url=https://wibu-storage.wibudev.com/api/files/cm7liew81000t3y8ax1v6yo02";
+ const fileName = "example.pdf"; // Nama file yang akan diunduh
+
+ return (
+
+
Download File Example
+
+
+ );
+}
+
+export function DownloadButton({ fileUrl, fileName }: DownloadButtonProps) {
+ const handleDownloadFromAPI = async () => {
+ try {
+ const response = await fetch("https://wibu-storage.wibudev.com/api/files/cm7liew81000t3y8ax1v6yo02")
+ const blob = await response.blob(); // Konversi respons ke Blob
+ const url = window.URL.createObjectURL(blob); // Buat URL untuk Blob
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = "generated-file.pdf"; // Nama file yang akan diunduh
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ window.URL.revokeObjectURL(url); // Bersihkan URL
+ } catch (error) {
+ console.error("Error downloading file:", error);
+ }
+ };
+
+ return (
+
+ );
+}
diff --git a/src/app/zCoba/pdf/page.tsx b/src/app/zCoba/pdf/page.tsx
new file mode 100644
index 00000000..a645fa5d
--- /dev/null
+++ b/src/app/zCoba/pdf/page.tsx
@@ -0,0 +1,13 @@
+import Coba from "./_view";
+
+
+
+async function Page() {
+ return (
+ <>
+
+ >
+ );
+}
+
+export default Page;
diff --git a/src/app/zCoba/scroll/_comp/ui_scroll.tsx b/src/app/zCoba/scroll/_comp/ui_scroll.tsx
new file mode 100644
index 00000000..4d0651f7
--- /dev/null
+++ b/src/app/zCoba/scroll/_comp/ui_scroll.tsx
@@ -0,0 +1,79 @@
+/* eslint-disable react-hooks/exhaustive-deps */
+import React, { useState, useEffect } from "react";
+
+// Tipe untuk data item (sesuaikan sesuai API kamu)
+interface Item {
+ id: number;
+ name: string;
+}
+
+// Props komponen
+interface InfiniteScrollProps {
+ fetchFunction: (page: number) => Promise;
+ renderItem: (item: T) => React.ReactNode;
+ itemsPerPage?: number;
+ threshold?: number; // Jarak dari bawah halaman untuk memicu load
+}
+
+const InfiniteScroll = ({
+ fetchFunction,
+ renderItem,
+ itemsPerPage = 10,
+ threshold = 50,
+}: InfiniteScrollProps) => {
+ const [items, setItems] = useState([]);
+ const [hasMore, setHasMore] = useState(true);
+ const [page, setPage] = useState(1);
+
+ // Load data awal
+ useEffect(() => {
+ const loadInitialData = async () => {
+ const data = await fetchFunction(page);
+ if (data.length === 0) setHasMore(false);
+ setItems(data);
+ };
+
+ loadInitialData();
+ }, [fetchFunction, page]);
+
+ // Handle scroll event
+ useEffect(() => {
+ const handleScroll = () => {
+ const isBottom =
+ window.innerHeight + window.scrollY >=
+ document.body.offsetHeight - threshold;
+
+ if (isBottom && hasMore) {
+ loadMoreItems();
+ }
+ };
+
+ window.addEventListener("scroll", handleScroll);
+ return () => window.removeEventListener("scroll", handleScroll);
+ }, [hasMore, threshold]);
+
+ const loadMoreItems = async () => {
+ const nextPage = page + 1;
+ const newItems = await fetchFunction(nextPage);
+
+ if (newItems.length === 0) {
+ setHasMore(false);
+ }
+
+ setItems((prev) => [...prev, ...newItems]);
+ setPage(nextPage);
+ };
+
+ return (
+
+
+ {items.map((item, index) => (
+ - {renderItem(item)}
+ ))}
+
+ {!hasMore &&
🎉 Semua data telah dimuat.
}
+
+ );
+};
+
+export default InfiniteScroll;
diff --git a/src/app/zCoba/scroll/page.tsx b/src/app/zCoba/scroll/page.tsx
new file mode 100644
index 00000000..8adcf1d7
--- /dev/null
+++ b/src/app/zCoba/scroll/page.tsx
@@ -0,0 +1,46 @@
+"use client"
+
+import React, { useState } from "react";
+import InfiniteScroll from "./_comp/ui_scroll";
+import { apiGetMessageByRoomId } from "@/app_modules/colab/_lib/api_collaboration";
+import { ChatMessage } from "@/app/dev/(user)/colab/_comp/interface";
+
+// Definisikan tipe data
+interface User {
+ id: number;
+ name: string;
+ email: string;
+}
+
+
+
+// Komponen App
+function App() {
+ const [data, setData] = useState([]);
+ // Simulasi API call
+ const fetchUsers = async (page: number): Promise => {
+ const response = await apiGetMessageByRoomId({
+ id: "cmb5x31dt0001tl7y7vj26pfy",
+ });
+ setData(response.data);
+ return response.data;
+ };
+
+ return (
+
+
Infinite Scroll with TypeScript
+
+ fetchFunction={fetchUsers}
+ itemsPerPage={10}
+ threshold={100}
+ renderItem={(item) => (
+
+ {item.User?.Profile?.name} - {item.message}
+
+ )}
+ />
+
+ );
+}
+
+export default App;
diff --git a/src/app/zCoba/skeleton/page.tsx b/src/app/zCoba/skeleton/page.tsx
new file mode 100644
index 00000000..df2e7133
--- /dev/null
+++ b/src/app/zCoba/skeleton/page.tsx
@@ -0,0 +1,56 @@
+"use client";
+
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import {
+ UIGlobal_LayoutHeaderTamplate,
+ UIGlobal_LayoutTamplate,
+} from "@/app_modules/_global/ui";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Button, Center, Grid, Group, Skeleton, Stack } from "@mantine/core";
+import Link from "next/link";
+
+export default function Voting_ComponentSkeletonViewPuh() {
+ return (
+ <>
+ }
+ >
+
+
+
+
+
+
+
+
+
+ {/*
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ */}
+
+ {/*
+ {Array.from({ length: 4 }).map((_, i) => (
+
+ ))}
+
+
+ */}
+
+ >
+ );
+}
diff --git a/src/app/zCoba/test1/page.tsx b/src/app/zCoba/test1/page.tsx
deleted file mode 100644
index 7f7cfd74..00000000
--- a/src/app/zCoba/test1/page.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-"use client";
-import {
- gs_admin_ntf,
- gs_realtimeData,
- IRealtimeData,
-} from "@/app/lib/global_state";
-import { Button, Stack } from "@mantine/core";
-import { useShallowEffect } from "@mantine/hooks";
-import { useAtom } from "jotai";
-import { WibuRealtime } from "wibu-pkg";
-import { v4 } from "uuid";
-import { useState } from "react";
-const angka = 10;
-export default function Page() {
- const [dataRealtime, setDataRealtime] = useAtom(gs_realtimeData);
- const [adminNtf, setAdminNtf] = useAtom(gs_admin_ntf);
- const [notif, setNotif] = useState(angka);
-
- useShallowEffect(() => {
- if (adminNtf) {
- setNotif((e) => e + 1);
- }
- }, [adminNtf]);
-
- async function onSend() {
- const newData: IRealtimeData = {
- appId: v4(),
- status: "Publish",
- userId: "user1",
- pesan: "apa kabar",
- title: "coba",
- kategoriApp: "INVESTASI",
- };
-
- WibuRealtime.setData({
- type: "message",
- pushNotificationTo: "USER",
- dataMessage: newData,
- });
- }
-
- return (
-
- {notif}
-
-
- );
-}
diff --git a/src/app/zCoba/test2/page.tsx b/src/app/zCoba/test2/page.tsx
index c0fbf7ba..d010f19e 100644
--- a/src/app/zCoba/test2/page.tsx
+++ b/src/app/zCoba/test2/page.tsx
@@ -1,5 +1,5 @@
"use client";
-import { gs_realtimeData, IRealtimeData } from "@/app/lib/global_state";
+import { gs_realtimeData, IRealtimeData } from "@/lib/global_state";
import { Button, Stack } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { useAtom } from "jotai";
diff --git a/src/app/zCoba/text_editor/page.tsx b/src/app/zCoba/text_editor/page.tsx
new file mode 100644
index 00000000..76fc18ac
--- /dev/null
+++ b/src/app/zCoba/text_editor/page.tsx
@@ -0,0 +1,140 @@
+"use client";
+
+import { useEditor, EditorContent } from "@tiptap/react";
+import StarterKit from "@tiptap/starter-kit";
+import Image from "@tiptap/extension-image";
+import { useState } from "react";
+import {
+ Box,
+ Button,
+ Group,
+ Image as MantineImage,
+ Stack,
+ Text,
+} from "@mantine/core";
+import Underline from "@tiptap/extension-underline";
+import { MainColor } from "@/app_modules/_global/color";
+
+const listStiker = [
+ {
+ id: 2,
+ name: "stiker2",
+ url: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQN9AKmsBY4yqdn3GueJJEVPJbfmf853gDL4cN8uc9eqsCTiJ1fzhcpywzVP68NCJEA5NQ&usqp=CAU",
+ },
+ {
+ id: 3,
+ name: "stiker3",
+ url: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS2lkV3ZiQ8m-OELSui2JGVy80vnh1cyRUV7NrgFNluPVVs2HUAyCHwCMAKGe2s5jk2sn8&usqp=CAU",
+ },
+ {
+ id: 4,
+ name: "stiker4",
+ url: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQHy9ZdsPc6dHgVTl5yIGpRJ-KtpTIsXA2_kbfO1Oc-pv_f7CNKGxhO56RjKujE3xCyb9k&usqp=CAU",
+ },
+];
+
+export default function RichTextWithStickers() {
+ const [chat, setChat] = useState([]);
+
+ const editor = useEditor({
+ extensions: [
+ StarterKit, // Sudah include Bold, Italic, dll
+ Underline, // Tambahan untuk underline
+ Image,
+ ],
+ content: "",
+ });
+
+ const insertSticker = (url: string) => {
+ editor?.chain().focus().setImage({ src: url }).run();
+ };
+
+ return (
+
+ Tiptap Editor dengan Stiker Inline
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {listStiker.map((item) => (
+ insertSticker(item.url)}
+ style={{
+ border: "none",
+ background: "transparent",
+ cursor: "pointer",
+ }}
+ >
+
+
+ ))}
+
+
+ {/*
+ {chat.map((item, index) => (
+
+ ))}
+ */}
+
+ );
+}
diff --git a/src/app/zCoba/text_editor2/page.tsx b/src/app/zCoba/text_editor2/page.tsx
new file mode 100644
index 00000000..580423c3
--- /dev/null
+++ b/src/app/zCoba/text_editor2/page.tsx
@@ -0,0 +1,210 @@
+"use client";
+import React, { useState, useEffect } from "react";
+import {
+ Box,
+ Button,
+ Group,
+ Image,
+ Paper,
+ ScrollArea,
+ SimpleGrid,
+ Stack,
+ Text,
+ Tooltip,
+ Modal,
+} from "@mantine/core";
+import { useDisclosure } from "@mantine/hooks";
+import dynamic from "next/dynamic";
+import { MainColor } from "@/app_modules/_global/color";
+import { listStiker } from "@/app_modules/_global/lib/stiker";
+
+// Dynamic import ReactQuill dengan SSR disabled
+const ReactQuill = dynamic(
+ async () => {
+ const { default: RQ } = await import("react-quill");
+ // Tidak perlu import CSS dengan import statement
+ return function comp({ forwardedRef, ...props }: any) {
+ return ;
+ };
+ },
+ { ssr: false, loading: () => Loading Editor...
}
+);
+
+
+type ChatItem = {
+ content: string; // HTML content including text and stickers
+};
+
+export default function Page() {
+ const [editorContent, setEditorContent] = useState("");
+ const [chat, setChat] = useState([]);
+ const [opened, { open, close }] = useDisclosure(false);
+ const quillRef = React.useRef(null);
+ const [quillLoaded, setQuillLoaded] = useState(false);
+
+ // Load CSS on client-side only
+ useEffect(() => {
+ // Add Quill CSS via tag
+ const link = document.createElement("link");
+ link.href = "https://cdn.quilljs.com/1.3.6/quill.snow.css";
+ link.rel = "stylesheet";
+ document.head.appendChild(link);
+
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .ql-editor img {
+ max-width: 100px !important;
+ max-height: 100px !important;
+ }
+ .chat-content img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ `;
+ document.head.appendChild(style);
+
+ setQuillLoaded(true);
+
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(link);
+ document.head.removeChild(style);
+ };
+ }, []);
+
+ // Custom toolbar options for ReactQuill
+ const modules = {
+ toolbar: [
+ [{ header: [1, 2, false] }],
+ ["bold", "italic", "underline", "strike", "blockquote"],
+ [{ list: "ordered" }, { list: "bullet" }],
+ ["link", "image"],
+ ["clean"],
+ ],
+ };
+
+ const formats = [
+ "header",
+ "bold",
+ "italic",
+ "underline",
+ "strike",
+ "blockquote",
+ "list",
+ "bullet",
+ "link",
+ "image",
+ ];
+
+ const insertSticker = (stickerUrl: string) => {
+ if (!quillRef.current) return;
+
+ const quill = quillRef.current.getEditor();
+ const range = quill.getSelection(true);
+
+ // Custom image insertion with size
+ // Use custom blot or HTML string with size attributes
+ const stickerHtml = `
`;
+
+ // Insert HTML at cursor position
+ quill.clipboard.dangerouslyPasteHTML(range.index, stickerHtml);
+
+ // Move cursor after inserted sticker
+ quill.setSelection(range.index + 1, 0);
+
+ // Focus back on editor
+ quill.focus();
+
+ // Close sticker modal
+ close();
+ };
+
+ // Function to send message
+ const sendMessage = () => {
+ if (editorContent.trim() !== "") {
+ setChat((prev) => [...prev, { content: editorContent }]);
+ setEditorContent(""); // Clear after sending
+ }
+ };
+
+ return (
+
+
+
+
+
+ {chat.map((item, index) => (
+
+
+
+ ))}
+
+
+
+
+
+ Chat Preview Data:
+
+
+
+ {JSON.stringify(chat, null, 2)}
+
+
+
+
+
+
+
+ {quillLoaded && (
+
+ )}
+
+
+
+
+
+
+
+
+
+ {/* Sticker Modal */}
+
+
+ {listStiker.map((item) => (
+
+
+ insertSticker(item.url)}
+ />
+
+
+ ))}
+
+
+
+ );
+}
diff --git a/src/app/zCoba/upload/page.tsx b/src/app/zCoba/upload/page.tsx
new file mode 100644
index 00000000..34ee4314
--- /dev/null
+++ b/src/app/zCoba/upload/page.tsx
@@ -0,0 +1,133 @@
+"use client";
+
+import { MainColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_BoxUploadImage } from "@/app_modules/_global/component";
+import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
+import {
+ UIGlobal_LayoutHeaderTamplate,
+ UIGlobal_LayoutTamplate,
+} from "@/app_modules/_global/ui";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ AspectRatio,
+ Button,
+ Center,
+ FileButton,
+ Image,
+ Stack,
+} from "@mantine/core";
+import { IconImageInPicture, IconUpload } from "@tabler/icons-react";
+import { useState } from "react";
+
+export default function Page() {
+ return (
+ <>
+ }
+ >
+
+
+ >
+ );
+}
+
+function Upload() {
+ const [file, setFile] = useState(null);
+ const [image, setImage] = useState(null);
+ const [isLoading, setLoading] = useState(false);
+
+ async function onUpload() {
+ if (!file) return alert("File Kosong");
+ try {
+ setLoading(true);
+ const formData = new FormData();
+ formData.append("file", file as File);
+
+ const uploadPhoto = await funGlobal_UploadToStorage({
+ file: file,
+ dirId: "cm5ohsepe002bq4nlxeejhg7q",
+ });
+
+ if (uploadPhoto.success) {
+ setLoading(false);
+ alert("berhasil upload");
+ console.log("uploadPhoto", uploadPhoto);
+ } else {
+ setLoading(false);
+ console.log("gagal upload", uploadPhoto);
+ }
+ } catch (error) {
+ console.error("Error upload img:", error);
+ }
+ }
+
+ return (
+ <>
+
+
+ {image ? (
+
+
+
+ ) : (
+
+
+
+ )}
+
+
+
+ {
+ try {
+ const buffer = URL.createObjectURL(
+ new Blob([new Uint8Array(await files.arrayBuffer())])
+ );
+
+ // if (files.size > MAX_SIZE) {
+ // ComponentGlobal_NotifikasiPeringatan(
+ // PemberitahuanMaksimalFile
+ // );
+ // return;
+ // } else {
+
+ // }
+
+ console.log("ini buffer", buffer);
+
+ setFile(files);
+ setImage(buffer);
+ } catch (error) {
+ clientLogger.error("Upload error:", error);
+ }
+ }}
+ accept="image/png,image/jpeg"
+ >
+ {(props) => (
+ }
+ bg={MainColor.yellow}
+ color="yellow"
+ c={"black"}
+ >
+ Upload
+
+ )}
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app/zz-makuro/LoadDataContoh.tsx b/src/app/zz-makuro/LoadDataContoh.tsx
new file mode 100644
index 00000000..adf8a237
--- /dev/null
+++ b/src/app/zz-makuro/LoadDataContoh.tsx
@@ -0,0 +1,30 @@
+"use client";
+import { Stack } from "@mantine/core";
+import useSwr from "swr";
+
+const fether = (url: string) =>
+ fetch("https://jsonplaceholder.typicode.com" + url, {
+ cache: "force-cache",
+ next: {
+ revalidate: 60,
+ },
+ }).then((res) => res.json());
+
+export default function LoadDataContoh() {
+ const { data, isLoading, error, mutate, isValidating } = useSwr(
+ "/posts/1",
+ fether,
+ {
+ revalidateOnFocus: false,
+ revalidateOnReconnect: false,
+ refreshInterval: 1000,
+ }
+ );
+ return (
+
+ {isLoading && Loading...
}
+ LoadDataContoh
+ {JSON.stringify(data, null, 2)}
+
+ );
+}
diff --git a/src/app/zz-makuro/get-data-example.ts b/src/app/zz-makuro/get-data-example.ts
new file mode 100644
index 00000000..d52d9586
--- /dev/null
+++ b/src/app/zz-makuro/get-data-example.ts
@@ -0,0 +1,9 @@
+async function getDataExample() {
+ const res = await fetch("https://jsonplaceholder.typicode.com/posts", {
+ next: {
+ revalidate: 60,
+ },
+ });
+
+ return res.json();
+}
diff --git a/src/app/zz-makuro/page.tsx b/src/app/zz-makuro/page.tsx
index 665c3a1f..a1df80ba 100644
--- a/src/app/zz-makuro/page.tsx
+++ b/src/app/zz-makuro/page.tsx
@@ -1,14 +1,51 @@
-"use client";
-import { useHookstate } from "@hookstate/core";
-import { Button, Stack } from "@mantine/core";
+import { Suspense } from "react";
+import LoadDataContoh from "./LoadDataContoh";
+const listMenu = [
+ {
+ name: "Dashboard",
+ url: "/dashboard",
+ icon: "dashboard",
+ },
+ {
+ name: "Event",
+ url: "/event",
+ icon: "event",
+ },
+ {
+ name: "Donasi",
+ url: "/donasi",
+ icon: "donasi",
+ },
+];
-export default function Page() {
+const fether = async (url: string) =>
+ fetch("https://jsonplaceholder.typicode.com" + url, {
+ next: {
+ revalidate: 2,
+ },
+ }).then(async (res) => {
+ const data = await res.json();
+ // console.log(data);
+ return data;
+ });
+export default async function Page() {
+ const data = await fether("/posts/1");
+
return (
-
-
-
-
+
+ {listMenu.map((item) => {
+ return (
+
+ );
+ })}
+ {/*
*/}
+
Loading... }>
+ {JSON.stringify(data, null, 2)}
+
+
);
}
diff --git a/src/app_modules/_global/button/comp_button_upload_photo.tsx b/src/app_modules/_global/button/comp_button_upload_photo.tsx
index 642feddc..59103c6c 100644
--- a/src/app_modules/_global/button/comp_button_upload_photo.tsx
+++ b/src/app_modules/_global/button/comp_button_upload_photo.tsx
@@ -1,42 +1,66 @@
"use client";
+import { clientLogger } from "@/util/clientLogger";
import { Button, FileButton } from "@mantine/core";
-import { IconCamera } from "@tabler/icons-react";
-import { MainColor } from "../color";
+import { IconUpload } from "@tabler/icons-react";
+import { useState } from "react";
+import { AccentColor, MainColor } from "../color";
+import { ComponentGlobal_NotifikasiPeringatan } from "../notif_global";
export function ComponentGlobal_ButtonUploadFileImage({
onSetFile,
onSetImage,
+ text,
+ icon,
+ accept,
}: {
- onSetFile: File | any;
- onSetImage: any | null;
+ onSetFile: File | null | any;
+ onSetImage?: any | null;
+ text?: string;
+ icon?: string | any
+ accept?: string;
}) {
+ const [isLoading, setIsLoading] = useState(false);
+
return (
{
try {
+ setIsLoading(true);
const buffer = URL.createObjectURL(
new Blob([new Uint8Array(await files.arrayBuffer())])
);
+ if (files.size > 100 * 1024 * 1024) {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("File terlalu besar");
+ return
+ }
+
onSetFile(files);
onSetImage(buffer);
} catch (error) {
- console.log(error);
+ clientLogger.error("Upload image error:", error);
+ } finally {
+ setIsLoading(false);
}
}}
- accept="image/png,image/jpeg"
+ accept={accept ? accept : "image/png,image/png,image/jpeg,image/gif"}
>
{(props) => (
}
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
+ style={{
+ backgroundColor: MainColor.yellow,
+ border: `1px solid ${AccentColor.yellow}`,
+ }}
+ leftIcon={icon ? icon : }
+ c={MainColor.darkblue}
>
- Upload
+ {text ? text : "Upload"}
)}
diff --git a/src/app_modules/_global/color/color_pallet.ts b/src/app_modules/_global/color/color_pallet.ts
index 3f2efc9d..64f15f64 100644
--- a/src/app_modules/_global/color/color_pallet.ts
+++ b/src/app_modules/_global/color/color_pallet.ts
@@ -1,14 +1,44 @@
export const MainColor = {
black: "#202020",
darkblue: "#001D3D",
- yellow: "#FFC300",
+ soft_darkblue: "#0e3763",
+ yellow: "#E1B525",
+ white: "#D4D0D0",
+ red: "#FF4B4C",
+ orange: "#FF7043",
+ green: "#4CAF4F",
+ login: "#EDEBEBFF",
};
export const AccentColor = {
- blackgray: "#333533",
+ blackgray: "#333533FF",
darkblue: "#002E59",
blue: "#00447D",
softblue: "#007CBA",
skyblue: "#00BFFF",
- yellow: "#FFD60A",
+ yellow: "#F8A824",
+ white: "#FEFFFE"
+
};
+
+export const AdminColor = {
+ yellow: "#FFEB99",
+ green: "#A7DCA5",
+ orange: "#F7C69B",
+ red: "#F4A8A8",
+ bgAdmin: "#182c47",
+ white: "#D6D9DCFF",
+ dividerWhite: "#D6D9DC2E",
+ softBlue: "#163C64FF"
+
+}
+//yellow: "#FFC300"
+//yellow: "#FFD60A"
+// white: "#FEFFFE"
+
+// Warna Terang: #80a7c4
+// Warna Sedang: #40738d
+// Warna Asli: #002e59
+// Warna Lebih Gelap: #001f3b
+// Warna Tergelap: #001323
+
diff --git a/src/app_modules/_global/component/box_information.tsx b/src/app_modules/_global/component/box_information.tsx
index 5f3f0643..618789f4 100644
--- a/src/app_modules/_global/component/box_information.tsx
+++ b/src/app_modules/_global/component/box_information.tsx
@@ -1,5 +1,7 @@
-import { Center, Grid, Group, Paper, Stack, Text, Title } from "@mantine/core";
-import { AccentColor, MainColor } from "../color/color_pallet";
+import { Grid, Stack, Text } from "@mantine/core";
+import { IconInfoCircle } from "@tabler/icons-react";
+import { MainColor } from "../color/color_pallet";
+import { ComponentGlobal_CardStyles } from "./comp_card_box_and_background";
export default function ComponentGlobal_BoxInformation({
informasi,
@@ -12,15 +14,7 @@ export default function ComponentGlobal_BoxInformation({
}) {
return (
<>
-
+
{isReport ? (
* Report
-
+
{informasi}
) : (
-
-
- *{" "}
-
+
+
+
+
+
+
{informasi}
-
-
+
+
)}
-
+
>
);
-
-
}
diff --git a/src/app_modules/_global/component/button_create.tsx b/src/app_modules/_global/component/button_create.tsx
index 892cc258..874f25c5 100644
--- a/src/app_modules/_global/component/button_create.tsx
+++ b/src/app_modules/_global/component/button_create.tsx
@@ -1,50 +1,70 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
-import { ActionIcon, Loader } from "@mantine/core";
+import { ActionIcon, createStyles, Loader } from "@mantine/core";
import { IconPencilPlus } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
+const useStyles = createStyles((theme) => ({
+ button: {
+ position: "fixed", // Menggunakan fixed untuk memastikan posisi tetap
+ zIndex: 10, // Pastikan z-index tinggi
+ bottom: "150px", // Jarak dari bawah
+ right: "20px", // Jarak dari kanan
+ transition: "0.5s",
+ border: `1px solid ${AccentColor.skyblue}`,
+ backgroundColor: AccentColor.softblue,
+ padding: 3,
+ // maxWidth: "500px", // Batasi lebar maksimum
+ // margin: "0 auto", // Pusatkan layout
+ borderRadius: "50%",
+
+ // Media query untuk desktop
+ [`@media (min-width: 769px)`]: {
+ right: "calc(50% - 250px + 20px)", // Sesuaikan dengan lebar container (500px)
+ },
+ [":hover"]: {
+ backgroundColor: AccentColor.blue,
+ },
+ },
+}));
+
export default function ComponentGlobal_CreateButton({
path,
}: {
path: string;
}) {
const router = useRouter();
+ const { classes, cx } = useStyles();
const [isLoading, setLoading] = useState(false);
return (
<>
{
- setLoading(true);
router.push(path);
}}
>
- {isLoading ? (
-
- ) : (
-
- )}
+
>
);
diff --git a/src/app_modules/_global/component/comp_avatar_and_username.tsx b/src/app_modules/_global/component/comp_avatar_and_username.tsx
index 9269be4a..5f0b7f1d 100644
--- a/src/app_modules/_global/component/comp_avatar_and_username.tsx
+++ b/src/app_modules/_global/component/comp_avatar_and_username.tsx
@@ -1,14 +1,15 @@
"use client";
+import { apiGetOneProfileById } from "@/app_modules/katalog/profile/lib/api_fetch_profile";
+import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
import { ActionIcon, Avatar, Grid, Stack, Text } from "@mantine/core";
import { Prisma } from "@prisma/client";
import { useRouter } from "next/navigation";
import React, { useState } from "react";
+import { MainColor } from "../color";
+import { ComponentGlobal_NotifikasiPeringatan } from "../notif_global";
import { ComponentGlobal_LoaderAvatar } from "./comp_load_avatar";
import ComponentGlobal_Loader from "./loader";
-import { funGlobal_CheckProfile } from "../fun/get";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
-import { ComponentGlobal_NotifikasiPeringatan } from "../notif_global";
type IFontSize = "xs" | "sm" | "md" | "lg" | "xl";
export function ComponentGlobal_AvatarAndUsername({
@@ -26,13 +27,17 @@ export function ComponentGlobal_AvatarAndUsername({
const [visible, setVisible] = useState(false);
async function onCheckProfile() {
- const res = await funGlobal_CheckProfile({ profileId: profile.id as any });
+ try {
+ const res = await apiGetOneProfileById({ id: profile.id as any });
- if (res !== null) {
- setVisible(true);
- router.push(RouterProfile.katalog({ id: profile.id as any }));
- } else {
- ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
+ if (res && res.success) {
+ setVisible(true);
+ router.push(RouterProfile.katalog({ id: profile.id as any }));
+ } else {
+ ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
+ }
+ } catch (error) {
+ console.log(error);
}
}
@@ -51,7 +56,7 @@ export function ComponentGlobal_AvatarAndUsername({
) : (
)}
@@ -60,8 +65,9 @@ export function ComponentGlobal_AvatarAndUsername({
onCheckProfile()}
>
diff --git a/src/app_modules/_global/component/comp_box_upload_image.tsx b/src/app_modules/_global/component/comp_box_upload_image.tsx
index 97b05beb..1deef182 100644
--- a/src/app_modules/_global/component/comp_box_upload_image.tsx
+++ b/src/app_modules/_global/component/comp_box_upload_image.tsx
@@ -1,5 +1,6 @@
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
import { Box } from "@mantine/core";
+import { MainColor } from "../color";
/**
*
@@ -28,6 +29,7 @@ export function ComponentGlobal_BoxUploadImage({
height: "100%",
borderStyle: "dashed",
borderRadius: "5px",
+ borderColor: MainColor.white,
}}
>
{children}
diff --git a/src/app_modules/_global/component/comp_card_box_and_background.tsx b/src/app_modules/_global/component/comp_card_box_and_background.tsx
index c3064edd..b7f26570 100644
--- a/src/app_modules/_global/component/comp_card_box_and_background.tsx
+++ b/src/app_modules/_global/component/comp_card_box_and_background.tsx
@@ -1,7 +1,21 @@
-import { AccentColor } from "@/app_modules/_global/color";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { Card } from "@mantine/core";
import React from "react";
+/**
+ * ComponentGlobal_CardStyles
+ *
+ * A React component that renders a customizable card element.
+ *
+ * Props:
+ * - children (React.ReactNode): Content to be displayed inside the card.
+ * - backgroundColor (string, optional): Background color of the card. Defaults to AccentColor.darkblue.
+ * - border (string, optional): Border color of the card. Defaults to AccentColor.blue.
+ * - marginBottom (string | number, optional): Margin below the card. Defaults to "15px".
+ * - height (string | number, optional): Height of the card. Defaults to "auto".
+ * - color (string, optional): Text color inside the card. Defaults to MainColor.white.
+ * - onClickHandler (React.MouseEventHandler, optional): Function to handle click events on the card.
+ */
export function ComponentGlobal_CardStyles({
children,
backgroundColor,
@@ -10,6 +24,7 @@ export function ComponentGlobal_CardStyles({
height,
color,
onClickHandler,
+ style,
}: {
children: React.ReactNode;
backgroundColor?: string;
@@ -18,11 +33,13 @@ export function ComponentGlobal_CardStyles({
height?: string | number;
color?: string;
onClickHandler?: React.MouseEventHandler;
+ style?: React.CSSProperties;
}) {
return (
<>
(null);
- const url = APIs.GET({ fileId: fileId, size: imageSize });
+ const url = APIs.GET({ fileId: fileId, size: imageSize ? imageSize : "400" });
useShallowEffect(() => {
onLoadImage();
diff --git a/src/app_modules/_global/component/comp_load_image.tsx b/src/app_modules/_global/component/comp_load_image.tsx
index 03bcbcdb..97f8084c 100644
--- a/src/app_modules/_global/component/comp_load_image.tsx
+++ b/src/app_modules/_global/component/comp_load_image.tsx
@@ -1,30 +1,32 @@
"use client";
-import { APIs } from "@/app/lib";
-import { pathAssetImage } from "@/app/lib/path_asset_image";
-import { RouterImagePreview } from "@/app/lib/router_hipmi/router_image_preview";
-import { Center, Image, Skeleton } from "@mantine/core";
+import { APIs } from "@/lib";
+import { pathAssetImage } from "@/lib/path_asset_image";
+import { RouterImagePreview } from "@/lib/router_hipmi/router_image_preview";
+import { Center, Image, MantineNumberSize, Skeleton } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation";
import { useState } from "react";
-type IRadius = "xs" | "sm" | "md" | "lg" | "xl";
+type IRadius = MantineNumberSize | undefined
export function ComponentGlobal_LoadImage({
fileId,
maw,
h,
radius,
+ style,
}: {
fileId: string;
maw?: number | string;
h?: number;
radius?: IRadius;
+ style?: React.CSSProperties;
}) {
const router = useRouter();
const [isImage, setIsImage] = useState(null);
const [isLoading, setIsLoading] = useState(false);
- const url = APIs.GET({ fileId: fileId });
+ const url = APIs.GET({ fileId: fileId, size: "500" });
useShallowEffect(() => {
onLoadImage();
@@ -44,7 +46,7 @@ export function ComponentGlobal_LoadImage({
if (isImage === null)
return (
-
+
@@ -63,6 +65,9 @@ export function ComponentGlobal_LoadImage({
<>
{
setIsLoading(true);
router.push(RouterImagePreview.main({ id: fileId }), {
diff --git a/src/app_modules/_global/component/comp_load_image_custom.tsx b/src/app_modules/_global/component/comp_load_image_custom.tsx
index 9cfd3b73..8392089b 100644
--- a/src/app_modules/_global/component/comp_load_image_custom.tsx
+++ b/src/app_modules/_global/component/comp_load_image_custom.tsx
@@ -1,7 +1,7 @@
"use client";
-import { APIs } from "@/app/lib";
-import { pathAssetImage } from "@/app/lib/path_asset_image";
+import { APIs } from "@/lib";
+import { pathAssetImage } from "@/lib/path_asset_image";
import { Center, Image, Skeleton } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation";
@@ -15,7 +15,7 @@ export function ComponentGlobal_LoadImageCustom({
height: number;
}) {
const [isImage, setIsImage] = useState(null);
- const url = APIs.GET({ fileId: fileId });
+ const url = APIs.GET({ fileId: fileId, size: "500" });
useShallowEffect(() => {
onLoadImage();
diff --git a/src/app_modules/_global/component/comp_load_image_landscape.tsx b/src/app_modules/_global/component/comp_load_image_landscape.tsx
index 0fc435b3..61f5bb60 100644
--- a/src/app_modules/_global/component/comp_load_image_landscape.tsx
+++ b/src/app_modules/_global/component/comp_load_image_landscape.tsx
@@ -1,12 +1,14 @@
"use client";
-import { APIs } from "@/app/lib";
-import { pathAssetImage } from "@/app/lib/path_asset_image";
-import { RouterImagePreview } from "@/app/lib";
-import { Center, Image, Skeleton } from "@mantine/core";
+import { APIs } from "@/lib";
+import { pathAssetImage } from "@/lib/path_asset_image";
+import { RouterImagePreview } from "@/lib";
+import { Center, Image } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { MainColor } from "../color";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
export function ComponentGlobal_LoadImageLandscape({
fileId,
@@ -16,7 +18,7 @@ export function ComponentGlobal_LoadImageLandscape({
const router = useRouter();
const [isImage, setIsImage] = useState(null);
const [isLoading, setLoading] = useState(false);
- const url = APIs.GET({ fileId: fileId });
+ const url = APIs.GET({ fileId: fileId, size: "500" });
useShallowEffect(() => {
onLoadImage();
@@ -34,12 +36,12 @@ export function ComponentGlobal_LoadImageLandscape({
}
}
- if (isImage === null) return ;
+ if (isImage === null) return ;
if (!isImage)
return (
<>
-
+
(null);
const [isLoading, setIsLoading] = useState(false);
- const url = APIs.GET({ fileId: fileId });
+ const url = APIs.GET({ fileId: fileId , size: "500" });
useShallowEffect(() => {
onLoadImage();
diff --git a/src/app_modules/_global/component/comp_tampilan_angka_ratusan.tsx b/src/app_modules/_global/component/comp_tampilan_angka_ratusan.tsx
index aa7b2565..ccf3c540 100644
--- a/src/app_modules/_global/component/comp_tampilan_angka_ratusan.tsx
+++ b/src/app_modules/_global/component/comp_tampilan_angka_ratusan.tsx
@@ -1,4 +1,5 @@
import { Group, Text } from "@mantine/core";
+import { MainColor } from "../color";
export default function ComponentGlobal_TampilanAngkaRatusan({
nominal,
@@ -32,7 +33,7 @@ export default function ComponentGlobal_TampilanAngkaRatusan({
fw={fontWeight ? fontWeight : "bold"}
fz={fontSize ? fontSize : "md"}
style={{
- color: color ? color : "white",
+ color: color ? color : MainColor.white,
}}
>
{new Intl.NumberFormat("id-ID", { maximumFractionDigits: 10 }).format(
@@ -43,6 +44,9 @@ export default function ComponentGlobal_TampilanAngkaRatusan({
{textAfter}
diff --git a/src/app_modules/_global/component/comp_tampilan_rupiah.tsx b/src/app_modules/_global/component/comp_tampilan_rupiah.tsx
index 9271882f..8c617cc0 100644
--- a/src/app_modules/_global/component/comp_tampilan_rupiah.tsx
+++ b/src/app_modules/_global/component/comp_tampilan_rupiah.tsx
@@ -1,4 +1,5 @@
-import { Text } from "@mantine/core";
+import { MantineStyleSystemProps, SystemProp, Text } from "@mantine/core";
+import { MainColor } from "../color";
export default function ComponentGlobal_TampilanRupiah({
nominal,
@@ -14,10 +15,10 @@ export default function ComponentGlobal_TampilanRupiah({
return (
<>
Rp.{" "}
diff --git a/src/app_modules/_global/component/input_countdown.tsx b/src/app_modules/_global/component/input_countdown.tsx
index 7aaa444b..4c06080b 100644
--- a/src/app_modules/_global/component/input_countdown.tsx
+++ b/src/app_modules/_global/component/input_countdown.tsx
@@ -12,9 +12,14 @@ export default function ComponentGlobal_InputCountDown({
}) {
return (
<>
-
- {maxInput - lengthInput < 0 ? 0 : maxInput - lengthInput} /{" "}
-
+
+ {maxInput - lengthInput} /
+
{maxInput}
diff --git a/src/app_modules/_global/component/new/comp_V3_grid_detail_data.tsx b/src/app_modules/_global/component/new/comp_V3_grid_detail_data.tsx
new file mode 100644
index 00000000..3eb6bfc9
--- /dev/null
+++ b/src/app_modules/_global/component/new/comp_V3_grid_detail_data.tsx
@@ -0,0 +1,29 @@
+import { MainColor } from "@/app_modules/_global/color";
+import { Grid, Paper, Text } from "@mantine/core";
+
+export function Component_V3_GridDetailData({
+ item,
+}: {
+ item: Record;
+}) {
+ return (
+ <>
+
+
+
+ {item.title || item.label}
+
+
+
+ {item.value}
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/_global/component/new/comp_V3_label_text_input.tsx b/src/app_modules/_global/component/new/comp_V3_label_text_input.tsx
new file mode 100644
index 00000000..fe29952e
--- /dev/null
+++ b/src/app_modules/_global/component/new/comp_V3_label_text_input.tsx
@@ -0,0 +1,19 @@
+import { Text } from "@mantine/core";
+import { MainColor } from "../../color";
+
+export default function Component_V3_Label_TextInput({
+ text,
+}: {
+ text: string;
+}) {
+ return (
+ <>
+
+ {text}
+
+ *
+
+
+ >
+ );
+}
diff --git a/src/app_modules/_global/component/new/comp_V3_moment_date_and_time.tsx b/src/app_modules/_global/component/new/comp_V3_moment_date_and_time.tsx
new file mode 100644
index 00000000..b2b04826
--- /dev/null
+++ b/src/app_modules/_global/component/new/comp_V3_moment_date_and_time.tsx
@@ -0,0 +1,26 @@
+import { Text } from "@mantine/core";
+import moment from "moment";
+import "moment/locale/id";
+import { MainColor } from "../../color/color_pallet";
+
+export const Component_V3_MomentDateAndTime = ({
+ dateTime,
+ color,
+}: {
+ dateTime: Date | string | undefined
+ color?: string;
+}) => {
+ return (
+ <>
+
+ {dateTime
+ ? moment(
+ dateTime.toLocaleString("id-ID", {
+ dateStyle: "full",
+ })
+ ).format("dddd, DD MMMM YYYY, LT")
+ : "-"}
+
+ >
+ );
+};
diff --git a/src/app_modules/_global/component/new/comp_V3_set_html_with_stiker.css b/src/app_modules/_global/component/new/comp_V3_set_html_with_stiker.css
new file mode 100644
index 00000000..d5be43c0
--- /dev/null
+++ b/src/app_modules/_global/component/new/comp_V3_set_html_with_stiker.css
@@ -0,0 +1,4 @@
+.sticker-content .chat-content img {
+ max-width: 70px;
+ max-height: 70px;
+}
diff --git a/src/app_modules/_global/component/new/comp_V3_set_html_with_stiker.tsx b/src/app_modules/_global/component/new/comp_V3_set_html_with_stiker.tsx
new file mode 100644
index 00000000..fea78a19
--- /dev/null
+++ b/src/app_modules/_global/component/new/comp_V3_set_html_with_stiker.tsx
@@ -0,0 +1,53 @@
+import { MainColor } from "../../color";
+
+export function Comp_V3_SetInnerHTMLWithStiker({
+ props,
+ className,
+ color,
+ style,
+}: {
+ props: string | undefined;
+ className?: string;
+ color?: string;
+ style?: React.CSSProperties;
+}) {
+ const baseStyle: React.CSSProperties = {
+ color: color ?? MainColor.white,
+ };
+
+ return (
+ <>
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/_global/component/new/comp_V3_text_editor.tsx b/src/app_modules/_global/component/new/comp_V3_text_editor.tsx
new file mode 100644
index 00000000..52349b66
--- /dev/null
+++ b/src/app_modules/_global/component/new/comp_V3_text_editor.tsx
@@ -0,0 +1,64 @@
+import { useState } from "react";
+import "react-quill/dist/quill.snow.css";
+import dynamic from "next/dynamic";
+import { useShallowEffect } from "@mantine/hooks";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Paper, ScrollArea } from "@mantine/core";
+import { MainColor } from "../../color";
+import { maxInputLength } from "../../lib/maximal_setting";
+const ReactQuill = dynamic(() => import("react-quill"), { ssr: false });
+
+
+export function Component_V3_TextEditor({
+ data,
+ onSetData,
+}: {
+ data: string;
+ onSetData: (value: string) => void;
+}) {
+ const [isReady, setIsReady] = useState(false);
+
+ useShallowEffect(() => {
+ setIsReady(true); // Set ready on client-side mount
+ }, []);
+
+ const handleChange = (input: string) => {
+ const text = input.replace(/<[^>]+>/g, "").trim(); // Remove HTML tags and trim
+ // if (text.length <= maxInputLength) {
+ // }
+ onSetData(input);
+ // Input diabaikan jika panjang > maxLength
+ };
+
+ return (
+ <>
+ {isReady ? (
+
+
+
+
+
+ ) : (
+
+ )}
+ >
+ );
+}
diff --git a/src/app_modules/_global/component/new/comp_V3_text_editor_stiker.tsx b/src/app_modules/_global/component/new/comp_V3_text_editor_stiker.tsx
new file mode 100644
index 00000000..e0affdfc
--- /dev/null
+++ b/src/app_modules/_global/component/new/comp_V3_text_editor_stiker.tsx
@@ -0,0 +1,284 @@
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import {
+ ActionIcon,
+ Box,
+ Button,
+ Group,
+ Image,
+ Paper,
+ ScrollArea,
+ SimpleGrid,
+ Stack,
+ Text,
+ Tooltip,
+} from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import React, { useState } from "react";
+import dynamic from "next/dynamic";
+import { MainColor } from "../../color";
+import { maxInputLength } from "../../lib/maximal_setting";
+import ComponentGlobal_InputCountDown from "../input_countdown";
+import { funReplaceHtml } from "../../fun/fun_replace_html";
+import { forum_funCreate } from "@/app_modules/forum/fun/create/fun_create";
+import {
+ ComponentGlobal_NotifikasiBerhasil,
+ ComponentGlobal_NotifikasiGagal,
+} from "../../notif_global";
+import { useRouter } from "next/navigation";
+import { IconMoodSmileFilled } from "@tabler/icons-react";
+import { listStiker } from "../../lib/stiker";
+import { UIGlobal_Modal } from "../../ui";
+
+const ReactQuill = dynamic(
+ async () => {
+ const { default: RQ } = await import("react-quill");
+ // Tidak perlu import CSS dengan import statement
+ return function comp({ forwardedRef, ...props }: any) {
+ return ;
+ };
+ },
+ {
+ ssr: false,
+ loading: () => (
+
+ Ketik pesan di sini atau tambahkan stiker...
+
+ ),
+ }
+);
+
+export function Component_V3_TextEditorWithStiker({
+ data,
+ onSetData,
+ onSetLengthData,
+}: {
+ data: string;
+ onSetData: (value: string) => void;
+ onSetLengthData: (value: number) => void;
+}) {
+ const router = useRouter();
+ const [editorContent, setEditorContent] = useState("");
+ const [opened, { open, close }] = useDisclosure(false);
+ const quillRef = React.useRef(null);
+ const [quillLoaded, setQuillLoaded] = useState(false);
+ const [isReady, setIsReady] = useState(false);
+
+ useShallowEffect(() => {
+ setIsReady(true); // Set ready on client-side mount
+ }, []);
+
+ useShallowEffect(() => {
+ setQuillLoaded(true); // Set ready on client-side mount
+ }, []);
+
+ const handleChange = (input: string) => {
+ const text = input.replace(/<[^>]+>/g, "").trim(); // Remove HTML tags and trim
+ // if (text.length <= maxInputLength) {
+ // }
+ onSetData(input);
+ onSetLengthData(text.length);
+ // Input diabaikan jika panjang > maxLength
+ };
+
+ useShallowEffect(() => {
+ // Add Quill CSS via tag
+ const link = document.createElement("link");
+ link.href = "https://cdn.quilljs.com/1.3.6/quill.snow.css";
+ link.rel = "stylesheet";
+ document.head.appendChild(link);
+
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .ql-editor img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ // .chat-content img {
+ // max-width: 70px !important;
+ // max-height: 70px !important;
+ // }
+ `;
+ document.head.appendChild(style);
+
+ setQuillLoaded(true);
+
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(link);
+ document.head.removeChild(style);
+ };
+ }, []);
+
+ // Custom toolbar options for ReactQuill
+ const modules = {
+ toolbar: [
+ [{ header: [1, 2, false] }],
+ ["bold", "italic", "underline", "strike", "blockquote"],
+ [{ list: "ordered" }, { list: "bullet" }],
+ ["link"],
+ ["clean"],
+ ],
+ };
+
+ const formats = [
+ "header",
+ "bold",
+ "italic",
+ "underline",
+ "strike",
+ "blockquote",
+ "list",
+ "bullet",
+ "link",
+ "image",
+ ];
+
+ const insertSticker = (stickerUrl: string) => {
+ if (!quillRef.current) return;
+
+ const quill = quillRef.current.getEditor();
+ const range = quill.getSelection(true);
+
+ // Custom image insertion with size
+ // Use custom blot or HTML string with size attributes
+ const stickerHtml = `
`;
+
+ // Insert HTML at cursor position
+ quill.clipboard.dangerouslyPasteHTML(range.index, stickerHtml);
+
+ // Move cursor after inserted sticker
+ quill.setSelection(range.index + 1, 0);
+
+ // Focus back on editor
+ quill.focus();
+
+ // Close sticker modal
+ close();
+ };
+
+ return (
+ <>
+ {isReady ? (
+
+ {quillLoaded && (
+
+
+
+
+
+ )}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {listStiker.map((item) => (
+
+
+ insertSticker(item.url)}
+ />
+
+
+ ))}
+
+
+
+ ) : (
+
+ )}
+ >
+ );
+}
+
+interface ButtonActionProps {
+ value: string;
+ lengthData: number;
+}
+
+function ButtonAction({ value, lengthData }: ButtonActionProps) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ async function onCreate() {
+ try {
+ setLoading(true);
+ const create = await forum_funCreate(value);
+ if (create.status === 201) {
+ ComponentGlobal_NotifikasiBerhasil(create.message);
+ router.back();
+
+ mqtt_client.publish(
+ "Forum_create_new",
+ JSON.stringify({ isNewPost: true, count: 1 })
+ );
+ } else {
+ ComponentGlobal_NotifikasiGagal(create.message);
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ return (
+ " ||
+ // value === "" ||
+ // funReplaceHtml({ html: editorContent }).length > maxInputLength
+ // }
+ bg={MainColor.yellow}
+ color="yellow"
+ c="black"
+ radius="xl"
+ loading={loading}
+ loaderPosition="center"
+ onClick={onCreate}
+ >
+ Posting
+
+ );
+}
diff --git a/src/app_modules/_global/component/new/comp_set_inner_html.tsx b/src/app_modules/_global/component/new/comp_set_inner_html.tsx
new file mode 100644
index 00000000..b4215289
--- /dev/null
+++ b/src/app_modules/_global/component/new/comp_set_inner_html.tsx
@@ -0,0 +1,52 @@
+import { MainColor } from "../../color";
+
+export const Comp_SetInnerHTML = ({
+ props,
+ color,
+ style: styleInput,
+}: {
+ props: string | undefined;
+ color?: string;
+ style?: React.CSSProperties;
+}) => {
+ const baseStyle: React.CSSProperties = {
+ color: color ?? MainColor.white,
+ // wordBreak: "break-word",
+ // overflow: "hidden",
+ };
+
+ return (
+ <>
+
+
+
+ >
+ );
+};
diff --git a/src/app_modules/_global/component/new/component_header.tsx b/src/app_modules/_global/component/new/component_header.tsx
new file mode 100644
index 00000000..bb2fd0af
--- /dev/null
+++ b/src/app_modules/_global/component/new/component_header.tsx
@@ -0,0 +1,106 @@
+"use client"
+
+import { ActionIcon, Box, Group, Title, Loader } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { IconChevronLeft } from "@tabler/icons-react";
+import { AccentColor, MainColor } from "../../color";
+
+export function Component_Header({
+ title,
+ posotion,
+ // left button
+ hideButtonLeft,
+ iconLeft,
+ routerLeft,
+ customButtonLeft,
+ // right button
+ iconRight,
+ routerRight,
+ customButtonRight,
+ backgroundColor,
+}: {
+ title: string;
+ posotion?: any;
+ // left button
+ hideButtonLeft?: boolean;
+ iconLeft?: any;
+ routerLeft?: any;
+ customButtonLeft?: React.ReactNode;
+ // right button
+ iconRight?: any;
+ routerRight?: any;
+ customButtonRight?: React.ReactNode;
+ backgroundColor?: string;
+}) {
+ const router = useRouter();
+ const [isLoading, setIsLoading] = useState(false);
+ const [isRightLoading, setRightLoading] = useState(false);
+
+ return (
+ <>
+
+ {hideButtonLeft ? (
+
+ ) : customButtonLeft ? (
+ customButtonLeft
+ ) : (
+ {
+ setIsLoading(true);
+ routerLeft === undefined
+ ? router.back()
+ : router.push(routerLeft, { scroll: false });
+ }}
+ >
+ {/* PAKE LOADING SAAT KLIK BACK */}
+ {/* {isLoading ? (
+
+ ) : iconLeft ? (
+ iconLeft
+ ) : (
+
+ )} */}
+
+ {/* GA PAKE LOADING SAAT KLIK BACK */}
+ {iconLeft ? iconLeft : }
+
+ )}
+
+
+ {title}
+
+
+ {customButtonRight ? (
+ customButtonRight
+ ) : iconRight === undefined ? (
+
+ ) : routerRight === undefined ? (
+ {iconRight}
+ ) : (
+ {
+ setRightLoading(true);
+ router.push(routerRight);
+ }}
+ >
+ {isRightLoading ? (
+
+ ) : (
+ iconRight
+ )}
+
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/_global/component/new/new_button_create.tsx b/src/app_modules/_global/component/new/new_button_create.tsx
new file mode 100644
index 00000000..f6fba7c1
--- /dev/null
+++ b/src/app_modules/_global/component/new/new_button_create.tsx
@@ -0,0 +1,51 @@
+"use client";
+
+import { RouterJob } from "@/lib/router_hipmi/router_job";
+import {
+ AccentColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
+import { ActionIcon, Loader } from "@mantine/core";
+import { IconPencilPlus } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+
+export default function Component_NewCreateButton({ path }: { path: string }) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+
+ return (
+ <>
+ {
+ setLoading(true);
+ router.push(path);
+ }}
+ >
+ {/* PAKE LOADING */}
+ {/* {isLoading ? (
+
+ ) : (
+
+ )} */}
+
+ {/* GA PAKE LOADING */}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/_global/fun/delete/fun_delete_file_by_id.tsx b/src/app_modules/_global/fun/delete/fun_delete_file_by_id.tsx
index a31df82d..568f3657 100644
--- a/src/app_modules/_global/fun/delete/fun_delete_file_by_id.tsx
+++ b/src/app_modules/_global/fun/delete/fun_delete_file_by_id.tsx
@@ -1,24 +1,42 @@
-export async function funGlobal_DeleteFileById({ fileId }: { fileId: string }) {
- try {
- const res = await fetch(
- `https://wibu-storage.wibudev.com/api/files/${fileId}/delete`,
- {
- method: "DELETE",
- headers: {
- Authorization: `Bearer ${process.env.WS_APIKEY}`,
- },
- }
- );
+import { clientLogger } from "@/util/clientLogger";
- if (res.ok) {
- const hasil = await res.json();
- return { success: true };
+export async function funDeteleteFileById({
+ fileId,
+ dirId,
+}: {
+ fileId: string;
+ dirId?: string;
+}) {
+ try {
+ const tokenResponse = await fetch("/api/get-cookie");
+ if (!tokenResponse.ok) {
+ return { success: false, message: "Token not found" };
+ }
+ const { token } = await tokenResponse.json();
+
+ if (!token) {
+ return { success: false, message: "Token not found" };
+ }
+
+ const res = await fetch("/api/image/delete", {
+ method: "DELETE",
+ body: JSON.stringify({ fileId, dirId }),
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ const data = await res.json();
+
+ if (data.success) {
+ clientLogger.info(`File ${fileId} deleted successfully`);
+ return { success: true, message: "File berhasil dihapus" };
} else {
- const errorText = await res.json();
- return { success: false };
+ return { success: false, message: data.message };
}
} catch (error) {
- return { success: false };
- console.error("Upload error:", error);
+ clientLogger.error("Upload error:", error);
+ return { success: false, message: "An unexpected error occurred" };
}
}
diff --git a/src/app_modules/_global/fun/fun_replace_html.ts b/src/app_modules/_global/fun/fun_replace_html.ts
new file mode 100644
index 00000000..9fc66768
--- /dev/null
+++ b/src/app_modules/_global/fun/fun_replace_html.ts
@@ -0,0 +1,3 @@
+export function funReplaceHtml({html}:{ html: string }) {
+ return html.replace(/<[^>]+>/g, "");
+}
\ No newline at end of file
diff --git a/src/app_modules/_global/fun/generate_seeder.ts b/src/app_modules/_global/fun/generate_seeder.ts
index c1f89d11..2595028d 100644
--- a/src/app_modules/_global/fun/generate_seeder.ts
+++ b/src/app_modules/_global/fun/generate_seeder.ts
@@ -1,4 +1,4 @@
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import bidangBisnis from "../../../bin/seeder/bidang_bisnis.json";
import collaboration_industri from "../../../bin/seeder/colab/master_industri.json";
import collaboration_status from "../../../bin/seeder/colab/master_status.json";
@@ -25,8 +25,12 @@ import voting_status from "../../../bin/seeder/voting/master_status.json";
import { master_kategori_app } from "@/bin/seeder/master";
import { new_status_transaksi_investasi } from "@/bin/seeder/investasi";
import { master_nama_bank } from "@/bin/seeder/master";
+import { master_status_transaksi } from "@/bin/seeder/master";
+import pLimit from "p-limit";
+import { master_new_bidang_bisnis } from "@/bin/seeder/master";
+import { master_emotions } from "@/bin/seeder/master";
-export async function generate_seeder() {
+async function masterUserRole() {
for (let i of userRole) {
await prisma.masterUserRole.upsert({
where: {
@@ -42,7 +46,10 @@ export async function generate_seeder() {
},
});
}
+ console.log("masterUserRole success");
+}
+async function seederUser() {
for (let i of userSeeder) {
await prisma.user.upsert({
where: {
@@ -52,31 +59,88 @@ export async function generate_seeder() {
nomor: i.nomor,
username: i.name,
masterUserRoleId: i.masterUserRoleId,
+ active: i.active,
},
update: {
nomor: i.nomor,
username: i.name,
masterUserRoleId: i.masterUserRoleId,
+ active: i.active,
},
});
}
+ console.log("user seeder success");
+}
- for (let i of bidangBisnis) {
- await prisma.masterBidangBisnis.upsert({
- where: {
- id: i.id.toString(),
- },
- update: {
- id: i.id.toString(),
- name: i.name,
- },
- create: {
- id: i.id.toString(),
- name: i.name,
- },
- });
+// async function masterBisnis() {
+// for (let i of bidangBisnis) {
+// await prisma.masterBidangBisnis.upsert({
+// where: {
+// id: i.id.toString(),
+// },
+// update: {
+// id: i.id.toString(),
+// name: i.name,
+// },
+// create: {
+// id: i.id.toString(),
+// name: i.name,
+// },
+// });
+// }
+// console.log("masterBisnis success");
+// }
+
+async function masterNewBidangBisnis() {
+ for (let i of master_new_bidang_bisnis) {
+ try {
+ // Upsert MasterBidangBisnis
+ const masterBidangBisnis = await prisma.masterBidangBisnis.upsert({
+ where: {
+ id: i.id.toString(),
+ },
+ update: {
+ name: i.name,
+ slug: i.slug,
+ },
+ create: {
+ id: i.id.toString(),
+ name: i.name,
+ slug: i.slug,
+ },
+ });
+
+ // Upsert untuk setiap subBidangBisnis dengan await untuk memastikan urutan tetap terjaga
+ for (let sub of i.subBidangBisnis) {
+ await prisma.masterSubBidangBisnis.upsert({
+ where: {
+ id: sub.id,
+ },
+ update: {
+ name: sub.name,
+ slug: sub.slug,
+ masterBidangBisnisId: masterBidangBisnis.id,
+ },
+ create: {
+ id: sub.id,
+ name: sub.name,
+ slug: sub.slug,
+ masterBidangBisnisId: masterBidangBisnis.id,
+ },
+ });
+ }
+ } catch (error) {
+ console.error(
+ `Terjadi error saat upserting bidang bisnis ${i.name}:`,
+ error
+ );
+ }
}
+ console.log("Semua masterBidangBisnis dan subBidangBisnis berhasil di-seed");
+}
+
+async function masterPencarianInvestor() {
for (let i of pencarianInvestor) {
await prisma.masterPencarianInvestor.upsert({
where: {
@@ -93,6 +157,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterPencarianInvestor success");
+}
+
+async function masterPembagianDeviden() {
for (let i of pembagianDeviden) {
await prisma.masterPembagianDeviden.upsert({
where: {
@@ -109,6 +177,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterPembagianDeviden success");
+}
+
+async function masterPeriodeDeviden() {
for (let i of periodeDeviden) {
await prisma.masterPeriodeDeviden.upsert({
where: {
@@ -125,6 +197,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterPeriodeDeviden success");
+}
+
+async function masterStatusInvestasi() {
for (let i of statusInvestasi) {
await prisma.masterStatusInvestasi.upsert({
where: {
@@ -143,6 +219,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterStatusInvestasi success");
+}
+
+async function masterNamaBank() {
for (let i of master_nama_bank) {
await prisma.masterBank.upsert({
where: {
@@ -162,7 +242,11 @@ export async function generate_seeder() {
},
});
}
-
+
+ console.log("masterNamaBank success");
+}
+
+async function masterStatusTransaksiInvestasi() {
for (let i of statusTransaksiInvestasi) {
await prisma.masterStatusTransaksiInvestasi.upsert({
where: {
@@ -181,6 +265,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterStatusTransaksiInvestasi success");
+}
+
+async function masterProgressInvestasi() {
for (let i of jenisProgres) {
await prisma.masterProgresInvestasi.upsert({
where: {
@@ -196,6 +284,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterProgressInvestasi success");
+}
+
+async function masterStatusDonasi() {
for (let d of donasi_status) {
await prisma.donasiMaster_StatusDonasi.upsert({
where: {
@@ -211,6 +303,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterStatusDonasi success");
+}
+
+async function masterKategoriDonasi() {
for (let d of donasi_kategori) {
await prisma.donasiMaster_Kategori.upsert({
where: {
@@ -226,6 +322,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterKategoriDonasi success");
+}
+
+async function masterDurasiDonasi() {
for (let d of donasi_durasi) {
await prisma.donasiMaster_Durasi.upsert({
where: {
@@ -241,6 +341,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterDurasiDonasi success");
+}
+
+async function masterDonasiNamaBank() {
for (let i of donasi_namaBank) {
await prisma.donasiMaster_Bank.upsert({
where: {
@@ -259,6 +363,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterDonasiBank success");
+}
+
+async function masterDonasiStatusInvoice() {
for (let d of donasi_status_invoice) {
await prisma.donasiMaster_StatusInvoice.upsert({
where: {
@@ -274,6 +382,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterDonasiStatusInvoice success");
+}
+
+async function masterEventStatus() {
for (let e of event_status) {
await prisma.eventMaster_Status.upsert({
where: {
@@ -289,6 +401,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterEventStatus success");
+}
+
+async function masterEventTipeAcara() {
for (let e of event_tipe_acara) {
await prisma.eventMaster_TipeAcara.upsert({
where: {
@@ -304,6 +420,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterEventTipeAcara success");
+}
+
+async function masterVotingStatus() {
for (let v of voting_status) {
await prisma.voting_Status.upsert({
where: {
@@ -319,6 +439,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterVotingStatus success");
+}
+
+async function masterStatusProses() {
for (let m of master_status) {
await prisma.masterStatus.upsert({
where: {
@@ -334,6 +458,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterStatusProses success");
+}
+
+async function masterForumKategoriReport() {
for (let m of forum_kategori_report) {
await prisma.forumMaster_KategoriReport.upsert({
where: {
@@ -350,6 +478,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterForumKategoriReport success");
+}
+
+async function masterForumStatusPosting() {
for (let s of forum_status_posting) {
await prisma.forumMaster_StatusPosting.upsert({
where: {
@@ -364,6 +496,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterForumStatusPosting success");
+}
+
+async function masterCollaborationIndustri() {
for (let p of collaboration_industri) {
await prisma.projectCollaborationMaster_Industri.upsert({
where: {
@@ -378,6 +514,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterCollaborationIndustri success");
+}
+
+async function masterCollaborationStatus() {
for (let p of collaboration_status) {
await prisma.projectCollaborationMaster_Status.upsert({
where: {
@@ -392,6 +532,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterCollaborationStatus success");
+}
+
+async function seederNomorAdmin() {
for (let a of nomor_admin) {
await prisma.nomorAdmin.upsert({
where: {
@@ -408,6 +552,10 @@ export async function generate_seeder() {
});
}
+ console.log("seederNomorAdmin success");
+}
+
+async function masterKategoriApp() {
for (let a of master_kategori_app) {
await prisma.masterKategoriApp.upsert({
where: {
@@ -424,6 +572,10 @@ export async function generate_seeder() {
});
}
+ console.log("masterKategoriApp success");
+}
+
+async function masterInvestasiNewTransaksiStatus() {
for (let a of new_status_transaksi_investasi) {
await prisma.investasiMaster_StatusInvoice.upsert({
where: {
@@ -440,5 +592,84 @@ export async function generate_seeder() {
});
}
+ console.log("masterInvestasiNewTransaksiStatus success");
+}
+
+async function masterStatusTransaksi() {
+ for (let a of master_status_transaksi) {
+ await prisma.masterStatusTransaksi.upsert({
+ where: {
+ id: a.id,
+ },
+ create: {
+ id: a.id,
+ name: a.name,
+ },
+ update: {
+ id: a.id,
+ name: a.name,
+ },
+ });
+ }
+
+ console.log("masterStatusTransaksi success");
+}
+
+async function masterEmotions() {
+ await Promise.all(
+ master_emotions.map((a) =>
+ prisma.masterEmotions.upsert({
+ where: { value: a.value },
+ create: { value: a.value, label: a.label },
+ update: { value: a.value, label: a.label },
+ })
+ )
+ );
+
+ console.log("masterEmotions success");
+}
+
+const listSeederQueue = [
+ masterUserRole,
+ seederUser,
+ // masterBisnis,
+ masterNewBidangBisnis,
+ masterPencarianInvestor,
+ masterPembagianDeviden,
+ masterPeriodeDeviden,
+ masterStatusInvestasi,
+ masterNamaBank,
+ masterStatusTransaksiInvestasi,
+ masterProgressInvestasi,
+ masterStatusDonasi,
+ masterKategoriDonasi,
+ masterDurasiDonasi,
+ masterDonasiNamaBank,
+ masterDonasiStatusInvoice,
+ masterEventStatus,
+ masterEventTipeAcara,
+ masterVotingStatus,
+ masterStatusProses,
+ masterForumKategoriReport,
+ masterForumStatusPosting,
+ masterCollaborationIndustri,
+ masterCollaborationStatus,
+ seederNomorAdmin,
+ masterKategoriApp,
+ masterInvestasiNewTransaksiStatus,
+ masterStatusTransaksi,
+ masterEmotions,
+];
+const limit = pLimit(1);
+
+export async function generate_seeder() {
+ try {
+ await Promise.all(listSeederQueue.map((fn) => limit(fn)));
+ await prisma.$disconnect();
+ } catch (error) {
+ console.error("error generate seeder", error);
+ await prisma.$disconnect();
+ }
+
return { status: 200, success: true };
}
diff --git a/src/app_modules/_global/fun/generete_seeder.back.txt b/src/app_modules/_global/fun/generete_seeder.back.txt
new file mode 100644
index 00000000..52a39d86
--- /dev/null
+++ b/src/app_modules/_global/fun/generete_seeder.back.txt
@@ -0,0 +1,465 @@
+import prisma from "@/app/lib/prisma";
+import bidangBisnis from "../../../bin/seeder/bidang_bisnis.json";
+import collaboration_industri from "../../../bin/seeder/colab/master_industri.json";
+import collaboration_status from "../../../bin/seeder/colab/master_status.json";
+import donasi_namaBank from "../../../bin/seeder/donasi/master_bank.json";
+import donasi_durasi from "../../../bin/seeder/donasi/master_durasi.json";
+import donasi_kategori from "../../../bin/seeder/donasi/master_kategori.json";
+import donasi_status from "../../../bin/seeder/donasi/master_status.json";
+import donasi_status_invoice from "../../../bin/seeder/donasi/master_status_invoice.json";
+import event_status from "../../../bin/seeder/event/master_status.json";
+import event_tipe_acara from "../../../bin/seeder/event/master_tipe_acara.json";
+import forum_kategori_report from "../../../bin/seeder/forum/master_report.json";
+import forum_status_posting from "../../../bin/seeder/forum/master_status.json";
+import jenisProgres from "../../../bin/seeder/investasi/master_progres.json";
+import pembagianDeviden from "../../../bin/seeder/investasi/pembagian_deviden.json";
+import pencarianInvestor from "../../../bin/seeder/investasi/pencarian_investor.json";
+import periodeDeviden from "../../../bin/seeder/investasi/periode_deviden.json";
+import statusInvestasi from "../../../bin/seeder/investasi/status_investasi.json";
+import statusTransaksiInvestasi from "../../../bin/seeder/investasi/status_transaksi_investasi.json";
+import master_status from "../../../bin/seeder/master_status.json";
+import nomor_admin from "../../../bin/seeder/nomor_admin.json";
+import userRole from "../../../bin/seeder/user_role.json";
+import userSeeder from "../../../bin/seeder/user_seeder.json";
+import voting_status from "../../../bin/seeder/voting/master_status.json";
+import { master_kategori_app } from "@/bin/seeder/master";
+import { new_status_transaksi_investasi } from "@/bin/seeder/investasi";
+import { master_nama_bank } from "@/bin/seeder/master";
+import pLimit from "p-limit";
+
+// PAKEK p-limit
+
+async function masterUserRole() {
+ for (let i of userRole) {
+ await prisma.masterUserRole.upsert({
+ where: {
+ id: i.id.toString(),
+ },
+ update: {
+ id: i.id.toString(),
+ name: i.name,
+ },
+ create: {
+ id: i.id.toString(),
+ name: i.name,
+ },
+ });
+ }
+ await new Promise((resolve) => setTimeout(resolve, 10000));
+ console.log("masterUserRole success");
+}
+
+async function user() {
+ for (let i of userSeeder) {
+ await prisma.user.upsert({
+ where: {
+ nomor: i.nomor,
+ },
+ create: {
+ nomor: i.nomor,
+ username: i.name,
+ masterUserRoleId: i.masterUserRoleId,
+ active: i.active,
+ },
+ update: {
+ nomor: i.nomor,
+ username: i.name,
+ masterUserRoleId: i.masterUserRoleId,
+ active: i.active,
+ },
+ });
+ }
+ console.log("user success");
+}
+
+const listAntrean = [masterUserRole, user];
+const limit = pLimit(1);
+
+(async () => {
+ console.log("start generate seeder");
+ await Promise.all(listAntrean.map((fn) => limit(fn)));
+ console.log("success generate seeder");
+})();
+
+export async function generate_seeder() {
+ for (let i of bidangBisnis) {
+ await prisma.masterBidangBisnis.upsert({
+ where: {
+ id: i.id.toString(),
+ },
+ update: {
+ id: i.id.toString(),
+ name: i.name,
+ },
+ create: {
+ id: i.id.toString(),
+ name: i.name,
+ },
+ });
+ }
+
+ for (let i of pencarianInvestor) {
+ await prisma.masterPencarianInvestor.upsert({
+ where: {
+ id: i.id.toString(),
+ },
+ update: {
+ id: i.id.toString(),
+ name: i.name,
+ },
+ create: {
+ id: i.id.toString(),
+ name: i.name,
+ },
+ });
+ }
+
+ for (let i of pembagianDeviden) {
+ await prisma.masterPembagianDeviden.upsert({
+ where: {
+ id: i.id.toString(),
+ },
+ update: {
+ id: i.id.toString(),
+ name: i.name,
+ },
+ create: {
+ id: i.id.toString(),
+ name: i.name,
+ },
+ });
+ }
+
+ for (let i of periodeDeviden) {
+ await prisma.masterPeriodeDeviden.upsert({
+ where: {
+ id: i.id.toString(),
+ },
+ update: {
+ id: i.id.toString(),
+ name: i.name,
+ },
+ create: {
+ id: i.id.toString(),
+ name: i.name,
+ },
+ });
+ }
+
+ for (let i of statusInvestasi) {
+ await prisma.masterStatusInvestasi.upsert({
+ where: {
+ id: i.id,
+ },
+ create: {
+ id: i.id,
+ name: i.name,
+ color: i.color,
+ },
+ update: {
+ id: i.id,
+ name: i.name,
+ color: i.color,
+ },
+ });
+ }
+
+ for (let i of master_nama_bank) {
+ await prisma.masterBank.upsert({
+ where: {
+ id: i.id.toString(),
+ },
+ create: {
+ id: i.id.toString(),
+ namaBank: i.namaBank,
+ namaAkun: i.namaAkun,
+ norek: i.norek.toString(),
+ },
+ update: {
+ id: i.id.toString(),
+ namaBank: i.namaBank,
+ namaAkun: i.namaAkun,
+ norek: i.norek.toString(),
+ },
+ });
+ }
+
+ for (let i of statusTransaksiInvestasi) {
+ await prisma.masterStatusTransaksiInvestasi.upsert({
+ where: {
+ id: i.id,
+ },
+ create: {
+ id: i.id,
+ name: i.name,
+ color: i.color,
+ },
+ update: {
+ id: i.id,
+ name: i.name,
+ color: i.color,
+ },
+ });
+ }
+
+ for (let i of jenisProgres) {
+ await prisma.masterProgresInvestasi.upsert({
+ where: {
+ id: i.id,
+ },
+ create: {
+ id: i.id,
+ name: i.name,
+ },
+ update: {
+ name: i.name,
+ },
+ });
+ }
+
+ for (let d of donasi_status) {
+ await prisma.donasiMaster_StatusDonasi.upsert({
+ where: {
+ id: d.id,
+ },
+ create: {
+ id: d.id,
+ name: d.name,
+ },
+ update: {
+ name: d.name,
+ },
+ });
+ }
+
+ for (let d of donasi_kategori) {
+ await prisma.donasiMaster_Kategori.upsert({
+ where: {
+ id: d.id,
+ },
+ create: {
+ id: d.id,
+ name: d.name,
+ },
+ update: {
+ name: d.name,
+ },
+ });
+ }
+
+ for (let d of donasi_durasi) {
+ await prisma.donasiMaster_Durasi.upsert({
+ where: {
+ id: d.id,
+ },
+ create: {
+ id: d.id,
+ name: d.name,
+ },
+ update: {
+ name: d.name,
+ },
+ });
+ }
+
+ for (let i of donasi_namaBank) {
+ await prisma.donasiMaster_Bank.upsert({
+ where: {
+ id: i.id,
+ },
+ create: {
+ id: i.id,
+ name: i.name,
+ norek: i.norek,
+ },
+ update: {
+ id: i.id,
+ name: i.name,
+ norek: i.norek,
+ },
+ });
+ }
+
+ for (let d of donasi_status_invoice) {
+ await prisma.donasiMaster_StatusInvoice.upsert({
+ where: {
+ id: d.id,
+ },
+ create: {
+ id: d.id,
+ name: d.name,
+ },
+ update: {
+ name: d.name,
+ },
+ });
+ }
+
+ for (let e of event_status) {
+ await prisma.eventMaster_Status.upsert({
+ where: {
+ id: e.id,
+ },
+ create: {
+ id: e.id,
+ name: e.name,
+ },
+ update: {
+ name: e.name,
+ },
+ });
+ }
+
+ for (let e of event_tipe_acara) {
+ await prisma.eventMaster_TipeAcara.upsert({
+ where: {
+ id: e.id,
+ },
+ create: {
+ id: e.id,
+ name: e.name,
+ },
+ update: {
+ name: e.name,
+ },
+ });
+ }
+
+ for (let v of voting_status) {
+ await prisma.voting_Status.upsert({
+ where: {
+ id: v.id,
+ },
+ create: {
+ id: v.id,
+ name: v.name,
+ },
+ update: {
+ name: v.name,
+ },
+ });
+ }
+
+ for (let m of master_status) {
+ await prisma.masterStatus.upsert({
+ where: {
+ id: m.id,
+ },
+ create: {
+ id: m.id,
+ name: m.name,
+ },
+ update: {
+ name: m.name,
+ },
+ });
+ }
+
+ for (let m of forum_kategori_report) {
+ await prisma.forumMaster_KategoriReport.upsert({
+ where: {
+ id: m.id as number,
+ },
+ create: {
+ title: m.title,
+ deskripsi: m.deskripsi,
+ },
+ update: {
+ title: m.title,
+ deskripsi: m.deskripsi,
+ },
+ });
+ }
+
+ for (let s of forum_status_posting) {
+ await prisma.forumMaster_StatusPosting.upsert({
+ where: {
+ id: s.id,
+ },
+ create: {
+ status: s.status,
+ },
+ update: {
+ status: s.status,
+ },
+ });
+ }
+
+ for (let p of collaboration_industri) {
+ await prisma.projectCollaborationMaster_Industri.upsert({
+ where: {
+ id: p.id,
+ },
+ create: {
+ name: p.name,
+ },
+ update: {
+ name: p.name,
+ },
+ });
+ }
+
+ for (let p of collaboration_status) {
+ await prisma.projectCollaborationMaster_Status.upsert({
+ where: {
+ id: p.id,
+ },
+ create: {
+ name: p.name,
+ },
+ update: {
+ name: p.name,
+ },
+ });
+ }
+
+ for (let a of nomor_admin) {
+ await prisma.nomorAdmin.upsert({
+ where: {
+ id: a.id,
+ },
+ create: {
+ id: a.id,
+ nomor: a.nomor,
+ },
+ update: {
+ id: a.id,
+ nomor: a.nomor,
+ },
+ });
+ }
+
+ for (let a of master_kategori_app) {
+ await prisma.masterKategoriApp.upsert({
+ where: {
+ id: a.id,
+ },
+ create: {
+ id: a.id,
+ name: a.name,
+ },
+ update: {
+ id: a.id,
+ name: a.name,
+ },
+ });
+ }
+
+ for (let a of new_status_transaksi_investasi) {
+ await prisma.investasiMaster_StatusInvoice.upsert({
+ where: {
+ id: a.id,
+ },
+ create: {
+ id: a.id,
+ name: a.name,
+ },
+ update: {
+ id: a.id,
+ name: a.name,
+ },
+ });
+ }
+
+ return { status: 200, success: true };
+}
diff --git a/src/app_modules/_global/fun/get/fun_check_activation_use_by_id.ts b/src/app_modules/_global/fun/get/fun_check_activation_use_by_id.ts
index 010902fe..d3368e63 100644
--- a/src/app_modules/_global/fun/get/fun_check_activation_use_by_id.ts
+++ b/src/app_modules/_global/fun/get/fun_check_activation_use_by_id.ts
@@ -1,7 +1,7 @@
"use server";
-import { prisma } from "@/app/lib";
-import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
+import { prisma } from "@/lib";
+import { RouterAuth } from "@/lib/router_hipmi/router_auth";
import { permanentRedirect } from "next/navigation";
export async function funGlobal_checkActivationUseById({
diff --git a/src/app_modules/_global/fun/get/fun_check_cookies.ts b/src/app_modules/_global/fun/get/fun_check_cookies.ts
index e1ac9caa..beb6ebdf 100644
--- a/src/app_modules/_global/fun/get/fun_check_cookies.ts
+++ b/src/app_modules/_global/fun/get/fun_check_cookies.ts
@@ -1,6 +1,6 @@
"use server";
-import { ServerEnv } from "@/app/lib/server_env";
+import { ServerEnv } from "@/lib/server_env";
import { unsealData } from "iron-session";
import _ from "lodash";
import { cookies } from "next/headers";
diff --git a/src/app_modules/_global/fun/get/fun_check_profile.tsx b/src/app_modules/_global/fun/get/fun_check_profile.tsx
index d103f9fc..a550675a 100644
--- a/src/app_modules/_global/fun/get/fun_check_profile.tsx
+++ b/src/app_modules/_global/fun/get/fun_check_profile.tsx
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
export async function funGlobal_CheckProfile({
profileId,
diff --git a/src/app_modules/_global/fun/get/fun_get_all_bank.ts b/src/app_modules/_global/fun/get/fun_get_all_bank.ts
index 59ede53a..04dea190 100644
--- a/src/app_modules/_global/fun/get/fun_get_all_bank.ts
+++ b/src/app_modules/_global/fun/get/fun_get_all_bank.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function funGlobal_getAllBank() {
const data = await prisma.masterBank.findMany({
diff --git a/src/app_modules/_global/fun/get/fun_get_directory_name.ts b/src/app_modules/_global/fun/get/fun_get_directory_name.ts
new file mode 100644
index 00000000..83ec55cd
--- /dev/null
+++ b/src/app_modules/_global/fun/get/fun_get_directory_name.ts
@@ -0,0 +1,11 @@
+import { DIRECTORY_ID } from "@/lib";
+
+export async function funGetDirectoryNameByValue({
+ value,
+}: {
+ value?: string | null;
+}) {
+ if (!value) return null;
+ const object: any = DIRECTORY_ID;
+ return Object.keys(object).find((key) => object[key] === value);
+}
diff --git a/src/app_modules/_global/fun/get/fun_get_nomor_admin.ts b/src/app_modules/_global/fun/get/fun_get_nomor_admin.ts
index 7b98da50..12195f0e 100644
--- a/src/app_modules/_global/fun/get/fun_get_nomor_admin.ts
+++ b/src/app_modules/_global/fun/get/fun_get_nomor_admin.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function funGlobal_getNomorAdmin() {
const data = await prisma.nomorAdmin.findFirst({
diff --git a/src/app_modules/_global/fun/get/fun_get_user_by_id.ts b/src/app_modules/_global/fun/get/fun_get_user_by_id.ts
index 1eb01da0..0e8908ce 100644
--- a/src/app_modules/_global/fun/get/fun_get_user_by_id.ts
+++ b/src/app_modules/_global/fun/get/fun_get_user_by_id.ts
@@ -1,7 +1,7 @@
"use server";
-import { prisma } from "@/app/lib";
-import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
+import { prisma } from "@/lib";
+import { RouterAuth } from "@/lib/router_hipmi/router_auth";
import { permanentRedirect } from "next/navigation";
export async function funGlobal_getUserById({ userId }: { userId: string }) {
diff --git a/src/app_modules/_global/fun/get/fun_get_user_id_by_token.ts b/src/app_modules/_global/fun/get/fun_get_user_id_by_token.ts
index 22249f85..6bc4b6c2 100644
--- a/src/app_modules/_global/fun/get/fun_get_user_id_by_token.ts
+++ b/src/app_modules/_global/fun/get/fun_get_user_id_by_token.ts
@@ -1,27 +1,33 @@
"use server";
-import { prisma } from "@/app/lib";
-import { ServerEnv } from "@/app/lib/server_env";
-import { unsealData } from "iron-session";
import { cookies } from "next/headers";
+import { decrypt } from "../../../../app/(auth)/_lib/decrypt";
export async function funGetUserIdByToken() {
- const c = cookies().get(process.env.NEXT_PUBLIC_BASE_SESSION_KEY!);
+ const SESSION_KEY = process.env.NEXT_PUBLIC_BASE_SESSION_KEY;
- // const token = JSON.parse(
- // await unsealData(c?.value as string, {
- // password: process.env.WIBU_PWD as string,
- // })
- // );
- // return token.id;
+ if (!SESSION_KEY) {
+ console.warn("SESSION_KEY tidak ditemukan");
+ return null;
+ }
- const token = c?.value
- const cekToken = await prisma.userSession.findFirst({
- where: {
- token: token,
- },
- });
+ const cookieStore = cookies();
+ const c = cookieStore.get(SESSION_KEY);
- // if (cekToken === null) return null
- return cekToken?.userId
+ if (!c?.value) {
+ console.warn("Cookie tidak ditemukan");
+ return null;
+ }
+
+ try {
+ const cekUser = await decrypt({
+ token: c.value,
+ encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
+ });
+
+ return cekUser?.id || null;
+ } catch (error) {
+ console.error("Gagal mendekripsi token:", error);
+ return null;
+ }
}
diff --git a/src/app_modules/_global/fun/get/fun_master_kategori_app.ts b/src/app_modules/_global/fun/get/fun_master_kategori_app.ts
index a47a70ea..66841b5d 100644
--- a/src/app_modules/_global/fun/get/fun_master_kategori_app.ts
+++ b/src/app_modules/_global/fun/get/fun_master_kategori_app.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function funGlobal_getMasterKategoriApp() {
const data = await prisma.masterKategoriApp.findMany({
diff --git a/src/app_modules/_global/fun/get/index.ts b/src/app_modules/_global/fun/get/index.ts
index b71aacbe..25d8ace9 100644
--- a/src/app_modules/_global/fun/get/index.ts
+++ b/src/app_modules/_global/fun/get/index.ts
@@ -1,5 +1,5 @@
-
import { funGlobal_CheckProfile } from "./fun_check_profile";
+import { funGetDirectoryNameByValue } from "./fun_get_directory_name";
import { funGlobal_getNomorAdmin } from "./fun_get_nomor_admin";
import { funGetUserIdByToken } from "./fun_get_user_id_by_token";
import { funGlobal_getMasterKategoriApp } from "./fun_master_kategori_app";
@@ -8,3 +8,4 @@ export { funGlobal_getMasterKategoriApp };
export { funGlobal_getNomorAdmin };
export { funGetUserIdByToken };
export { funGlobal_CheckProfile };
+export { funGetDirectoryNameByValue };
diff --git a/src/app_modules/_global/fun/index.ts b/src/app_modules/_global/fun/index.ts
index 809afd9b..7a6106b5 100644
--- a/src/app_modules/_global/fun/index.ts
+++ b/src/app_modules/_global/fun/index.ts
@@ -1,5 +1,7 @@
-import { funGlobal_DeleteFileById } from "./delete/fun_delete_file_by_id";
-import { funGlobal_UploadToStorage } from "./upload/fun_upload_to_storage";
+import { funDeteleteFileById } from "./delete/fun_delete_file_by_id";
+import { funUploadFileToStorage } from "./upload/fun_upload_to_storage";
+import { funValidasiUploadCreatedFile } from "./upload/fun_validasi_upload_created_file";
-export { funGlobal_UploadToStorage };
-export { funGlobal_DeleteFileById };
+export { funUploadFileToStorage as funGlobal_UploadToStorage };
+export { funDeteleteFileById as funGlobal_DeleteFileById };
+export { funValidasiUploadCreatedFile };
diff --git a/src/app_modules/_global/fun/upload/fun_upload_to_storage.ts b/src/app_modules/_global/fun/upload/fun_upload_to_storage.ts
index 30bc8a51..1b81245f 100644
--- a/src/app_modules/_global/fun/upload/fun_upload_to_storage.ts
+++ b/src/app_modules/_global/fun/upload/fun_upload_to_storage.ts
@@ -1,59 +1,40 @@
-import { ServerEnv } from "@/app/lib/server_env";
-import { TokenStorage } from "@/app/lib/token";
-import { envs } from "@/lib/envs";
-
-export async function funGlobal_UploadToStorage({
+export async function funUploadFileToStorage({
file,
dirId,
}: {
file: File;
dirId: string;
}) {
- const Env_WS_APIKEY = TokenStorage.value;
-
- const allowedMimeTypes = [
- "image/png",
- "image/jpeg",
- "image/gif",
- "text/csv",
- "application/pdf",
- "application/msword",
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
- "application/vnd.ms-excel",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
- "text/plain",
- ];
-
- if (!allowedMimeTypes.includes(file.type)) console.log("File tidak sesuai");
-
- if (file.size > 100 * 1024 * 1024) console.log("File terlalu besar");
-
- const formData = new FormData();
- formData.append("file", file);
- formData.append("dirId", dirId);
-
try {
- const res = await fetch("https://wibu-storage.wibudev.com/api/upload", {
+ const tokenResponse = await fetch("/api/get-cookie");
+ if (!tokenResponse.ok) {
+ throw new Error("Failed to get token");
+ }
+ const { token } = await tokenResponse.json();
+
+ if (!token) {
+ return { success: false, message: "Token not found" };
+ }
+
+ const formData = new FormData();
+ formData.append("file", file);
+ formData.append("dirId", dirId);
+
+ const upload = await fetch("/api/image/upload", {
method: "POST",
body: formData,
headers: {
- Authorization: `Bearer ${Env_WS_APIKEY}`,
+ Authorization: `Bearer ${token}`,
},
});
- const dataRes = await res.json();
+ const res = await upload.json();
- if (res.ok) {
- return { success: true, data: dataRes.data };
- } else {
- const errorText = await res.text();
- console.error("Error:", errorText);
- return { success: false, data: {} };
- }
+ return upload.ok
+ ? { success: true, data: res.data, message: res.message }
+ : { success: false, data: {}, message: res.message };
} catch (error) {
- console.error("Error:", error);
- return { success: false, data: {} };
+ console.log(error);
+ return { success: false, message: "An unexpected error occurred" };
}
-
- return { success: false, data: { id: "" } };
}
diff --git a/src/app_modules/_global/fun/upload/fun_validasi_upload_created_file.ts b/src/app_modules/_global/fun/upload/fun_validasi_upload_created_file.ts
new file mode 100644
index 00000000..9aa680b1
--- /dev/null
+++ b/src/app_modules/_global/fun/upload/fun_validasi_upload_created_file.ts
@@ -0,0 +1,106 @@
+import { clientLogger } from "@/util/clientLogger";
+import { MAX_SIZE } from "../../lib";
+import { PemberitahuanMaksimalFile } from "../../lib/maximal_setting";
+import { ComponentGlobal_NotifikasiPeringatan } from "../../notif_global";
+import { funDeteleteFileById } from "../delete/fun_delete_file_by_id";
+import { funUploadFileToStorage } from "./fun_upload_to_storage";
+
+export async function funValidasiUploadCreatedFile({
+ files,
+ dirId,
+ fileId,
+ onSetFileId,
+ onSetImageBuffer,
+}: {
+ files: any | null;
+ dirId: string;
+ fileId: string;
+ onSetFileId: (val: string) => void;
+ onSetImageBuffer: (val: any | null) => void;
+}) {
+ try {
+ const buffer = URL.createObjectURL(
+ new Blob([new Uint8Array(await files.arrayBuffer())])
+ );
+
+ if (files.size > MAX_SIZE) {
+ ComponentGlobal_NotifikasiPeringatan(PemberitahuanMaksimalFile);
+ onSetImageBuffer(null);
+
+ return false;
+ }
+
+ if (fileId != "") {
+ const deleteFotoProfile = await funDeteleteFileById({
+ fileId: fileId,
+ dirId: dirId,
+ });
+
+ if (!deleteFotoProfile.success) {
+ console.log(
+ `Client failed delete ${dirId}:` + deleteFotoProfile.message
+ );
+ onSetImageBuffer(null);
+
+ return false;
+ }
+
+ if (deleteFotoProfile.success) {
+ onSetFileId("");
+ onSetImageBuffer(null);
+
+ const uploadPhoto = await funUploadFileToStorage({
+ file: files,
+ dirId: dirId,
+ });
+
+ if (!uploadPhoto.success) {
+ clientLogger.error(
+ `Client failed upload ${dirId}:` + uploadPhoto.message
+ );
+ return false;
+ }
+
+ if (uploadPhoto.success) {
+ clientLogger.info(`Client success upload ${dirId}`);
+ onSetFileId("");
+ onSetImageBuffer(buffer);
+
+ return true;
+ } else {
+ clientLogger.error("Client failed upload foto:", uploadPhoto.message);
+ ComponentGlobal_NotifikasiPeringatan(`Gagal upload ${dirId}`);
+ }
+ }
+ } else {
+ const uploadPhoto = await funUploadFileToStorage({
+ file: files,
+ dirId: dirId,
+ });
+
+ if (!uploadPhoto.success) {
+ clientLogger.error(
+ `Client failed upload ${dirId}:` + uploadPhoto.message
+ );
+ return false;
+ }
+
+ if (uploadPhoto.success) {
+ clientLogger.info(`Client success upload ${dirId}`);
+ onSetFileId("");
+ onSetImageBuffer(buffer);
+
+ return true;
+ } else {
+ clientLogger.error("Client failed upload foto:", uploadPhoto.message);
+ ComponentGlobal_NotifikasiPeringatan(`Gagal upload ${dirId}`);
+
+ return false;
+ }
+ }
+ } catch (error) {
+ console.log(error);
+
+ return false;
+ }
+}
diff --git a/src/app_modules/_global/lib/api_fetch_global.ts b/src/app_modules/_global/lib/api_fetch_global.ts
new file mode 100644
index 00000000..fd89e9e0
--- /dev/null
+++ b/src/app_modules/_global/lib/api_fetch_global.ts
@@ -0,0 +1,144 @@
+export { apiGetPdfToImage, apiCreatedNotificationToAdmin, apiGetSeasonUserId };
+
+export interface PageData {
+ imageUrl: string;
+ pageNumber: number;
+}
+
+interface PdfResponse {
+ pages: PageData[];
+ totalPages: number;
+}
+const apiGetPdfToImage = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ // const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ // if (!token) {
+ // console.error("No token found");
+ // return null;
+ // }
+
+ const token =
+ "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7ImlkIjoiY20wdXIxeXh3MDAwMDU2bnNqbHI2MTg3cCIsIm5hbWUiOiJiYWdhcyIsImVtYWlsIjoiYmFnYXNAZ21haWwuY29tIn0sImlhdCI6MTcyNTg3MTAzNiwiZXhwIjo0ODgxNjMxMDM2fQ.wFQLcrJj66wFeqIMYk2esMx3ULaHK6RFxkiToaLCuko";
+
+ // Anda bisa menggunakan prospektusId di URL jika diperlukan
+ const pdfUrl = `https://wibu-storage.wibudev.com/api/pdf-to-image?url=https://wibu-storage.wibudev.com/api/files/${id}`;
+
+ const response = await fetch(pdfUrl, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed get file", errorData?.message || "Unknown error");
+
+ return null;
+ }
+
+ const jsonData: PdfResponse = await response.json();
+ return jsonData;
+ } catch (error) {
+ console.error("Error get file", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiCreatedNotificationToAdmin = async ({ data }: { data: any }) => {
+ try {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/notifications/to-admin`, {
+ method: "POST",
+ body: JSON.stringify({ data }),
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to created notifications",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to created notifications");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error to created notifications", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiGetSeasonUserId = async () => {
+ try {
+ const response = await fetch(`/api/season`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to created notifications",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to created notifications");
+ }
+
+ return await response.json();
+ } catch (error) {
+ console.error("Error get user id", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+export const apiNewGetUserIdByToken = async () => {
+ try {
+ const response = await fetch(`/api/user/id`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get user id",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get user id");
+ }
+
+ const data = await response.json();
+ return data;
+ } catch (error) {
+ console.error("Error get user id", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+}
+
\ No newline at end of file
diff --git a/src/app_modules/_global/lib/api_fetch_master.ts b/src/app_modules/_global/lib/api_fetch_master.ts
new file mode 100644
index 00000000..cd437086
--- /dev/null
+++ b/src/app_modules/_global/lib/api_fetch_master.ts
@@ -0,0 +1,145 @@
+export {
+ apiGetMasterBank,
+ apiGetMasterBidangBisnis,
+ apiGetMasterStatusTransaksi,
+ apiGetAdminContact,
+ apiGetMasterEmotions,
+ apiGetMasterIndustri,
+};
+
+const apiGetMasterBank = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const respone = await fetch(`/api/master/bank`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await respone.json().catch(() => null);
+};
+
+const apiGetMasterBidangBisnis = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const respone = await fetch(`/api/master/bidang-bisnis`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await respone.json().catch(() => null);
+};
+
+const apiGetMasterStatusTransaksi = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/master/status_transaksi`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminContact = async () => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ // Send PUT request to update portfolio logo
+ const response = await fetch(`/api/master/admin-contact`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error get admin contact:",
+ errorData?.message || "Unknown error"
+ );
+
+ return null;
+ }
+
+ return await response.json();
+ } catch (error) {
+ console.error("Error get admin contact:", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiGetMasterEmotions = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/master/emotions`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+const apiGetMasterIndustri = async () => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/master/industri`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error get master industri:",
+ errorData?.message || "Unknown error"
+ );
+
+ return null;
+ }
+
+ return await response.json();
+ } catch (error) {
+ console.error("Error get master industri:", error);
+ throw error;
+ }
+};
\ No newline at end of file
diff --git a/src/app_modules/_global/lib/api_fetch_not_user.tsx b/src/app_modules/_global/lib/api_fetch_not_user.tsx
new file mode 100644
index 00000000..5795eb99
--- /dev/null
+++ b/src/app_modules/_global/lib/api_fetch_not_user.tsx
@@ -0,0 +1,16 @@
+export async function apiGetNotUserForJob({ id }: { id: string }) {
+ try {
+ const response = await fetch(`/api/not-user/job/${id}`);
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get job", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get job");
+ }
+
+ const data = await response.json();
+ return data;
+ } catch (error) {
+ console.error("Error get job:", error);
+ throw error;
+ }
+}
diff --git a/src/app_modules/_global/lib/api_user.ts b/src/app_modules/_global/lib/api_user.ts
new file mode 100644
index 00000000..a2009553
--- /dev/null
+++ b/src/app_modules/_global/lib/api_user.ts
@@ -0,0 +1,99 @@
+import { apiGetUserProfile } from './../../user/lib/api_user';
+export const apiGetUserId = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/user`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) return null;
+ const data: Record = await response.json();
+ return data;
+};
+
+export const apiGetCookiesUser = async () => {
+ const response = await fetch(`/api/user/get`);
+ return await response.json().catch(() => null);
+};
+
+export const apiGetACtivationUser = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/user/activation`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ return await response.json().catch(() => null);
+};
+
+export const apiGetAllUserWithExceptId = async ({
+ exceptId,
+}: {
+ exceptId?: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isExceptId = exceptId ? `?except-id=${exceptId}` : "";
+
+ const response = await fetch(`/api/user/all${isExceptId}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ return await response.json().catch(() => null);
+};
+
+export const apiGetUserById = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ // Send PUT request to update portfolio logo
+ const response = await fetch(`/api/user/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get user",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to get user"
+ );
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get user:", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
\ No newline at end of file
diff --git a/src/app_modules/_global/lib/base_style_text_input.tsx b/src/app_modules/_global/lib/base_style_text_input.tsx
new file mode 100644
index 00000000..722711b6
--- /dev/null
+++ b/src/app_modules/_global/lib/base_style_text_input.tsx
@@ -0,0 +1,15 @@
+import { Styles } from "@mantine/core";
+import { BaseSelectStylesNames } from "@mantine/core/lib/Select/types";
+import { MainColor } from "../color";
+
+export const baseStylesTextInput: Styles<
+ BaseSelectStylesNames,
+ Record
+> = {
+ label: {
+ color: MainColor.white,
+ },
+ input: {
+ backgroundColor: MainColor.white,
+ },
+};
diff --git a/src/app_modules/_global/lib/index.ts b/src/app_modules/_global/lib/index.ts
new file mode 100644
index 00000000..45e3c358
--- /dev/null
+++ b/src/app_modules/_global/lib/index.ts
@@ -0,0 +1,5 @@
+import { globalStatusApp } from "./master_list_app";
+import { MAX_SIZE } from "./maximal_setting";
+
+export { MAX_SIZE };
+export { globalStatusApp };
diff --git a/src/app_modules/_global/lib/interface/stiker.ts b/src/app_modules/_global/lib/interface/stiker.ts
new file mode 100644
index 00000000..ee7756e5
--- /dev/null
+++ b/src/app_modules/_global/lib/interface/stiker.ts
@@ -0,0 +1,17 @@
+import { Prisma } from "@prisma/client";
+
+export type ISticker = Prisma.StickerGetPayload<{
+ select: {
+ id: true;
+ name: true;
+ fileId: true;
+ emotions: true;
+ };
+ include: {
+ MasterEmotions: {
+ select: {
+ value: true;
+ };
+ };
+ };
+}>;
\ No newline at end of file
diff --git a/src/app_modules/_global/lib/master_jenis_kelamin.tsx b/src/app_modules/_global/lib/master_jenis_kelamin.tsx
new file mode 100644
index 00000000..4390edbb
--- /dev/null
+++ b/src/app_modules/_global/lib/master_jenis_kelamin.tsx
@@ -0,0 +1,4 @@
+export const masterJenisKelamin = [
+ { value: "laki-laki", label: "Laki-laki" },
+ { value: "perempuan", label: "Perempuan" },
+];
diff --git a/src/app_modules/_global/lib/master_list_app.ts b/src/app_modules/_global/lib/master_list_app.ts
new file mode 100644
index 00000000..6b08101b
--- /dev/null
+++ b/src/app_modules/_global/lib/master_list_app.ts
@@ -0,0 +1,55 @@
+import statusTransaksi from "../../../../src/bin/seeder/master/master_status_transaksi.json";
+import masterKategoriApp from "../../../../src/bin/seeder/master/master_kategori_app.json";
+
+export const globalStatusApp = [
+ {
+ id: "1",
+ name: "Publish",
+ },
+ {
+ id: "2",
+ name: "Review",
+ },
+ {
+ id: "3",
+ name: "Draft",
+ },
+ {
+ id: "4",
+ name: "Reject",
+ },
+];
+
+export const globalStatusTransaksi = statusTransaksi;
+
+export const globalMasterApp = [
+ { id: "0", name: "Semua" },
+ {
+ id: "1",
+ name: "Event",
+ },
+ {
+ id: "2",
+ name: "Job",
+ },
+ {
+ id: "3",
+ name: "Voting",
+ },
+ {
+ id: "4",
+ name: "Donasi",
+ },
+ {
+ id: "5",
+ name: "Investasi",
+ },
+ {
+ id: "6",
+ name: "Forum",
+ },
+ {
+ id: "7",
+ name: "Collaboration",
+ },
+];
diff --git a/src/app_modules/_global/lib/maximal_setting.ts b/src/app_modules/_global/lib/maximal_setting.ts
new file mode 100644
index 00000000..fb020b3e
--- /dev/null
+++ b/src/app_modules/_global/lib/maximal_setting.ts
@@ -0,0 +1,8 @@
+// Maksimal ukuran file dalam byte (3 MB)
+export const MAX_SIZE = 3 * 1024 * 1024; // 3 MB
+export const PemberitahuanMaksimalFile = "Ukuran file terlalu besar. Maksimal 3 MB.";
+
+/**
+ * Maksimal panjang input 1000 karakter
+ */
+export const maxInputLength = 1000;
\ No newline at end of file
diff --git a/src/app_modules/_global/lib/stiker.ts b/src/app_modules/_global/lib/stiker.ts
new file mode 100644
index 00000000..32c86160
--- /dev/null
+++ b/src/app_modules/_global/lib/stiker.ts
@@ -0,0 +1,89 @@
+const dummyStiker = [
+ {
+ id: 1,
+ name: "stiker1",
+ url: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQN9AKmsBY4yqdn3GueJJEVPJbfmf853gDL4cN8uc9eqsCTiJ1fzhcpywzVP68NCJEA5NQ&usqp=CAU",
+ },
+ {
+ id: 2,
+ name: "stiker2",
+ url: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS2lkV3ZiQ8m-OELSui2JGVy80vnh1cyRUV7NrgFNluPVVs2HUAyCHwCMAKGe2s5jk2sn8&usqp=CAU",
+ },
+ {
+ id: 3,
+ name: "stiker3",
+ url: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQHy9ZdsPc6dHgVTl5yIGpRJ-KtpTIsXA2_kbfO1Oc-pv_f7CNKGxhO56RjKujE3xCyb9k&usqp=CAU",
+ },
+ {
+ id: 4,
+ name: "stiker4",
+ url: "https://i.pinimg.com/236x/0a/2e/54/0a2e544c9a908beed6b544d031a444ca.jpg",
+ },
+ {
+ id: 5,
+ name: "stiker5",
+ url: "https://i.pinimg.com/564x/ff/d3/f7/ffd3f7498d09e4fdf48967fb4651b70b.jpg",
+ },
+ {
+ id: 6,
+ name: "stiker6",
+ url: "https://s.cafebazaar.ir/images/icons/com.apikdev.stickerwapentol-4febefdb-b3d4-4436-a241-e5e140ba3e0a_512x512.png?x-img=v1/resize,h_256,w_256,lossless_false/optimize",
+ },
+ {
+ id: 7,
+ name: "stiker7",
+ url: "https://down-id.img.susercontent.com/file/39fbca466b027a644d8386f265330365",
+ },
+ {
+ id: 8,
+ name: "stiker8",
+ url: "https://i.pinimg.com/236x/34/73/91/3473915a7434885e80ca11728e9b376a.jpg",
+ },
+ {
+ id: 9,
+ name: "stiker9",
+ url: "https://i.pinimg.com/736x/ae/8b/29/ae8b29377f241616e57e5d5745a8984a.jpg",
+ },
+ {
+ id: 10,
+ name: "stiker10",
+ url: "https://i.pinimg.com/564x/cd/da/68/cdda68c895e9e74382d912cbf1161634.jpg",
+ },
+ {
+ id: 11,
+ name: "stiker11",
+ url: "https://i.pinimg.com/564x/7c/af/41/7caf412dd8f5336951a45ca5f8105423.jpg",
+ },
+ {
+ id: 12,
+ name: "stiker12",
+ url: "https://i.pinimg.com/736x/43/55/5a/43555a618afc52331fd9a8effbbb33b1.jpg",
+ },
+ {
+ id: 13,
+ name: "stiker13",
+ url: "https://i.pinimg.com/564x/77/52/b1/7752b14b010db94a40132bf4f7aede8f.jpg",
+ },
+ {
+ id: 14,
+ name: "stiker14",
+ url: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSEeCX_gq9XpK9CwQvEtIwWXlciBHFBP5IpB5YPWR6QqD4TFIs8xj2ezCGzJfMgH4vR34Q&usqp=CAU",
+ },
+ {
+ id: 15,
+ name: "stiker15",
+ url: "https://i.pinimg.com/originals/03/a5/2f/03a52faa637fe35f33316e95b9e3f1ee.gif",
+ },
+ {
+ id: 16,
+ name: "stiker16",
+ url: "https://teknogram.id/gallery/stiker-wa/kartun-bergerak/stiker-kartun-bergerak-3.png",
+ },
+ {
+ id: 17,
+ name: "stiker17",
+ url: "https://id-live-01.slatic.net/p/1cbe0e62964c31030d12cfdf9dadb96b.jpg",
+ },
+];
+
+export const listStiker = dummyStiker;
\ No newline at end of file
diff --git a/src/app_modules/_global/lib/stiker/api_fecth_stiker_for_user.tsx b/src/app_modules/_global/lib/stiker/api_fecth_stiker_for_user.tsx
new file mode 100644
index 00000000..76724e9d
--- /dev/null
+++ b/src/app_modules/_global/lib/stiker/api_fecth_stiker_for_user.tsx
@@ -0,0 +1,32 @@
+export const apiGetStickerForUser = async ({ gender }: { gender: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/sticker?gender=${gender}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get sticker", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get sticker");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get sticker", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
diff --git a/src/app_modules/_global/lib/stiker/comp_V3_text_editor_stiker.tsx b/src/app_modules/_global/lib/stiker/comp_V3_text_editor_stiker.tsx
new file mode 100644
index 00000000..5b3e84c6
--- /dev/null
+++ b/src/app_modules/_global/lib/stiker/comp_V3_text_editor_stiker.tsx
@@ -0,0 +1,45 @@
+import { Paper, ScrollArea } from "@mantine/core";
+import React from "react";
+import { MainColor } from "../../color";
+import { ReactQuillDynamic } from "./react_quill_dynamix";
+import {
+ formatsReactQuill,
+ modulesReactQuill,
+} from "./react_quill_format_for_stiker";
+
+const ReactQuill = ReactQuillDynamic;
+
+export function Component_V3_TextEditorWithSticker({
+ quillRef,
+ data,
+ onSetData,
+}: {
+ quillRef: React.MutableRefObject;
+ data: any;
+ onSetData: (value: any) => void;
+}) {
+ return (
+ <>
+
+
+ {
+ onSetData(val);
+ }}
+ modules={modulesReactQuill}
+ formats={formatsReactQuill}
+ placeholder="Ketik pesan di sini atau tambahkan stiker..."
+ style={{
+ color: "black",
+ backgroundColor: MainColor.white,
+ border: "none",
+ }}
+ />
+
+
+ >
+ );
+}
diff --git a/src/app_modules/_global/lib/stiker/comp_button_sticker.tsx b/src/app_modules/_global/lib/stiker/comp_button_sticker.tsx
new file mode 100644
index 00000000..8ca66dbc
--- /dev/null
+++ b/src/app_modules/_global/lib/stiker/comp_button_sticker.tsx
@@ -0,0 +1,95 @@
+import { APIs } from "@/lib";
+import {
+ ActionIcon,
+ Box,
+ Center,
+ Image,
+ Loader,
+ ScrollArea,
+ SimpleGrid,
+ Stack,
+ Text,
+ Tooltip
+} from "@mantine/core";
+import { IconMoodSmileFilled } from "@tabler/icons-react";
+import _ from "lodash";
+import { MainColor } from "../../color";
+import { UIGlobal_Modal } from "../../ui";
+import { ISticker } from "../interface/stiker";
+import { insertStickerReactQuill } from "./react_quill_format_for_stiker";
+
+interface Props {
+ open: () => void;
+ close: () => void;
+ opened: boolean;
+ quillRef: any;
+ dataSticker: ISticker[] | null;
+}
+
+export const Comp_ButtonSticker = ({
+ open,
+ close,
+ opened,
+ quillRef,
+ dataSticker,
+}: Props) => {
+ return (
+ <>
+
+
+
+
+
+
+
+ {_.isEmpty(dataSticker) ? (
+
+
+
+ Sticker belum tersedia
+
+
+ Silahkan hubungi admin
+
+
+
+ ) : (
+
+ {dataSticker?.map((item: any) => (
+
+
+ }
+ src={APIs.GET({ fileId: item.fileId })}
+ height={100}
+ width={100}
+ alt={item.name}
+ style={{ cursor: "pointer" }}
+ onClick={() =>
+ insertStickerReactQuill({
+ stickerUrl: APIs.GET({ fileId: item.fileId }),
+ quillRef: quillRef,
+ close: close,
+ })
+ }
+ />
+
+
+ ))}
+
+ )}
+
+
+
+ >
+ );
+};
diff --git a/src/app_modules/_global/lib/stiker/react_quill_dynamix.tsx b/src/app_modules/_global/lib/stiker/react_quill_dynamix.tsx
new file mode 100644
index 00000000..d95ede3a
--- /dev/null
+++ b/src/app_modules/_global/lib/stiker/react_quill_dynamix.tsx
@@ -0,0 +1,20 @@
+import { Text } from "@mantine/core";
+import dynamic from "next/dynamic";
+
+export const ReactQuillDynamic = dynamic(
+ async () => {
+ const { default: RQ } = await import("react-quill");
+ // Tidak perlu import CSS dengan import statement
+ return function comp({ forwardedRef, ...props }: any) {
+ return ;
+ };
+ },
+ {
+ ssr: false,
+ loading: () => (
+
+ Ketik pesan di sini atau tambahkan stiker...
+
+ ),
+ }
+);
diff --git a/src/app_modules/_global/lib/stiker/react_quill_format_for_stiker.ts b/src/app_modules/_global/lib/stiker/react_quill_format_for_stiker.ts
new file mode 100644
index 00000000..c8af8914
--- /dev/null
+++ b/src/app_modules/_global/lib/stiker/react_quill_format_for_stiker.ts
@@ -0,0 +1,61 @@
+import React from "react";
+
+export {
+ modulesReactQuill,
+ formatsReactQuill,
+ insertStickerReactQuill
+};
+
+const modulesReactQuill = {
+ toolbar: [
+ [{ header: [1, 2, 3, 4, 5, 6, false] }],
+ ["bold", "italic", "underline", "strike", "blockquote"],
+ [{ list: "ordered" }, { list: "bullet" }],
+ ["link"],
+ ["clean"],
+ ],
+};
+
+const formatsReactQuill = [
+ "header",
+ "bold",
+ "italic",
+ "underline",
+ "strike",
+ "blockquote",
+ "list",
+ "bullet",
+ "link",
+ "image",
+];
+
+ const insertStickerReactQuill = ({
+ stickerUrl,
+ quillRef,
+ close,
+ }: {
+ stickerUrl: string;
+ quillRef: React.MutableRefObject;
+ close: () => void;
+ }) => {
+ if (!quillRef.current) return;
+
+ const quill = quillRef.current.getEditor();
+ const range = quill.getSelection(true);
+
+ // Custom image insertion with size
+ // Use custom blot or HTML string with size attributes
+ const stickerHtml = `
`;
+
+ // Insert HTML at cursor position
+ quill.clipboard.dangerouslyPasteHTML(range.index, stickerHtml);
+
+ // Move cursor after inserted sticker
+ quill.setSelection(range.index + 1, 0);
+
+ // Focus back on editor
+ quill.focus();
+
+ // Close sticker modal
+ close();
+ };
\ No newline at end of file
diff --git a/src/app_modules/_global/ui/V2_layout_tamplate.tsx b/src/app_modules/_global/ui/V2_layout_tamplate.tsx
new file mode 100644
index 00000000..4f8a0daa
--- /dev/null
+++ b/src/app_modules/_global/ui/V2_layout_tamplate.tsx
@@ -0,0 +1,151 @@
+"use client";
+
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import {
+ ActionIcon,
+ Box,
+ Button,
+ Container,
+ Group,
+ Text,
+ Title,
+} from "@mantine/core";
+import { useDisclosure } from "@mantine/hooks";
+import { createStyles } from "@mantine/styles";
+import { IconBell, IconSearch } from "@tabler/icons-react";
+import { ReactNode, useEffect, useState } from "react";
+
+// Styling langsung didefinisikan di dalam komponen
+const useStyles = createStyles((theme) => ({
+ pageContainer: {
+ display: "flex",
+ flexDirection: "column",
+ minHeight: "100dvh", // dynamic viewport height untuk mobile
+ width: "100%",
+ maxWidth: "500px", // Batasi lebar maksimum
+ margin: "0 auto", // Pusatkan layout
+ boxShadow: "0 0 10px rgba(0, 0, 0, 0.1)", // Tambahkan shadow untuk efek mobile-like
+ backgroundColor: MainColor.darkblue, // Warna latar belakang fallback
+
+ [`@media (max-width: 768px)`]: {
+ maxWidth: "100%", // Pada layar mobile, gunakan lebar penuh
+ boxShadow: "none", // Hilangkan shadow pada mobile
+ },
+ },
+
+ header: {
+ position: "sticky",
+ top: 0,
+ width: "100%",
+ maxWidth: "500px", // Batasi lebar header sesuai container
+ margin: "0 auto", // Pusatkan header
+ backgroundColor: MainColor.darkblue,
+ boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)",
+ zIndex: 100, // Pastikan z-index tinggi
+ transition: "all 0.3s ease",
+ color: MainColor.yellow,
+ },
+
+ scrolled: {
+ boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
+ },
+
+ headerContainer: {
+ height: "8vh",
+ display: "flex",
+ alignItems: "center",
+ padding: "0 16px", // Padding untuk mobile view
+
+ [`@media (max-width: 768px)`]: {
+ height: "8vh",
+ },
+ borderBottom: `2px solid ${AccentColor.blue}`,
+ borderBottomLeftRadius: "20px",
+ borderBottomRightRadius: "20px",
+ },
+
+ content: {
+ flex: 1,
+ width: "100%",
+ overflowY: "hidden", // Izinkan scrolling pada konten
+ paddingBottom: "8vh", // Sesuaikan dengan tinggi footer
+ },
+
+ footer: {
+ width: "100%",
+ backgroundColor: MainColor.darkblue,
+ borderTop: `2px solid ${AccentColor.blue}`,
+ height: "10vh", // Tinggi footer
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ position: "fixed",
+ bottom: 0,
+ left: "50%", // Pusatkan footer
+ transform: "translateX(-50%)", // Pusatkan footer
+ maxWidth: "500px", // Batasi lebar footer
+ color: MainColor.white,
+ borderTopLeftRadius: "20px",
+ borderTopRightRadius: "20px",
+ },
+}));
+
+interface ClientLayoutProps {
+ children: ReactNode;
+}
+
+export default function UI_NewLayoutTamplate({ children }: ClientLayoutProps) {
+ const { classes } = useStyles();
+
+ return {children};
+}
+
+export function UI_NewHeader({ children }: { children: ReactNode }) {
+ const { classes, cx } = useStyles();
+ const [scrolled, setScrolled] = useState(false);
+
+ // Effect untuk mendeteksi scroll
+ useEffect(() => {
+ function handleScroll() {
+ if (window.scrollY > 10) {
+ setScrolled(true);
+ } else {
+ setScrolled(false);
+ }
+ }
+
+ window.addEventListener("scroll", handleScroll);
+ return () => window.removeEventListener("scroll", handleScroll);
+ }, []);
+
+ return (
+
+
+ {children}
+
+
+ );
+}
+
+export function UI_NewChildren({ children }: { children: ReactNode }) {
+ const { classes } = useStyles();
+ return (
+
+
+ {children}
+
+
+ );
+}
+
+export function UI_NewFooter({ children }: { children: ReactNode }) {
+ const { classes } = useStyles();
+ return (
+
+ {children}
+
+ );
+}
diff --git a/src/app_modules/_global/ui/new_ui_content.tsx b/src/app_modules/_global/ui/new_ui_content.tsx
new file mode 100644
index 00000000..e3e00a8e
--- /dev/null
+++ b/src/app_modules/_global/ui/new_ui_content.tsx
@@ -0,0 +1,28 @@
+import { Box } from "@mantine/core";
+
+export function NewUI_Content({
+ children,
+ isScroll,
+}: {
+ children: React.ReactNode;
+ isScroll?: React.CSSProperties["overflowY"];
+}) {
+ return (
+ <>
+
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/_global/ui/new_ui_footer.tsx b/src/app_modules/_global/ui/new_ui_footer.tsx
new file mode 100644
index 00000000..645dd94f
--- /dev/null
+++ b/src/app_modules/_global/ui/new_ui_footer.tsx
@@ -0,0 +1,30 @@
+import { Box, rem } from "@mantine/core";
+import { AccentColor } from "../color";
+
+export function NewUI_Footer({ children }: { children: React.ReactNode }) {
+ return (
+ <>
+
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/_global/ui/new_ui_header.tsx b/src/app_modules/_global/ui/new_ui_header.tsx
new file mode 100644
index 00000000..7bf251e4
--- /dev/null
+++ b/src/app_modules/_global/ui/new_ui_header.tsx
@@ -0,0 +1,123 @@
+import { ActionIcon, Box, Group, Title, Loader } from "@mantine/core";
+import { AccentColor, MainColor } from "../color";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { IconChevronLeft } from "@tabler/icons-react";
+
+export function NewUI_Header({
+ title,
+ posotion,
+ // left button
+ hideButtonLeft,
+ iconLeft,
+ routerLeft,
+ customButtonLeft,
+ // right button
+ iconRight,
+ routerRight,
+ customButtonRight,
+ backgroundColor,
+}: {
+ title: string;
+ posotion?: any;
+ // left button
+ hideButtonLeft?: boolean;
+ iconLeft?: any;
+ routerLeft?: any;
+ customButtonLeft?: React.ReactNode;
+ // right button
+ iconRight?: any;
+ routerRight?: any;
+ customButtonRight?: React.ReactNode;
+ backgroundColor?: string;
+}) {
+ const router = useRouter();
+ const [isLoading, setIsLoading] = useState(false);
+ const [isRightLoading, setRightLoading] = useState(false);
+
+ return (
+ <>
+
+
+ {hideButtonLeft ? (
+
+ ) : customButtonLeft ? (
+ customButtonLeft
+ ) : (
+ {
+ setIsLoading(true);
+ routerLeft === undefined
+ ? router.back()
+ : router.push(routerLeft, { scroll: false });
+ }}
+ >
+ {/* PAKE LOADING SAAT KLIK BACK */}
+ {/* {isLoading ? (
+
+ ) : iconLeft ? (
+ iconLeft
+ ) : (
+
+ )} */}
+
+ {/* GA PAKE LOADING SAAT KLIK BACK */}
+ {iconLeft ? iconLeft : }
+
+ )}
+
+
+ {title}
+
+
+ {customButtonRight ? (
+ customButtonRight
+ ) : iconRight === undefined ? (
+
+ ) : routerRight === undefined ? (
+ {iconRight}
+ ) : (
+ {
+ setRightLoading(true);
+ router.push(routerRight);
+ }}
+ >
+ {isRightLoading ? (
+
+ ) : (
+ iconRight
+ )}
+
+ )}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/_global/ui/new_ui_tamplate.tsx b/src/app_modules/_global/ui/new_ui_tamplate.tsx
new file mode 100644
index 00000000..2e292795
--- /dev/null
+++ b/src/app_modules/_global/ui/new_ui_tamplate.tsx
@@ -0,0 +1,40 @@
+"use client";
+
+import { BackgroundImage, Box } from "@mantine/core";
+import { MainColor } from "../color";
+
+export function NewUI_Tamplate({ children }: { children: React.ReactNode }) {
+ return (
+
+
+ {children}
+
+
+ );
+}
diff --git a/src/app_modules/_global/ui/ui_drawer.tsx b/src/app_modules/_global/ui/ui_drawer.tsx
index e15e2bea..6129be67 100644
--- a/src/app_modules/_global/ui/ui_drawer.tsx
+++ b/src/app_modules/_global/ui/ui_drawer.tsx
@@ -11,7 +11,7 @@ import {
import { IconX } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import { AccentColor } from "../color/color_pallet";
+import { AccentColor, MainColor } from "../color/color_pallet";
import ComponentGlobal_Loader from "../component/loader";
interface MODEL_DRAWER {
@@ -28,13 +28,13 @@ export default function UIGlobal_Drawer({
opened: boolean;
close: () => void;
component:
- | {
- id: string;
- name: string;
- icon: string;
- path: string;
- }[]
- | any[];
+ | {
+ id: string;
+ name: string;
+ icon: string;
+ path: string;
+ }[]
+ | any[];
}) {
const router = useRouter();
const [isLoading, setIsLoading] = useState(false);
@@ -64,7 +64,7 @@ export default function UIGlobal_Drawer({
borderRight: `1px solid ${AccentColor.blue}`,
borderLeft: `1px solid ${AccentColor.blue}`,
borderRadius: "20px 20px 0px 0px",
- color: "white",
+ color: MainColor.white,
paddingBottom: "5%",
},
}}
@@ -72,28 +72,35 @@ export default function UIGlobal_Drawer({
-
+
{component.map((e, i) => (
-
+ {
+ setPageId(e?.id);
+ setIsLoading(true);
+ router.push(e?.path, { scroll: false });
+ }}
+ >
{
- setPageId(e?.id);
- setIsLoading(true);
- router.push(e?.path, {scroll: false});
- }}
+ c={MainColor.white}
>
- {isLoading && e?.id === pageId ? (
+ {/* PAKE LOADING */}
+ {/* {isLoading && e?.id === pageId ? (
) : (
e?.icon
- )}
+ )} */}
+
+
+ {/* GA PAKE LOADING */}
+ {e?.icon}
+
-
+
{e?.name}
diff --git a/src/app_modules/_global/ui/ui_drawer_custom.tsx b/src/app_modules/_global/ui/ui_drawer_custom.tsx
index 034670b2..08b9a624 100644
--- a/src/app_modules/_global/ui/ui_drawer_custom.tsx
+++ b/src/app_modules/_global/ui/ui_drawer_custom.tsx
@@ -25,7 +25,7 @@ export default function UIGlobal_DrawerCustom({
}: {
opened: boolean;
close: () => void;
- component: React.ReactNode;
+ component: React.ReactNode;
}) {
return (
<>
@@ -44,6 +44,7 @@ export default function UIGlobal_DrawerCustom({
left: 0,
right: 0,
width: 500,
+ zIndex:10
},
body: {
backgroundColor: AccentColor.darkblue,
diff --git a/src/app_modules/_global/ui/ui_header_tamplate.tsx b/src/app_modules/_global/ui/ui_header_tamplate.tsx
index 6126711c..ef2e4fd2 100644
--- a/src/app_modules/_global/ui/ui_header_tamplate.tsx
+++ b/src/app_modules/_global/ui/ui_header_tamplate.tsx
@@ -49,12 +49,11 @@ export default function UIGlobal_LayoutHeaderTamplate({
<>
{
@@ -77,13 +76,17 @@ export default function UIGlobal_LayoutHeaderTamplate({
: router.push(routerLeft, { scroll: false });
}}
>
- {isLoading ? (
+ {/* PAKE LOADING SAAT KLIK BACK */}
+ {/* {isLoading ? (
) : iconLeft ? (
iconLeft
) : (
- )}
+ )} */}
+
+ {/* GA PAKE LOADING SAAT KLIK BACK */}
+ {iconLeft ? iconLeft : }
)}
diff --git a/src/app_modules/_global/ui/ui_image_preview.tsx b/src/app_modules/_global/ui/ui_image_preview.tsx
index 9f37411a..d867ebed 100644
--- a/src/app_modules/_global/ui/ui_image_preview.tsx
+++ b/src/app_modules/_global/ui/ui_image_preview.tsx
@@ -1,7 +1,7 @@
"use client";
-import { APIs } from "@/app/lib";
-import { pathAssetImage } from "@/app/lib/path_asset_image";
+import { APIs } from "@/lib";
+import { pathAssetImage } from "@/lib/path_asset_image";
import {
ActionIcon,
Box,
@@ -10,25 +10,23 @@ import {
Image,
rem,
ScrollArea,
- Skeleton,
- Text,
- Title,
+ Skeleton
} from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { IconX } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { MainColor } from "../color";
+import ComponentGlobal_Loader from "../component/loader";
import UIGlobal_LayoutHeaderTamplate from "./ui_header_tamplate";
import { UIHeader } from "./ui_layout_tamplate";
-import ComponentGlobal_Loader from "../component/loader";
export function UIGlobal_ImagePreview({ fileId }: { fileId: string }) {
const router = useRouter();
const [isImage, setIsImage] = useState(null);
const [isLoading, setIsLoading] = useState(false);
- const url = APIs.GET({ fileId: fileId });
+ const url = APIs.GET({ fileId: fileId, size: "500" });
useShallowEffect(() => {
onLoadImage();
@@ -82,7 +80,7 @@ export function UIGlobal_ImagePreview({ fileId }: { fileId: string }) {
}
/>
-
+
{isImage === null ? (
) : isImage ? (
diff --git a/src/app_modules/_global/ui/ui_layout_tamplate.tsx b/src/app_modules/_global/ui/ui_layout_tamplate.tsx
index 393a8f25..201a93fa 100644
--- a/src/app_modules/_global/ui/ui_layout_tamplate.tsx
+++ b/src/app_modules/_global/ui/ui_layout_tamplate.tsx
@@ -32,17 +32,17 @@ export default function UIGlobal_LayoutTamplate({
}}
>
-
+ > */}
{children}
-
+ {/* */}
>
@@ -78,7 +78,7 @@ export function UIChildren({
return (
<>
-
+
{children}
diff --git a/src/app_modules/_global/ui/ui_modal.tsx b/src/app_modules/_global/ui/ui_modal.tsx
index e6f33b7d..35547dc3 100644
--- a/src/app_modules/_global/ui/ui_modal.tsx
+++ b/src/app_modules/_global/ui/ui_modal.tsx
@@ -1,7 +1,17 @@
"use client";
-import { Modal, Stack, Title, Group, Button, Box } from "@mantine/core";
+import {
+ Modal,
+ Stack,
+ Title,
+ Group,
+ Button,
+ Box,
+ ActionIcon,
+} from "@mantine/core";
import { MainColor, AccentColor } from "../color/color_pallet";
+import React from "react";
+import { IconX } from "@tabler/icons-react";
export default function UIGlobal_Modal({
opened,
@@ -9,12 +19,18 @@ export default function UIGlobal_Modal({
title,
buttonKiri,
buttonKanan,
+ children,
+ closeButton,
+ closeOnClickOutside,
}: {
opened: any;
close: any;
title: any;
- buttonKiri: any;
- buttonKanan: any;
+ buttonKiri?: any;
+ buttonKanan?: any;
+ children?: React.ReactNode;
+ closeButton?: boolean;
+ closeOnClickOutside?: boolean;
}) {
return (
<>
@@ -25,6 +41,7 @@ export default function UIGlobal_Modal({
}}
centered
withCloseButton={false}
+ closeOnClickOutside={closeOnClickOutside}
styles={{
content: {
backgroundColor: MainColor.darkblue,
@@ -32,14 +49,25 @@ export default function UIGlobal_Modal({
},
}}
>
-
-
- {title}
-
-
- {buttonKiri}
- {buttonKanan}
+
+
+
+ {title}
+
+ {closeButton ? (
+
+
+
+ ) : null}
+ {children ? (
+ children
+ ) : (
+
+ {buttonKiri}
+ {buttonKanan}
+
+ )}
>
diff --git a/src/app_modules/_global/ui/ui_new_image_preview.tsx b/src/app_modules/_global/ui/ui_new_image_preview.tsx
new file mode 100644
index 00000000..11bb080b
--- /dev/null
+++ b/src/app_modules/_global/ui/ui_new_image_preview.tsx
@@ -0,0 +1,187 @@
+"use client";
+
+import { APIs } from "@/lib";
+import { pathAssetImage } from "@/lib/path_asset_image";
+import {
+ ActionIcon,
+ Box,
+ Center,
+ Container,
+ Image,
+ rem,
+ ScrollArea,
+ Skeleton,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconX } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { MainColor } from "../color";
+import ComponentGlobal_Loader from "../component/loader";
+import UIGlobal_LayoutHeaderTamplate from "./ui_header_tamplate";
+import { UIHeader } from "./ui_layout_tamplate";
+import { Component_Header } from "../component/new/component_header";
+import UI_NewLayoutTamplate, { UI_NewHeader, UI_NewChildren } from "./V2_layout_tamplate";
+
+export function UIGlobal_NewImagePreview({ fileId }: { fileId: string }) {
+ const router = useRouter();
+ const [isImage, setIsImage] = useState(null);
+ const [isLoading, setIsLoading] = useState(false);
+
+ const url = APIs.GET({ fileId: fileId, size: "500" });
+
+ useShallowEffect(() => {
+ onLoadImage();
+ }, []);
+
+ async function onLoadImage() {
+ const res = await fetch(url);
+ try {
+ if (res.ok) {
+ return setIsImage(true);
+ }
+ setIsImage(false);
+ } catch (error) {
+ console.log(error);
+ }
+ }
+
+ return (
+ <>
+
+
+ {
+ router.back(), setIsLoading(true);
+ }}
+ variant="transparent"
+ >
+ {isLoading ? (
+
+ ) : (
+
+ )}
+
+ }
+ />
+
+
+
+ {isImage === null ? (
+
+ ) : isImage ? (
+
+
+
+
+
+ ) : (
+
+
+
+
+
+ )}
+
+
+
+
+ {/*
+
+ {
+ router.back(), setIsLoading(true);
+ }}
+ variant="transparent"
+ >
+ {isLoading ? (
+
+ ) : (
+
+ )}
+
+ }
+ />
+ }
+ />
+
+
+ {isImage === null ? (
+
+ ) : isImage ? (
+
+
+
+
+
+ ) : (
+
+
+
+
+
+ )}
+
+
+ */}
+ >
+ );
+}
diff --git a/src/app_modules/_global/ui/ui_not_user_image_preview.tsx b/src/app_modules/_global/ui/ui_not_user_image_preview.tsx
index 134c594f..6fad617c 100644
--- a/src/app_modules/_global/ui/ui_not_user_image_preview.tsx
+++ b/src/app_modules/_global/ui/ui_not_user_image_preview.tsx
@@ -1,7 +1,7 @@
"use client";
-import { APIs } from "@/app/lib";
-import { pathAssetImage } from "@/app/lib/path_asset_image";
+import { APIs } from "@/lib";
+import { pathAssetImage } from "@/lib/path_asset_image";
import {
ActionIcon,
Box,
@@ -23,7 +23,7 @@ export function UIGlobal_NotUserImagePreview({ fileId }: { fileId: string }) {
const router = useRouter();
const [isImage, setIsImage] = useState(null);
- const url = APIs.GET({ fileId: fileId });
+ const url = APIs.GET({ fileId: fileId, size: "500" });
useShallowEffect(() => {
onLoadImage();
diff --git a/src/app_modules/_global/ui/ui_splash.tsx b/src/app_modules/_global/ui/ui_splash.tsx
index 0dc8657b..2a4d570b 100644
--- a/src/app_modules/_global/ui/ui_splash.tsx
+++ b/src/app_modules/_global/ui/ui_splash.tsx
@@ -2,16 +2,17 @@
import { Loader, Stack, ThemeIcon } from "@mantine/core";
import UIGlobal_LayoutDefault from "./ui_layout_default";
+import { MainColor } from "../color";
export default function UIGlobal_SplashScreen({ icon }: { icon: any }) {
return (
<>
-
+
{icon}
-
+
>
diff --git a/src/app_modules/admin/_admin_global/_component/button/detail_button.tsx b/src/app_modules/admin/_admin_global/_component/button/detail_button.tsx
new file mode 100644
index 00000000..2a6ebda6
--- /dev/null
+++ b/src/app_modules/admin/_admin_global/_component/button/detail_button.tsx
@@ -0,0 +1,28 @@
+import { Button } from "@mantine/core";
+import { IconEye } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+
+export default function Admin_DetailButton({ path }: { path: string }) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+
+ return (
+ <>
+ }
+ onClick={() => {
+ setLoading(true);
+ router.push(path || "");
+ }}
+ >
+ Detail
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/_admin_global/_component/comp_admin_boxstyle.tsx b/src/app_modules/admin/_admin_global/_component/comp_admin_boxstyle.tsx
new file mode 100644
index 00000000..7324985a
--- /dev/null
+++ b/src/app_modules/admin/_admin_global/_component/comp_admin_boxstyle.tsx
@@ -0,0 +1,26 @@
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { Paper } from "@mantine/core";
+
+export function Admin_ComponentBoxStyle({
+ children,
+ style,
+}: {
+ children: React.ReactNode;
+ style?: React.CSSProperties;
+}) {
+ return (
+ <>
+
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/_admin_global/_component/comp_admin_load_image.tsx b/src/app_modules/admin/_admin_global/_component/comp_admin_load_image.tsx
index 1e74a89e..497bde54 100644
--- a/src/app_modules/admin/_admin_global/_component/comp_admin_load_image.tsx
+++ b/src/app_modules/admin/_admin_global/_component/comp_admin_load_image.tsx
@@ -1,7 +1,7 @@
"use client";
-import { APIs, RouterAdminGlobal } from "@/app/lib";
-import { pathAssetImage } from "@/app/lib/path_asset_image";
+import { APIs, RouterAdminGlobal } from "@/lib";
+import { pathAssetImage } from "@/lib/path_asset_image";
import { Center, Image, Skeleton } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation";
@@ -15,7 +15,7 @@ export function Admin_ComponentLoadImageLandscape({
const router = useRouter();
const [isImage, setIsImage] = useState(null);
const [isLoading, setLoading] = useState(false);
- const url = APIs.GET({ fileId: fileId });
+ const url = APIs.GET({ fileId: fileId, size: "500" });
useShallowEffect(() => {
onLoadImage();
diff --git a/src/app_modules/admin/_admin_global/_component/comp_admin_modal.tsx b/src/app_modules/admin/_admin_global/_component/comp_admin_modal.tsx
new file mode 100644
index 00000000..168e4d9c
--- /dev/null
+++ b/src/app_modules/admin/_admin_global/_component/comp_admin_modal.tsx
@@ -0,0 +1,41 @@
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { Modal } from "@mantine/core";
+
+export function Admin_ComponentModal({
+ children,
+ opened,
+ onClose,
+ title,
+ size,
+ withCloseButton,
+ closeOnClickOutside,
+}: {
+ children: React.ReactNode;
+ opened: boolean;
+ onClose: () => void;
+ size?: "sm" | "md" | "lg" | "xl";
+ title?: any;
+ withCloseButton?: boolean | undefined;
+ closeOnClickOutside?: boolean | undefined;
+}) {
+ return (
+ <>
+
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/_admin_global/_component/comp_admin_modal_publish.tsx b/src/app_modules/admin/_admin_global/_component/comp_admin_modal_publish.tsx
new file mode 100644
index 00000000..d962a119
--- /dev/null
+++ b/src/app_modules/admin/_admin_global/_component/comp_admin_modal_publish.tsx
@@ -0,0 +1,34 @@
+import { AdminColor } from '@/app_modules/_global/color/color_pallet';
+import { Group, Modal, Stack } from '@mantine/core';
+import React from 'react';
+
+function Admin_ComponentModalPublish({ onClose, opened, title, buttonKiri, buttonKanan, }: {
+ onClose: () => void;
+ opened: any;
+ title: string;
+ buttonKiri: React.ReactNode;
+ buttonKanan: React.ReactNode;
+}) {
+ return (
+ <>
+
+
+
+ {buttonKiri}
+ {buttonKanan}
+
+
+
+ >
+ );
+}
+
+export default Admin_ComponentModalPublish;
diff --git a/src/app_modules/admin/_admin_global/_component/comp_admin_modal_report.tsx b/src/app_modules/admin/_admin_global/_component/comp_admin_modal_report.tsx
index aed01faf..9abdc037 100644
--- a/src/app_modules/admin/_admin_global/_component/comp_admin_modal_report.tsx
+++ b/src/app_modules/admin/_admin_global/_component/comp_admin_modal_report.tsx
@@ -1,5 +1,6 @@
"use client";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import { Group, Modal, Stack, Textarea } from "@mantine/core";
import React from "react";
@@ -25,6 +26,8 @@ export function Admin_ComponentModalReport({
return (
<>
Rp.{" "}
diff --git a/src/app_modules/admin/_admin_global/_component/comp_button_user_on_navbar.tsx b/src/app_modules/admin/_admin_global/_component/comp_button_user_on_navbar.tsx
index 787b63ce..0f8e5a2f 100644
--- a/src/app_modules/admin/_admin_global/_component/comp_button_user_on_navbar.tsx
+++ b/src/app_modules/admin/_admin_global/_component/comp_button_user_on_navbar.tsx
@@ -1,6 +1,6 @@
"use client";
-import { Warna } from "@/app/lib/warna";
+import { Warna } from "@/lib/warna";
import { AccentColor } from "@/app_modules/_global/color";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global";
import { MODEL_USER } from "@/app_modules/home/model/interface";
@@ -14,6 +14,7 @@ import {
Menu,
Modal,
Popover,
+ SimpleGrid,
Stack,
Text,
Title,
@@ -21,6 +22,7 @@ import {
import { IconPhone, IconUser, IconUserCircle } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { Admin_ComponentModal } from "./comp_admin_modal";
export function Admin_ComponentButtonUserCircle({
dataUser,
@@ -35,7 +37,7 @@ export function Admin_ComponentButtonUserCircle({
async function onClickLogout() {
setLoadingLogout(true);
- const res = await fetch(`/api/auth/logout?id=${dataUser.id}`, {
+ const res = await fetch(`/api/auth/logout?id=${dataUser?.id}`, {
method: "GET",
});
@@ -67,7 +69,7 @@ export function Admin_ComponentButtonUserCircle({
- {dataUser.username}
+ {dataUser?.username}
@@ -76,22 +78,32 @@ export function Admin_ComponentButtonUserCircle({
- +{dataUser.nomor}
+ +{dataUser?.nomor}
-
-
+
- setOpenModal(false)}
centered
@@ -121,7 +133,38 @@ export function Admin_ComponentButtonUserCircle({
-
+ */}
+
+ setOpenModal(false)}
+ title={"Anda yakin ingin keluar ?"}
+ withCloseButton={false}
+ closeOnClickOutside={false}
+ >
+
+
+ {
+ setOpenModal(false);
+ }}
+ radius={50}
+ >
+ Batal
+
+ onClickLogout()}
+ >
+ Keluar
+
+
+
+
>
);
@@ -165,7 +208,7 @@ export function Admin_ComponentButtonUserCircle({
- {dataUser.username}
+ {dataUser?.username}
@@ -175,7 +218,7 @@ export function Admin_ComponentButtonUserCircle({
- +{dataUser.nomor}
+ +{dataUser?.nomor}
diff --git a/src/app_modules/admin/_admin_global/_component/skeleton/customSkeletonAdmin.tsx b/src/app_modules/admin/_admin_global/_component/skeleton/customSkeletonAdmin.tsx
new file mode 100644
index 00000000..a1461a53
--- /dev/null
+++ b/src/app_modules/admin/_admin_global/_component/skeleton/customSkeletonAdmin.tsx
@@ -0,0 +1,34 @@
+import { Skeleton, SkeletonProps, createStyles } from '@mantine/core';
+
+interface CustomSkeletonProps extends SkeletonProps {
+ isLoading?: boolean;
+ className?: string;
+}
+
+const useStyles = createStyles((theme) => ({
+ skeleton: {
+ '&::before': {
+ backgroundColor: "#1F5B9E",
+ },
+ '&::after': {
+ backgroundColor: "#0F3055",
+ },
+ },
+}));
+
+const CustomSkeletonAdmin: React.FC = ({
+ isLoading = true,
+ className,
+ ...props
+}) => {
+ const { classes, cx } = useStyles();
+ return (
+
+ );
+};
+
+export default CustomSkeletonAdmin;
\ No newline at end of file
diff --git a/src/app_modules/admin/_admin_global/_component/skeleton/main_dashboard_skeleton.tsx b/src/app_modules/admin/_admin_global/_component/skeleton/main_dashboard_skeleton.tsx
new file mode 100644
index 00000000..47a7d59e
--- /dev/null
+++ b/src/app_modules/admin/_admin_global/_component/skeleton/main_dashboard_skeleton.tsx
@@ -0,0 +1,53 @@
+import { MainColor, AccentColor } from '@/app_modules/_global/color';
+import { AdminColor } from '@/app_modules/_global/color/color_pallet';
+import { Flex, Grid, Paper, Stack, Text, ThemeIcon, Title } from '@mantine/core';
+import React from 'react';
+import CustomSkeletonAdmin from './customSkeletonAdmin';
+import ComponentAdminGlobal_HeaderTamplate from '../../header_tamplate';
+import { IconFileText, IconUsers } from '@tabler/icons-react';
+
+function MainDashboardSkeleton() {
+ const listBox = [
+ {
+ id: 1,
+ name: "User",
+ jumlah: "",
+ link: "",
+ icon:
+ },
+ {
+ id: 2,
+ name: "Portofolio",
+ jumlah: "countPortofolio",
+ link: "",
+ icon:
+ },
+ ];
+ return (
+ <>
+
+
+
+ {listBox.map((e) => (
+
+
+
+ {e.name}
+
+
+ {e.icon}
+
+
+
+
+ ))}
+
+
+ {/* */}
+
+
+
+ >
+ );
+}
+export default MainDashboardSkeleton;
diff --git a/src/app_modules/admin/_admin_global/_component/title_page.tsx b/src/app_modules/admin/_admin_global/_component/title_page.tsx
index adf4b7f1..49070859 100644
--- a/src/app_modules/admin/_admin_global/_component/title_page.tsx
+++ b/src/app_modules/admin/_admin_global/_component/title_page.tsx
@@ -1,5 +1,6 @@
"use client";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import { Group, Title, TextInput } from "@mantine/core";
import { IconSearch } from "@tabler/icons-react";
import React from "react";
@@ -9,7 +10,7 @@ export function ComponentAdminGlobal_TitlePage({
color,
component,
}: {
- name: string;
+ name: React.ReactNode | string
color?: string;
component?: React.ReactNode;
}) {
@@ -17,11 +18,11 @@ export function ComponentAdminGlobal_TitlePage({
<>
- {name}
+ {name}
{component ? component : ""}
>
diff --git a/src/app_modules/admin/_admin_global/_ui/ui_navbar_admin.tsx b/src/app_modules/admin/_admin_global/_ui/ui_navbar_admin.tsx
index d71b65f8..9669cd7c 100644
--- a/src/app_modules/admin/_admin_global/_ui/ui_navbar_admin.tsx
+++ b/src/app_modules/admin/_admin_global/_ui/ui_navbar_admin.tsx
@@ -14,7 +14,7 @@ export default function Admin_UiNavbar({
setActiveId,
setActiveChildId,
}: {
- userRoleId: string;
+ userRoleId: string | null;
activeId: string;
activeChildId: string;
setActiveId: (val: any) => void;
@@ -199,5 +199,5 @@ export default function Admin_UiNavbar({
));
- return userRoleId == "2" ? adminNavbar : developerNavbar;
+ return userRoleId == "3" ? developerNavbar : adminNavbar;
}
diff --git a/src/app_modules/admin/_admin_global/back_button.tsx b/src/app_modules/admin/_admin_global/back_button.tsx
index 3012652a..28f0ed33 100644
--- a/src/app_modules/admin/_admin_global/back_button.tsx
+++ b/src/app_modules/admin/_admin_global/back_button.tsx
@@ -1,11 +1,12 @@
"use client";
+import { AccentColor, AdminColor } from "@/app_modules/_global/color/color_pallet";
import { Group, Button, Loader } from "@mantine/core";
import { IconChevronLeft } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
-export default function AdminGlobal_ComponentBackButton({
+export default function Admin_ComponentBackButton({
path,
}: {
path?: string;
@@ -17,7 +18,8 @@ export default function AdminGlobal_ComponentBackButton({
<>
@@ -25,7 +27,7 @@ export default function AdminGlobal_ComponentBackButton({
)
}
- variant="white"
+ style={{ backgroundColor: AdminColor.softBlue}}
onClick={() => {
setLoading(true);
// setTimeout(() => , 3000);
diff --git a/src/app_modules/admin/_admin_global/comp_preview_image_admin.tsx b/src/app_modules/admin/_admin_global/comp_preview_image_admin.tsx
index f75bdb40..31f15088 100644
--- a/src/app_modules/admin/_admin_global/comp_preview_image_admin.tsx
+++ b/src/app_modules/admin/_admin_global/comp_preview_image_admin.tsx
@@ -1,19 +1,22 @@
"use client";
import { Box, Center, Image, ScrollArea, Skeleton, Stack, Text } from "@mantine/core";
-import AdminGlobal_ComponentBackButton from "./back_button";
-import { APIs, pathAssetImage } from "@/app/lib";
+import Admin_ComponentBackButton from "./back_button";
+import { APIs, pathAssetImage } from "@/lib";
import { useShallowEffect } from "@mantine/hooks";
import { useState } from "react";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
export function Admin_ComponentPreviewImageAdmin({
fileId,
+ size,
}: {
fileId: string;
+ size?: string;
}) {
const [isImage, setIsImage] = useState(null);
- const url = APIs.GET({ fileId: fileId });
+ const url = APIs.GET({ fileId: fileId, size: size || "1000" });
useShallowEffect(() => {
onLoadImage();
@@ -34,19 +37,21 @@ export function Admin_ComponentPreviewImageAdmin({
return (
<>
-
-
+
+
{isImage === null ? (
-
+
) : isImage ? (
-
-
-
-
-
+
+
+
) : (
+ //
+ //
+ //
+ //
- {name ? name : null}
-
+ {name ? name : null}
>
);
diff --git a/src/app_modules/admin/_admin_global/logout.tsx b/src/app_modules/admin/_admin_global/logout.tsx
index bd430212..f45b6d58 100644
--- a/src/app_modules/admin/_admin_global/logout.tsx
+++ b/src/app_modules/admin/_admin_global/logout.tsx
@@ -1,5 +1,5 @@
"use client";
-import { Warna } from "@/app/lib/warna";
+import { Warna } from "@/lib/warna";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import { auth_Logout } from "@/app_modules/auth/fun/fun_logout";
diff --git a/src/app_modules/admin/_admin_global/tampilan_rupiah.tsx b/src/app_modules/admin/_admin_global/tampilan_rupiah.tsx
index 2a9145fd..31fbd524 100644
--- a/src/app_modules/admin/_admin_global/tampilan_rupiah.tsx
+++ b/src/app_modules/admin/_admin_global/tampilan_rupiah.tsx
@@ -1,3 +1,4 @@
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import { Text } from "@mantine/core";
export default function ComponentAdminGlobal_TampilanRupiahDonasi({
@@ -9,7 +10,7 @@ export default function ComponentAdminGlobal_TampilanRupiahDonasi({
}) {
return (
<>
-
+
Rp.{" "}
{new Intl.NumberFormat("id-ID", { maximumFractionDigits: 10 }).format(
nominal
diff --git a/src/app_modules/admin/_components_v3/comp_button_user_circle.tsx b/src/app_modules/admin/_components_v3/comp_button_user_circle.tsx
new file mode 100644
index 00000000..765a1f35
--- /dev/null
+++ b/src/app_modules/admin/_components_v3/comp_button_user_circle.tsx
@@ -0,0 +1,396 @@
+"use client";
+
+import { AccentColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global";
+import { apiFetchLogout } from "@/app_modules/auth/_lib/api_fetch_auth";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { MODEL_USER } from "@/app_modules/home/model/interface";
+import { Warna } from "@/lib/warna";
+import {
+ ActionIcon,
+ Button,
+ Divider,
+ Group,
+ Indicator,
+ MediaQuery,
+ Popover,
+ Stack,
+ Text,
+ Title
+} from "@mantine/core";
+import {
+ IconBell,
+ IconDotsVertical,
+ IconHierarchy2,
+ IconLogout,
+ IconReplaceUser,
+ IconUser,
+ IconUserCircle,
+} from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { Admin_ComponentModal } from "../_admin_global/_component/comp_admin_modal";
+
+export function Admin_V3_ComponentButtonUserCircle({
+ dataUser,
+ openPop,
+ setOpenPop,
+ setNavbarOpen,
+ setDrawerNotifikasi,
+ countNotifikasi,
+}: {
+ dataUser: MODEL_USER | null;
+ openPop: boolean;
+ setOpenPop: React.Dispatch>;
+ // setOpenPop: (open: boolean) => void;
+ setNavbarOpen: React.Dispatch>;
+ // setNavbarOpen: (open: boolean) => void;
+ setDrawerNotifikasi: React.Dispatch>;
+ // setDrawerNotifikasi: (open: boolean) => void;
+ countNotifikasi: number;
+}) {
+ const router = useRouter();
+
+ // STATE DESKTOP VIEW
+ const [dks_opened, setDksOpened] = useState(false);
+
+ // STATE MOBILE VIEW
+ const [openModalLogout, setOpenModalLogout] = useState(false);
+ const [openModalReplaceUser, setOpenModalReplaceUser] = useState(false);
+ const [loadingLogout, setLoadingLogout] = useState(false);
+ const [loadingReplaceUser, setLoadingReplaceUser] = useState(false);
+
+ const listMenuMobile = [
+ {
+ icon: IconUser,
+ label: dataUser?.username,
+ color: "",
+ onClick: () => {},
+ },
+ {
+ icon: IconHierarchy2,
+ label:
+ dataUser?.masterUserRoleId == "2"
+ ? "Admin "
+ : dataUser?.masterUserRoleId == "3"
+ ? "Super Admin"
+ : "",
+ color: "",
+ onClick: () => {},
+ },
+ {
+ icon: IconBell,
+ label: "Notifikasi",
+ color: "",
+ onClick: () => {
+ // ComponentAdminGlobal_NotifikasiPeringatan(
+ // "Notifikasi: Masih dalam pengembangan",
+ // 2000
+ // );
+ setDrawerNotifikasi(true);
+ },
+ },
+ {
+ icon: IconReplaceUser,
+ label: "Tampilan user",
+ color: "",
+ onClick: () => setOpenModalReplaceUser(true),
+ },
+ {
+ icon: IconLogout,
+ label: "Logout",
+ color: "red",
+ onClick: () => setOpenModalLogout(true),
+ },
+ ];
+
+ const listMenuDekstop = [
+ {
+ icon: IconBell,
+ label: "Notifikasi",
+ color: "",
+ onClick: () => {
+ // ComponentAdminGlobal_NotifikasiPeringatan(
+ // "Notifikasi: Masih dalam pengembangan",
+ // 2000
+ // );
+ setDrawerNotifikasi(true);
+ },
+ },
+ {
+ icon: IconReplaceUser,
+ label: "Tampilan user",
+ color: "",
+ onClick: () => setOpenModalReplaceUser(true),
+ },
+ {
+ icon: IconLogout,
+ label: "Logout",
+ color: "red",
+ onClick: () => setOpenModalLogout(true),
+ },
+ ];
+
+ async function onClickLogout() {
+ try {
+ setLoadingLogout(true);
+ const response = await apiFetchLogout({ id: dataUser?.id as string });
+
+ if (response && response.success) {
+ ComponentGlobal_NotifikasiBerhasil(response.message);
+ router.replace("/login", { scroll: false });
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoadingLogout(false);
+ }
+ }
+
+ const PopoverButton = () => {
+ return (
+ <>
+
+
+
+
+ {
+ setOpenPop((o) => !o);
+ setNavbarOpen(false);
+ }}
+ >
+
+
+
+
+
+
+
+
+
+ {!dataUser?.username ? (
+
+ ) : (
+ dataUser?.username
+ )}
+ {" "}
+
+
+ {!dataUser?.username ? (
+
+ ) : dataUser?.masterUserRoleId == "2" ? (
+ "Admin"
+ ) : dataUser?.masterUserRoleId == "3" ? (
+ "Super Admin"
+ ) : (
+ ""
+ )}
+ {" "}
+
+ {
+ setOpenPop((o) => !o);
+ setNavbarOpen(false);
+ }}
+ >
+
+
+
+
+
+
+
+
+ {/* */}
+
+ {/* Mobile View */}
+ <>
+ {listMenuMobile.map((e, i) => (
+
+
+ {e.label == "Notifikasi" ? (
+ countNotifikasi == 0 ||
+ dataUser?.masterUserRoleId == "3" ? (
+
+ ) : (
+
+ {countNotifikasi ? countNotifikasi : ""}
+
+ }
+ >
+
+
+ )
+ ) : (
+
+ )}
+
+ {e.label}
+
+
+
+ ))}
+ >
+ {/* Mobile View */}
+
+ {/* Desktop View */}
+ <>
+ {listMenuDekstop.map((e, i) => (
+
+
+ {e.label == "Notifikasi" ? (
+ countNotifikasi == 0 ||
+ dataUser?.masterUserRoleId == "3" ? (
+
+ ) : (
+
+ {countNotifikasi ? countNotifikasi : ""}
+
+ }
+ >
+
+
+ )
+ ) : (
+
+ )}
+
+ {e.label}
+
+
+
+ ))}
+ >
+ {/* Desktop View */}
+
+
+
+
+
+ >
+ );
+ };
+
+ return (
+ <>
+
+
+ setOpenModalLogout(false)}
+ withCloseButton={false}
+ closeOnClickOutside={false}
+ >
+
+
+ Anda yakin ingin keluar ?
+
+
+ {
+ setOpenPop((o) => !o);
+ setOpenModalLogout(false);
+ }}
+ radius={50}
+ >
+ Batal
+
+ onClickLogout()}
+ >
+ Keluar
+
+
+
+
+
+ setOpenModalReplaceUser(false)}
+ withCloseButton={false}
+ closeOnClickOutside={false}
+ >
+
+
+ Anda yakin ingin pindah ke tampilan user ?
+
+
+ {
+ setOpenPop((o) => !o);
+ setOpenModalReplaceUser(false);
+ }}
+ radius={50}
+ >
+ Batal
+
+ {
+ router.push("/dev/home", { scroll: false });
+ setLoadingReplaceUser(true);
+ }}
+ >
+ Ke Tampilan User
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/_components_v3/comp_detail_data.tsx b/src/app_modules/admin/_components_v3/comp_detail_data.tsx
new file mode 100644
index 00000000..8de45ed3
--- /dev/null
+++ b/src/app_modules/admin/_components_v3/comp_detail_data.tsx
@@ -0,0 +1,29 @@
+import { MainColor } from "@/app_modules/_global/color";
+import { Grid, Paper, Text } from "@mantine/core";
+
+export function Admin_V3_ComponentDetail({
+ item,
+}: {
+ item: Record;
+}) {
+ return (
+ <>
+
+
+
+ {item.title || item.label}
+
+
+
+ {item.value}
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/_components_v3/comp_pagination_breakpoint.tsx b/src/app_modules/admin/_components_v3/comp_pagination_breakpoint.tsx
new file mode 100644
index 00000000..80723cb3
--- /dev/null
+++ b/src/app_modules/admin/_components_v3/comp_pagination_breakpoint.tsx
@@ -0,0 +1,35 @@
+import { Pagination } from "@mantine/core";
+import { useMediaQuery } from "@mantine/hooks";
+
+export function Admin_V3_ComponentPaginationBreakpoint({
+ value,
+ total,
+ onChange,
+}: {
+ value: number;
+ total: number;
+ onChange: (val: number) => void;
+}) {
+ // Dalam komponen Anda
+ const isMobile = useMediaQuery("(max-width: 480px)");
+ const isTablet = useMediaQuery("(max-width: 768px)");
+
+ return (
+ <>
+ {
+ onChange(val);
+ }}
+ position="center"
+ size={isMobile ? "xs" : isTablet ? "sm" : "md"}
+ radius={isMobile ? "xl" : "md"}
+ siblings={isMobile ? 0 : 1}
+ boundaries={isMobile ? 1 : 2}
+ withEdges
+ />
+ >
+ );
+}
diff --git a/src/app_modules/admin/_components_v3/comp_simple_grid_breakpoint.tsx b/src/app_modules/admin/_components_v3/comp_simple_grid_breakpoint.tsx
new file mode 100644
index 00000000..7d1883b0
--- /dev/null
+++ b/src/app_modules/admin/_components_v3/comp_simple_grid_breakpoint.tsx
@@ -0,0 +1,34 @@
+import { SimpleGrid } from "@mantine/core";
+
+export function Admin_V3_ComponentBreakpoint({
+ children,
+ cols,
+ sm,
+ md,
+ lg,
+ allCols,
+}: {
+ children: React.ReactNode;
+ cols?: number;
+ sm?: number;
+ md?: number;
+ lg?: number;
+ allCols?: number;
+}) {
+ return (
+ <>
+
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/_components_v3/comp_skeleton_breakpoint.tsx b/src/app_modules/admin/_components_v3/comp_skeleton_breakpoint.tsx
new file mode 100644
index 00000000..1358f0e6
--- /dev/null
+++ b/src/app_modules/admin/_components_v3/comp_skeleton_breakpoint.tsx
@@ -0,0 +1,25 @@
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { SimpleGrid } from "@mantine/core";
+
+export function Admin_V3_ComponentSkeletonBreakpoint({
+ skeletonRequest,
+}: {
+ skeletonRequest?: number;
+}) {
+ return (
+ <>
+
+ {Array.from({ length: skeletonRequest || 1 }, (_, index) => (
+
+ ))}
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/_components_v3/main_layout.tsx b/src/app_modules/admin/_components_v3/main_layout.tsx
new file mode 100644
index 00000000..19e1fb4c
--- /dev/null
+++ b/src/app_modules/admin/_components_v3/main_layout.tsx
@@ -0,0 +1,247 @@
+"use client";
+
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { apiGetUserById } from "@/app_modules/_global/lib/api_user";
+import { MODEL_USER } from "@/app_modules/home/model/interface";
+import { gs_admin_ntf } from "@/lib/global_state";
+import {
+ AppShell,
+ Burger,
+ Divider,
+ Drawer,
+ Group,
+ Header,
+ MediaQuery,
+ Navbar,
+ ScrollArea,
+ Stack,
+ Text
+} from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { useAtom } from "jotai";
+import type React from "react";
+import { useState } from "react";
+import { Admin_UiNavbar } from "../_admin_global";
+import {
+ gs_admin_navbar_menu,
+ gs_admin_navbar_subMenu,
+} from "../_admin_global/new_global_state";
+import { apiGetCountNotifikasiByUserId } from "../notifikasi/lib/api_fetch_notifikasi";
+import { Admin_V3_ComponentButtonUserCircle } from "./comp_button_user_circle";
+import { Admin_V3_ViewDrawerNotifikasi } from "./notifikasi/view_drawer_notifikasi";
+import { Admin_V3_SkeletonNavbar } from "./skeleton_navbar";
+
+export function Admin_V3_MainLayout({
+ children,
+ userLoginId,
+ countNotifikasi,
+
+ version,
+}: {
+ children: React.ReactNode;
+ userLoginId: string;
+ countNotifikasi: number;
+ version: string;
+}) {
+ const [dataUser, setDataUser] = useState(null);
+ const userRoleId = dataUser?.masterUserRoleId;
+ const [activeId, setActiveId] = useAtom(gs_admin_navbar_menu);
+ const [activeChildId, setActiveChildId] = useAtom(gs_admin_navbar_subMenu);
+
+ // Notifikasi
+ const [countNtf, setCountNtf] = useState(countNotifikasi);
+ const [newAdminNtf, setNewAdminNtf] = useAtom(gs_admin_ntf);
+ const [reloadNtf, setReloadNtf] = useState(false);
+ const [openPop, setOpenPop] = useState(false);
+ const [opened, handlers] = useDisclosure(false);
+ const [openedDrawer, handlersDrawer] = useDisclosure(false);
+
+ useShallowEffect(() => {
+ handleLoadUser();
+ }, []);
+
+ async function handleLoadUser() {
+ try {
+ const response = await apiGetUserById({ id: userLoginId });
+ if (response && response.success) {
+ setDataUser(response.data);
+ } else {
+ console.error("Failed to fetch user data", response);
+ setDataUser(null);
+ }
+ } catch (error) {
+ console.error("Error fetching user data", error);
+ setDataUser(null);
+ }
+ }
+
+ useShallowEffect(() => {
+ setCountNtf((e) => e + newAdminNtf);
+ setNewAdminNtf(0);
+ }, [newAdminNtf, setNewAdminNtf]);
+
+ useShallowEffect(() => {
+ handleLoadCountNotifikasi();
+ }, [reloadNtf]);
+
+ async function handleLoadCountNotifikasi() {
+ try {
+ const response = await apiGetCountNotifikasiByUserId({ id: userLoginId });
+ if (response && response.success) {
+ setCountNtf(response.data);
+ setReloadNtf(false);
+ } else {
+ console.error("Failed to fetch count notifikasi", response);
+ setCountNtf(0);
+ setReloadNtf(false);
+ }
+ } catch (error) {
+ console.error("Error fetching count notifikasi", error);
+ setCountNtf(0);
+ setReloadNtf(false);
+ }
+ }
+
+ return (
+ <>
+
+
+
+ {!dataUser ? (
+
+ ) : (
+
+ )}
+
+
+
+
+
+
+
+
+ V {version}
+
+
+
+
+
+ }
+ header={
+
+
+
+
+
+
+
+ HIPMI DASHBOARD
+
+
+
+
+
+ }
+ >
+ {children}
+
+
+
+
+ Notifikasi
+
+
+ }
+ opened={openedDrawer}
+ onClose={handlersDrawer.toggle}
+ position="right"
+ size={"sm"}
+ >
+ {
+ setActiveId(val.id as any);
+ setActiveChildId(val.childId);
+ }}
+ onToggleNavbar={(val: any) => {
+ val === false && handlersDrawer.close();
+ }}
+ onLoadCountNotif={(val: boolean) => {
+ setReloadNtf(val);
+ }}
+ />
+ {/* {
+ setActiveId(val.id as any);
+ setActiveChildId(val.childId);
+ }}
+ onToggleNavbar={(val: any) => {
+ setDrawerNotifikasi(val);
+ }}
+ onLoadCountNotif={(val: any) => {
+ setCountNtf(val);
+ }}
+ /> */}
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/_components_v3/notifikasi/comp_card_notifikasi.tsx b/src/app_modules/admin/_components_v3/notifikasi/comp_card_notifikasi.tsx
new file mode 100644
index 00000000..01856bbf
--- /dev/null
+++ b/src/app_modules/admin/_components_v3/notifikasi/comp_card_notifikasi.tsx
@@ -0,0 +1,343 @@
+import { AccentColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component";
+import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
+import {
+ gs_adminDonasi_triggerReview,
+ gs_adminEvent_triggerReview,
+ gs_adminJob_triggerReview,
+ gs_adminVoting_triggerReview,
+ ITypeStatusNotifikasi,
+} from "@/lib/global_state";
+import { clientLogger } from "@/util/clientLogger";
+import { Badge, Card, Divider, Group, Stack, Text } from "@mantine/core";
+import { IconCheck, IconChecks, IconSpeakerphone } from "@tabler/icons-react";
+import { useAtom } from "jotai";
+import moment from "moment";
+import "moment/locale/id";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
+import adminNotifikasi_findRouterDonasi from "../../notifikasi/route_setting/donasi";
+import { adminNotifikasi_findRouterEvent } from "../../notifikasi/route_setting/event";
+import adminNotifikasi_findRouterForum from "../../notifikasi/route_setting/forum";
+import adminNotifikasi_findRouterInvestasi from "../../notifikasi/route_setting/investasi";
+import { adminNotifikasi_findRouterJob } from "../../notifikasi/route_setting/job";
+import {
+ IAdmin_ActiveChildId,
+ IAdmin_ActivePage,
+} from "../../notifikasi/route_setting/type_of_select_page";
+import { adminNotifikasi_findRouterVoting } from "../../notifikasi/route_setting/voting";
+
+export default function Admin_V3_ComponentCardNotifikasi({
+ data,
+ activePage,
+ onChangeNavbar,
+ onToggleNavbar,
+ onLoadCountNotif,
+ // onLoadDataNotifikasi,
+}: {
+ data: MODEL_NOTIFIKASI;
+ activePage: number;
+ onChangeNavbar: (val: {
+ id: IAdmin_ActivePage;
+ childId: IAdmin_ActiveChildId;
+ }) => void;
+ onToggleNavbar: (val: any) => void;
+ onLoadCountNotif: (val: boolean) => void;
+ // onLoadDataNotifikasi: (val: any) => void;
+}) {
+ const router = useRouter();
+ const [visible, setVisible] = useState(false);
+ const [dataId, setDataId] = useState("");
+
+ // Realtime
+ const [isAdminJob_TriggerReview, setIsAdminJob_TriggerReview] = useAtom(
+ gs_adminJob_triggerReview
+ );
+ const [isAdminEvent_TriggerReview, setIsAdminEvent_TriggerReview] = useAtom(
+ gs_adminEvent_triggerReview
+ );
+ const [isAdminVoting_TriggerReview, setIsAdminVoting_TriggerReview] = useAtom(
+ gs_adminVoting_triggerReview
+ );
+ const [isAdminDonasi_TriggerReview, setIsAdminDonasi_TriggerReview] = useAtom(
+ gs_adminDonasi_triggerReview
+ );
+
+ async function onRead() {
+ // ========================== JOB ========================== //
+ try {
+ setVisible(true);
+
+ if (data?.kategoriApp === "JOB") {
+ setDataId(data.id);
+
+ const checkJob = await adminNotifikasi_findRouterJob({
+ appId: data.appId,
+ notifikasiId: data.id,
+ router: router,
+ onChangeNavbar(val) {
+ onChangeNavbar({
+ id: val.id,
+ childId: val.childId,
+ });
+ },
+ });
+
+ if (checkJob) {
+ setIsAdminJob_TriggerReview(false);
+ setVisible(false);
+ setDataId("");
+ onToggleNavbar(false);
+ onLoadCountNotif(true);
+ }
+
+ return;
+ }
+ // ========================== JOB ========================== //
+
+ // ========================== FORUM ==============================//
+
+ if (data.kategoriApp === "FORUM") {
+ setDataId(data.id);
+
+ const checkForum = await adminNotifikasi_findRouterForum({
+ data: data,
+ router: router,
+ onChangeNavbar(val) {
+ onChangeNavbar(val);
+ },
+ });
+
+ if (checkForum !== "") {
+ router.push(checkForum);
+ setDataId("");
+ setVisible(false);
+ onToggleNavbar(false);
+ onLoadCountNotif(true);
+ } else {
+ ComponentAdminGlobal_NotifikasiPeringatan("Gagal memuat forum");
+ }
+ }
+ // ========================== FORUM ==============================//
+
+ // ========================== EVENT ========================== //
+
+ if (data.kategoriApp == "EVENT") {
+ setDataId(data.id);
+
+ const checkEvent = await adminNotifikasi_findRouterEvent({
+ appId: data.appId,
+ notifikasiId: data.id,
+ router: router,
+ onChangeNavbar(val) {
+ onChangeNavbar({
+ id: val.id,
+ childId: val.childId,
+ });
+ },
+ });
+
+ if (checkEvent) {
+ setIsAdminEvent_TriggerReview(false);
+ setVisible(false);
+ setDataId("");
+ onToggleNavbar(false);
+ onLoadCountNotif(true);
+ }
+
+ return;
+ }
+ // ========================== EVENT ========================== //
+
+ // ========================== VOTING ========================== //
+
+ if (data.kategoriApp == "VOTING") {
+ setDataId(data.id);
+
+ const checkVoting = await adminNotifikasi_findRouterVoting({
+ router: router,
+ appId: data.appId,
+ notifikasiId: data.id,
+ onChangeNavbar(val) {
+ onChangeNavbar({
+ id: val.id,
+ childId: val.childId,
+ });
+ },
+ });
+
+ if (checkVoting) {
+ setIsAdminVoting_TriggerReview(false);
+ setVisible(false);
+ setDataId("");
+ onToggleNavbar(false);
+ onLoadCountNotif(true);
+ }
+
+ return;
+ }
+ // ========================== VOTING ========================== //
+
+ // ========================== DONASI ========================== //
+
+ if (data.kategoriApp == "DONASI") {
+ setDataId(data.id);
+
+ const checkDonasi = await adminNotifikasi_findRouterDonasi({
+ appId: data.appId,
+ notifikasiId: data.id,
+ router: router,
+ status: data.status as ITypeStatusNotifikasi,
+ onChangeNavbar(val) {
+ onChangeNavbar({
+ id: val.id,
+ childId: val.childId,
+ });
+ },
+ });
+
+ if (checkDonasi) {
+ setIsAdminDonasi_TriggerReview(false);
+ setVisible(false);
+ setDataId("");
+ onToggleNavbar(false);
+ onLoadCountNotif(true);
+ }
+
+ return;
+ }
+
+ // ========================== DONASI ========================== //
+
+ // ========================== INVESTASI ========================== //
+
+ if (data.kategoriApp == "INVESTASI") {
+ setDataId(data.id);
+
+ const checkInvestasi = await adminNotifikasi_findRouterInvestasi({
+ appId: data.appId,
+ notifikasiId: data.id,
+ status: data.status as ITypeStatusNotifikasi,
+ router: router,
+ onChangeNavbar(val) {
+ onChangeNavbar({
+ id: val.id,
+ childId: val.childId,
+ });
+ },
+ });
+
+ if (checkInvestasi) {
+ setIsAdminDonasi_TriggerReview(false);
+ setVisible(false);
+ setDataId("");
+ onToggleNavbar(false);
+ onLoadCountNotif(true);
+ }
+
+ return;
+ }
+
+ // ========================== INVESTASI ========================== //
+ } catch (error) {
+ clientLogger.error("Error notifikasi function", error);
+ } finally {
+ setVisible(false);
+ }
+ }
+
+ return (
+ <>
+ {
+ onRead();
+ }}
+ >
+
+
+
+
+
+
+ {data.kategoriApp}
+
+
+ {data.status ? (
+
+ {data.status}
+
+ ) : (
+ ""
+ )}
+
+
+
+
+
+
+
+ {data.title}
+
+ {/*
+ {data.pesan}
+ */}
+
+
+
+
+
+ {moment(data.createdAt).format("LLL")}
+
+ {/*
+ {new Intl.DateTimeFormat("id-ID", {
+ dateStyle: "long",
+ }).format(data.createdAt)}
+
+
+ {", "}
+ {new Intl.DateTimeFormat("id-ID", {
+ timeStyle: "short",
+ }).format(data.createdAt)}
+
+ */}
+ {data.isRead ? (
+
+
+ Sudah dilihat
+
+ ) : (
+
+
+ Belum dilihat
+
+ )}
+
+ {visible && dataId === data.id && (
+
+ )}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/_components_v3/notifikasi/view_drawer_notifikasi.tsx b/src/app_modules/admin/_components_v3/notifikasi/view_drawer_notifikasi.tsx
new file mode 100644
index 00000000..10d27689
--- /dev/null
+++ b/src/app_modules/admin/_components_v3/notifikasi/view_drawer_notifikasi.tsx
@@ -0,0 +1,222 @@
+import {
+ MainColor
+} from "@/app_modules/_global/color/color_pallet";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
+import {
+ Button,
+ Center,
+ Divider,
+ Group,
+ Loader,
+ Stack,
+ Text
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useState } from "react";
+import {
+ apiGetNotifikasiByUserId,
+ apiPostIsReadNotifikasi,
+} from "../../notifikasi/lib/api_fetch_notifikasi";
+import {
+ IAdmin_ActiveChildId,
+ IAdmin_ActivePage,
+} from "../../notifikasi/route_setting/type_of_select_page";
+import Admin_V3_ComponentCardNotifikasi from "./comp_card_notifikasi";
+
+export function Admin_V3_ViewDrawerNotifikasi({
+ userLoginId,
+ openedDrawer,
+ onChangeNavbar,
+ onToggleNavbar,
+ onLoadCountNotif,
+}: {
+ userLoginId: string;
+ openedDrawer: boolean;
+ onChangeNavbar: (val: {
+ id: IAdmin_ActivePage;
+ childId: IAdmin_ActiveChildId;
+ }) => void;
+ onToggleNavbar: (val: any) => void;
+ onLoadCountNotif: (val: boolean) => void;
+}) {
+ // newAdminNtf,
+ // listNotifikasi,
+ // onChangeNavbar,
+
+ // }: {
+ // newAdminNtf: number;
+ // listNotifikasi: MODEL_NOTIFIKASI[];
+ // onChangeNavbar: (val: {
+ // id: IAdmin_ActivePage;
+ // childId: IAdmin_ActiveChildId;
+ // }) => void;
+
+ const [data, setData] = useState(null);
+ const [activePage, setActivePage] = useState(1);
+
+ // Action Button
+ const [isRead, setIsRead] = useState(false);
+ const [isUnRead, setIsUnRead] = useState(false);
+
+ useShallowEffect(() => {
+ if (openedDrawer || isRead || isUnRead) {
+ handleLoadtData();
+ }
+ }, [openedDrawer, isRead, isUnRead]);
+
+ async function handleLoadtData() {
+ try {
+ const response = await apiGetNotifikasiByUserId({
+ id: userLoginId,
+ page: `${activePage}`,
+ });
+ if (response && response.success) {
+ setData(response.data);
+ setIsRead(false);
+ setIsUnRead(false);
+ } else {
+ console.error("Failed to fetch user data", response);
+ setData(null);
+ }
+ } catch (error) {
+ console.error("Error fetching data:", error);
+ setData(null);
+ }
+ }
+
+ async function handleMoreData() {
+ try {
+ const nextPage = activePage + 1;
+ const response = await apiGetNotifikasiByUserId({
+ id: userLoginId,
+ page: `${nextPage}`,
+ });
+ if (response && response.success) {
+ setActivePage(nextPage);
+ return response.data;
+ } else {
+ console.error("Failed to fetch user data", response);
+ return null;
+ }
+ } catch (error) {
+ console.error("Error fetching data:", error);
+ return null;
+ }
+ }
+
+ async function handleUpdateReadAll() {
+ try {
+ const response = await apiPostIsReadNotifikasi({
+ id: userLoginId,
+ isRead: true,
+ });
+ if (response && response.success) {
+ console.log("Berhasil tandai baca semua");
+ setIsRead(true);
+ } else {
+ console.error("Failed to update notification", response);
+ return null;
+ }
+ } catch (error) {
+ console.error("Error updating notification:", error);
+ return null;
+ }
+ }
+
+ async function handleUpdateUnRead() {
+ try {
+ const response = await apiPostIsReadNotifikasi({
+ id: userLoginId,
+ isRead: false,
+ });
+ if (response && response.success) {
+ console.log("Berhasil tandai belum baca");
+ setIsUnRead(true);
+ } else {
+ console.error("Failed to update notification", response);
+ return null;
+ }
+ } catch (error) {
+ console.error("Error updating notification:", error);
+ return null;
+ }
+ }
+
+ if (!data) {
+ return (
+ <>
+
+ {Array.from({ length: 3 }, (_, i) => (
+
+ ))}
+
+ >
+ );
+ }
+
+ return (
+ <>
+
+
+ {
+ handleUpdateReadAll();
+ }}
+ >
+ Tandai baca semua
+
+ {/* {
+ handleUpdateUnRead();
+ }}
+ >
+ Tandai belum baca
+ */}
+
+
+
+ {_.isEmpty(data) ? (
+
+
+ Tidak ada notifikasi
+
+
+ ) : (
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={handleMoreData}
+ >
+ {(item) => (
+ onChangeNavbar(val)}
+ onToggleNavbar={(val) => onToggleNavbar(val)}
+ onLoadCountNotif={(val) => {
+ onLoadCountNotif(val)
+ }}
+ // onLoadDataNotifikasi={(val) => setData(val)}
+ />
+ )}
+
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/_components_v3/skeleton_navbar.tsx b/src/app_modules/admin/_components_v3/skeleton_navbar.tsx
new file mode 100644
index 00000000..e229cc86
--- /dev/null
+++ b/src/app_modules/admin/_components_v3/skeleton_navbar.tsx
@@ -0,0 +1,32 @@
+import { Box, NavLink, Text } from "@mantine/core";
+import _ from "lodash";
+import { newListAdminPage } from "../new_list_page";
+
+export function Admin_V3_SkeletonNavbar() {
+ const listPage = newListAdminPage.slice(0, -1);
+ return (
+ <>
+ {listPage.map((parent) => (
+
+ {parent.name}}
+ icon={parent.icon}
+ >
+ {!_.isEmpty(parent.child) &&
+ parent.child.map((child) => )}
+
+
+ ))}
+ >
+ );
+}
diff --git a/src/app_modules/admin/app_info/component/info_bank/comp_title_page.tsx b/src/app_modules/admin/app_info/component/info_bank/comp_title_page.tsx
index 01dfefc1..08dcb35e 100644
--- a/src/app_modules/admin/app_info/component/info_bank/comp_title_page.tsx
+++ b/src/app_modules/admin/app_info/component/info_bank/comp_title_page.tsx
@@ -11,21 +11,21 @@ export function AdminAppInformation_ComponentTitlePageBank({
<>
}
- radius={"xl"}
- onClick={() => {
- onEventListener({
- isCreate: true,
- isUpdate: false,
- });
- }}
- >
- Tambah
-
- }
+ // component={
+ // }
+ // radius={"xl"}
+ // onClick={() => {
+ // onEventListener({
+ // isCreate: true,
+ // isUpdate: false,
+ // });
+ // }}
+ // >
+ // Tambah
+ //
+ // }
/>
>
);
diff --git a/src/app_modules/admin/app_info/fun/create/fun_create_bidang_bisnis.ts b/src/app_modules/admin/app_info/fun/create/fun_create_bidang_bisnis.ts
index 1fb0add0..9576b9fe 100644
--- a/src/app_modules/admin/app_info/fun/create/fun_create_bidang_bisnis.ts
+++ b/src/app_modules/admin/app_info/fun/create/fun_create_bidang_bisnis.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterAdminAppInformation } from "@/app/lib/router_admin/router_app_information";
+import prisma from "@/lib/prisma";
+import { RouterAdminAppInformation } from "@/lib/router_admin/router_app_information";
import { revalidatePath } from "next/cache";
export async function adminAppInformation_funCreateBidangBisnis({
diff --git a/src/app_modules/admin/app_info/fun/create/fun_create_new_bank.ts b/src/app_modules/admin/app_info/fun/create/fun_create_new_bank.ts
index ff3c9372..1e82f5b1 100644
--- a/src/app_modules/admin/app_info/fun/create/fun_create_new_bank.ts
+++ b/src/app_modules/admin/app_info/fun/create/fun_create_new_bank.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_MASTER_BANK } from "@/app_modules/investasi/_lib/interface";
export default async function adminAppInformation_createBank({
diff --git a/src/app_modules/admin/app_info/fun/get/get_one_bank_by_id.ts b/src/app_modules/admin/app_info/fun/get/get_one_bank_by_id.ts
index 896df1e1..40973e9d 100644
--- a/src/app_modules/admin/app_info/fun/get/get_one_bank_by_id.ts
+++ b/src/app_modules/admin/app_info/fun/get/get_one_bank_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function adminAppInformation_getOneBankById({
id,
diff --git a/src/app_modules/admin/app_info/fun/master/fun_get_master_bidang_bisnis.ts b/src/app_modules/admin/app_info/fun/master/fun_get_master_bidang_bisnis.ts
index 975c53df..5505b3e4 100644
--- a/src/app_modules/admin/app_info/fun/master/fun_get_master_bidang_bisnis.ts
+++ b/src/app_modules/admin/app_info/fun/master/fun_get_master_bidang_bisnis.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function adminAppInformation_funGetBidangBisnis() {
const data = await prisma.masterBidangBisnis.findMany({
diff --git a/src/app_modules/admin/app_info/fun/master/get_list_bank.ts b/src/app_modules/admin/app_info/fun/master/get_list_bank.ts
index 4b378608..8250f070 100644
--- a/src/app_modules/admin/app_info/fun/master/get_list_bank.ts
+++ b/src/app_modules/admin/app_info/fun/master/get_list_bank.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function adminAppInformation_getMasterBank() {
const data = await prisma.masterBank.findMany({
diff --git a/src/app_modules/admin/app_info/fun/master/get_nomor_admin.ts b/src/app_modules/admin/app_info/fun/master/get_nomor_admin.ts
index 897be7dc..d9f8b756 100644
--- a/src/app_modules/admin/app_info/fun/master/get_nomor_admin.ts
+++ b/src/app_modules/admin/app_info/fun/master/get_nomor_admin.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function adminAppInformation_getNomorAdmin() {
const data = await prisma.nomorAdmin.findFirst({
diff --git a/src/app_modules/admin/app_info/fun/update/fun_udpate_status_bank.ts b/src/app_modules/admin/app_info/fun/update/fun_udpate_status_bank.ts
index 20708e11..8ae6017b 100644
--- a/src/app_modules/admin/app_info/fun/update/fun_udpate_status_bank.ts
+++ b/src/app_modules/admin/app_info/fun/update/fun_udpate_status_bank.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_MASTER_BANK } from "@/app_modules/investasi/_lib/interface";
export default async function adminAppInformation_updateStatusBankById({
diff --git a/src/app_modules/admin/app_info/fun/update/fun_update_bidang_bisnis.ts b/src/app_modules/admin/app_info/fun/update/fun_update_bidang_bisnis.ts
index ab6a4e4d..c343925b 100644
--- a/src/app_modules/admin/app_info/fun/update/fun_update_bidang_bisnis.ts
+++ b/src/app_modules/admin/app_info/fun/update/fun_update_bidang_bisnis.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterAdminAppInformation } from "@/app/lib/router_admin/router_app_information";
+import prisma from "@/lib/prisma";
+import { RouterAdminAppInformation } from "@/lib/router_admin/router_app_information";
import { revalidatePath } from "next/cache";
export async function adminAppInformation_funUpdateBidangBisnis({
diff --git a/src/app_modules/admin/app_info/fun/update/fun_update_data_bank.ts b/src/app_modules/admin/app_info/fun/update/fun_update_data_bank.ts
index 6cdd2091..9021a0ab 100644
--- a/src/app_modules/admin/app_info/fun/update/fun_update_data_bank.ts
+++ b/src/app_modules/admin/app_info/fun/update/fun_update_data_bank.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_MASTER_BANK } from "@/app_modules/investasi/_lib/interface";
export default async function adminAppInformation_updateDataBankById({
diff --git a/src/app_modules/admin/app_info/fun/update/fun_update_nomor.ts b/src/app_modules/admin/app_info/fun/update/fun_update_nomor.ts
index 5d9d336f..8d4334aa 100644
--- a/src/app_modules/admin/app_info/fun/update/fun_update_nomor.ts
+++ b/src/app_modules/admin/app_info/fun/update/fun_update_nomor.ts
@@ -1,21 +1,29 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function adminAppInformation_funUpdateNomorAdmin({
data,
}: {
data: any;
}) {
- const updt = await prisma.nomorAdmin.update({
- where: {
- id: data.id,
- },
- data: {
- nomor: data.nomor,
- },
- });
+ try {
+ const updt = await prisma.nomorAdmin.update({
+ where: {
+ id: data.id,
+ },
+ data: {
+ nomor: data.nomor,
+ },
+ });
- if (!updt) return { status: 400, message: "Gagal update" };
- return { status: 200, message: "Berhasil update" };
+ if (!updt) return { status: 400, message: "Gagal update" };
+ return { status: 200, message: "Berhasil update" };
+ } catch (error) {
+ return {
+ status: 500,
+ message: "Error update",
+ error: (error as Error).message,
+ };
+ }
}
diff --git a/src/app_modules/admin/app_info/lib/api_fetch_master.ts b/src/app_modules/admin/app_info/lib/api_fetch_master.ts
new file mode 100644
index 00000000..a82dbb7c
--- /dev/null
+++ b/src/app_modules/admin/app_info/lib/api_fetch_master.ts
@@ -0,0 +1,71 @@
+export {
+ apiGetMasterAdminBank,
+ apiGetMasterAdminBidangBisnis,
+};
+
+const apiGetMasterAdminBank = async () => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/master/bank`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get master admin bank", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get master admin bank");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get master admin bank", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiGetMasterAdminBidangBisnis = async () => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/master/bidang-bisnis`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get master admin bidang bisnis", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get master admin bidang bisnis");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get master admin bidang bisnis", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
\ No newline at end of file
diff --git a/src/app_modules/admin/app_info/lib/api_fetch_stiker.tsx b/src/app_modules/admin/app_info/lib/api_fetch_stiker.tsx
new file mode 100644
index 00000000..d0886b68
--- /dev/null
+++ b/src/app_modules/admin/app_info/lib/api_fetch_stiker.tsx
@@ -0,0 +1,201 @@
+export const apiAdminCreateSticker = async ({ data }: { data: any }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/sticker`, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ body: JSON.stringify(data),
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to create sticker", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to create sticker");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error create sticker", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+export const apiAdminGetSticker = async ({ page }: { page: number }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/sticker?page=${page}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get sticker", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get sticker");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get sticker", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+export const apiAdminGetStickerById = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/sticker/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get sticker", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get sticker");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get sticker", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+
+export const apiAdminUpdateSticker = async ({ data }: { data: any }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/sticker/${data.id}`, {
+ method: "PUT",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ body: JSON.stringify(data),
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to update sticker", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to update sticker");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error update sticker", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+export const apiAdminDeleteSticker = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/sticker/${id}`, {
+ method: "DELETE",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to delete sticker", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to delete sticker");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error delete sticker", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+export const apiAdminUpdateStatusStickerById = async ({ data }: { data: any }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/sticker/${data.id}/activation`, {
+ method: "PUT",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ body: JSON.stringify(data),
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to update status sticker", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to update status sticker");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error update status sticker", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
\ No newline at end of file
diff --git a/src/app_modules/admin/app_info/lib/global_state.ts b/src/app_modules/admin/app_info/lib/global_state.ts
index 26c4e460..d646f931 100644
--- a/src/app_modules/admin/app_info/lib/global_state.ts
+++ b/src/app_modules/admin/app_info/lib/global_state.ts
@@ -1,9 +1,7 @@
+import { atom } from "jotai";
import { atomWithStorage } from "jotai/utils";
/**
* @param index | 0 - 3 | 1: Whatsapp, 2: Bank, 3: Bidang Bisnis
*/
-export const gs_app_information_menu = atomWithStorage(
- "gs_app_information_menu",
- "1"
-);
+export const gs_app_information_menu = atomWithStorage("gs_app_informations_menu","2");
diff --git a/src/app_modules/admin/app_info/ui/ui_layout_admin_app.tsx b/src/app_modules/admin/app_info/ui/ui_layout_admin_app.tsx
new file mode 100644
index 00000000..2a268168
--- /dev/null
+++ b/src/app_modules/admin/app_info/ui/ui_layout_admin_app.tsx
@@ -0,0 +1,107 @@
+"use client";
+
+import { AccentColor } from "@/app_modules/_global/color";
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import { RouterAdminAppInformation } from "@/lib/router_admin/router_app_information";
+import { Button, Group, Stack } from "@mantine/core";
+import { usePathname, useRouter } from "next/navigation";
+import React, { useState } from "react";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import {
+ IconBriefcase,
+ IconMoneybag,
+ IconMoodSmileFilled,
+ IconSticker,
+} from "@tabler/icons-react";
+import { useShallowEffect } from "@mantine/hooks";
+
+export default function AdminAppInformation_Layout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ const pathname = usePathname();
+ const router = useRouter();
+ const [loadingPath, setLoadingPath] = useState(null);
+
+ // Reset loading saat route berubah
+ useShallowEffect(() => {
+ setLoadingPath(null);
+ }, [pathname]);
+
+ const listPage = [
+ {
+ icon: ,
+ name: "Informasi Bank",
+ path: RouterAdminAppInformation.infoBank,
+ },
+ {
+ icon: ,
+ name: "Bidang Bisnis",
+ path: RouterAdminAppInformation.bidangBisnis,
+ },
+ {
+ icon: ,
+ name: "Stiker",
+ path: RouterAdminAppInformation.sticker,
+ },
+ ];
+
+ const isActive = (path: string) => {
+ if (path === "/" && pathname === "/") return true;
+ if (path !== "/" && pathname.startsWith(path)) return true;
+ return false;
+ };
+
+ const handleClick = async (path: string) => {
+ if (path === pathname) return; // kalau sudah di halaman itu, jangan reload
+ // setLoadingPath(path);
+ router.push(path);
+ };
+
+ return (
+
+
+
+
+
+ {listPage.map((e, i) => {
+ const active = isActive(e.path);
+ const loading = loadingPath === e.path;
+
+ return (
+ handleClick(e.path)}
+ >
+ {e.name}
+
+ );
+ })}
+
+
+
+ {children}
+
+ );
+}
diff --git a/src/app_modules/admin/app_info/ui/ui_main.tsx b/src/app_modules/admin/app_info/ui/ui_main.tsx
index 03782b1a..0875fe35 100644
--- a/src/app_modules/admin/app_info/ui/ui_main.tsx
+++ b/src/app_modules/admin/app_info/ui/ui_main.tsx
@@ -1,30 +1,25 @@
"use client";
+import {
+ AccentColor,
+ AdminColor,
+} from "@/app_modules/_global/color/color_pallet";
import { Button, Group, Stack } from "@mantine/core";
import { useAtom } from "jotai";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
import { gs_app_information_menu } from "../lib";
import {
AdminAppInformation_ViewInfoBank,
- AdminAppInformation_ViewInformasiWhatApps,
AdminAppInformation_ViewKategoriPortofolio,
} from "../view";
-export default function AdminAppInformation_UiMain({
- nomorAdmin,
- listBank,
- dataBidangBisnis,
-}: {
- nomorAdmin: any;
- listBank: any[];
- dataBidangBisnis: any[];
-}) {
+export default function AdminAppInformation_UiMain() {
const [selectPage, setSelectPage] = useAtom(gs_app_information_menu);
const listPage = [
- {
- id: "1",
- name: "Whatsapp",
- },
+ // {
+ // id: "1",
+ // name: "Whatsapp",
+ // },
{
id: "2",
name: "Informasi Bank",
@@ -45,8 +40,8 @@ export default function AdminAppInformation_UiMain({
{
setSelectPage(e.id);
}}
@@ -59,18 +54,12 @@ export default function AdminAppInformation_UiMain({
))}
- {selectPage === "1" && (
-
- )}
+ {/* {selectPage === "1" && (
+
+ )} */}
- {selectPage === "2" && (
-
- )}
- {selectPage === "3" && (
-
- )}
+ {selectPage === "2" && }
+ {selectPage === "3" && }
>
);
diff --git a/src/app_modules/admin/app_info/view/index.tsx b/src/app_modules/admin/app_info/view/index.ts
similarity index 96%
rename from src/app_modules/admin/app_info/view/index.tsx
rename to src/app_modules/admin/app_info/view/index.ts
index 55184d32..0bf586c9 100644
--- a/src/app_modules/admin/app_info/view/index.tsx
+++ b/src/app_modules/admin/app_info/view/index.ts
@@ -1,3 +1,5 @@
+"use client";
+
import AdminAppInformation_ViewInfoBank from "./view_info_bank";
import AdminAppInformation_ViewInformasiWhatApps from "./view_info_whatsapp";
import { AdminAppInformation_ViewKategoriPortofolio } from "./view_kategori_portofolio";
diff --git a/src/app_modules/admin/app_info/view/new_kategori_bidang_bisnis.tsx b/src/app_modules/admin/app_info/view/new_kategori_bidang_bisnis.tsx
new file mode 100644
index 00000000..5d83601b
--- /dev/null
+++ b/src/app_modules/admin/app_info/view/new_kategori_bidang_bisnis.tsx
@@ -0,0 +1,265 @@
+"use client";
+
+import {
+ AdminColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { MODEL_DEFAULT_MASTER_OLD } from "@/app_modules/model_global/interface";
+import {
+ Box,
+ Button,
+ Center,
+ Paper,
+ ScrollArea,
+ Stack,
+ Switch,
+ Table,
+ Text,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconCirclePlus, IconEdit } from "@tabler/icons-react";
+import { useState } from "react";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
+import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
+import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
+import {
+ adminAppInformation_funCreateBidangBisnis,
+ adminAppInformation_funGetBidangBisnis,
+ adminAppInformation_funUpdateBidangBisnis,
+} from "../fun";
+import { apiGetMasterAdminBidangBisnis } from "../lib/api_fetch_master";
+import { useRouter } from "next/navigation";
+import { RouterAdminAppInformation } from "@/lib/router_admin/router_app_information";
+
+export function AdminAppInformation_V3_ViewKategoriBidangBisnis() {
+ const router = useRouter();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ async function handleLoadData() {
+ try {
+ const response = await apiGetMasterAdminBidangBisnis();
+
+ if (response && response.success) {
+ setData(response.data);
+ } else {
+ setData([]);
+ }
+ } catch (error) {
+ console.log("Error load data", error);
+ setData([]);
+ }
+ }
+
+ // Create
+ const [isLoadingCreate, setLoadingCreate] = useState(false);
+ const [isCreate, setIsCreate] = useState(true);
+ const [newData, setNewData] = useState("");
+ async function onCreate() {
+ try {
+ const create = await adminAppInformation_funCreateBidangBisnis({
+ name: newData,
+ });
+
+ if (create.status === 201) {
+ setLoadingCreate(true);
+ const loadData = await adminAppInformation_funGetBidangBisnis();
+ setData(loadData);
+ setNewData("");
+ ComponentAdminGlobal_NotifikasiBerhasil(create.message);
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(create.message);
+ }
+ } catch (error) {
+ console.log(error);
+ ComponentAdminGlobal_NotifikasiGagal("Gagal menambah bidang bisnis");
+ } finally {
+ setLoadingCreate(false);
+ }
+ }
+
+ // Update Data
+ const [isLoadingUpdate, setLoadingUpdate] = useState(false);
+
+ const [isUpdate, setIsUpdate] = useState(false);
+ const [updateData, setUpdateData] = useState({
+ id: "",
+ name: "",
+ });
+
+ async function onUpdate() {
+ try {
+ setLoadingUpdate(true);
+ const updt = await adminAppInformation_funUpdateBidangBisnis({
+ data: updateData as any,
+ });
+ if (updt?.status === 200) {
+ const loadData = await adminAppInformation_funGetBidangBisnis();
+ setData(loadData);
+
+ ComponentAdminGlobal_NotifikasiBerhasil(updt.message);
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(updt?.message as any);
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setIsUpdate(false);
+ setIsCreate(true);
+ setLoadingUpdate(false);
+ }
+ }
+
+ // Activation
+ const [openModal, setOpenModal] = useState(false);
+ const [updateStatus, setUpdateStatus] = useState({
+ id: "",
+ active: null,
+ });
+ const [isLoadingActivation, setLoadingActivation] = useState(false);
+
+ async function onUpdateActivation({
+ id,
+ active,
+ }: {
+ id: string;
+ active: boolean;
+ }) {
+ try {
+ setLoadingActivation(true);
+ const updt = await adminAppInformation_funUpdateBidangBisnis({
+ data: { id: id, active: active },
+ });
+
+ if (updt?.status === 200) {
+ const loadData = await adminAppInformation_funGetBidangBisnis();
+ setData(loadData);
+ setOpenModal(false);
+ setLoadingActivation(false);
+ ComponentAdminGlobal_NotifikasiBerhasil(updt?.message);
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(updt?.message as any);
+ }
+ } catch (error) {
+ console.log(error);
+ ComponentAdminGlobal_NotifikasiGagal("Gagal mengupdate status");
+ }
+ }
+
+ const rowTable = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+ return data.map((e, i) => (
+
+ |
+
+ }
+ radius={"xl"}
+ bg={MainColor.green}
+ color="green"
+ onClick={() => {
+ setIsUpdate(true);
+ setIsCreate(false);
+ setUpdateData({
+ id: e?.id,
+ name: e?.name,
+ });
+ }}
+ >
+ Edit
+
+
+ |
+
+
+
+ {
+ setOpenModal(true);
+ setUpdateStatus({
+ id: e?.id,
+ active: val.currentTarget.checked as any,
+ });
+ }}
+ />
+
+ |
+
+
+
+ {e?.name}
+
+ |
+
+ ));
+ };
+
+ return (
+ <>
+
+
+
+ }
+ onClick={() => {
+ router.push(RouterAdminAppInformation.createBidangBisnis);
+ }}
+ >
+ Tambah
+
+
+
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Aksi
+ |
+
+ Status
+ |
+
+ Kategori
+ |
+
+
+ {rowTable()}
+
+
+
+ )}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/app_info/view/sticker/view_create_sticker.tsx b/src/app_modules/admin/app_info/view/sticker/view_create_sticker.tsx
new file mode 100644
index 00000000..a61fb134
--- /dev/null
+++ b/src/app_modules/admin/app_info/view/sticker/view_create_sticker.tsx
@@ -0,0 +1,256 @@
+"use client";
+
+import {
+ AspectRatio,
+ Box,
+ Button,
+ Center,
+ Chip,
+ Group,
+ Image,
+ Select,
+ Stack
+} from "@mantine/core";
+
+import {
+ MainColor
+} from "@/app_modules/_global/color/color_pallet";
+import {
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage
+} from "@/app_modules/_global/component";
+import Component_V3_Label_TextInput from "@/app_modules/_global/component/new/comp_V3_label_text_input";
+import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
+import { apiGetMasterEmotions } from "@/app_modules/_global/lib/api_fetch_master";
+import {
+ ComponentGlobal_NotifikasiBerhasil,
+ ComponentGlobal_NotifikasiGagal,
+ ComponentGlobal_NotifikasiPeringatan,
+} from "@/app_modules/_global/notif_global";
+import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
+import { Admin_ComponentBoxStyle } from "@/app_modules/admin/_admin_global/_component/comp_admin_boxstyle";
+import { ComponentAdminGlobal_NotifikasiPeringatan } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_peringatan";
+import Admin_ComponentBackButton from "@/app_modules/admin/_admin_global/back_button";
+import { Admin_V3_ComponentBreakpoint } from "@/app_modules/admin/_components_v3/comp_simple_grid_breakpoint";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { DIRECTORY_ID } from "@/lib";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconCheck, IconPhoto } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { apiAdminCreateSticker } from "../../lib/api_fetch_stiker";
+import { baseStylesTextInput } from "@/app_modules/_global/lib/base_style_text_input";
+import { masterJenisKelamin } from "@/app_modules/_global/lib/master_jenis_kelamin";
+
+export default function AdminAppInformation_ViewCreateSticker() {
+ const router = useRouter();
+ const [file, setFile] = useState(null);
+ const [img, setImg] = useState(null);
+ const [valueEmotion, setValueEmotion] = useState(["senang"]);
+ const [gender, setGender] = useState(null);
+
+ const [listEmotion, setListEmotion] = useState([]);
+ const [loading, setLoading] = useState(false);
+
+ useShallowEffect(() => {
+ onLoadMasterEmotions();
+ }, []);
+
+ async function onLoadMasterEmotions() {
+ try {
+ const response = await apiGetMasterEmotions();
+
+ if (response.success) {
+ setListEmotion(response.data);
+ }
+ } catch (error) {
+ console.error("Error on load master emotions:", error);
+ }
+ }
+
+ const validateData = () => {
+ if (!file) {
+ ComponentAdminGlobal_NotifikasiPeringatan("File tidak ada");
+ return false;
+ }
+
+ if (valueEmotion.length === 0) {
+ ComponentAdminGlobal_NotifikasiPeringatan("Pilih emosi");
+ return false;
+ }
+
+ if (!gender) {
+ ComponentAdminGlobal_NotifikasiPeringatan("Pilih jenis kelamin");
+ return false;
+ }
+
+ return true;
+ };
+
+ async function onUploadFile() {
+ try {
+ const response = await funGlobal_UploadToStorage({
+ file: file as File,
+ dirId: DIRECTORY_ID.sticker,
+ });
+
+ if (!response.success) {
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ return;
+ }
+
+ return response.data.id;
+ } catch (error) {
+ console.error("Error on upload file", error);
+ }
+ }
+
+ async function handleCreateSticker({ fileId }: { fileId: string }) {
+ try {
+ const response = await apiAdminCreateSticker({
+ data: {
+ emotions: valueEmotion,
+ fileId: fileId,
+ gender: gender as string,
+ },
+ });
+
+ if (response.success) {
+ ComponentGlobal_NotifikasiBerhasil("Berhasil disimpan");
+ router.back();
+ } else {
+ setLoading(false);
+ throw new Error("Failed to create sticker");
+ }
+ } catch (error) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal("Gagal disimpan");
+ console.error("Error create sticker", error);
+ }
+ }
+
+ async function onSubmit() {
+ if (!validateData()) return;
+
+ try {
+ setLoading(true);
+ const uploadFile = await onUploadFile();
+
+ if (!uploadFile) {
+ setLoading(false);
+ return;
+ }
+
+ await handleCreateSticker({ fileId: uploadFile });
+ } catch (error) {
+ console.error("Error on create sticker", error);
+ }
+ }
+
+ return (
+ <>
+
+
+
+
+
+ {!listEmotion.length ? (
+
+ ) : (
+
+
+
+
+ {img ? (
+
+
+
+ ) : (
+
+
+
+ )}
+
+
+
+
+
+
+
+
+
+
+
+ )}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/app_info/view/sticker/view_detail_sticker.tsx b/src/app_modules/admin/app_info/view/sticker/view_detail_sticker.tsx
new file mode 100644
index 00000000..8e7867fe
--- /dev/null
+++ b/src/app_modules/admin/app_info/view/sticker/view_detail_sticker.tsx
@@ -0,0 +1,348 @@
+"use client";
+
+import { MainColor } from "@/app_modules/_global/color";
+import {
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
+} from "@/app_modules/_global/component";
+import Component_V3_Label_TextInput from "@/app_modules/_global/component/new/comp_V3_label_text_input";
+import {
+ funGlobal_DeleteFileById,
+ funGlobal_UploadToStorage,
+} from "@/app_modules/_global/fun";
+import { apiGetMasterEmotions } from "@/app_modules/_global/lib/api_fetch_master";
+import { ISticker } from "@/app_modules/_global/lib/interface/stiker";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
+import { Admin_ComponentBoxStyle } from "@/app_modules/admin/_admin_global/_component/comp_admin_boxstyle";
+import { Admin_ComponentModal } from "@/app_modules/admin/_admin_global/_component/comp_admin_modal";
+import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil";
+import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal";
+import Admin_ComponentBackButton from "@/app_modules/admin/_admin_global/back_button";
+import { Admin_V3_ComponentBreakpoint } from "@/app_modules/admin/_components_v3/comp_simple_grid_breakpoint";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { APIs, DIRECTORY_ID, pathAssetImage } from "@/lib";
+import {
+ AspectRatio,
+ Box,
+ Button,
+ Center,
+ Chip,
+ Group,
+ Image,
+ Select,
+ Stack,
+ Text,
+ Title,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconCheck, IconTrash } from "@tabler/icons-react";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import {
+ apiAdminDeleteSticker,
+ apiAdminGetStickerById,
+ apiAdminUpdateSticker,
+} from "../../lib/api_fetch_stiker";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { masterJenisKelamin } from "@/app_modules/_global/lib/master_jenis_kelamin";
+
+export default function AdminAppInformation_ViewStickerDetail() {
+ const router = useRouter();
+ const param = useParams<{ id: string }>();
+ const [file, setFile] = useState(null);
+ const [img, setImg] = useState(null);
+ const [listEmotion, setListEmotion] = useState([]);
+ const [valueEmotion, setValueEmotion] = useState([]);
+ const [data, setData] = useState(null);
+ const [loading, setLoading] = useState(false);
+ const [loadingDelete, setLoadingDelete] = useState(false);
+ const [openModalDelete, setOpenModalDelete] = useState(false);
+
+ useShallowEffect(() => {
+ onLoadData();
+ onLoadMasterEmotions();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiAdminGetStickerById({ id: param.id });
+ if (response.success) {
+ setData(response.data);
+ setValueEmotion(response.data.MasterEmotions.map((e: any) => e.value));
+ }
+ } catch (error) {
+ console.error("Error fetching data", error);
+ }
+ }
+
+ async function onLoadMasterEmotions() {
+ try {
+ const response = await apiGetMasterEmotions();
+
+ if (response.success) {
+ setListEmotion(response.data);
+ }
+ } catch (error) {
+ console.error("Error on load master emotions:", error);
+ }
+ }
+
+ async function onUploadFile() {
+ try {
+ const response = await funGlobal_UploadToStorage({
+ file: file as File,
+ dirId: DIRECTORY_ID.sticker,
+ });
+
+ if (!response.success) {
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ return;
+ } else {
+ const deleteFile = await funGlobal_DeleteFileById({
+ fileId: data?.fileId as string,
+ });
+
+ if (!deleteFile.success) {
+ ComponentGlobal_NotifikasiPeringatan("Gagal delete gambar");
+ return;
+ }
+
+ return response.data.id;
+ }
+ } catch (error) {
+ console.error("Error on upload file", error);
+ }
+ }
+
+ async function handleUpdateSticker({ fileId }: { fileId?: string }) {
+ try {
+ const response = await apiAdminUpdateSticker({
+ data: {
+ emotions: valueEmotion,
+ fileId: fileId || "",
+ id: param.id,
+ jenisKelamin: data?.jenisKelamin,
+ },
+ });
+
+ if (response.success) {
+ ComponentAdminGlobal_NotifikasiBerhasil("Berhasil disimpan");
+ router.back();
+ } else {
+ setLoading(false);
+ throw new Error("Failed to create sticker");
+ }
+ } catch (error) {
+ setLoading(false);
+ ComponentAdminGlobal_NotifikasiGagal("Gagal disimpan");
+ console.error("Error create sticker", error);
+ }
+ }
+
+ async function onSubmit() {
+ try {
+ setLoading(true);
+
+ if (file) {
+ const uploadFile = await onUploadFile();
+
+ if (!uploadFile) {
+ setLoading(false);
+ return;
+ }
+
+ await handleUpdateSticker({ fileId: uploadFile });
+ } else {
+ await handleUpdateSticker({});
+ }
+ } catch (error) {
+ console.error("Error on create sticker", error);
+ }
+ }
+
+ async function onDelete() {
+ try {
+ setLoadingDelete(true);
+ const response = await apiAdminDeleteSticker({ id: param.id });
+
+ if (response.success) {
+ const deleteFile = await funGlobal_DeleteFileById({
+ fileId: data?.fileId as string,
+ });
+
+ setLoadingDelete(false);
+ ComponentAdminGlobal_NotifikasiBerhasil("Berhasil dihapus");
+ router.back();
+ } else {
+ setLoadingDelete(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal dihapus");
+ }
+ } catch (error) {
+ setLoadingDelete(false);
+ ComponentAdminGlobal_NotifikasiGagal("Proses hapus error");
+ console.error("Error delete sticker", error);
+ }
+ }
+
+ return (
+ <>
+
+
+
+ {/*
+ {JSON.stringify(valueEmotion, null, 2)}
+ */}
+
+
+ {!listEmotion.length || !data ? (
+
+ ) : (
+
+
+
+
+ {img ? (
+
+
+
+ ) : (
+
+
+
+ )}
+
+
+
+
+
+
+
+
+
+
+
+ )}
+
+
+ setOpenModalDelete(false)}
+ withCloseButton={false}
+ closeOnClickOutside={false}
+ size="md"
+ >
+
+
+ Apakah anda yakin ingin menghapus stiker ini?
+
+
+ setOpenModalDelete(false)}>
+ Batal
+
+ onDelete()}
+ >
+ Hapus
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/app_info/view/sticker/view_stiker.tsx b/src/app_modules/admin/app_info/view/sticker/view_stiker.tsx
new file mode 100644
index 00000000..6d0dfe10
--- /dev/null
+++ b/src/app_modules/admin/app_info/view/sticker/view_stiker.tsx
@@ -0,0 +1,359 @@
+"use client";
+
+import {
+ AdminColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
+import { ISticker } from "@/app_modules/_global/lib/interface/stiker";
+import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
+import { Admin_ComponentBoxStyle } from "@/app_modules/admin/_admin_global/_component/comp_admin_boxstyle";
+import { Admin_ComponentModal } from "@/app_modules/admin/_admin_global/_component/comp_admin_modal";
+import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil";
+import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal";
+import { Admin_V3_ComponentPaginationBreakpoint } from "@/app_modules/admin/_components_v3/comp_pagination_breakpoint";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { APIs, pathAssetImage } from "@/lib";
+import { RouterAdminAppInformation } from "@/lib/router_admin/router_app_information";
+import {
+ Badge,
+ Box,
+ Button,
+ Center,
+ Group,
+ Image,
+ Paper,
+ ScrollArea,
+ Spoiler,
+ Stack,
+ Switch,
+ Table,
+ Text
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconPencil, IconPlus } from "@tabler/icons-react";
+import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import {
+ apiAdminGetSticker,
+ apiAdminUpdateStatusStickerById,
+} from "../../lib/api_fetch_stiker";
+
+export default function AdminAppInformation_ViewSticker() {
+ const router = useRouter();
+ const [loadingCreate, setLoadingCreate] = useState(false);
+ const [loadingDetail, setLoadingDetail] = useState(null);
+ const [dataSticker, setDataSticker] = useState(null);
+ const [dataUpdate, setDataUpdate] = useState({
+ id: "",
+ isActive: false,
+ });
+ const [loadingUpdate, setLoadingUpdate] = useState(false);
+ const [opened, setOpened] = useState(false);
+ const [nPage, setNPage] = useState(1);
+ const [activePage, setActivePage] = useState(1);
+ const [loadingImg, setLoadingImg] = useState(false);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, [activePage]);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiAdminGetSticker({ page: activePage });
+ if (response.success) {
+ setDataSticker(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ setDataSticker([]);
+ }
+ } catch (error) {
+ console.error("Error fetching data", error);
+ setDataSticker([]);
+ }
+ };
+
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
+
+ const handleUpdateActivation = async ({
+ id,
+ value,
+ }: {
+ id: string;
+ value: boolean;
+ }) => {
+ const data = {
+ id: id,
+ isActive: value,
+ };
+
+ try {
+ setLoadingUpdate(true);
+ const updt = await apiAdminUpdateStatusStickerById({
+ data: data as any,
+ });
+
+ if (updt.success) {
+ const cloneData = [...(dataSticker || [])];
+ const index = cloneData.findIndex((e) => e.id === id);
+ if (index !== -1) {
+ cloneData[index].isActive = value;
+ setDataSticker([...cloneData]);
+ }
+ setOpened(false);
+ setLoadingUpdate(false);
+ ComponentAdminGlobal_NotifikasiBerhasil(updt.message);
+ } else {
+ setOpened(false);
+ setLoadingUpdate(false);
+ ComponentAdminGlobal_NotifikasiGagal(updt.message);
+ }
+ } catch (error) {
+ setLoadingUpdate(false);
+ console.log("Error update status sticker", error);
+ }
+ };
+
+ return (
+ <>
+
+
+ {/* }> Filter */}
+ }
+ onClick={() => {
+ router.push(RouterAdminAppInformation.createSticker);
+ setLoadingCreate(true);
+ }}
+ >
+ Tambah
+
+
+ }
+ />
+
+ {!dataSticker ? (
+
+ ) : (
+
+
+
+
+
+
+ |
+ Aksi
+ |
+
+ Status
+ |
+
+
+ Stiker
+ |
+
+ Kategori
+ |
+
+
+
+ {rowTable({
+ dataSticker,
+ router,
+ loadingDetail,
+ setLoadingDetail,
+ setOpened,
+ dataUpdate,
+ setDataUpdate,
+ setLoadingImg,
+ loadingImg,
+ })}
+
+
+
+
+
+
+ )}
+
+
+ setOpened(false)}
+ closeOnClickOutside={false}
+ >
+
+
+ Apakah anda yakin ingin mengubah status stiker ini ?
+
+
+ {
+ setOpened(false);
+ setLoadingUpdate(false);
+ }}
+ >
+ Tidak
+
+ {
+ handleUpdateActivation({
+ id: dataUpdate.id,
+ value: dataUpdate.isActive,
+ });
+ }}
+ >
+ Ya
+
+
+
+
+ >
+ );
+}
+
+type RowTableProps = {
+ dataSticker: ISticker[] | null;
+ router: AppRouterInstance;
+ loadingDetail: string | null;
+ setLoadingDetail: (val: string | null) => void;
+ setOpened: (val: boolean) => void;
+ dataUpdate: {
+ id: string;
+ isActive: boolean;
+ };
+ setDataUpdate: (val: { id: string; isActive: boolean }) => void;
+ setLoadingImg: (val: boolean) => void;
+ loadingImg: boolean;
+};
+
+const rowTable = ({
+ dataSticker,
+ router,
+ loadingDetail,
+ setLoadingDetail,
+ setOpened,
+ dataUpdate,
+ setDataUpdate,
+ setLoadingImg,
+ loadingImg,
+}: RowTableProps) => {
+ if (!Array.isArray(dataSticker) || dataSticker.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+ return dataSticker.map((e, i) => (
+
+ |
+
+ }
+ onClick={() => {
+ setLoadingDetail(e.id);
+ setTimeout(() => {
+ router.push(
+ RouterAdminAppInformation.detailSticker({ id: e.id })
+ );
+ setLoadingDetail(null);
+ }, 1000);
+ }}
+ >
+ Detail
+
+
+ |
+
+
+ {
+ setDataUpdate({ id: e.id, isActive: val.currentTarget.checked });
+ setOpened(true);
+ }}
+ />
+
+ |
+
+
+ {loadingImg && }
+
+ setLoadingImg(false),
+ onError: () => setLoadingImg(false),
+ style: { display: loadingImg ? "none" : "block" },
+ }}
+ />
+
+
+ |
+
+
+
+
+ {e.MasterEmotions.map((e) => (
+ {e.value}
+ ))}
+
+
+
+ |
+
+ ));
+};
diff --git a/src/app_modules/admin/app_info/view/view_create_bidang.tsx b/src/app_modules/admin/app_info/view/view_create_bidang.tsx
new file mode 100644
index 00000000..27f07c12
--- /dev/null
+++ b/src/app_modules/admin/app_info/view/view_create_bidang.tsx
@@ -0,0 +1,75 @@
+"use client";
+
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { Button, Center, Group, Stack, TextInput, Title } from "@mantine/core";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
+import { Admin_ComponentBoxStyle } from "../../_admin_global/_component/comp_admin_boxstyle";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
+import { Admin_V3_ComponentBreakpoint } from "../../_components_v3/comp_simple_grid_breakpoint";
+
+export default function AdminAppInformation_ViewCreateBidangBisnis() {
+ return (
+ <>
+
+
+
+
+
+ {/* BIDANG */}
+
+
+
+ Tambah Bidang Bisnis
+
+
+ {
+ // setNewData(val.currentTarget.value);
+ // }}
+ />
+
+
+
+ {/* SUB BIDANG */}
+
+
+
+ Tambah Sub Bidang Bisnis
+
+
+ {
+ // setNewData(val.currentTarget.value);
+ // }}
+ />
+
+ {
+ // onCreate();
+ }}
+ >
+ Simpan
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/app_info/view/view_info_bank.tsx b/src/app_modules/admin/app_info/view/view_info_bank.tsx
index 42ce3059..5397cd02 100644
--- a/src/app_modules/admin/app_info/view/view_info_bank.tsx
+++ b/src/app_modules/admin/app_info/view/view_info_bank.tsx
@@ -1,13 +1,16 @@
"use client";
+import { AccentColor } from "@/app_modules/_global/color";
+import {
+ AdminColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
import { MODEL_MASTER_BANK } from "@/app_modules/investasi/_lib/interface";
import {
- ActionIcon,
+ Box,
Button,
Center,
- Grid,
Group,
- Modal,
Paper,
ScrollArea,
Stack,
@@ -16,28 +19,30 @@ import {
Text,
TextInput,
Title,
- Tooltip,
} from "@mantine/core";
-import { IconCirclePlus, IconEdit } from "@tabler/icons-react";
+import { IconEdit } from "@tabler/icons-react";
import _ from "lodash";
import { useState } from "react";
+import { Admin_ComponentModal } from "../../_admin_global/_component/comp_admin_modal";
import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
+import { Admin_V3_ComponentBreakpoint } from "../../_components_v3/comp_simple_grid_breakpoint";
+import { AdminAppInformation_ComponentTitlePageBank } from "../component";
import adminAppInformation_createBank from "../fun/create/fun_create_new_bank";
import adminAppInformation_getMasterBank from "../fun/master/get_list_bank";
import adminAppInformation_updateStatusBankById from "../fun/update/fun_udpate_status_bank";
import adminAppInformation_updateDataBankById from "../fun/update/fun_update_data_bank";
-import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
-import { AdminAppInformation_ComponentTitlePageBank } from "../component";
+import { useShallowEffect } from "@mantine/hooks";
-export default function AdminAppInformation_ViewInfoBank({
- listBank,
-}: {
- listBank: MODEL_MASTER_BANK[];
-}) {
- const [data, setData] = useState(listBank);
- const [isCreate, setIsCreate] = useState(false);
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { apiGetMasterAdminBank } from "../lib/api_fetch_master";
+
+export default function AdminAppInformation_ViewInfoBank() {
+ const [data, setData] = useState(null);
+ const [isCreate, setIsCreate] = useState(true);
const [isLoadingCreate, setLoadingCreate] = useState(false);
+ const [isLoadingUpdate, setLoadingUpdate] = useState(false);
+ const [isLoadingActivation, setLoadingActivation] = useState(false);
const [newData, setNewData] = useState({
namaBank: "",
@@ -59,35 +64,70 @@ export default function AdminAppInformation_ViewInfoBank({
active: "",
});
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ async function handleLoadData() {
+ try {
+ const response = await apiGetMasterAdminBank();
+
+ if (response && response.success) {
+ setData(response.data);
+ } else {
+ setData([]);
+ }
+ } catch (error) {
+ console.log("Error load data", error);
+ setData([]);
+ }
+ }
+
async function onCreate() {
- const create = await adminAppInformation_createBank({ data: newData });
- if (create.status === 200) {
- try {
+ try {
+ setLoadingCreate(true);
+ const create = await adminAppInformation_createBank({ data: newData });
+
+ if (create.status === 200) {
+ setNewData({
+ namaBank: "",
+ namaAkun: "",
+ norek: "",
+ });
+
const loadData = await adminAppInformation_getMasterBank();
setData(loadData);
- } catch (error) {
- console.log(error);
- } finally {
- setLoadingCreate(true);
ComponentAdminGlobal_NotifikasiBerhasil(create.message);
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(create.message);
}
- } else {
- ComponentAdminGlobal_NotifikasiGagal(create.message);
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setLoadingCreate(false);
}
- setIsCreate(false);
}
async function onUpdate() {
- const updt = await adminAppInformation_updateDataBankById({
- data: updateData as any,
- });
- if (updt.status === 200) {
- const loadData = await adminAppInformation_getMasterBank();
- setData(loadData);
- ComponentAdminGlobal_NotifikasiBerhasil(updt.message);
- setIsUpdate(false);
- } else {
- ComponentAdminGlobal_NotifikasiGagal(updt.message);
+ try {
+ setLoadingUpdate(true);
+ const updt = await adminAppInformation_updateDataBankById({
+ data: updateData as any,
+ });
+ if (updt.status === 200) {
+ const loadData = await adminAppInformation_getMasterBank();
+ setData(loadData);
+ setIsUpdate(false);
+ setIsCreate(true);
+
+ ComponentAdminGlobal_NotifikasiBerhasil(updt.message);
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(updt.message);
+ }
+ } catch (error) {
+ console.log("Error update data bank", error);
+ } finally {
+ setLoadingUpdate(false);
}
}
@@ -103,36 +143,71 @@ export default function AdminAppInformation_ViewInfoBank({
isActive: value,
};
- const updt = await adminAppInformation_updateStatusBankById({
- data: data as any,
- });
+ try {
+ setLoadingActivation(true);
+ const updt = await adminAppInformation_updateStatusBankById({
+ data: data as any,
+ });
- if (updt.status === 200) {
- const loadData = await adminAppInformation_getMasterBank();
- setData(loadData);
- ComponentAdminGlobal_NotifikasiBerhasil(updt.message);
- setIsActivation(false);
- } else {
- ComponentAdminGlobal_NotifikasiGagal(updt.message);
+ if (updt.status === 200) {
+ const loadData = await adminAppInformation_getMasterBank();
+ setData(loadData);
+ ComponentAdminGlobal_NotifikasiBerhasil(updt.message);
+ setIsActivation(false);
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(updt.message);
+ }
+ } catch (error) {
+ console.log("Error update status bank", error);
+ } finally {
+ setLoadingActivation(false);
}
}
- const rowTable = _.isEmpty(data) ? (
-
-
- Tidak ada data
-
-
- ) : (
- data.map((e, i) => (
+ const rowTable = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+
+ return data.map((e, i) => (
|
-
- {e?.namaBank}
-
+
+ }
+ radius={"xl"}
+ bg={MainColor.green}
+ color="green"
+ onClick={() => {
+ setIsUpdate(true);
+ setIsCreate(false);
+ setUpdateData({
+ id: e?.id,
+ namaBank: e?.namaBank,
+ namaAkun: e?.namaAkun,
+ norek: e?.norek,
+ });
+ }}
+ >
+ Edit
+
+ {/*
+
+
+
+ */}
+
|
-
+
-
- |
-
-
- {e?.namaAkun}
-
- |
-
-
- {e?.norek}
-
+
|
-
- {
- setIsUpdate(true);
- setIsCreate(false);
- setUpdateData({
- id: e?.id,
- namaBank: e?.namaBank,
- namaAkun: e?.namaAkun,
- norek: e?.norek,
- });
- }}
- >
-
-
-
-
-
+
+ {e?.namaBank}
+
+ |
+
+
+
+ {e?.namaAkun}
+
+ |
+
+
+ {e?.norek}
+
|
- ))
- );
+ ));
+ };
return (
<>
-
- {
- setIsCreate(val.isCreate);
- setIsUpdate(val.isUpdate);
- }}
- />
-
+ {
+ setIsCreate(val.isCreate);
+ setIsUpdate(val.isUpdate);
+ }}
+ />
-
-
-
-
-
-
-
- |
- Bank
- |
-
- Status
- |
-
- Nama Rekening
- |
-
- Nomor Rekening
- |
-
- Aksi
- |
-
-
- {rowTable}
-
-
-
-
-
-
- {isCreate ? (
-
+
+
+ {isCreate && (
+
- Tambah Daftar Bank
+
+ Tambah Daftar Bank
+
{
setNewData({
@@ -255,6 +284,12 @@ export default function AdminAppInformation_ViewInfoBank({
{
setNewData({
@@ -266,6 +301,12 @@ export default function AdminAppInformation_ViewInfoBank({
{
@@ -276,19 +317,20 @@ export default function AdminAppInformation_ViewInfoBank({
}}
/>
- {
setIsCreate(false);
}}
>
Batal
-
+ */}
{
@@ -300,18 +342,23 @@ export default function AdminAppInformation_ViewInfoBank({
- ) : (
- ""
)}
- {isUpdate ? (
-
+ {isUpdate && (
+
- Update Data Bank
+
+ Update Data Bank
+
{
@@ -322,6 +369,11 @@ export default function AdminAppInformation_ViewInfoBank({
{
@@ -332,6 +384,11 @@ export default function AdminAppInformation_ViewInfoBank({
{
setIsUpdate(false);
+ setIsCreate(true);
}}
>
Batal
- ) : (
- ""
)}
-
-
+
+
+
+
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Aksi
+ |
+
+ Status
+ |
+
+
+ Bank
+
+ |
+
+ Nama Rekening
+ |
+
+ Nomor Rekening
+ |
+
+
+ {rowTable()}
+
+
+
+ )}
+
{/* Activasi bank */}
- setIsActivation(false)}
>
-
+
Anda ingin{" "}
{updateStatus.active ? (
@@ -401,6 +492,8 @@ export default function AdminAppInformation_ViewInfoBank({
Batal
{
@@ -414,7 +507,7 @@ export default function AdminAppInformation_ViewInfoBank({
-
+
>
);
diff --git a/src/app_modules/admin/app_info/view/view_info_whatsapp.tsx b/src/app_modules/admin/app_info/view/view_info_whatsapp.tsx
index 50d1895f..2fc09824 100644
--- a/src/app_modules/admin/app_info/view/view_info_whatsapp.tsx
+++ b/src/app_modules/admin/app_info/view/view_info_whatsapp.tsx
@@ -1,51 +1,77 @@
" use client";
+import {
+ AccentColor,
+ AdminColor,
+} from "@/app_modules/_global/color/color_pallet";
+import { apiGetAdminContact } from "@/app_modules/_global/lib/api_fetch_master";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
import {
ActionIcon,
Button,
Collapse,
+ Grid,
Group,
Paper,
+ SimpleGrid,
Stack,
TextInput,
Title,
Tooltip,
} from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
import { IconEdit, IconPhone } from "@tabler/icons-react";
import { useState } from "react";
import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
-import adminAppInformation_getNomorAdmin from "../fun/master/get_nomor_admin";
import adminAppInformation_funUpdateNomorAdmin from "../fun/update/fun_update_nomor";
-import { useDisclosure } from "@mantine/hooks";
-import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import { Admin_V3_ComponentBreakpoint } from "../../_components_v3/comp_simple_grid_breakpoint";
-export default function AdminAppInformation_ViewInformasiWhatApps({
- nomorAdmin,
-}: {
- nomorAdmin: any;
-}) {
- const [dataNomor, setDataNomor] = useState(nomorAdmin);
+export default function AdminAppInformation_ViewInformasiWhatApps() {
+ const [dataNomor, setDataNomor] = useState(null);
const [updateNomor, setUpdateNomor] = useState("");
const [opened, { toggle }] = useDisclosure(false);
- async function onUpdate() {
- const newNumber = (dataNomor.nomor = updateNomor);
- setDataNomor({
- ...dataNomor,
- nomor: newNumber,
- });
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
- const updt = await adminAppInformation_funUpdateNomorAdmin({
- data: dataNomor,
- });
- if (updt.status === 200) {
- const loadDdata = await adminAppInformation_getNomorAdmin();
- setDataNomor(loadDdata);
- toggle();
- ComponentAdminGlobal_NotifikasiBerhasil(updt.message);
- } else {
- ComponentAdminGlobal_NotifikasiGagal(updt.message);
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetAdminContact();
+
+ if (response) {
+ setDataNomor(response.data);
+ } else {
+ setDataNomor("");
+ }
+ } catch (error) {
+ clientLogger.error("Error get admin contact", error);
+ setDataNomor("");
+ }
+ };
+
+ async function onUpdate() {
+ try {
+ const newNumber = (dataNomor.nomor = updateNomor);
+ setDataNomor({
+ ...dataNomor,
+ nomor: newNumber,
+ });
+
+ const updt = await adminAppInformation_funUpdateNomorAdmin({
+ data: dataNomor,
+ });
+ if (updt.status === 200) {
+ handleLoadData();
+ toggle();
+ ComponentAdminGlobal_NotifikasiBerhasil(updt.message);
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(updt.message);
+ }
+ } catch (error) {
+ clientLogger.error("Error update nomor admin", error);
}
}
@@ -55,82 +81,94 @@ export default function AdminAppInformation_ViewInformasiWhatApps({
- Informasi WhatsApp
+
+ Informasi WhatsApp
+
-
-
-
-
- {`+${dataNomor.nomor}`}
-
- {
- toggle();
- setUpdateNomor(dataNomor.nomor);
- }}
- >
-
-
-
-
-
-
-
+ {!dataNomor ? (
+
+ ) : (
+
+
- }
- value={updateNomor}
- label={Nomor Aktif Admin}
- onChange={(val) => {
- setUpdateNomor(val.currentTarget.value);
- }}
- />
-
- {
- toggle();
- }}
- >
- Batal
-
- {
- onUpdate();
- }}
- >
- Update
-
-
+
+
+
+ {
+ toggle();
+ setUpdateNomor(dataNomor?.nomor);
+ }}
+ >
+
+
+
+ {`+${dataNomor?.nomor}`}
+
+
+
+
+
+ }
+ value={updateNomor}
+ label={
+
+ Nomor Aktif Admin
+
+ }
+ onChange={(val) => {
+ setUpdateNomor(val.currentTarget.value);
+ }}
+ />
+
+ {
+ toggle();
+ }}
+ >
+ Batal
+
+ {
+ onUpdate();
+ }}
+ >
+ Update
+
+
+
+
-
-
-
+
+
+ )}
>
);
diff --git a/src/app_modules/admin/app_info/view/view_kategori_portofolio.tsx b/src/app_modules/admin/app_info/view/view_kategori_portofolio.tsx
index ec2533e5..02c947fd 100644
--- a/src/app_modules/admin/app_info/view/view_kategori_portofolio.tsx
+++ b/src/app_modules/admin/app_info/view/view_kategori_portofolio.tsx
@@ -1,67 +1,92 @@
+"use client";
+
+import {
+ AdminColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
import { MODEL_DEFAULT_MASTER_OLD } from "@/app_modules/model_global/interface";
import {
- ActionIcon,
- Button,
- Center,
- Grid,
- Group,
- Modal,
- Paper,
- ScrollArea,
- Stack,
- Switch,
- Table,
- Text,
- TextInput,
- Title,
- Tooltip,
+ Box,
+ Button,
+ Center,
+ Group,
+ Paper,
+ ScrollArea,
+ Stack,
+ Switch,
+ Table,
+ Text,
+ TextInput,
+ Title,
} from "@mantine/core";
-import { IconCirclePlus, IconEdit } from "@tabler/icons-react";
+import { IconEdit } from "@tabler/icons-react";
import { useState } from "react";
import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
+import { Admin_ComponentModal } from "../../_admin_global/_component/comp_admin_modal";
import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
+import { Admin_V3_ComponentBreakpoint } from "../../_components_v3/comp_simple_grid_breakpoint";
import {
- adminAppInformation_funCreateBidangBisnis,
- adminAppInformation_funGetBidangBisnis,
- adminAppInformation_funUpdateBidangBisnis,
+ adminAppInformation_funCreateBidangBisnis,
+ adminAppInformation_funGetBidangBisnis,
+ adminAppInformation_funUpdateBidangBisnis,
} from "../fun";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetMasterAdminBidangBisnis } from "../lib/api_fetch_master";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export function AdminAppInformation_ViewKategoriPortofolio({
- dataBidangBisnis,
-}: {
- dataBidangBisnis: MODEL_DEFAULT_MASTER_OLD[];
-}) {
- const [data, setData] = useState(dataBidangBisnis);
+export function AdminAppInformation_ViewKategoriPortofolio() {
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ async function handleLoadData() {
+ try {
+ const response = await apiGetMasterAdminBidangBisnis();
+
+ if (response && response.success) {
+ setData(response.data);
+ } else {
+ setData([]);
+ }
+ } catch (error) {
+ console.log("Error load data", error);
+ setData([]);
+ }
+ }
// Create
const [isLoadingCreate, setLoadingCreate] = useState(false);
- const [isCreate, setIsCreate] = useState(false);
+ const [isCreate, setIsCreate] = useState(true);
const [newData, setNewData] = useState("");
async function onCreate() {
- const create = await adminAppInformation_funCreateBidangBisnis({
- name: newData,
- });
+ try {
+ const create = await adminAppInformation_funCreateBidangBisnis({
+ name: newData,
+ });
- if (create.status === 201) {
- try {
+ if (create.status === 201) {
setLoadingCreate(true);
const loadData = await adminAppInformation_funGetBidangBisnis();
setData(loadData);
- } catch (error) {
- console.log(error);
- } finally {
setNewData("");
- setLoadingCreate(false);
ComponentAdminGlobal_NotifikasiBerhasil(create.message);
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(create.message);
}
- } else {
- ComponentAdminGlobal_NotifikasiGagal(create.message);
+ } catch (error) {
+ console.log(error);
+ ComponentAdminGlobal_NotifikasiGagal("Gagal menambah bidang bisnis");
+ } finally {
+ setLoadingCreate(false);
}
}
// Update Data
const [isLoadingUpdate, setLoadingUpdate] = useState(false);
+
const [isUpdate, setIsUpdate] = useState(false);
const [updateData, setUpdateData] = useState({
id: "",
@@ -69,22 +94,25 @@ export function AdminAppInformation_ViewKategoriPortofolio({
});
async function onUpdate() {
- const updt = await adminAppInformation_funUpdateBidangBisnis({
- data: updateData as any,
- });
- if (updt?.status === 200) {
- try {
- setLoadingUpdate(true);
+ try {
+ setLoadingUpdate(true);
+ const updt = await adminAppInformation_funUpdateBidangBisnis({
+ data: updateData as any,
+ });
+ if (updt?.status === 200) {
const loadData = await adminAppInformation_funGetBidangBisnis();
setData(loadData);
- } catch (error) {
- console.log(error);
- } finally {
- setLoadingUpdate(false);
+
ComponentAdminGlobal_NotifikasiBerhasil(updt.message);
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(updt?.message as any);
}
- } else {
- ComponentAdminGlobal_NotifikasiGagal(updt?.message as any);
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setIsUpdate(false);
+ setIsCreate(true);
+ setLoadingUpdate(false);
}
}
@@ -94,6 +122,7 @@ export function AdminAppInformation_ViewKategoriPortofolio({
id: "",
active: null,
});
+ const [isLoadingActivation, setLoadingActivation] = useState(false);
async function onUpdateActivation({
id,
@@ -102,133 +131,104 @@ export function AdminAppInformation_ViewKategoriPortofolio({
id: string;
active: boolean;
}) {
- const updt = await adminAppInformation_funUpdateBidangBisnis({
- data: { id: id, active: active },
- });
+ try {
+ setLoadingActivation(true);
+ const updt = await adminAppInformation_funUpdateBidangBisnis({
+ data: { id: id, active: active },
+ });
- if (updt?.status === 200) {
- try {
- setLoadingUpdate(true);
+ if (updt?.status === 200) {
const loadData = await adminAppInformation_funGetBidangBisnis();
setData(loadData);
- } catch (error) {
- console.log(error);
- } finally {
setOpenModal(false);
- setLoadingUpdate(false);
+ setLoadingActivation(false);
ComponentAdminGlobal_NotifikasiBerhasil(updt?.message);
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(updt?.message as any);
}
- } else {
- ComponentAdminGlobal_NotifikasiGagal(updt?.message as any);
+ } catch (error) {
+ console.log(error);
+ ComponentAdminGlobal_NotifikasiGagal("Gagal mengupdate status");
}
}
- // Row Table
- const rowTable = data.map((e, i) => (
-
- |
-
- {e?.name}
-
- |
-
-
- {
- setOpenModal(true);
- setUpdateStatus({
- id: e?.id,
- active: val.currentTarget.checked as any,
- });
- }}
- />
-
- |
+ const rowTable = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+ return data.map((e, i) => (
+
+ |
+
+ }
+ radius={"xl"}
+ bg={MainColor.green}
+ color="green"
+ onClick={() => {
+ setIsUpdate(true);
+ setIsCreate(false);
+ setUpdateData({
+ id: e?.id,
+ name: e?.name,
+ });
+ }}
+ >
+ Edit
+
+
+ |
-
-
- {
- setIsUpdate(true);
- setIsCreate(false);
- setUpdateData({
- id: e?.id,
- name: e?.name,
- });
- }}
- >
-
-
-
-
-
- |
-
- ));
+
+
+ {
+ setOpenModal(true);
+ setUpdateStatus({
+ id: e?.id,
+ active: val.currentTarget.checked as any,
+ });
+ }}
+ />
+
+ |
+
+
+
+ {e?.name}
+
+ |
+
+ ));
+ };
return (
<>
- }
- onClick={() => {
- setIsCreate(true);
- setIsUpdate(false);
- }}
- >
- Tambah
-
- }
- />
+
-
-
-
-
-
-
-
- |
- Kategori
- |
-
- Status
- |
-
- Aksi
- |
-
-
- {rowTable}
-
-
-
-
-
-
+
+
{/* Form Create */}
{isCreate ? (
-
+
- Tambah Bidang Bisnis
+
+ Tambah Bidang Bisnis
+
- {
- setIsCreate(false);
- }}
- >
- Batal
-
{
@@ -267,12 +259,15 @@ export function AdminAppInformation_ViewKategoriPortofolio({
) : (
""
)}
+
{/* Form Update */}
{isUpdate ? (
-
+
- Update Bidang Bisnis
+
+ Update Bidang Bisnis
+
{
setIsUpdate(false);
+ setIsCreate(true);
}}
>
Batal
-
+
+
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Aksi
+ |
+
+ Status
+ |
+
+ Kategori
+ |
+
+
+ {rowTable()}
+
+
+
+ )}
+
{/* Activasi bank */}
- setOpenModal(false)}
>
-
+
Anda ingin{" "}
{updateStatus.active ? (
@@ -339,6 +365,8 @@ export function AdminAppInformation_ViewKategoriPortofolio({
Batal
{
@@ -352,7 +380,7 @@ export function AdminAppInformation_ViewKategoriPortofolio({
-
+
>
);
}
diff --git a/src/app_modules/admin/colab/component/detail_data.tsx b/src/app_modules/admin/colab/component/detail_data.tsx
index a26c9e7f..beb28ef1 100644
--- a/src/app_modules/admin/colab/component/detail_data.tsx
+++ b/src/app_modules/admin/colab/component/detail_data.tsx
@@ -1,3 +1,4 @@
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import { MODEL_COLLABORATION } from "@/app_modules/colab/model/interface";
import { Stack, Box, Center, Title, Grid, Text } from "@mantine/core";
@@ -11,20 +12,20 @@ export default function ComponentAdminColab_DetailData({
- {data?.title ? data.title : "Judul Proyek"}
+ {data?.title ? data.title : "Judul Proyek"}
-
+
Industri
- :
+ :
-
+
{data?.ProjectCollaborationMaster_Industri.name
? data.ProjectCollaborationMaster_Industri.name
: "Industri"}
@@ -34,31 +35,31 @@ export default function ComponentAdminColab_DetailData({
-
+
Lokasi
- :
+ :
-
+
{data?.lokasi ? data.lokasi : " Lokasi dari proyek"}
-
+
Tujuan proyek
- {data?.purpose ? data?.purpose : "-"}
+ {data?.purpose ? data?.purpose : "-"}
-
+
Keuntungan
- {data?.benefit ? data?.benefit : "-"}
+ {data?.benefit ? data?.benefit : "-"}
diff --git a/src/app_modules/admin/colab/dashboard/index.tsx b/src/app_modules/admin/colab/dashboard/index.tsx
index 6f865bdd..af537ca3 100644
--- a/src/app_modules/admin/colab/dashboard/index.tsx
+++ b/src/app_modules/admin/colab/dashboard/index.tsx
@@ -1,38 +1,136 @@
"use client";
-import { Stack, SimpleGrid, Paper, Group, Title, Text } from "@mantine/core";
+import {
+ Stack,
+ SimpleGrid,
+ Paper,
+ Group,
+ Title,
+ Text,
+ Flex,
+ ThemeIcon,
+} from "@mantine/core";
import { useRouter } from "next/navigation";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import {
+ IconAlertTriangle,
+ IconMessage2,
+ IconUpload,
+} from "@tabler/icons-react";
+import {
+ AccentColor,
+ AdminColor,
+} from "@/app_modules/_global/color/color_pallet";
+import { useState } from "react";
+import { clientLogger } from "@/util/clientLogger";
+import { apiGetAdminCollaborationStatusCountDashboard } from "../lib/api_fetch_admin_collaboration";
+import global_limit from "@/lib/limit";
+import { useShallowEffect } from "@mantine/hooks";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export default function AdminColab_Dashboard({
- countPublish,
- countRoom,
- countReject,
-}: {
- countPublish: number;
- countRoom: number;
- countReject: number;
-}) {
+export default function AdminColab_Dashboard() {
+ const [countPublish, setCountPublish] = useState(null);
+ const [countRoom, setCountRoom] = useState(null);
+ const [countReject, setCountReject] = useState(null);
const router = useRouter();
+ useShallowEffect(() => {
+ handlerLoadData();
+ }, []);
+
+ async function handlerLoadData() {
+ try {
+ const listLoadData = [
+ global_limit(() => onLoadCountPublish()),
+ global_limit(() => onLoadCountRoom()),
+ global_limit(() => onLoadCountReject()),
+ ];
+ const result = await Promise.all(listLoadData);
+ } catch (error) {
+ clientLogger.error("Error handler load data", error);
+ }
+ }
+ async function onLoadCountPublish() {
+ try {
+ const response = await apiGetAdminCollaborationStatusCountDashboard({
+ name: "Publish",
+ });
+ if (response) {
+ setCountPublish(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count publish", error);
+ }
+ }
+
+ async function onLoadCountRoom() {
+ try {
+ const response = await apiGetAdminCollaborationStatusCountDashboard({
+ name: "Room",
+ });
+ if (response) {
+ setCountRoom(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count room", error);
+ }
+ }
+
+ async function onLoadCountReject() {
+ try {
+ const response = await apiGetAdminCollaborationStatusCountDashboard({
+ name: "Reject",
+ });
+ if (response) {
+ setCountReject(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count reject", error);
+ }
+ }
+
const listStatus = [
{
id: 1,
name: "Publish",
- jumlah: countPublish,
+ jumlah:
+ countPublish == null ? (
+
+ ) : countPublish ? (
+ countPublish
+ ) : (
+ "-"
+ ),
color: "green",
+ icon: ,
},
{
id: 2,
name: "Group Chat",
- jumlah: countRoom,
+ jumlah:
+ countRoom == null ? (
+
+ ) : countRoom ? (
+ countRoom
+ ) : (
+ "-"
+ ),
color: "orange",
+ icon: ,
},
{
id: 3,
name: "Reject",
- jumlah: countReject,
+ jumlah:
+ countReject == null ? (
+
+ ) : countReject ? (
+ countReject
+ ) : (
+ "-"
+ ),
color: "red",
+ icon: ,
},
];
return (
@@ -51,18 +149,29 @@ export default function AdminColab_Dashboard({
{listStatus.map((e, i) => (
-
-
- {e.name}
- {e.jumlah ? e.jumlah : 0}
-
-
+
+
+ {e.name}
+
+
+
+ {e.jumlah ? e.jumlah : 0}
+
+
+ {e.icon}
+
+
+
))}
@@ -70,3 +179,6 @@ export default function AdminColab_Dashboard({
>
);
}
+function apiGetAdminCollaborationStatuCountDashboard(arg0: { name: string }) {
+ throw new Error("Function not implemented.");
+}
diff --git a/src/app_modules/admin/colab/detail/detail_group.tsx b/src/app_modules/admin/colab/detail/detail_group.tsx
new file mode 100644
index 00000000..33b9e096
--- /dev/null
+++ b/src/app_modules/admin/colab/detail/detail_group.tsx
@@ -0,0 +1,166 @@
+"use client";
+
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { MODEL_COLLABORATION_ROOM_CHAT } from "@/app_modules/colab/model/interface";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ Grid,
+ Group,
+ Paper,
+ ScrollArea,
+ SimpleGrid,
+ Stack,
+ Text,
+ Title,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import { apiGetAdminCollaborationGroupById } from "../lib/api_fetch_admin_collaboration";
+import { Admin_ComponentBoxStyle } from "../../_admin_global/_component/comp_admin_boxstyle";
+import { IconCaretRight } from "@tabler/icons-react";
+import { Admin_V3_ComponentSkeletonBreakpoint } from "../../_components_v3/comp_skeleton_breakpoint";
+import { Admin_V3_ComponentBreakpoint } from "../../_components_v3/comp_simple_grid_breakpoint";
+import { Admin_V3_ComponentDetail } from "../../_components_v3/comp_detail_data";
+
+function DetailGroup() {
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [loading, setLoading] = useState(false);
+
+ useShallowEffect(() => {
+ loadInitialData();
+ }, []);
+
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminCollaborationGroupById({
+ id: params.id,
+ });
+
+ if (response?.success && response?.data) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved:", error);
+ setData(null);
+ }
+ };
+
+ const listData = [
+ {
+ label: "Admin",
+ value: data?.ProjectCollaboration?.Author?.username,
+ },
+ {
+ label: "Judul",
+ value: data?.ProjectCollaboration?.title,
+ },
+ {
+ label: "Industri",
+ value:
+ data?.ProjectCollaboration?.ProjectCollaborationMaster_Industri?.name,
+ },
+ {
+ label: "Jumlah Partisipan",
+ value: data?.ProjectCollaboration_AnggotaRoomChat.length,
+ },
+ {
+ label: "Lokasi",
+ value: data?.ProjectCollaboration?.lokasi,
+ },
+ {
+ label: "Tujuan",
+ value: data?.ProjectCollaboration?.purpose,
+ },
+ {
+ label: "Keuntungan",
+ value: data?.ProjectCollaboration?.benefit,
+ },
+ ];
+
+ return (
+
+
+
+
+ {!data ? (
+
+ ) : (
+
+
+
+
+ {listData.map((e, i) => (
+
+ ))}
+
+ {/*
+ {
+ setOpenReject(true);
+ }}
+ leftIcon={}
+ >
+ Reject
+
+ */}
+
+
+
+
+
+
+
+ Anggota
+
+
+
+ {data.ProjectCollaboration_AnggotaRoomChat.map((e, i) => (
+
+
+
+
+
+
+ Username
+
+ :
+ {e.User.username}
+
+
+
+
+ Name
+
+ :
+ {e.User.Profile.name}
+
+
+
+ ))}
+
+
+
+
+ )}
+
+ );
+}
+
+export default DetailGroup;
diff --git a/src/app_modules/admin/colab/detail/detail_publish.tsx b/src/app_modules/admin/colab/detail/detail_publish.tsx
new file mode 100644
index 00000000..92a4d52c
--- /dev/null
+++ b/src/app_modules/admin/colab/detail/detail_publish.tsx
@@ -0,0 +1,190 @@
+"use client";
+
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { MODEL_COLLABORATION } from "@/app_modules/colab/model/interface";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ Button,
+ Grid,
+ Group,
+ Modal,
+ Paper,
+ SimpleGrid,
+ Stack,
+ Text,
+ Textarea,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconCheck, IconFlag2Off } from "@tabler/icons-react";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import { Admin_ComponentBoxStyle } from "../../_admin_global/_component/comp_admin_boxstyle";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import adminColab_funReportProjectById from "../fun/edit/fun_report_project_by_id";
+import { apiGetAdminCollaborationById } from "../lib/api_fetch_admin_collaboration";
+import { Admin_V3_ComponentSkeletonBreakpoint } from "../../_components_v3/comp_skeleton_breakpoint";
+import { Admin_V3_ComponentBreakpoint } from "../../_components_v3/comp_simple_grid_breakpoint";
+import { Admin_V3_ComponentDetail } from "../../_components_v3/comp_detail_data";
+import { Comp_V3_SetInnerHTMLWithStiker } from "@/app_modules/_global/component/new/comp_V3_set_html_with_stiker";
+
+function DetailPublish() {
+ const router = useRouter();
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [loading, setLoading] = useState(false);
+ const [openReject, setOpenReject] = useState(false);
+ const [report, setReport] = useState("");
+
+ useShallowEffect(() => {
+ loadInitialData();
+ }, []);
+
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminCollaborationById({
+ id: params.id,
+ });
+
+ if (response?.success && response?.data) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved:", error);
+ setData(null);
+ }
+ };
+
+ async function onReject() {
+ try {
+ setLoading(true);
+ const response = await adminColab_funReportProjectById({
+ colabId: params.id,
+ report: report,
+ });
+
+ if (response.status == 200) {
+ setLoading(false);
+ router.back();
+ }
+ } catch (error) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal Load");
+ clientLogger.error("Invalid report collaboration", error);
+ }
+ }
+
+ const listData = [
+ {
+ label: "Username",
+ value: data?.Author.username,
+ },
+ {
+ label: "Judul",
+ value: data?.title,
+ },
+ {
+ label: "Industri",
+ value: data?.ProjectCollaborationMaster_Industri.name,
+ },
+ {
+ label: "Jumlah Partisipan",
+ value: data?.ProjectCollaboration_Partisipasi.length,
+ },
+ {
+ label: "Lokasi",
+ value: data?.lokasi,
+ },
+ {
+ label: "Tujuan",
+ value: ,
+ },
+ {
+ label: "Keuntungan",
+ value: ,
+ },
+ ];
+
+ return (
+ <>
+
+
+
+
+ {!data ? (
+
+ ) : (
+
+
+
+ {listData.map((e, i) => (
+
+ ))}
+
+
+ {
+ setOpenReject(true);
+ }}
+ leftIcon={}
+ >
+ Reject
+
+
+
+
+
+ )}
+
+
+ {/* Reject Project */}
+ setOpenReject(false)}
+ centered
+ withCloseButton={false}
+ size={"md"}
+ >
+
+
+
+ Apakah anda yakin ingin mereport project{" "}
+
+ {data?.title}
+
+ ?
+ {" "}
+
+
+
+ >
+ );
+}
+
+export default DetailPublish;
diff --git a/src/app_modules/admin/colab/detail/detail_reject.tsx b/src/app_modules/admin/colab/detail/detail_reject.tsx
new file mode 100644
index 00000000..807a6cbe
--- /dev/null
+++ b/src/app_modules/admin/colab/detail/detail_reject.tsx
@@ -0,0 +1,139 @@
+"use client";
+
+import React, { useState } from "react";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
+import {
+ Button,
+ Flex,
+ Grid,
+ Group,
+ Modal,
+ Paper,
+ SimpleGrid,
+ Stack,
+ Text,
+ Textarea,
+ Title,
+} from "@mantine/core";
+import { useParams, useRouter } from "next/navigation";
+import { MODEL_COLLABORATION } from "@/app_modules/colab/model/interface";
+import { useShallowEffect } from "@mantine/hooks";
+import { clientLogger } from "@/util/clientLogger";
+import { apiGetAdminCollaborationById } from "../lib/api_fetch_admin_collaboration";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { IconCheck, IconFlag2Off } from "@tabler/icons-react";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import adminColab_funReportProjectById from "../fun/edit/fun_report_project_by_id";
+import { Admin_ComponentBoxStyle } from "../../_admin_global/_component/comp_admin_boxstyle";
+import { Admin_V3_ComponentBreakpoint } from "../../_components_v3/comp_simple_grid_breakpoint";
+import { Admin_V3_ComponentSkeletonBreakpoint } from "../../_components_v3/comp_skeleton_breakpoint";
+import { Admin_V3_ComponentDetail } from "../../_components_v3/comp_detail_data";
+
+function DetailReject() {
+ const router = useRouter();
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [loading, setLoading] = useState(false);
+ const [openReject, setOpenReject] = useState(false);
+ const [report, setReport] = useState("");
+
+ useShallowEffect(() => {
+ loadInitialData();
+ }, []);
+
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminCollaborationById({
+ id: params.id,
+ });
+
+ if (response?.success && response?.data) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved:", error);
+ setData(null);
+ }
+ };
+
+ // async function onReject() {
+ // try {
+ // setLoading(true);
+ // const response = await adminColab_funReportProjectById({
+ // colabId: params.id,
+ // report: report,
+ // });
+
+ // if (response.status == 200) {
+ // setLoading(false);
+ // router.back();
+ // }
+ // } catch (error) {
+ // setLoading(false);
+ // ComponentGlobal_NotifikasiPeringatan("Gagal Load");
+ // clientLogger.error("Invalid report collaboration", error);
+ // }
+ // }
+
+ const listData = [
+ {
+ label: "Username",
+ value: data?.Author.username,
+ },
+ {
+ label: "Judul",
+ value: data?.title,
+ },
+ {
+ label: "Industri",
+ value: data?.ProjectCollaborationMaster_Industri.name,
+ },
+ {
+ label: "Jumlah Partisipan",
+ value: data?.ProjectCollaboration_Partisipasi.length,
+ },
+ {
+ label: "Lokasi",
+ value: data?.lokasi,
+ },
+ {
+ label: "Tujuan",
+ value: data?.purpose,
+ },
+ {
+ label: "Keuntungan",
+ value: data?.benefit,
+ },
+ {
+ label: "Catatan Report",
+ value: data?.report,
+ },
+ ];
+
+ return (
+ <>
+
+
+
+
+ {!data ? (
+
+ ) : (
+
+
+
+ {listData.map((e, i) => (
+
+ ))}
+
+
+
+ )}
+
+ >
+ );
+}
+
+export default DetailReject;
diff --git a/src/app_modules/admin/colab/fun/count/count_group_chat.ts b/src/app_modules/admin/colab/fun/count/count_group_chat.ts
index ce5cf8cc..838be9b9 100644
--- a/src/app_modules/admin/colab/fun/count/count_group_chat.ts
+++ b/src/app_modules/admin/colab/fun/count/count_group_chat.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function adminColab_countGroupChat() {
const count = await prisma.projectCollaboration_RoomChat.count({
diff --git a/src/app_modules/admin/colab/fun/count/count_publish.ts b/src/app_modules/admin/colab/fun/count/count_publish.ts
index 3d4acee1..da67232e 100644
--- a/src/app_modules/admin/colab/fun/count/count_publish.ts
+++ b/src/app_modules/admin/colab/fun/count/count_publish.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function adminColab_countIsPublish() {
const count = await prisma.projectCollaboration.count({
diff --git a/src/app_modules/admin/colab/fun/count/count_reject.ts b/src/app_modules/admin/colab/fun/count/count_reject.ts
index 3b74ea21..b61dd4eb 100644
--- a/src/app_modules/admin/colab/fun/count/count_reject.ts
+++ b/src/app_modules/admin/colab/fun/count/count_reject.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function adminColab_countIsReject() {
const count = await prisma.projectCollaboration.count({
diff --git a/src/app_modules/admin/colab/fun/edit/fun_report_project_by_id.ts b/src/app_modules/admin/colab/fun/edit/fun_report_project_by_id.ts
index d1463374..41b87e6e 100644
--- a/src/app_modules/admin/colab/fun/edit/fun_report_project_by_id.ts
+++ b/src/app_modules/admin/colab/fun/edit/fun_report_project_by_id.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterAdminColab } from "@/app/lib/router_admin/router_admin_colab";
+import prisma from "@/lib/prisma";
+import { RouterAdminColab } from "@/lib/router_admin/router_admin_colab";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { revalidatePath } from "next/cache";
@@ -30,16 +30,16 @@ export default async function adminColab_funReportProjectById({
if (!projectUpdate) return { status: 400, message: "Gagal update project" };
- const updateReport = await prisma.projectCollaboration_Notifikasi.create({
- data: {
- projectCollaborationId: colabId,
- adminId: userLoginId as string,
- userId: projectUpdate.userId as any,
- note: "Project Anda Telah Direport Admin",
- },
- });
+ // const updateReport = await prisma.projectCollaboration_Notifikasi.create({
+ // data: {
+ // projectCollaborationId: colabId,
+ // adminId: userLoginId as string,
+ // userId: projectUpdate.userId as any,
+ // note: "Project Anda Telah Direport Admin",
+ // },
+ // });
- if (!updateReport) return { status: 400, message: "Gagal update notifikasi" };
+ // if (!updateReport) return { status: 400, message: "Gagal update notifikasi" };
revalidatePath(RouterAdminColab.table_publish);
return { status: 200, message: "Berhasil Update" };
diff --git a/src/app_modules/admin/colab/fun/get/get_list_all_group_chat.ts b/src/app_modules/admin/colab/fun/get/get_list_all_group_chat.ts
index 29a3b2e6..5c25db37 100644
--- a/src/app_modules/admin/colab/fun/get/get_list_all_group_chat.ts
+++ b/src/app_modules/admin/colab/fun/get/get_list_all_group_chat.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { ceil } from "lodash";
export default async function adminColab_getListAllGroupChat({
diff --git a/src/app_modules/admin/colab/fun/get/get_list_all_publish.ts b/src/app_modules/admin/colab/fun/get/get_list_all_publish.ts
index e3ca56fe..a754d6e1 100644
--- a/src/app_modules/admin/colab/fun/get/get_list_all_publish.ts
+++ b/src/app_modules/admin/colab/fun/get/get_list_all_publish.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _, { ceil } from "lodash";
export default async function adminColab_getListAllPublish({
diff --git a/src/app_modules/admin/colab/fun/get/get_list_all_reject.ts b/src/app_modules/admin/colab/fun/get/get_list_all_reject.ts
index 3ad87f3d..9064b7ff 100644
--- a/src/app_modules/admin/colab/fun/get/get_list_all_reject.ts
+++ b/src/app_modules/admin/colab/fun/get/get_list_all_reject.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _ from "lodash";
export default async function adminColab_getListAllRejected({
diff --git a/src/app_modules/admin/colab/fun/get/get_one_by_colab_id.ts b/src/app_modules/admin/colab/fun/get/get_one_by_colab_id.ts
index 23825ec9..285daffa 100644
--- a/src/app_modules/admin/colab/fun/get/get_one_by_colab_id.ts
+++ b/src/app_modules/admin/colab/fun/get/get_one_by_colab_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function adminColab_getOneByColabId({
id,
diff --git a/src/app_modules/admin/colab/fun/get/get_one_room_chat_by_id.ts b/src/app_modules/admin/colab/fun/get/get_one_room_chat_by_id.ts
index d3bfc67e..629c11a9 100644
--- a/src/app_modules/admin/colab/fun/get/get_one_room_chat_by_id.ts
+++ b/src/app_modules/admin/colab/fun/get/get_one_room_chat_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function adminColab_getOneRoomChatById({
roomId,
diff --git a/src/app_modules/admin/colab/lib/api_fetch_admin_collaboration.ts b/src/app_modules/admin/colab/lib/api_fetch_admin_collaboration.ts
new file mode 100644
index 00000000..e7907b83
--- /dev/null
+++ b/src/app_modules/admin/colab/lib/api_fetch_admin_collaboration.ts
@@ -0,0 +1,151 @@
+export {
+ apiGetAdminCollaborationStatusCountDashboard,
+ apiGetAdminCollaborationPublish,
+ apiGetAdminCollaborationReject,
+ apiGetAdminCollaborationRoomById,
+ apiGetAdminCollaborationById,
+ apiGetAdminCollaborationGroupById,
+};
+const apiGetAdminCollaborationStatusCountDashboard = async ({
+ name,
+}: {
+ name: "Publish" | "Reject" | "Room";
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ // console.log("Ini Token", token);
+ const response = await fetch(`/api/admin/collaboration/dashboard/${name}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ // console.log("Ini Response", await response.json());
+ return await response.json().catch(() => null);
+};
+const apiGetAdminCollaborationPublish = async ({ page }: { page: string }) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isPage = page ? `?page=${page}` : "";
+ const response = await fetch(
+ `/api/admin/collaboration/status/publish/${isPage}`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminCollaborationReject = async ({ page }: { page: string }) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isPage = page ? `?page=${page}` : "";
+ const response = await fetch(
+ `/api/admin/collaboration/status/reject/${isPage}`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ return await response.json().catch(() => null);
+};
+const apiGetAdminCollaborationRoomById = async ({
+ page,
+ search,
+}: {
+ page: string;
+ search?: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isPage = page ? `?page=${page}` : "";
+ const isSearch = search ? `&search=${search}` : "";
+ const response = await fetch(
+ `/api/admin/collaboration/group${isPage}${isSearch}`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminCollaborationById = async ({ id }: { id: string }) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/collaboration/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminCollaborationGroupById = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/collaboration/group/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get data collaboration group",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to get data collaboration group"
+ );
+ }
+
+ // Return the JSON response
+
+ const result = await response.json();
+ return result;
+ } catch (error) {
+ console.error("Error get data collaboration group", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
diff --git a/src/app_modules/admin/colab/sub_menu/group.tsx b/src/app_modules/admin/colab/sub_menu/group.tsx
index 08f137fe..9840cbea 100644
--- a/src/app_modules/admin/colab/sub_menu/group.tsx
+++ b/src/app_modules/admin/colab/sub_menu/group.tsx
@@ -1,54 +1,48 @@
"use client";
+import { AccentColor } from "@/app_modules/_global/color";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import { MODEL_COLLABORATION_ROOM_CHAT } from "@/app_modules/colab/model/interface";
import {
- Stack,
- Group,
- Title,
+ Box,
+ Center,
+ Modal,
Paper,
ScrollArea,
- Table,
- Center,
- Text,
- Badge,
- Spoiler,
- Pagination,
- Button,
- Modal,
SimpleGrid,
- Box,
+ Stack,
+ Table,
+ Text,
+ Title,
} from "@mantine/core";
-import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
-import {
- MODEL_COLLABORATION,
- MODEL_COLLABORATION_ROOM_CHAT,
-} from "@/app_modules/colab/model/interface";
-import { IconBan, IconCircleDot, IconEye } from "@tabler/icons-react";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconCircleDot } from "@tabler/icons-react";
import { useState } from "react";
-import adminColab_getOneByColabId from "../fun/get/get_one_by_colab_id";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
+import Admin_DetailButton from "../../_admin_global/_component/button/detail_button";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
import ComponentAdminColab_DetailData from "../component/detail_data";
import adminColab_getOneRoomChatById from "../fun/get/get_one_room_chat_by_id";
-import adminColab_getListAllGroupChat from "../fun/get/get_list_all_group_chat";
+import { apiGetAdminCollaborationRoomById } from "../lib/api_fetch_admin_collaboration";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export default function AdminColab_TableGroup({
- listGroup,
-}: {
- listGroup: any;
-}) {
+export default function AdminColab_TableGroup() {
return (
<>
-
+
>
);
}
-function TableMenu({ listGroup }: { listGroup: any }) {
- const [data, setData] = useState(
- listGroup.data
+function TableMenu() {
+ const [data, setData] = useState(
+ null
);
- const [isNPage, setNPage] = useState(listGroup.nPage);
+ const [isNPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
const [idProject, setIdProject] = useState("");
@@ -56,14 +50,37 @@ function TableMenu({ listGroup }: { listGroup: any }) {
const [loadingDetail, setLoadingDetail] = useState(false);
const [detailData, setDetailData] = useState();
+ useShallowEffect(() => {
+ onLoadData();
+ }, [activePage]);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetAdminCollaborationRoomById({
+ page: `${activePage}`,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format recieved", response);
+ setData([]);
+ }
+ } catch (error) {
+ console.error("Error get data table reject", error);
+ setData([]);
+ }
+ }
+
// PAGINATION dan No awal data di tampilkan
let noAwal = activePage * 5 - 4;
- async function onLoad(pindahPage: any) {
- const load = await adminColab_getListAllGroupChat({ page: pindahPage });
- setActivePage(pindahPage);
- setData(load.data as any);
- setNPage(load.nPage);
- }
+ // async function onLoad(pindahPage: any) {
+ // const load = await adminColab_getListAllGroupChat({ page: pindahPage });
+ // setActivePage(pindahPage);
+ // setData(load.data as any);
+ // setNPage(load.nPage);
+ // }
async function onDetailData(roomId: string) {
setLoadingDetail(true);
@@ -79,131 +96,119 @@ function TableMenu({ listGroup }: { listGroup: any }) {
});
}
- const tableRow = data.map((e, i) => (
-
- |
- {noAwal++}
- |
-
-
-
- {e?.ProjectCollaboration?.Author?.Profile?.name}
-
-
- |
-
-
- {e?.name}
-
- |
-
-
-
- {e?.ProjectCollaboration?.ProjectCollaborationMaster_Industri?.name}
-
-
- |
-
-
- {e?.ProjectCollaboration_AnggotaRoomChat.length}
-
- |
-
-
-
- {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+
+ return data.map((e, i) => (
+
+ {/* |
+ {noAwal++}
+ | */}
+
+
+
+ {e?.ProjectCollaboration?.Author?.Profile?.name}
+
+
+ |
+
+
+ {e?.name}
+
+ |
+
+
+
+ {
+ e?.ProjectCollaboration?.ProjectCollaborationMaster_Industri
+ ?.name
}
- leftIcon={}
- loaderPosition="center"
- radius={"xl"}
- color="green"
- onClick={() => {
- onDetailData(e?.id);
- }}
- >
- Detail
-
- {/* }
- loaderPosition="center"
- radius={"xl"}
- color="red"
- // onClick={() => {
- // onRejected(e.id);
- // }}
- >
- Reject
- */}
-
-
- |
-
- ));
+
+
+ |
+
+
+ {e?.ProjectCollaboration_AnggotaRoomChat.length}
+
+ |
+
+
+
+
+
+
+ |
+
+ ));
+ };
return (
<>
-
- Group Chat
-
-
-
-
-
-
-
- |
- No
- |
-
- Admin Room
- |
-
- Nama Group
- |
-
- Industri
- |
-
- Anggota Group
- |
-
- Aksi
- |
-
-
- {tableRow}
-
-
- {
- onLoad(val);
- }}
- />
-
-
+ >}
+ />
+
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+
+ {/* |
+ No
+ | */}
+
+ Admin Room
+ |
+
+ Nama Group
+ |
+
+ Industri
+ |
+
+ Anggota Group
+ |
+
+ Aksi
+ |
+
+
+ {tableRow()}
+
+
+ {
+ setActivePage(val);
+ }}
+ />
+
+
+ )}
setOpenDetail(false)}
centered
@@ -211,26 +216,28 @@ function TableMenu({ listGroup }: { listGroup: any }) {
withCloseButton={false}
>
-
+
-
+
- Anggota
+
+ Anggota
+
{detailData?.ProjectCollaboration_AnggotaRoomChat?.map(
(e, i) => (
- {" "}
-
+ {" "}
+
{e?.User?.Profile?.name}
@@ -243,7 +250,6 @@ function TableMenu({ listGroup }: { listGroup: any }) {
- {/* {JSON.stringify(detailData, null, 2)} */}
>
);
}
diff --git a/src/app_modules/admin/colab/sub_menu/publish.tsx b/src/app_modules/admin/colab/sub_menu/publish.tsx
index acdb54fb..1e01220d 100644
--- a/src/app_modules/admin/colab/sub_menu/publish.tsx
+++ b/src/app_modules/admin/colab/sub_menu/publish.tsx
@@ -1,314 +1,218 @@
"use client";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { MODEL_COLLABORATION } from "@/app_modules/colab/model/interface";
import {
- Stack,
+ Box,
+ Button,
+ Center,
Group,
- Title,
+ Pagination,
Paper,
ScrollArea,
+ Stack,
Table,
- Center,
Text,
- Badge,
- Spoiler,
- Pagination,
- Button,
- Modal,
- TextInput,
- Textarea,
- Box,
+ Title,
} from "@mantine/core";
-import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
-import { MODEL_COLLABORATION } from "@/app_modules/colab/model/interface";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconEye } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
import { useState } from "react";
-import { useDisclosure, useShallowEffect } from "@mantine/hooks";
-import adminColab_getListAllPublish from "../fun/get/get_list_all_publish";
-import ComponentAdminColab_DetailData from "../component/detail_data";
-import adminColab_getOneByColabId from "../fun/get/get_one_by_colab_id";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
-import _ from "lodash";
-import { IconBan, IconCheck, IconEye } from "@tabler/icons-react";
-import adminColab_funReportProjectById from "../fun/edit/fun_report_project_by_id";
-import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
-export default function AdminColab_TablePublish({
- listData,
-}: {
- listData: any;
-}) {
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { RouterAdminColab } from "@/lib/router_admin/router_admin_colab";
+import { clientLogger } from "@/util/clientLogger";
+import { apiGetAdminCollaborationPublish } from "../lib/api_fetch_admin_collaboration";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
+
+export default function AdminColab_TablePublish() {
return (
<>
-
+
{/* {JSON.stringify(listData.nPage, null, 2)} */}
>
);
}
-function TableMenu({ listData }: { listData: any }) {
- const [data, setData] = useState(listData.data);
- const [isNPage, setNPage] = useState(listData.nPage);
+function TableMenu() {
+ const router = useRouter();
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
+ const [idData, setIdData] = useState("");
+ const [isLoading, setLoading] = useState(false);
- const [idProject, setIdProject] = useState("");
- const [openDetail, setOpenDetail] = useState(false);
- const [loadingDetail, setLoadingDetail] = useState(false);
- const [detailData, setDetailData] = useState();
+ useShallowEffect(() => {
+ loadInitialData();
+ }, [activePage]);
- const [openReject, setOpenReject] = useState(false);
- const [report, setReport] = useState("");
- const [loadingReject, setLoadingReject] = useState(false);
- const [loadingReport, setLoadingReport] = useState(false);
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminCollaborationPublish({
+ page: `${activePage}`,
+ });
- // PAGINATION dan No awal data di tampilkan
- let noAwal = activePage * 5 - 4;
- async function onLoad(pindahPage: any) {
- const load = await adminColab_getListAllPublish({ page: pindahPage });
- setActivePage(pindahPage);
- setData(load.data as any);
- setNPage(load.nPage);
- }
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format recieved", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data table publish", error);
+ setData([]);
+ }
+ };
- // Table Body
- const tableRow = data.map((e, i) => (
-
- |
- {noAwal++}
- |
-
-
- {e?.Author?.Profile?.name}
-
- |
-
-
-
+ const onPageCLick = (page: number) => {
+ setActivePage(page);
+ };
+
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
- {e?.title}
+ Tidak ada data
+ |
+
+ );
+ }
+
+ return data.map((e, i) => (
+
+ |
+
+
+ {e?.Author?.username}
+
-
- |
-
-
- {e?.ProjectCollaborationMaster_Industri.name}
-
- |
-
-
- {e?.ProjectCollaboration_Partisipasi.length}
-
- |
-
-
-
+ |
+
+
+ {e?.title}
+
+ |
+
+
+ {e?.ProjectCollaborationMaster_Industri.name}
+
+ |
+
+
+ {e?.ProjectCollaboration_Partisipasi.length}
+
+ |
+
+
}
loaderPosition="center"
radius={"xl"}
color="green"
onClick={() => {
- getDetailData(e.id);
+ setLoading(true);
+ setIdData(e?.id);
+ router.push(RouterAdminColab.detail_publish + `${e?.id}`);
}}
>
Detail
- }
- loaderPosition="center"
- radius={"xl"}
- color="red"
- onClick={() => {
- onRejected(e.id);
- }}
- >
- Reject
-
-
-
- |
-
- ));
+
+ |
+
+ ));
+ };
- // Menampilkan Detail Data
- async function getDetailData(colabId: any) {
- setLoadingDetail(true);
- setIdProject(colabId);
+ // async function onReport() {
+ // if (report === "")
+ // return ComponentGlobal_NotifikasiPeringatan("Lengkapi Alasan Report");
- await adminColab_getOneByColabId({ id: colabId }).then((res) => {
- if (res.status === 200) {
- setDetailData(res.data as any);
- setOpenDetail(true);
- setLoadingDetail(false);
- } else {
- ComponentGlobal_NotifikasiPeringatan("Gagal Load");
- }
- });
- }
+ // await adminColab_funReportProjectById({
+ // colabId: idData,
+ // report: report,
+ // }).then(async (res) => {
+ // if (res.status === 200) {
+ // const newData = await adminColab_getListAllPublish({
+ // page: activePage,
+ // });
- // Menampilkan Data Title yang akan di REJECT
- async function onRejected(colabId: string) {
- setLoadingReject(true);
- setIdProject(colabId);
-
- await adminColab_getOneByColabId({ id: colabId }).then((res) => {
- if (res.status === 200) {
- const selectedData = _.omit(res.data, [
- "Author",
- "ProjectCollaborationMaster_Industri",
- "ProjectCollaboration_Partisipasi",
- "benefit",
- "createdAt",
- "purpose",
- "lokasi",
- ]);
-
- setDetailData(selectedData as any);
- setOpenReject(true);
- setLoadingReject(false);
- } else {
- ComponentGlobal_NotifikasiPeringatan("Gagal Load");
- }
- });
- }
-
- // Update status report pada project
- async function onReport() {
- if (report === "")
- return ComponentGlobal_NotifikasiPeringatan("Lengkapi Alasan Report");
-
- await adminColab_funReportProjectById({
- colabId: idProject,
- report: report,
- }).then(async (res) => {
- if (res.status === 200) {
- const newData = await adminColab_getListAllPublish({
- page: activePage,
- });
-
- setActivePage(activePage);
- setData(newData.data as any);
- setNPage(newData.nPage);
- setOpenReject(false);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- } else {
- ComponentGlobal_NotifikasiPeringatan(res.message);
- }
- });
- }
+ // setActivePage(activePage);
+ // setData(newData.data as any);
+ // setNPage(newData.nPage);
+ // setOpenReject(false);
+ // ComponentGlobal_NotifikasiBerhasil(res.message);
+ // } else {
+ // ComponentGlobal_NotifikasiPeringatan(res.message);
+ // }
+ // });
+ // }
return (
<>
Publish
-
-
-
-
-
-
- |
- No
- |
-
- Username
- |
-
- Title
- |
-
- Industri
- |
-
- Jumlah Partisipan
- |
-
- Aksi
- |
-
-
- {tableRow}
-
-
- {
- onLoad(val);
- }}
- />
-
-
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+
+ |
+ Username
+ |
+
+ Title
+ |
+
+ Industri
+ |
+
+ Jumlah Partisipan
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+ {
+ onPageCLick(val);
+ }}
+ />
+
+
+ )}
-
- {/* Detail Data */}
- setOpenDetail(false)}
- centered
- withCloseButton={false}
- size={"lg"}
- >
-
-
-
-
-
- {/* Reject Project */}
- setOpenReject(false)}
- centered
- withCloseButton={false}
- size={"lg"}
- >
-
-
-
- Apakah anda yakin ingin mereport project{" "}
-
- {detailData?.title}
-
- ?
- {" "}
-
-
-
>
);
}
diff --git a/src/app_modules/admin/colab/sub_menu/publish.txt b/src/app_modules/admin/colab/sub_menu/publish.txt
new file mode 100644
index 00000000..80a6b327
--- /dev/null
+++ b/src/app_modules/admin/colab/sub_menu/publish.txt
@@ -0,0 +1,317 @@
+"use client";
+
+import {
+ Stack,
+ Group,
+ Title,
+ Paper,
+ ScrollArea,
+ Table,
+ Center,
+ Text,
+ Badge,
+ Spoiler,
+ Pagination,
+ Button,
+ Modal,
+ TextInput,
+ Textarea,
+ Box,
+} from "@mantine/core";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import { MODEL_COLLABORATION } from "@/app_modules/colab/model/interface";
+import { useState } from "react";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import adminColab_getListAllPublish from "../fun/get/get_list_all_publish";
+import ComponentAdminColab_DetailData from "../component/detail_data";
+import adminColab_getOneByColabId from "../fun/get/get_one_by_colab_id";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
+import _ from "lodash";
+import { IconBan, IconCheck, IconEye } from "@tabler/icons-react";
+import adminColab_funReportProjectById from "../fun/edit/fun_report_project_by_id";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+
+export default function AdminColab_TablePublish({
+ listData,
+}: {
+ listData: any;
+}) {
+ return (
+ <>
+
+
+
+ {/* {JSON.stringify(listData.nPage, null, 2)} */}
+
+ >
+ );
+}
+function TableMenu({ listData }: { listData: any }) {
+ const [data, setData] = useState(listData.data);
+ const [isNPage, setNPage] = useState(listData.nPage);
+ const [activePage, setActivePage] = useState(1);
+
+ const [idProject, setIdProject] = useState("");
+ const [openDetail, setOpenDetail] = useState(false);
+ const [loadingDetail, setLoadingDetail] = useState(false);
+ const [detailData, setDetailData] = useState();
+
+ const [openReject, setOpenReject] = useState(false);
+ const [report, setReport] = useState("");
+ const [loadingReject, setLoadingReject] = useState(false);
+ const [loadingReport, setLoadingReport] = useState(false);
+
+ // PAGINATION dan No awal data di tampilkan
+ let noAwal = activePage * 5 - 4;
+ async function onLoad(pindahPage: any) {
+ const load = await adminColab_getListAllPublish({ page: pindahPage });
+ setActivePage(pindahPage);
+ setData(load.data as any);
+ setNPage(load.nPage);
+ }
+
+ // Table Body
+ const tableRow = data.map((e, i) => (
+
+ |
+ {noAwal++}
+ |
+
+
+ {e?.Author?.Profile?.name}
+
+ |
+
+
+
+
+ {e?.title}
+
+
+
+ |
+
+
+ {e?.ProjectCollaborationMaster_Industri.name}
+
+ |
+
+
+ {e?.ProjectCollaboration_Partisipasi.length}
+
+ |
+
+
+
+ }
+ loaderPosition="center"
+ radius={"xl"}
+ color="green"
+ onClick={() => {
+ getDetailData(e.id);
+ }}
+ >
+ Detail
+
+ }
+ loaderPosition="center"
+ radius={"xl"}
+ color="red"
+ onClick={() => {
+ onRejected(e.id);
+ }}
+ >
+ Reject
+
+
+
+ |
+
+ ));
+
+ // Menampilkan Detail Data
+ async function getDetailData(colabId: any) {
+ setLoadingDetail(true);
+ setIdProject(colabId);
+
+ await adminColab_getOneByColabId({ id: colabId }).then((res) => {
+ if (res.status === 200) {
+ setDetailData(res.data as any);
+ setOpenDetail(true);
+ setLoadingDetail(false);
+ } else {
+ ComponentGlobal_NotifikasiPeringatan("Gagal Load");
+ }
+ });
+ }
+
+ // Menampilkan Data Title yang akan di REJECT
+ async function onRejected(colabId: string) {
+ setLoadingReject(true);
+ setIdProject(colabId);
+
+ await adminColab_getOneByColabId({ id: colabId }).then((res) => {
+ if (res.status === 200) {
+ const selectedData = _.omit(res.data, [
+ "Author",
+ "ProjectCollaborationMaster_Industri",
+ "ProjectCollaboration_Partisipasi",
+ "benefit",
+ "createdAt",
+ "purpose",
+ "lokasi",
+ ]);
+
+ setDetailData(selectedData as any);
+ setOpenReject(true);
+ setLoadingReject(false);
+ } else {
+ ComponentGlobal_NotifikasiPeringatan("Gagal Load");
+ }
+ });
+ }
+
+ // Update status report pada project
+ async function onReport() {
+ if (report === "")
+ return ComponentGlobal_NotifikasiPeringatan("Lengkapi Alasan Report");
+
+ await adminColab_funReportProjectById({
+ colabId: idProject,
+ report: report,
+ }).then(async (res) => {
+ if (res.status === 200) {
+ const newData = await adminColab_getListAllPublish({
+ page: activePage,
+ });
+
+ setActivePage(activePage);
+ setData(newData.data as any);
+ setNPage(newData.nPage);
+ setOpenReject(false);
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ } else {
+ ComponentGlobal_NotifikasiPeringatan(res.message);
+ }
+ });
+ }
+
+ return (
+ <>
+
+
+ Publish
+
+
+
+
+
+
+
+ |
+ No
+ |
+
+ Username
+ |
+
+ Title
+ |
+
+ Industri
+ |
+
+ Jumlah Partisipan
+ |
+
+ Aksi
+ |
+
+
+ {tableRow}
+
+
+ {
+ onLoad(val);
+ }}
+ />
+
+
+
+
+ {/* Detail Data */}
+ setOpenDetail(false)}
+ centered
+ withCloseButton={false}
+ size={"lg"}
+ >
+
+
+
+
+
+ {/* Reject Project */}
+ setOpenReject(false)}
+ centered
+ withCloseButton={false}
+ size={"lg"}
+ >
+
+
+
+ Apakah anda yakin ingin mereport project{" "}
+
+ {detailData?.title}
+
+ ?
+ {" "}
+
+
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/admin/colab/sub_menu/reject.tsx b/src/app_modules/admin/colab/sub_menu/reject.tsx
index f5c51c72..fe649d00 100644
--- a/src/app_modules/admin/colab/sub_menu/reject.tsx
+++ b/src/app_modules/admin/colab/sub_menu/reject.tsx
@@ -1,185 +1,169 @@
"use client";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { MODEL_COLLABORATION } from "@/app_modules/colab/model/interface";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
import {
- Stack,
+ Box,
+ Center,
Group,
- Title,
+ Pagination,
Paper,
ScrollArea,
+ Stack,
Table,
- Center,
Text,
- Badge,
- Spoiler,
- Box,
- Pagination,
+ Title,
} from "@mantine/core";
-import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import { useShallowEffect } from "@mantine/hooks";
import { useState } from "react";
-import { MODEL_COLLABORATION } from "@/app_modules/colab/model/interface";
-import adminColab_getListAllRejected from "../fun/get/get_list_all_reject";
+import Admin_DetailButton from "../../_admin_global/_component/button/detail_button";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import { apiGetAdminCollaborationReject } from "../lib/api_fetch_admin_collaboration";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
-export default function AdminColab_TableRejected({
- listReject,
-}: {
- listReject: any;
-}) {
+export default function AdminColab_TableRejected() {
return (
<>
-
+
>
);
}
-function TableMenu({ listReject }: { listReject: any }) {
- const [data, setData] = useState(listReject.data);
- const [isNPage, setNPage] = useState(listReject.nPage);
+function TableMenu() {
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
- let noAwal = activePage * 5 - 4;
- async function onLoad(pindahPage: any) {
- const load = await adminColab_getListAllRejected({ page: pindahPage });
- setActivePage(pindahPage);
- setData(load.data as any);
- setNPage(load.nPage);
- }
+ useShallowEffect(() => {
+ loadInitialData();
+ }, [activePage]);
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminCollaborationReject({
+ page: `${activePage}`,
+ });
- const tableRow = data?.map((e, i) => (
-
- |
- {noAwal++}
- |
-
-
- {e?.Author?.Profile?.name}
-
- |
-
-
-
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format recieved", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table reject", error);
+ setData([]);
+ }
+ };
+
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
+
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
- {e?.title}
+ Tidak ada data
-
-
- |
-
-
- {e?.ProjectCollaborationMaster_Industri.name}
-
- |
-
-
- {e?.ProjectCollaboration_Partisipasi.length}
-
- |
-
-
-
-
-
- {e?.report}
-
-
-
-
+ |
+
+ );
+ }
- {/*
- }
- loaderPosition="center"
- radius={"xl"}
- color="green"
- onClick={() => {
- getDetailData(e.id);
- }}
- >
- Detail
-
- }
- loaderPosition="center"
- radius={"xl"}
- color="red"
- onClick={() => {
- onRejected(e.id);
- }}
- >
- Reject
-
- */}
- |
-
- ));
+ return data.map((e, i) => (
+
+ |
+
+ {e?.Author.username}
+
+ |
+
+
+ {e?.title}
+
+ |
+
+
+
+ {e?.ProjectCollaborationMaster_Industri.name}
+
+ |
+
+
+
+ {e?.ProjectCollaboration_Partisipasi.length}
+
+ |
+
+
+
+
+ |
+
+ ));
+ };
return (
<>
- Reject
+
+ Reject
+
-
-
-
-
-
-
- |
- No
- |
-
- Username
- |
-
- Title
- |
-
- Industri
- |
-
- Jumlah Partisipan
- |
-
- Report
- |
-
-
- {tableRow}
-
-
- {
- onLoad(val);
- }}
- />
-
-
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+
+ |
+ Username
+ |
+
+ Title
+ |
+
+ Industri
+ |
+
+ Jumlah Partisipan
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+ {
+ onPageClick(val);
+ }}
+ />
+
+
+ )}
>
);
diff --git a/src/app_modules/admin/colab/sub_menu/reject.txt b/src/app_modules/admin/colab/sub_menu/reject.txt
new file mode 100644
index 00000000..a1047a6b
--- /dev/null
+++ b/src/app_modules/admin/colab/sub_menu/reject.txt
@@ -0,0 +1,186 @@
+"use client";
+
+import {
+ Stack,
+ Group,
+ Title,
+ Paper,
+ ScrollArea,
+ Table,
+ Center,
+ Text,
+ Badge,
+ Spoiler,
+ Box,
+ Pagination,
+} from "@mantine/core";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import { useState } from "react";
+import { MODEL_COLLABORATION } from "@/app_modules/colab/model/interface";
+import adminColab_getListAllRejected from "../fun/get/get_list_all_reject";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+
+export default function AdminColab_TableRejected({
+ listReject,
+}: {
+ listReject: any;
+}) {
+ return (
+ <>
+
+
+
+
+ >
+ );
+}
+function TableMenu({ listReject }: { listReject: any }) {
+ const [data, setData] = useState(listReject.data);
+ const [isNPage, setNPage] = useState(listReject.nPage);
+ const [activePage, setActivePage] = useState(1);
+
+ let noAwal = activePage * 5 - 4;
+ async function onLoad(pindahPage: any) {
+ const load = await adminColab_getListAllRejected({ page: pindahPage });
+ setActivePage(pindahPage);
+ setData(load.data as any);
+ setNPage(load.nPage);
+ }
+
+ const tableRow = data?.map((e, i) => (
+
+ |
+ {noAwal++}
+ |
+
+
+ {e?.Author?.Profile?.name}
+
+ |
+
+
+
+
+ {e?.title}
+
+
+
+ |
+
+
+ {e?.ProjectCollaborationMaster_Industri.name}
+
+ |
+
+
+ {e?.ProjectCollaboration_Partisipasi.length}
+
+ |
+
+
+
+
+
+ {e?.report}
+
+
+
+
+
+ {/*
+ }
+ loaderPosition="center"
+ radius={"xl"}
+ color="green"
+ onClick={() => {
+ getDetailData(e.id);
+ }}
+ >
+ Detail
+
+ }
+ loaderPosition="center"
+ radius={"xl"}
+ color="red"
+ onClick={() => {
+ onRejected(e.id);
+ }}
+ >
+ Reject
+
+ */}
+ |
+
+ ));
+
+ return (
+ <>
+
+
+ Reject
+
+
+
+
+
+
+
+ |
+ No
+ |
+
+ Username
+ |
+
+ Title
+ |
+
+ Industri
+ |
+
+ Jumlah Partisipan
+ |
+
+ Report
+ |
+
+
+ {tableRow}
+
+
+ {
+ onLoad(val);
+ }}
+ />
+
+
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/admin/developer/_lib/api_fetch_developer.tsx b/src/app_modules/admin/developer/_lib/api_fetch_developer.tsx
new file mode 100644
index 00000000..ac01d595
--- /dev/null
+++ b/src/app_modules/admin/developer/_lib/api_fetch_developer.tsx
@@ -0,0 +1,41 @@
+export async function apiAdminGetListAdmin({
+ search,
+ page,
+}: {
+ search?: any;
+ page: any;
+}) {
+ try {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const isPage = `?page=${page}`;
+ const isSearch = search ? `&search=${search}` : "";
+ const response = await fetch(`/api/admin/developer${isPage}${isSearch}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error get data admin:",
+ errorData?.message || "Unknown error"
+ );
+ return null;
+ }
+
+ const data = await response.json();
+ return data;
+ } catch (error) {
+ console.error("Error get data admin:", error);
+ throw error;
+ }
+}
diff --git a/src/app_modules/admin/developer/fun/edit/fun_edit_user_akses_by_id.ts b/src/app_modules/admin/developer/fun/edit/fun_edit_user_akses_by_id.ts
index db032e37..00a6753f 100644
--- a/src/app_modules/admin/developer/fun/edit/fun_edit_user_akses_by_id.ts
+++ b/src/app_modules/admin/developer/fun/edit/fun_edit_user_akses_by_id.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterAdminDeveloper } from "@/app/lib/router_admin/router_admin_developer";
+import prisma from "@/lib/prisma";
+import { RouterAdminDeveloper } from "@/lib/router_admin/router_admin_developer";
import { revalidatePath } from "next/cache";
export default async function adminDeveloper_funEditUserAksesById(
diff --git a/src/app_modules/admin/developer/fun/get/fun_get_list_all_admin.ts b/src/app_modules/admin/developer/fun/get/fun_get_list_all_admin.ts
index 14ba2777..df0783bb 100644
--- a/src/app_modules/admin/developer/fun/get/fun_get_list_all_admin.ts
+++ b/src/app_modules/admin/developer/fun/get/fun_get_list_all_admin.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _, { ceil } from "lodash";
export default async function adminDeveloper_funGetListAllAdmin({
diff --git a/src/app_modules/admin/developer/fun/get/fun_get_list_all_user.ts b/src/app_modules/admin/developer/fun/get/fun_get_list_all_user.ts
index 12b0445f..81d49a58 100644
--- a/src/app_modules/admin/developer/fun/get/fun_get_list_all_user.ts
+++ b/src/app_modules/admin/developer/fun/get/fun_get_list_all_user.ts
@@ -1,5 +1,5 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _, { ceil } from "lodash";
export default async function adminDeveloper_funGetListAllUser({
diff --git a/src/app_modules/admin/developer/index.tsx b/src/app_modules/admin/developer/index.tsx
index eb0bf165..0f034778 100644
--- a/src/app_modules/admin/developer/index.tsx
+++ b/src/app_modules/admin/developer/index.tsx
@@ -1,78 +1,121 @@
"use client";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { MODEL_USER } from "@/app_modules/home/model/interface";
import {
- Box,
Button,
Center,
- Group,
- Pagination,
Paper,
ScrollArea,
- SimpleGrid,
Stack,
Table,
TextInput,
- Title,
} from "@mantine/core";
-import ComponentAdminGlobal_HeaderTamplate from "../_admin_global/header_tamplate";
-import { MODEL_USER } from "@/app_modules/home/model/interface";
-import _ from "lodash";
+import { useShallowEffect } from "@mantine/hooks";
import { IconSearch } from "@tabler/icons-react";
-import { useEffect, useState } from "react";
+import { useState } from "react";
+import { ComponentAdminGlobal_TitlePage } from "../_admin_global/_component";
+import ComponentAdminGlobal_HeaderTamplate from "../_admin_global/header_tamplate";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../_components_v3/comp_pagination_breakpoint";
+import { Admin_V3_ComponentBreakpoint } from "../_components_v3/comp_simple_grid_breakpoint";
+import { apiGetUserAccess } from "../user-access/_lib/api_fetch_user_access";
+import { apiAdminGetListAdmin } from "./_lib/api_fetch_developer";
import adminDeveloper_funEditUserAksesById from "./fun/edit/fun_edit_user_akses_by_id";
-import adminDeveloper_funGetListAllAdmin from "./fun/get/fun_get_list_all_admin";
-import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import adminDeveloper_funGetListAllUser from "./fun/get/fun_get_list_all_user";
-export default function AdminDeveloper({
- listUser,
- listAdmin,
- pUser,
- pAdmin,
-}: {
- listUser: MODEL_USER[];
- listAdmin: MODEL_USER[];
- pUser: any;
- pAdmin: any;
-}) {
- const [dataUser, setDataUser] = useState(listUser);
- const [dataAdmin, setDataAdmin] = useState(listAdmin);
- const [pageUser, setPageUser] = useState(pUser);
- const [pageAdmin, setPageAdmin] = useState(pAdmin);
+export default function AdminDeveloper() {
+ // USER
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
+ const [activePage, setActivePage] = useState(1);
+ const [isSearch, setSearch] = useState("");
+ const [reloadUser, setReloadUser] = useState(false);
+
+ useShallowEffect(() => {
+ handleLoad_DataUser();
+ }, [activePage, isSearch, reloadUser]);
+
+ const handleLoad_DataUser = async () => {
+ try {
+ const response = await apiGetUserAccess({
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response.success) {
+ setData(response.data.data);
+ setNPage(response.data.nPage);
+ } else {
+ setData([]);
+ }
+ } catch (error) {
+ console.error("Error get user access", error);
+ setData([]);
+ }
+ };
+
+ // ADMIN
+ const [dataAdmin, setDataAdmin] = useState(null);
+ const [nPageAdmin, setNPageAdmin] = useState(1);
+ const [activePageAdmin, setActivePageAdmin] = useState(1);
+ const [isSearchAdmin, setSearchAdmin] = useState("");
+ const [reloadAdmin, setReloadAdmin] = useState(false);
+
+ useShallowEffect(() => {
+ handleLoad_DataAdmin();
+ }, [activePageAdmin, isSearchAdmin, reloadAdmin]);
+
+ const handleLoad_DataAdmin = async () => {
+ try {
+ const response = await apiAdminGetListAdmin({
+ page: `${activePageAdmin}`,
+ search: isSearchAdmin,
+ });
+
+ if (response.success) {
+ setDataAdmin(response.data.data);
+ setNPageAdmin(response.data.nPage);
+ } else {
+ setDataAdmin([]);
+ }
+ } catch (error) {
+ console.error("Error get user access", error);
+ setDataAdmin([]);
+ }
+ };
return (
<>
-
-
- {/* */}
- {/* */}
+
+
+
{
- setDataUser(val.data);
- setPageUser(val.nPage);
- }}
+ nPage={nPageAdmin}
+ activePage={activePageAdmin}
+ isSearch={isSearchAdmin}
+ setData={setDataAdmin}
+ setNPage={setNPageAdmin}
+ setActivePage={setActivePageAdmin}
+ setSearch={setSearchAdmin}
+ handleLoad_DataAdmin={handleLoad_DataAdmin}
+ handleLoad_DataUser={handleLoad_DataUser}
/>
- {
- setDataAdmin(val.data);
- setPageAdmin(val.nPage);
- }}
- />
-
+
>
);
@@ -81,134 +124,139 @@ export default function AdminDeveloper({
function NewTableUser({
data,
nPage,
- onUpdated,
+ activePage,
+ isSearch,
+ setData,
+ setNPage,
+ setActivePage,
+ setSearch,
+ handleLoad_DataUser,
+ handleLoad_DataAdmin,
}: {
- data: any;
- nPage: any;
- onUpdated: (val: any) => void;
+ data: MODEL_USER[] | null;
+ nPage: number;
+ activePage: number;
+ isSearch: string;
+ setData: (data: MODEL_USER[] | null) => void;
+ setNPage: (nPage: number) => void;
+ setActivePage: (activePage: number) => void;
+ setSearch: (isSearch: string) => void;
+ handleLoad_DataUser: () => void;
+ handleLoad_DataAdmin: () => void;
}) {
- const [isChoosePage, setChoosePage] = useState(1);
- const [dataUser, setDataUser] = useState(data);
- const [isNPage, setNPage] = useState(nPage);
- const [isSearch, setSearch] = useState("");
-
- async function onPageClick(p: any) {
- setChoosePage(p);
- const loadData = await adminDeveloper_funGetListAllUser({
- search: isSearch,
- page: p,
- });
- setDataUser(loadData.data);
- setNPage(loadData.nPage);
- }
-
+ const [selectedId, setSelectedId] = useState(null);
async function onSearch(s: any) {
setSearch(s);
- setChoosePage(1);
- const loadData = await adminDeveloper_funGetListAllUser({
- search: s,
- page: 1,
- });
- setDataUser(loadData.data);
- setNPage(loadData.nPage);
+ }
+
+ async function onPageClick(p: any) {
+ setActivePage(p);
}
async function onAccess(id: string) {
- const upd = await adminDeveloper_funEditUserAksesById(id, "2");
- if (upd.status == 200) {
- const loadData = await adminDeveloper_funGetListAllUser({
- search: isSearch,
- page: isChoosePage,
- });
- setDataUser(loadData.data);
- setNPage(loadData.nPage);
- const loadDataAdmin = await adminDeveloper_funGetListAllAdmin({
- page: 1,
- });
- onUpdated(loadDataAdmin);
- ComponentGlobal_NotifikasiBerhasil(upd.message);
- } else {
- ComponentGlobal_NotifikasiGagal(upd.message);
+ try {
+ setSelectedId(id);
+ const upd = await adminDeveloper_funEditUserAksesById(id, "2");
+ if (upd.status == 200) {
+ handleLoad_DataUser();
+ handleLoad_DataAdmin();
+ ComponentGlobal_NotifikasiBerhasil(upd.message);
+ setSelectedId(null);
+ } else {
+ ComponentGlobal_NotifikasiGagal(upd.message);
+ setSelectedId(null);
+ }
+ } catch (error) {
+ console.error("Error get data admin", error);
+ setSelectedId(null);
}
}
- useEffect(() => {
- setDataUser(data);
- setNPage(nPage);
- setSearch("");
- setChoosePage(1);
- }, [data, nPage]);
+ const tableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+ No data available
+ |
+
+ );
+ }
+
+ return data.map((v: any, i: any) => (
+
+ |
+ {v.username}
+ |
+
+ {v.nomor}
+ |
+
+
+ onAccess(v.id)}
+ >
+ Admin Access
+
+
+ |
+
+ ));
+ };
return (
<>
-
- Table User NEW
- }
- radius={"xl"}
- placeholder="Masukan username"
- onChange={(val) => {
- onSearch(val.currentTarget.value);
- }}
- />
-
-
-
-
-
- |
- Username
- |
-
- Nomor
- |
-
- Aksi
- |
-
-
-
- {dataUser.map((v: any, i: any) => (
-
- |
- {v.username}
- |
-
- {v.nomor}
- |
-
-
- onAccess(v.id)}>
- Admin Access
-
-
- |
-
- ))}
-
-
-
- }
+ radius={"xl"}
+ placeholder="Masukan username"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
+
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Username
+ |
+
+ Nomor
+ |
+
+ Aksi
+ |
+
+
+ {tableBody()}
+
+
+ {
onPageClick(val);
}}
- total={isNPage}
/>
-
-
+
+ )}
>
);
@@ -217,312 +265,141 @@ function NewTableUser({
function NewTableAdmin({
data,
nPage,
- onUpdated,
+ activePage,
+ isSearch,
+ setData,
+ setNPage,
+ setActivePage,
+ setSearch,
+ handleLoad_DataUser,
+ handleLoad_DataAdmin,
}: {
- data: any;
- nPage: any;
- onUpdated: (val: any) => void;
+ data: MODEL_USER[] | null;
+ nPage: number;
+ activePage: number;
+ isSearch: string;
+ setData: (data: MODEL_USER[] | null) => void;
+ setNPage: (nPage: number) => void;
+ setActivePage: (activePage: number) => void;
+ setSearch: (isSearch: string) => void;
+ handleLoad_DataUser: () => void;
+ handleLoad_DataAdmin: () => void;
}) {
- const [isChoosePage, setChoosePage] = useState(1);
- const [dataAdmin, setDataAdmin] = useState(data);
- const [isNPage, setNPage] = useState(nPage);
- const [isSearch, setSearch] = useState("");
-
- async function onPageClick(p: any) {
- setChoosePage(p);
- const loadData = await adminDeveloper_funGetListAllAdmin({
- search: isSearch,
- page: p,
- });
- setDataAdmin(loadData.data);
- setNPage(loadData.nPage);
- }
+ const [selectedId, setSelectedId] = useState(null);
async function onSearch(s: any) {
setSearch(s);
- setChoosePage(1);
- const loadData = await adminDeveloper_funGetListAllAdmin({
- search: s,
- page: 1,
- });
- setDataAdmin(loadData.data);
- setNPage(loadData.nPage);
+ }
+
+ async function onPageClick(p: any) {
+ setActivePage(p);
}
async function onAccess(id: string) {
- const upd = await adminDeveloper_funEditUserAksesById(id, "1");
- if (upd.status == 200) {
- const loadData = await adminDeveloper_funGetListAllAdmin({
- search: isSearch,
- page: isChoosePage,
- });
- setDataAdmin(loadData.data);
- setNPage(loadData.nPage);
- const loadDataUser = await adminDeveloper_funGetListAllUser({ page: 1 });
- onUpdated(loadDataUser);
- ComponentGlobal_NotifikasiBerhasil(upd.message);
- } else {
- ComponentGlobal_NotifikasiGagal(upd.message);
+ try {
+ setSelectedId(id);
+ const upd = await adminDeveloper_funEditUserAksesById(id, "1");
+ if (upd.status == 200) {
+ handleLoad_DataUser();
+ handleLoad_DataAdmin();
+ ComponentGlobal_NotifikasiBerhasil(upd.message);
+ setSelectedId(null);
+ } else {
+ ComponentGlobal_NotifikasiGagal(upd.message);
+ setSelectedId(null);
+ }
+ } catch (error) {
+ console.error("Error get data admin", error);
+ setSelectedId(null);
}
}
- useEffect(() => {
- setDataAdmin(data);
- setNPage(nPage);
- setSearch("");
- setChoosePage(1);
- }, [data, nPage]);
+ const tableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+ No data available
+ |
+
+ );
+ }
+
+ return data.map((v: any, i: any) => (
+
+ |
+ {v.username}
+ |
+
+ {v.nomor}
+ |
+
+
+ onAccess(v.id)}
+ >
+ Delete Access
+
+
+ |
+
+ ));
+ };
return (
<>
-
- Table Admin
- }
- radius={"xl"}
- placeholder="Masukan username"
- onChange={(val) => {
- onSearch(val.currentTarget.value);
- }}
- />
-
-
-
-
-
- |
- Username
- |
-
- Nomor
- |
-
- Aksi
- |
-
-
-
- {dataAdmin.map((v: any, i: any) => (
-
- |
- {v.username}
- |
-
- {v.nomor}
- |
-
-
- onAccess(v.id)}
- >
- Delete Access
-
-
- |
-
- ))}
-
-
-
- }
+ radius={"xl"}
+ placeholder="Masukan username"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
+
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Username
+ |
+
+ Nomor
+ |
+
+ Aksi
+ |
+
+
+ {tableBody()}
+
+
+ {
onPageClick(val);
}}
- total={isNPage}
/>
-
-
-
- >
- );
-}
-
-function TableAdmin({
- dataAdmin,
- setDataAdmin,
- setDataUser,
-}: {
- dataAdmin: MODEL_USER[];
- setDataAdmin: any;
- setDataUser: any;
-}) {
- async function onAccess(id: string) {
- await adminDeveloper_funEditUserAksesById(id, "1").then(async (res) => {
- if (res.status === 200) {
- await adminDeveloper_funGetListAllUser({ page: 1 }).then((val) => {
- setDataUser(val);
- });
- await adminDeveloper_funGetListAllAdmin({ page: 1 }).then((val) => {
- setDataAdmin(val);
- });
- ComponentGlobal_NotifikasiBerhasil(res.message);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
- }
-
- const tableBody = dataAdmin.map((e) => (
-
- |
- {e.username}
- |
-
- {e.nomor}
- |
-
-
- onAccess(e.id)}>
- Delete Access
-
-
- |
-
- ));
-
- return (
- <>
-
-
- Table Admin
- }
- radius={"xl"}
- placeholder="Masukan username"
- />
-
-
-
-
-
- |
- Username
- |
-
- Nomor
- |
-
- Aksi
- |
-
-
- {tableBody}
-
-
-
- >
- );
-}
-
-function TableUser({
- dataUser,
- setDataUser,
- setDataAdmin,
-}: {
- dataUser: MODEL_USER[];
- setDataUser: any;
- setDataAdmin: any;
-}) {
- async function onAccess(id: string) {
- await adminDeveloper_funEditUserAksesById(id, "2").then(async (res) => {
- if (res.status === 200) {
- await adminDeveloper_funGetListAllUser({ page: 1 }).then((val) => {
- setDataUser(val.data);
- });
- await adminDeveloper_funGetListAllAdmin({ page: 1 }).then((val) => {
- setDataAdmin(val);
- });
- ComponentGlobal_NotifikasiBerhasil(res.message);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
- }
-
- const tableBody = dataUser.map((e) => (
-
- |
- {e.username}
- |
-
- {e.nomor}
- |
-
-
- onAccess(e.id)}>
- Admin Access
-
-
- |
-
- ));
-
- return (
- <>
-
-
- Table User
- }
- radius={"xl"}
- placeholder="Masukan username"
- />
-
-
-
-
-
- |
- Username
- |
-
- Nomor
- |
-
- Aksi
- |
-
-
- {tableBody}
-
-
+
+ )}
>
);
diff --git a/src/app_modules/admin/donasi/component/skeleton_detail donasi_reject.tsx b/src/app_modules/admin/donasi/component/skeleton_detail donasi_reject.tsx
new file mode 100644
index 00000000..95bb4dad
--- /dev/null
+++ b/src/app_modules/admin/donasi/component/skeleton_detail donasi_reject.tsx
@@ -0,0 +1,37 @@
+import CustomSkeleton from '@/app_modules/components/CustomSkeleton';
+import { Box, SimpleGrid, Stack } from '@mantine/core';
+import React from 'react';
+
+function SkeletonAdminDetailDonasiReject() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+export default SkeletonAdminDetailDonasiReject;
+
+
diff --git a/src/app_modules/admin/donasi/component/skeleton_detail_donasi_publish.tsx b/src/app_modules/admin/donasi/component/skeleton_detail_donasi_publish.tsx
new file mode 100644
index 00000000..8eeb0d79
--- /dev/null
+++ b/src/app_modules/admin/donasi/component/skeleton_detail_donasi_publish.tsx
@@ -0,0 +1,18 @@
+import CustomSkeleton from '@/app_modules/components/CustomSkeleton';
+import { Box, Stack } from '@mantine/core';
+
+function SkeletonAdminDetailDonasiPublish() {
+ return (
+ <>
+
+
+
+
+
+
+
+ >
+ );
+}
+
+export default SkeletonAdminDetailDonasiPublish;
diff --git a/src/app_modules/admin/donasi/component/skeleton_detail_donasi_review.tsx b/src/app_modules/admin/donasi/component/skeleton_detail_donasi_review.tsx
new file mode 100644
index 00000000..07b13b62
--- /dev/null
+++ b/src/app_modules/admin/donasi/component/skeleton_detail_donasi_review.tsx
@@ -0,0 +1,31 @@
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Stack, Box, SimpleGrid } from "@mantine/core";
+
+function SkeletonAdminDetailDonasiReview() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+export default SkeletonAdminDetailDonasiReview;
diff --git a/src/app_modules/admin/donasi/component/tampilan_detail_cerita.tsx b/src/app_modules/admin/donasi/component/tampilan_detail_cerita.tsx
index cd64d266..8a19f9d2 100644
--- a/src/app_modules/admin/donasi/component/tampilan_detail_cerita.tsx
+++ b/src/app_modules/admin/donasi/component/tampilan_detail_cerita.tsx
@@ -1,9 +1,19 @@
-"use client"
+"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { MODEL_CERITA_DONASI } from "@/app_modules/donasi/model/interface";
-import { Paper, Stack, Title, Box, AspectRatio, Image, Text } from "@mantine/core";
+import {
+ Paper,
+ Stack,
+ Title,
+ Box,
+ AspectRatio,
+ Image,
+ Text,
+} from "@mantine/core";
import { Admin_ComponentLoadImageLandscape } from "../../_admin_global";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { Comp_SetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
export default function ComponentAdminDonasi_CeritaPenggalangDana({
cerita,
@@ -13,18 +23,20 @@ export default function ComponentAdminDonasi_CeritaPenggalangDana({
return (
<>
{/* {JSON.stringify(cerita, null, 2)} */}
-
+
- Cerita Penggalang Dana
- {cerita.pembukaan}
+
+ Cerita Penggalang Dana
+
+
- {cerita.cerita}
+
>
);
-}
\ No newline at end of file
+}
diff --git a/src/app_modules/admin/donasi/component/tampilan_detail_donasi.tsx b/src/app_modules/admin/donasi/component/tampilan_detail_donasi.tsx
index 63f5e8c3..2df97e72 100644
--- a/src/app_modules/admin/donasi/component/tampilan_detail_donasi.tsx
+++ b/src/app_modules/admin/donasi/component/tampilan_detail_donasi.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
import { MODEL_DONASI } from "@/app_modules/donasi/model/interface";
import {
@@ -12,10 +12,12 @@ import {
Group,
Image,
Text,
+ ScrollArea,
} from "@mantine/core";
import { Admin_ComponentLoadImageLandscape } from "../../_admin_global";
import ComponentAdminGlobal_TampilanRupiahDonasi from "../../_admin_global/tampilan_rupiah";
import { ComponentGlobal_TampilanRupiah } from "@/app_modules/_global/component";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
export default function ComponentAdminDonasi_TampilanDetailDonasi({
donasi,
@@ -24,40 +26,51 @@ export default function ComponentAdminDonasi_TampilanDetailDonasi({
}) {
return (
<>
-
-
- Detail Data Donasi
+
+
-
-
-
+
+ Detail Data Donasi
+
+
+
+
+
+
-
- {donasi.title}
-
- Durasi: {donasi.DonasiMaster_Durasi.name} hari
-
-
+
+
+ {donasi.title}
+
+
+ Durasi: {donasi.DonasiMaster_Durasi.name} hari
+
+
-
-
- Dana dibutuhkan
-
-
-
-
-
- Kategori
-
- {donasi.DonasiMaster_Ketegori.name}
-
-
+
+
+
+ Dana dibutuhkan
+
+
+
+
+
+
+
+ Kategori
+
+
+ {donasi.DonasiMaster_Ketegori.name}
+
+
+
-
+
>
);
diff --git a/src/app_modules/admin/donasi/component/tombol_kembali.tsx b/src/app_modules/admin/donasi/component/tombol_kembali.tsx
index 2630f979..8d507b7e 100644
--- a/src/app_modules/admin/donasi/component/tombol_kembali.tsx
+++ b/src/app_modules/admin/donasi/component/tombol_kembali.tsx
@@ -1,5 +1,6 @@
"use client";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import { Group, Button } from "@mantine/core";
import { IconChevronLeft } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
@@ -10,7 +11,8 @@ export default function ComponentAdminDonasi_TombolKembali() {
<>
}
variant="white"
onClick={() => router.back()}
diff --git a/src/app_modules/admin/donasi/detail/detail_reject.tsx b/src/app_modules/admin/donasi/detail/detail_reject.tsx
index 84ad0dfe..801d91c4 100644
--- a/src/app_modules/admin/donasi/detail/detail_reject.tsx
+++ b/src/app_modules/admin/donasi/detail/detail_reject.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
import { MODEL_DONASI } from "@/app_modules/donasi/model/interface";
@@ -17,47 +17,77 @@ import {
Textarea,
Title,
} from "@mantine/core";
-import { useDisclosure } from "@mantine/hooks";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
import React, { useState } from "react";
import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
-import AdminGlobal_ComponentBackButton from "../../_admin_global/back_button";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
import ComponentAdminDonasi_CeritaPenggalangDana from "../component/tampilan_detail_cerita";
import ComponentAdminDonasi_TampilanDetailDonasi from "../component/tampilan_detail_donasi";
import { AdminDonasi_getOneById } from "../fun/get/get_one_by_id";
import { AdminDonasi_funUpdateCatatanReject } from "../fun/update/fun_update_catatan_reject";
import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
import { Admin_ComponentModalReport } from "../../_admin_global/_component";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { useParams } from "next/navigation";
+import { apiGetAdminDonasiById } from "../lib/api_fetch_admin_donasi";
+import { clientLogger } from "@/util/clientLogger";
+import CustomSkeletonAdmin from "../../_admin_global/_component/skeleton/customSkeletonAdmin";
+import SkeletonAdminDetailDonasiReject from "../component/skeleton_detail donasi_reject";
-export default function AdminDonasi_DetailReject({
- dataReject,
-}: {
- dataReject: MODEL_DONASI;
-}) {
- const [data, setData] = useState(dataReject);
+export default function AdminDonasi_DetailReject() {
+ const [data, setData] = useState(null);
+ const params = useParams<{ id: string }>();
+
+ useShallowEffect(() => {
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminDonasiById({
+ id: params.id,
+ });
+
+ if (response?.success && response?.data) {
+ setData(response.data);
+ } else {
+ console.error("Invalid data format recieved:", response);
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved:", error);
+ setData(null);
+ }
+ };
+ loadInitialData();
+ });
return (
<>
-
-
-
-
-
-
+ {!data ? (
+
+ ) : (
+ <>
+
+
+
+
+
+
+ >
+ )}
>
);
@@ -92,7 +122,7 @@ function ButtonOnHeader({
<>
-
+
- {
- close();
- }}
- >
+ setOpened(false)}>
Batal
>
@@ -177,10 +202,12 @@ function ButtonOnHeader({
function CatatanReject({ catatan }: { catatan: string }) {
return (
<>
-
+
- Alasan Penolakan :
- {catatan}
+
+ Alasan Penolakan :
+
+ {catatan}
>
diff --git a/src/app_modules/admin/donasi/detail/detail_review.tsx b/src/app_modules/admin/donasi/detail/detail_review.tsx
index d4273c45..3c3bea90 100644
--- a/src/app_modules/admin/donasi/detail/detail_review.tsx
+++ b/src/app_modules/admin/donasi/detail/detail_review.tsx
@@ -1,52 +1,82 @@
"use client";
-import { IRealtimeData } from "@/app/lib/global_state";
+import { MainColor } from "@/app_modules/_global/color";
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { donasi_checkStatus } from "@/app_modules/donasi/fun";
import { MODEL_DONASI } from "@/app_modules/donasi/model/interface";
+import { IRealtimeData } from "@/lib/global_state";
+import { clientLogger } from "@/util/clientLogger";
import { Button, Group, SimpleGrid, Stack } from "@mantine/core";
-import { useDisclosure } from "@mantine/hooks";
-import { useRouter } from "next/navigation";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import { WibuRealtime } from "wibu-pkg";
import { Admin_ComponentModalReport } from "../../_admin_global/_component";
+import Admin_ComponentModalPublish from "../../_admin_global/_component/comp_admin_modal_publish";
import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
-import AdminGlobal_ComponentBackButton from "../../_admin_global/back_button";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
+import adminNotifikasi_funCreateToAllUser from "../../notifikasi/fun/create/fun_create_notif_to_all_user";
import adminNotifikasi_funCreateToUser from "../../notifikasi/fun/create/fun_create_notif_user";
+
import ComponentAdminDonasi_CeritaPenggalangDana from "../component/tampilan_detail_cerita";
import ComponentAdminDonasi_TampilanDetailDonasi from "../component/tampilan_detail_donasi";
import { AdminDonasi_getOneById } from "../fun/get/get_one_by_id";
import { AdminDonasi_funUpdateStatusPublish } from "../fun/update/fun_status_publish";
import { AdminDonasi_funUpdateStatusReject } from "../fun/update/fun_status_reject";
-import { donasi_checkStatus } from "@/app_modules/donasi/fun";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { apiGetAdminDonasiById } from "../lib/api_fetch_admin_donasi";
+import SkeletonAdminDetailDonasiReview from "../component/skeleton_detail_donasi_review";
-export default function AdminDonasi_DetailReview({
- dataReview,
-}: {
- dataReview: MODEL_DONASI;
-}) {
- const [data, setData] = useState(dataReview);
+export default function AdminDonasi_DetailReview() {
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ useShallowEffect(() => {
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminDonasiById({
+ id: params.id,
+ });
+
+ if (response?.success && response?.data) {
+ setData(response.data);
+ } else {
+ console.error("Invalid data format recieved:", response);
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved:", error);
+ setData(null);
+ }
+ };
+ loadInitialData();
+ });
return (
<>
-
-
-
-
-
+ {!data ? (
+
+ ) : (
+ <>
+
+
+
+
+
+ >
+ )}
>
);
@@ -62,55 +92,94 @@ function ButtonOnHeader({
const router = useRouter();
const [isLoadingPublish, setLoadingPublish] = useState(false);
const [isLoadingReject, setLoadingReject] = useState(false);
- const [opened, { open, close }] = useDisclosure(false);
+ const [openedPublish, { open: openPublish, close: closePublish }] =
+ useDisclosure(false);
+ const [openedReject, { open: openReject, close: closeReject }] =
+ useDisclosure(false);
const [catatan, setCatatan] = useState("");
- async function onPulish() {
- const checkStatus = await donasi_checkStatus({ id: donasi.id });
+ async function onPublish() {
+ try {
+ setLoadingPublish(true);
+ const checkStatus = await donasi_checkStatus({ id: donasi.id });
- if (checkStatus) {
- const res = await AdminDonasi_funUpdateStatusPublish(donasi.id, "1");
- if (res.status === 200) {
- const dataNotifikasi: IRealtimeData = {
- appId: res.data?.id as string,
- status: res.data?.DonasiMaster_Status?.name as any,
- userId: res.data?.authorId as any,
- pesan: res.data?.title as any,
- kategoriApp: "DONASI",
- title: "Donasi publish",
- };
+ if (checkStatus) {
+ const res = await AdminDonasi_funUpdateStatusPublish(donasi.id, "1");
+ if (res.status === 200) {
+ // ===== TO CREATEOR ====== //
+ const notifikasiToCreator: IRealtimeData = {
+ appId: res.data?.id as string,
+ status: res.data?.DonasiMaster_Status?.name as any,
+ userId: res.data?.authorId as any,
+ pesan: res.data?.title as any,
+ kategoriApp: "DONASI",
+ title: "Donasi publish",
+ };
- const notif = await adminNotifikasi_funCreateToUser({
- data: dataNotifikasi as any,
- });
-
- if (notif.status === 201) {
- WibuRealtime.setData({
- type: "notification",
- pushNotificationTo: "USER",
- dataMessage: dataNotifikasi,
+ const notif = await adminNotifikasi_funCreateToUser({
+ data: notifikasiToCreator as any,
});
- WibuRealtime.setData({
- type: "trigger",
- pushNotificationTo: "USER",
- dataMessage: dataNotifikasi,
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: notifikasiToCreator,
+ });
+
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "USER",
+ dataMessage: notifikasiToCreator,
+ });
+ }
+
+ // ===== TO CREATEOR ====== //
+
+ // TO ALL USER
+ const notificationToAll = await adminNotifikasi_funCreateToAllUser({
+ data: res.data as any,
+ authorId: donasi.authorId,
});
- const newData = await AdminDonasi_getOneById(donasi?.id);
- setData(newData);
+ if (notificationToAll.status === 201) {
+ const dataUser = notificationToAll.data;
+ for (let i of dataUser as any) {
+ const dataNotifikasiToAll: IRealtimeData = {
+ appId: res.data?.id as string,
+ status: res.data?.DonasiMaster_Status?.name as any,
+ userId: i.id as any,
+ pesan: res.data?.title as any,
+ kategoriApp: "DONASI",
+ title: "Donasi baru terpublish",
+ };
+
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasiToAll,
+ });
+ }
+ }
+
ComponentAdminGlobal_NotifikasiBerhasil(
"Berhasil Mengubah Status Donasi"
);
- setLoadingPublish(true);
+ setLoadingPublish(false);
+ router.back();
+ } else {
+ setLoadingPublish(false);
+ ComponentAdminGlobal_NotifikasiPeringatan(
+ "Gagal Mengubah Status Donasi"
+ );
}
} else {
- ComponentAdminGlobal_NotifikasiPeringatan(
- "Gagal Mengubah Status Donasi"
- );
+ setLoadingPublish(false);
+ ComponentGlobal_NotifikasiPeringatan("Status donasi telah diubah user");
}
- } else {
- ComponentGlobal_NotifikasiPeringatan("Status donasi telah diubah user");
+ } catch (error) {
+ setLoadingPublish(false);
+ clientLogger.error("Error to published donasi", error);
}
}
@@ -120,64 +189,71 @@ function ButtonOnHeader({
"Lengkapi Alasan Penolakan"
);
- const checkStatus = await donasi_checkStatus({ id: donasi.id });
+ try {
+ setLoadingReject(true);
+ const checkStatus = await donasi_checkStatus({ id: donasi.id });
- if (checkStatus) {
- const res = await AdminDonasi_funUpdateStatusReject(
- donasi.id,
- "4",
- catatan
- );
- if (res.status === 200) {
- const dataNotifikasi: IRealtimeData = {
- appId: res.data?.id as string,
- status: res.data?.DonasiMaster_Status?.name as any,
- userId: res.data?.authorId as any,
- pesan: res.data?.title as any,
- kategoriApp: "DONASI",
- title: "Donasi anda di tolak !",
- };
+ if (checkStatus) {
+ const res = await AdminDonasi_funUpdateStatusReject(
+ donasi.id,
+ "4",
+ catatan
+ );
+ if (res.status === 200) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res.data?.id as string,
+ status: res.data?.DonasiMaster_Status?.name as any,
+ userId: res.data?.authorId as any,
+ pesan: res.data?.title as any,
+ kategoriApp: "DONASI",
+ title: "Donasi anda di tolak !",
+ };
- const notif = await adminNotifikasi_funCreateToUser({
- data: dataNotifikasi as any,
- });
-
- if (notif.status === 201) {
- WibuRealtime.setData({
- type: "notification",
- pushNotificationTo: "USER",
- dataMessage: dataNotifikasi,
+ const notif = await adminNotifikasi_funCreateToUser({
+ data: dataNotifikasi as any,
});
- const newData = await AdminDonasi_getOneById(donasi?.id);
- setData(newData);
- close();
- ComponentAdminGlobal_NotifikasiBerhasil(res.message);
- setLoadingReject(true);
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+
+ ComponentAdminGlobal_NotifikasiBerhasil(res.message);
+ closeReject();
+ router.back()
+ }
+ } else {
+ setLoadingReject(false);
+ ComponentAdminGlobal_NotifikasiGagal(res.message);
}
} else {
- ComponentAdminGlobal_NotifikasiGagal(res.message);
+ setLoadingReject(false);
+ ComponentGlobal_NotifikasiPeringatan("Status donasi telah diubah user");
}
- } else {
- ComponentGlobal_NotifikasiPeringatan("Status donasi telah diubah user");
+ } catch (error) {
+ setLoadingReject(false);
+ console.error("Error to reject donasi", error);
}
}
return (
<>
-
+
{donasi.donasiMaster_StatusDonasiId === "2" ? (
onPulish()}
+ onClick={openPublish}
>
Publish
-
+
Reject
@@ -188,8 +264,8 @@ function ButtonOnHeader({
{/* */}
setCatatan(val.target.value)}
buttonKiri={
@@ -197,7 +273,7 @@ function ButtonOnHeader({
{
- close();
+ closeReject();
}}
>
Batal
@@ -207,6 +283,7 @@ function ButtonOnHeader({
buttonKanan={
<>
}
/>
+
+ {
+ closePublish();
+ }}
+ >
+ Batal
+
+ >
+ }
+ buttonKanan={
+ <>
+ {
+ onPublish();
+ }}
+ >
+ Simpan
+
+ >
+ }
+ />
{/* void;
+ donasi: MODEL_DONASI;
+ isReload: boolean;
+}) {
+ const router = useRouter();
+ const params = useParams<{ id: string }>();
+ const donasiId = params.id;
+ const [isLoadingCek, setLoadingCek] = useState(false);
+ const [idData, setIdData] = useState("");
+ const [lisDonatur, setListDonatur] = useState(null);
+ const [listStatus, setListStatus] = useState<
+ MODEL_NEW_DEFAULT_MASTER[] | null
+ >(null);
+ const [isNPage, setNPage] = useState(1);
+ const [isActivePage, setActivePage] = useState(1);
+ const [selectStatus, setSelectStatus] = useState("");
+ const [isLoadingReload, setIsLoadingReload] = useState(false);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, [isActivePage, selectStatus, isReload]);
+
+ useShallowEffect(() => {
+ handleLoadStatus();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const cek = globalStatusTransaksi.find((e) => e.id === selectStatus);
+ const response = await apiGetAdminAllDaftarDonatur({
+ id: donasiId,
+ page: `${isActivePage}`,
+ status: cek?.name,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setListDonatur(response.data.data);
+ setNPage(response.data.nPage || 1);
+ setIsLoadingReload(false);
+ } else {
+ console.error("Invalid data format received:", response);
+ setListDonatur([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data daftar donatur", error);
+ setListDonatur([]);
+ }
+ };
+
+ const handleLoadStatus = async () => {
+ try {
+ const response = await apiGetMasterStatusTransaksi();
+
+ if (response?.success && response?.data) {
+ setListStatus(response.data);
+ } else {
+ console.error("Invalid data format received:", response);
+ setListStatus(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get status donatur", error);
+ setListStatus(null);
+ }
+ };
+ const onPageClick = async (page: number) => {
+ setActivePage(page);
+ };
+ async function onSelect(selectStatus: any) {
+ setSelectStatus(selectStatus);
+ setActivePage(1);
+ }
+ async function onReload() {
+ setSelectStatus("");
+ setIsLoadingReload(true);
+ handleLoadData();
+ }
+
+ const renderTableBody = () => {
+ if (isLoadingReload)
+ return (
+
+ |
+
+ Loading Data...
+
+ |
+
+ );
+ if (!Array.isArray(lisDonatur) || lisDonatur.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+
+ return lisDonatur?.map((e, i) => (
+
+ |
+ {e?.Author.username}
+ |
+
+ {e?.DonasiMaster_Bank?.name}
+ |
+
+
+
+
+ |
+
+
+ {new Intl.DateTimeFormat("id-ID", { dateStyle: "full" }).format(
+ new Date(e?.createdAt)
+ )}
+
+ |
+
+
+
+ {e?.DonasiMaster_StatusInvoice?.name}
+
+
+ |
+
+
+ {e?.donasiMaster_StatusInvoiceId === "1" ||
+ e?.donasiMaster_StatusInvoiceId === "2" ? (
+ {
+ setLoadingCek(true), setIdData(e?.id);
+ router.push(
+ RouterAdminGlobal.preview_image({ id: e.imageId })
+ );
+ }}
+ >
+ Cek
+
+ ) : (
+ "-"
+ )}
+
+ |
+
+
+ {e?.donasiMaster_StatusInvoiceId === "1" ? (
+
+ Selesai
+
+ ) : e?.DonasiMaster_StatusInvoice?.id === "2" ? (
+ {
+ setReloadDonasi(true);
+ }}
+ onSuccessDonatur={(val) => {
+ setListDonatur(val.data);
+ setNPage(val.nPage);
+ isReload;
+ }}
+ />
+ ) : (
+ -
+ )}
+
+ |
+
+ ));
+ };
+
+ if (!lisDonatur && !listStatus)
+ return ;
+
+ return (
+ <>
+
+ {/* {JSON.stringify(dataDonasi, null, 2)} */}
+
+ {
+ onReload();
+ }}
+ >
+
+
+
+ }
+ />
+
+
+
+
+
+
+ |
+ Nama Donatur
+ |
+
+ Nama Bank
+ |
+
+ Jumlah Donasi
+ |
+
+ Tanggal
+ |
+
+ Status
+ |
+
+ Bukti Transfer
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+
+ {
+ onPageClick(val);
+ }}
+ />
+
+
+ >
+ );
+}
+
+export default TampilanListDonatur;
+function ButtonAccept({
+ invoiceId,
+ donasiId,
+ nominal,
+ danaTerkumpul,
+ target,
+ onSetDonasi: onSuccessDonasi,
+ onSuccessDonatur,
+ isReload,
+}: {
+ invoiceId: string;
+ donasiId: string;
+ nominal: number;
+ danaTerkumpul: number;
+ target: number;
+ onSetDonasi: (val: boolean) => void;
+ onSuccessDonatur: (val: any) => void;
+ isReload: boolean;
+}) {
+ const [opened, setOpened] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
+
+ async function onAccept() {
+ let nominalDonasi = nominal;
+ let jumlahTerkumpul = danaTerkumpul;
+ setIsLoading(true);
+ isReload;
+
+ try {
+ const updateStatus = await adminDonasi_funUpdateStatusDanTotal({
+ invoiceId: invoiceId,
+ donasiId: donasiId,
+ jumlahTerkumpul: jumlahTerkumpul,
+ nominal: nominalDonasi,
+ target: target,
+ statusInvoiceId: "1",
+ });
+
+ if (updateStatus.status === 200) {
+ const dataNotif = {
+ appId: updateStatus.data?.id,
+ userId: updateStatus.data?.authorId,
+ pesan: updateStatus.data?.Donasi?.title,
+ status: updateStatus.data?.DonasiMaster_StatusInvoice?.name,
+ kategoriApp: "DONASI",
+ title: "Terimakasih, Donasi anda telah diterima",
+ };
+
+ const notif = await adminNotifikasi_funCreateToUser({
+ data: dataNotif as any,
+ });
+
+ if (notif.status === 201) {
+ mqtt_client.publish(
+ "USER",
+ JSON.stringify({ userId: updateStatus?.data?.authorId, count: 1 })
+ );
+
+ mqtt_client.publish(
+ "donasi_invoice",
+ JSON.stringify({
+ invoiceId: invoiceId,
+ statusInvoiceId: "1",
+ })
+ );
+ }
+
+ const dataNotifToAuthorDonasi = {
+ appId: updateStatus.data?.Donasi?.id,
+ userId: updateStatus.data?.Donasi?.authorId,
+ pesan: updateStatus.data?.Donasi?.title,
+ status: "Donatur Baru",
+ kategoriApp: "DONASI",
+ title: "Ada donatur baru",
+ };
+
+ const notifToAuthorDonasi = await adminNotifikasi_funCreateToUser({
+ data: dataNotifToAuthorDonasi as any,
+ });
+
+ if (notifToAuthorDonasi.status === 201) {
+ mqtt_client.publish(
+ "USER",
+ JSON.stringify({
+ userId: updateStatus?.data?.Donasi?.authorId,
+ count: 1,
+ })
+ );
+ }
+
+ // const updateData = await AdminDonasi_getOneById(donasiId);
+ // onSuccessDonasi(updateData as any);
+ // const updatelistDonatur = await adminDonasi_getListDonatur({
+ // donasiId: donasiId,
+ // page: 1,
+ // });
+ setOpened(false);
+ onSuccessDonasi(true);
+ ComponentAdminGlobal_NotifikasiBerhasil(updateStatus.message);
+ setIsLoading(false);
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(updateStatus.message);
+ setIsLoading(false);
+ }
+ } catch (error) {
+ console.error("Error update status invoice", error);
+ setIsLoading(false);
+ }
+ }
+
+ return (
+ <>
+ {
+ setOpened(true);
+ }}
+ >
+ Terima
+
+
+ {
+ setOpened(false);
+ }}
+ // title="Terima Donasi"
+ size="sm"
+ withCloseButton={false}
+ >
+
+ {`${"Anda sudah melihat bukti transfer dan yakin menerima donasi ini ?"}`}
+
+ setOpened(false)}>
+ Batal
+
+ {
+ onAccept();
+ }}
+ >
+ Terima
+
+
+
+
+
+ {/*
+
+ */}
+ >
+ );
+}
diff --git a/src/app_modules/admin/donasi/detail/publish/detail_list_pencairan.tsx b/src/app_modules/admin/donasi/detail/publish/detail_list_pencairan.tsx
new file mode 100644
index 00000000..eec28e51
--- /dev/null
+++ b/src/app_modules/admin/donasi/detail/publish/detail_list_pencairan.tsx
@@ -0,0 +1,208 @@
+import { AccentColor } from "@/app_modules/_global/color";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
+import { MODEL_DONASI_PENCAIRAN_DANA } from "@/app_modules/donasi/model/interface";
+import { RouterAdminDonasi } from "@/lib/router_admin/router_admin_donasi";
+import {
+ Box,
+ Button,
+ Center,
+ Paper,
+ ScrollArea,
+ Spoiler,
+ Stack,
+ Table,
+ Text,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import moment from "moment";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import { apiGetAdminDonasiPencairan } from "../../lib/api_fetch_admin_donasi";
+import { Admin_V3_ComponentPaginationBreakpoint } from "@/app_modules/admin/_components_v3/comp_pagination_breakpoint";
+
+function TampilanListPencairan() {
+ const params = useParams<{ id: string }>();
+ const router = useRouter();
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
+ const [activePage, setActivePage] = useState(1);
+ const [loading, setLoading] = useState("");
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, [activePage]);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetAdminDonasiPencairan({
+ id: params.id,
+ page: `${activePage}`,
+ });
+
+ if (response?.success && response?.data) {
+ // console.log("response", response.data);
+ setData(response.data.data);
+ setNPage(response.data.nPage);
+ } else {
+ setData([]);
+ setNPage(1);
+ }
+ } catch (error) {
+ console.error("Error get pencairan donasi:", error);
+ setData([]);
+ setNPage(1);
+ }
+ }
+
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
+
+ const rowTable = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+
+ return data.map((e) => (
+
+ |
+
+
+
+ |
+
+
+ {moment(e.createdAt).format("ll")}
+
+ |
+
+
+
+ {e.title}
+
+
+ |
+
+
+
+ {e.deskripsi}
+
+
+ |
+
+
+ {
+ setLoading(e.id);
+ router.push(
+ RouterAdminDonasi.transfer_invoice_reimbursement + e.imageId
+ );
+ }}
+ >
+ Cek
+
+
+ |
+
+ ));
+ };
+
+ if (!data) return ;
+
+ return (
+ <>
+
+
+ // {
+ // // onRelaod();
+ // }}
+ // >
+ //
+ //
+ // {/*
+ // }
+ />
+
+
+
+
+
+
+ |
+ Nominal
+ |
+
+ Tanggal
+ |
+
+ Judul
+ |
+ Deskripsi |
+
+ Bukti Transfer
+ |
+
+
+ {rowTable()}
+
+
+
+ {
+ onPageClick(val);
+ }}
+ />
+
+
+ >
+ );
+}
+
+export default TampilanListPencairan;
diff --git a/src/app_modules/admin/donasi/detail/publish/detail_publish.tsx b/src/app_modules/admin/donasi/detail/publish/detail_publish.tsx
index 4f179996..17496b24 100644
--- a/src/app_modules/admin/donasi/detail/publish/detail_publish.tsx
+++ b/src/app_modules/admin/donasi/detail/publish/detail_publish.tsx
@@ -1,113 +1,126 @@
"use client";
-import { RouterAdminGlobal } from "@/app/lib";
-import { RouterAdminDonasi } from "@/app/lib/router_admin/router_admin_donasi";
-import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_TampilanRupiah } from "@/app_modules/_global/component";
import { Admin_ComponentLoadImageLandscape } from "@/app_modules/admin/_admin_global";
-import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil";
-import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal";
-import AdminGlobal_ComponentBackButton from "@/app_modules/admin/_admin_global/back_button";
-import adminNotifikasi_funCreateToUser from "@/app_modules/admin/notifikasi/fun/create/fun_create_notif_user";
-import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
+import CustomSkeletonAdmin from "@/app_modules/admin/_admin_global/_component/skeleton/customSkeletonAdmin";
+import Admin_ComponentBackButton from "@/app_modules/admin/_admin_global/back_button";
import {
- MODEL_DONASI,
- MODEL_DONASI_INVOICE,
- MODEL_DONASI_PENCAIRAN_DANA,
+ MODEL_DONASI
} from "@/app_modules/donasi/model/interface";
-import { MODEL_NEW_DEFAULT_MASTER } from "@/app_modules/model_global/interface";
-import mqtt_client from "@/util/mqtt_client";
+import { RouterAdminDonasi } from "@/lib/router_admin/router_admin_donasi";
+import { RouterAdminDonasi_OLD } from "@/lib/router_hipmi/router_admin";
import {
- ActionIcon,
- Badge,
- Box,
Button,
Center,
Grid,
- Group,
Modal,
- Pagination,
Paper,
- ScrollArea,
- Select,
SimpleGrid,
- Spoiler,
Stack,
- Table,
Text,
TextInput,
Title,
} from "@mantine/core";
-import { useDisclosure } from "@mantine/hooks";
-import { IconReload } from "@tabler/icons-react";
-import _, { toNumber } from "lodash";
-import moment from "moment";
-import { useRouter } from "next/navigation";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { toNumber } from "lodash";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
-import { adminDonasi_getListDonatur } from "../../fun/get/get_list_donatur_by_id";
-import { AdminDonasi_getOneById } from "../../fun/get/get_one_by_id";
-import adminDonasi_funUpdateStatusDanTotal from "../../fun/update/fun_update_status_dan_total";
+import {
+ apiGetAdminDonasiById,
+ apiGetAdminDonasiCountDonatur,
+} from "../../lib/api_fetch_admin_donasi";
+import TampilanListDonatur from "./detail_list_donatur";
+import TampilanListPencairan from "./detail_list_pencairan";
-export default function AdminDonasi_DetailPublish({
- dataPublish,
- listDonatur,
- countDonatur,
- listPencairan,
- listMasterStatus,
-}: {
- dataPublish: MODEL_DONASI;
- listDonatur: any[];
- countDonatur: number;
- listPencairan: MODEL_DONASI_PENCAIRAN_DANA[];
- listMasterStatus: MODEL_NEW_DEFAULT_MASTER[];
-}) {
- const [dataDonasi, setDataDonasi] = useState(dataPublish);
- const [pencairan, setPencairan] = useState(listPencairan);
- const selectedData = _.omit(dataDonasi, [
- "Author",
- "imageDonasi",
- "CeritaDonasi",
- "DonasiMaster_Ketegori",
- "DonasiMaster_Durasi",
- "DonasiMaster_Status",
- ]);
+export default function AdminDonasi_DetailPublish() {
+ const params = useParams<{ id: string }>();
+ const [isReload, setReload] = useState(false);
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ loadInitialData();
+ }, [isReload]);
+
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminDonasiById({
+ id: params.id,
+ });
+
+ if (response?.success && response?.data) {
+ setData(response.data);
+ setReload(false);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ console.error("Invalid data format recieved:", error);
+ setData(null);
+ }
+ };
return (
<>
- {/* {JSON.stringify(pencairan, null, 2)} */}
-
-
- {
- setDataDonasi(val);
- }}
- />
-
+ <>
+
+ {!data ? (
+
+ ) : (
+
+ )}
+ {!data ? (
+
+ ) : (
+ {
+ setReload(val);
+ }}
+ donasi={data}
+ isReload={isReload}
+ />
+ )}
+
+ >
>
);
}
function TampilanDetailDonasi({
+ // countDonatur,
donasi,
- countDonatur,
}: {
+ // countDonatur: number;
donasi: MODEL_DONASI;
- countDonatur: number;
}) {
const [opened, { open, close }] = useDisclosure(false);
const router = useRouter();
const [isLoadingPencairanDana, setIsLoadingPencairanDana] = useState(false);
+ const [countDonatur, setCountDonatur] = useState(0);
+
+ useShallowEffect(() => {
+ onLoadData()
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetAdminDonasiCountDonatur({ id: donasi.id });
+ if (response?.success && response?.data) {
+ setCountDonatur(response.data);
+ } else {
+ setCountDonatur(0);
+ }
+ } catch (error) {
+ console.error("Error get count donatur", error);
+ setCountDonatur(0);
+ }
+ }
return (
<>
-
+
-
+
-
+
Gambar Donasi
-
+
-
+
- Detail Donasi
+
+ Detail Donasi
+
- Judul
+
+ Judul
+
+
+
+ :
- :
-
+
{donasi?.title}
@@ -144,11 +163,15 @@ function TampilanDetailDonasi({
- Penggalang Dana
+
+ Penggalang Dana
+
+
+
+ :
- :
-
+
{donasi?.Author.username}
@@ -156,11 +179,15 @@ function TampilanDetailDonasi({
- Durasi
+
+ Durasi
+
+
+
+ :
- :
-
+
{donasi?.DonasiMaster_Durasi.name} hari
@@ -168,24 +195,32 @@ function TampilanDetailDonasi({
- Dana dibutuhkan
+
+ Dana dibutuhkan
+
+
+
+ :
- :
- Kategori
+
+ Kategori
+
+
+
+ :
- :
-
+
{donasi?.DonasiMaster_Ketegori?.name}
@@ -193,23 +228,31 @@ function TampilanDetailDonasi({
- Total donatur
+
+ Total donatur
+
+
+
+ :
- :
-
- {countDonatur}
+
+ {countDonatur ? countDonatur : "-"}
- Progres
+
+ Progres
+
+
+
+ :
- :
-
+
{toNumber(donasi.progres).toFixed(2)} %
@@ -217,13 +260,17 @@ function TampilanDetailDonasi({
- Dana terkumpul
+
+ Dana terkumpul
+
+
+
+ :
- :
@@ -231,25 +278,31 @@ function TampilanDetailDonasi({
{/* Pencairan Dana */}
-
+
- Pencairan Dana
+
+ Pencairan Dana
+
- Total Dana Dicairkan
+
+ Total Dana Dicairkan
+
- Bank Tujuan
-
+
+ Bank Tujuan
+
+
{donasi?.namaBank}
@@ -258,16 +311,20 @@ function TampilanDetailDonasi({
- Akumulasi Pencairan
-
+
+ Akumulasi Pencairan
+
+
{donasi?.akumulasiPencairan} Kali
- Nomor Rekening
-
+
+ Nomor Rekening
+
+
{donasi?.rekening}
@@ -275,13 +332,15 @@ function TampilanDetailDonasi({
- Sisa Dana
+
+ Sisa Dana
+
@@ -303,13 +362,13 @@ function TampilanDetailDonasi({
+
>
);
}
-
function PencairanDana() {
return (
<>
@@ -319,543 +378,3 @@ function PencairanDana() {
>
);
}
-
-//######################## LIST DONATUR #####################//
-function TampilanListDonatur({
- donatur,
- listMasterStatus,
- dataDonasi,
- onSuccessDonasi,
-}: {
- donatur: any;
- listMasterStatus: MODEL_NEW_DEFAULT_MASTER[];
- dataDonasi: MODEL_DONASI;
- onSuccessDonasi: (val: any) => void;
-}) {
- const router = useRouter();
- const [isLoadingCek, setLoadingCek] = useState(false);
- const [idData, setIdData] = useState("");
- const [lisDonatur, setListDonatur] = useState(
- donatur.data
- );
- const [isNPage, setNPage] = useState(donatur.nPage);
- const [isActivePage, setActivePage] = useState(1);
- const [isSelect, setSelect] = useState("");
-
- async function onRelaod() {
- const loadData = await adminDonasi_getListDonatur({
- donasiId: dataDonasi?.id,
- page: 1,
- });
- setSelect("");
- setListDonatur(loadData.data as any);
- setNPage(loadData.nPage);
- }
-
- async function onSelect(s: any) {
- setSelect(s);
- const loadData = await adminDonasi_getListDonatur({
- donasiId: dataDonasi?.id,
- page: 1,
- selectStatusId: s,
- });
- setListDonatur(loadData.data as any);
- setNPage(loadData.nPage);
- setActivePage(1);
- }
-
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminDonasi_getListDonatur({
- donasiId: dataDonasi?.id,
- page: p,
- selectStatusId: isSelect,
- });
- setListDonatur(loadData.data as any);
- setNPage(loadData.nPage);
- }
-
- const tableRows = lisDonatur.map((e, i) => (
-
- |
- {e?.Author.username}
- |
-
- {e?.DonasiMaster_Bank?.name}
- |
-
-
-
-
- |
-
-
- {new Intl.DateTimeFormat("id-ID", { dateStyle: "full" }).format(
- e?.createdAt
- )}
-
- |
-
-
-
- {e?.DonasiMaster_StatusInvoice?.name}
-
-
- |
-
-
- {e?.donasiMaster_StatusInvoiceId === "1" ||
- e?.donasiMaster_StatusInvoiceId === "2" ? (
- {
- setLoadingCek(true), setIdData(e?.id);
- router.push(RouterAdminGlobal.preview_image({ id: e.imageId }));
- }}
- >
- Cek
-
- ) : (
- "-"
- )}
-
- |
-
-
- {e?.donasiMaster_StatusInvoiceId === "1" ? (
-
- Selesai
-
- ) : e?.DonasiMaster_StatusInvoice?.id === "2" ? (
- {
- onSuccessDonasi(val);
- }}
- onSuccessDonatur={(val) => {
- setListDonatur(val.data);
- setNPage(val.nPage);
- }}
- />
- ) : (
- -
- )}
-
- |
-
- ));
-
- return (
- <>
-
- {/* {JSON.stringify(dataDonasi, null, 2)} */}
-
- Daftar Donatur
-
- {
- onRelaod();
- }}
- >
-
-
-
-
-
-
-
-
-
-
- |
- Nama Donatur
- |
-
- Nama Bank
- |
-
- Jumlah Donasi
- |
-
- Tanggal
- |
-
- Status
- |
-
- Bukti Transfer
- |
-
- Aksi
- |
-
-
- {tableRows}
-
-
-
-
- {
- onPageClick(val);
- }}
- />
-
-
-
- >
- );
-}
-
-function ButtonAccept({
- invoiceId,
- donasiId,
- nominal,
- danaTerkumpul,
- target,
- onSuccessDonasi,
- onSuccessDonatur,
-}: {
- invoiceId: string;
- donasiId: string;
- nominal: number;
- danaTerkumpul: number;
- target: number;
- onSuccessDonasi: (val: any) => void;
- onSuccessDonatur: (val: any) => void;
-}) {
- const [opened, { open, close }] = useDisclosure(false);
- const [isLoading, setIsLoading] = useState(false);
-
- async function onAccept() {
- let nominalDonasi = nominal;
- let jumlahTerkumpul = danaTerkumpul;
-
- const updateStatus = await adminDonasi_funUpdateStatusDanTotal({
- invoiceId: invoiceId,
- donasiId: donasiId,
- jumlahTerkumpul: jumlahTerkumpul,
- nominal: nominalDonasi,
- statusInvoiceId: "1",
- target: target,
- });
- if (updateStatus.status == 200) {
- setIsLoading(true);
- const dataNotif = {
- appId: updateStatus.data?.id,
- userId: updateStatus.data?.authorId,
- pesan: updateStatus.data?.Donasi?.title,
- status: updateStatus.data?.DonasiMaster_StatusInvoice?.name,
- kategoriApp: "DONASI",
- title: "Terimakasih, Donasi anda telah diterima",
- };
-
- const notif = await adminNotifikasi_funCreateToUser({
- data: dataNotif as any,
- });
-
- if (notif.status === 201) {
- mqtt_client.publish(
- "USER",
- JSON.stringify({ userId: updateStatus?.data?.authorId, count: 1 })
- );
-
- mqtt_client.publish(
- "donasi_invoice",
- JSON.stringify({
- invoiceId: invoiceId,
- statusInvoiceId: "1",
- })
- );
- }
-
- const dataNotifToAuthorDonasi = {
- appId: updateStatus.data?.Donasi?.id,
- userId: updateStatus.data?.Donasi?.authorId,
- pesan: updateStatus.data?.Donasi?.title,
- status: "Donatur Baru",
- kategoriApp: "DONASI",
- title: "Ada donatur baru",
- };
-
- const notifToAuthorDonasi = await adminNotifikasi_funCreateToUser({
- data: dataNotifToAuthorDonasi as any,
- });
-
- if (notifToAuthorDonasi.status === 201) {
- mqtt_client.publish(
- "USER",
- JSON.stringify({
- userId: updateStatus?.data?.Donasi?.authorId,
- count: 1,
- })
- );
- }
-
- const updateData = await AdminDonasi_getOneById(donasiId);
- onSuccessDonasi(updateData as any);
- const updatelistDonatur = await adminDonasi_getListDonatur({
- donasiId: donasiId,
- page: 1,
- });
- onSuccessDonatur(updatelistDonatur);
- ComponentAdminGlobal_NotifikasiBerhasil(updateStatus.message);
- setIsLoading(false);
- } else {
- ComponentAdminGlobal_NotifikasiGagal(updateStatus.message);
- setIsLoading(false);
- }
- close();
- }
-
- return (
- <>
- {
- open();
- }}
- >
- Terima
-
-
-
-
-
- {`${"Anda sudah melihat bukti transfer dan yakin menerima donasi ini ?"}`}
-
- close()}>
- Batal
-
- {
- onAccept();
- }}
- >
- Terima
-
-
-
-
-
- >
- );
-}
-
-//######################## LIST PENCAIRAN #####################//
-function TampilanListPencairan({
- pencairan,
-}: {
- pencairan: MODEL_DONASI_PENCAIRAN_DANA[];
-}) {
- const router = useRouter();
- const [data, setData] = useState(pencairan);
- const [opened, { open, close }] = useDisclosure(false);
- const [gambarId, setGambarId] = useState("");
-
- const rowTable = data.map((e) => (
-
- |
-
-
-
- |
-
- {moment(e.createdAt).format("ll")}
- |
-
-
- {e.title}
-
- |
-
-
-
- {e.deskripsi}
-
-
- |
-
-
-
- {
- // open();
- // setGambarId(e.imagesId);
- router.push(
- RouterAdminDonasi.transfer_invoice_reimbursement + e?.imagesId
- );
- }}
- >
- Cek
-
-
-
- |
-
- ));
-
- return (
- <>
- {/*
-
-
-
- */}
-
- {/* {JSON.stringify(data, null, 2)} */}
-
-
-
- Rincian Pencairan Dana
-
- {
- // onRelaod();
- }}
- >
-
-
- {/*
-
-
-
-
-
-
-
- |
- Nominal
- |
-
- Tanggal
- |
-
- Judul
- |
- Deskripsi |
-
- Bukti Transfer
- |
-
-
- {rowTable}
-
-
-
- {/*
- {
- onPageClick(val);
- }}
- />
- */}
-
-
-
- {/*
- Rincian Pencairan Dana
- {_.isEmpty(pencairan) ? (
-
- BELUM ADA PENCAIRAN DANA
-
- ) : (
-
-
-
-
- | Nominal |
- Tanggal |
- Judul |
-
- Deskripsi
- |
-
- Bukti Transfer
- |
-
-
- {rowTable}
-
-
- )}
- */}
- >
- );
-}
diff --git a/src/app_modules/admin/donasi/detail/publish/pencairan_dana.tsx b/src/app_modules/admin/donasi/detail/publish/pencairan_dana.tsx
index 43ce6778..8bb2847e 100644
--- a/src/app_modules/admin/donasi/detail/publish/pencairan_dana.tsx
+++ b/src/app_modules/admin/donasi/detail/publish/pencairan_dana.tsx
@@ -24,42 +24,78 @@ import {
import { IconCamera } from "@tabler/icons-react";
import _, { toNumber } from "lodash";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import ComponentAdminDonasi_TombolKembali from "../../component/tombol_kembali";
import { AdminDonasi_funCreatePencairanDana } from "../../fun/create/fun_create_pencairan_dana";
import { AdminDonasi_getOneById } from "../../fun/get/get_one_by_id";
import { AdminDonasi_AkumulasiPencairanById } from "../../fun/update/fun_update_akumulasi_pencairan";
import { ComponentGlobal_InputCountDown } from "@/app_modules/_global/component";
-import { DIRECTORY_ID } from "@/app/lib";
+import { DIRECTORY_ID } from "@/lib";
import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { apiGetAdminDonasiById } from "../../lib/api_fetch_admin_donasi";
+import { MODEL_DONASI } from "@/app_modules/donasi/model/interface";
+import { clientLogger } from "@/util/clientLogger";
+import { useShallowEffect } from "@mantine/hooks";
+import CustomSkeletonAdmin from "@/app_modules/admin/_admin_global/_component/skeleton/customSkeletonAdmin";
-export default function AdminDonasi_PencairanDana({
- donasiId,
- danaTerkumpul,
- totalPencairan,
-}: {
- donasiId: string;
- danaTerkumpul: string;
- totalPencairan: number;
-}) {
- const [terkumpul, setTerkumpul] = useState(danaTerkumpul);
- const [total, setTotal] = useState(totalPencairan);
+export default function AdminDonasi_PencairanDana() {
+ const params = useParams<{ id: string }>();
+ const donasiId = params.id;
+ const [data, setData] = useState(null);
+ // const [terkumpul, setTerkumpul] = useState(data?.terkumpul);
+ // const [total, setTotal] = useState(data?.totalPencairan);
+
+ useShallowEffect(() => {
+ loadInitialData();
+ }, []);
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminDonasiById({
+ id: donasiId,
+ });
+
+ if (response?.success && response?.data) {
+ setData(response.data);
+ // setTerkumpul(response.data.terkumpul)
+ // setTotal(response.data.totalPencairan)
+ } else {
+ setData(null);
+ // setTerkumpul("")
+ // setTotal(0)
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved:", error);
+ setData(null);
+ // setTerkumpul("");
+ // setTotal(0);
+ }
+ };
return (
<>
-
- {
- setTerkumpul(val.terkumpul);
- setTotal(val.totalPencairan);
- }}
- />
+ {!data ? (
+
+ ) : (
+ <>
+
+ {
+ // setTerkumpul(val.terkumpul);
+ // setTotal(val.totalPencairan);
+ }}
+ />
+ >
+ )}
>
);
@@ -81,11 +117,12 @@ function TotalDanaView({
- Dana Tersisa
+
+ Dana Tersisa
+
{
-
+
- Form Pencairan Dana
+
+ Form Pencairan Dana
+
Rp.}
+ styles={{ label: { color: AdminColor.white } }}
withAsterisk
placeholder="0"
label="Nominal"
@@ -245,6 +294,7 @@ function FormView({
}}
/>
}
- placeholder="Masukan kategori baru"
- onChange={(val) => {
- setCreate(val.currentTarget.value);
- }}
- />
-
- {
- setIsCreate(false);
- setCreate("");
- }}
- >
- Batal
-
- {
- onCreateNewKategori();
- }}
- >
- Simpan
-
-
-
-
- ) : (
- ""
- )}
-
- {isUpdate ? (
-
-
- Update Kategori}
- placeholder="Update kategori"
- onChange={(val) => {
- const data = _.clone(updateKategori);
- setUpdateKategori({
- kategoriId: data.kategoriId,
- name: val.currentTarget.value,
- });
- }}
- />
-
- {
- setIsUpdate(false);
- setUpdateKategori({
- kategoriId: "",
- name: "",
- });
- }}
- >
- Batal
-
- {
- onUpdate();
- }}
- >
- Update
-
-
-
-
- ) : (
- ""
- )}
-
-
+
+ )}
-
+
>
);
}
-function TableStatus({ listPublish }: { listPublish: any }) {
+function TableStatus() {
const router = useRouter();
const [isLoading, setLoading] = useState(false);
const [idData, setIdData] = useState("");
- const [data, setData] = useState(listPublish.data);
- const [isNPage, setNPage] = useState(listPublish.nPage);
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
const [isActivePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
- async function onSearch(s: string) {
- setSearch(s);
- const loadData = await adminDonasi_getListPublish({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ useShallowEffect(() => {
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminDonasiByStatus({
+ name: "Publish",
+ page: `${isActivePage}`,
+ search: isSearch,
+ });
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminDonasi_getListPublish({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ if (response?.success && response?.data.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format recieved:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved:", error);
+ setData([]);
+ }
+ };
+ loadInitialData();
+ }, [isActivePage, isSearch]);
- const TableRows = data.map((e, i) => (
-
- |
- {e.title}
- |
-
-
-
-
- |
-
-
-
-
- |
-
- {e.DonasiMaster_Ketegori.name}
- |
-
- {e.DonasiMaster_Durasi.name} hari
- |
-
-
- }
- radius={"xl"}
- variant="outline"
- onClick={() => {
- setLoading(true);
- setIdData(e?.id);
- router.push(RouterAdminDonasi_OLD.detail_publish + `${e.id}`);
- }}
- >
- Tampilkan
-
-
- |
-
- ));
+ const onSearch = (searchTerm: string) => {
+ setSearch(searchTerm);
+ setActivePage(1);
+ };
+
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+ return data.map((e, i) => (
+
+ |
+
+
+ {e?.Author?.username}
+
+
+ |
+
+
+
+ {e.title}
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+ {/*
+ {e.DonasiMaster_Ketegori.name}
+ |
+
+ {e.DonasiMaster_Durasi.name} hari
+ | */}
+
+
+ {/* }
+ radius={"xl"}
+ onClick={() => {
+ setLoading(true);
+ setIdData(e?.id);
+ router.push(RouterAdminDonasi_OLD.detail_publish + `${e.id}`);
+ }}
+ >
+ Tampilkan
+ */}
+
+
+ |
+
+ ));
+ };
return (
<>
{/* {JSON.stringify(listUser, null, 2)} */}
- }
+ radius={"xl"}
+ placeholder="Masukan judul"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
+ {/*
-
+ */}
-
-
-
-
-
- |
- Judul
- |
-
- Target
- |
-
- Terkumpul
- |
-
- Ketegori
- |
-
- Durasi
- |
-
- Aksi
- |
-
-
- {TableRows}
-
-
- {/*
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Username
+ |
+
+ Judul
+ |
+
+ Target
+ |
+
+ Terkumpul
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+ {/*
*/}
-
- {
onPageClick(val);
}}
/>
-
-
+
+ )}
>
);
diff --git a/src/app_modules/admin/donasi/sub_menu/table_reject.tsx b/src/app_modules/admin/donasi/sub_menu/table_reject.tsx
index bab4629a..c0926483 100644
--- a/src/app_modules/admin/donasi/sub_menu/table_reject.tsx
+++ b/src/app_modules/admin/donasi/sub_menu/table_reject.tsx
@@ -1,14 +1,16 @@
"use client";
-import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin";
-import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
+import { AccentColor } from "@/app_modules/_global/color";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_TampilanRupiah } from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { MODEL_DONASI } from "@/app_modules/donasi/model/interface";
+import { RouterAdminDonasi_OLD } from "@/lib/router_hipmi/router_admin";
+import { clientLogger } from "@/util/clientLogger";
import {
- Button,
+ Box,
Center,
- Group,
Modal,
- Pagination,
Paper,
ScrollArea,
Stack,
@@ -17,103 +19,143 @@ import {
TextInput,
Title,
} from "@mantine/core";
-import { useDisclosure } from "@mantine/hooks";
-import { IconEyeEdit, IconSearch } from "@tabler/icons-react";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { IconSearch } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
+import Admin_DetailButton from "../../_admin_global/_component/button/detail_button";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
-import adminDonasi_getListReject from "../fun/get/get_list_reject";
-import { ComponentGlobal_TampilanRupiah } from "@/app_modules/_global/component";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
+import { apiGetAdminDonasiByStatus } from "../lib/api_fetch_admin_donasi";
-export default function AdminDonasi_TableReject({
- dataReject,
-}: {
- dataReject: any;
-}) {
+export default function AdminDonasi_TableReject() {
return (
<>
-
+
>
);
}
-function TableStatus({ dataReject }: { dataReject: any }) {
+function TableStatus() {
const router = useRouter();
const [opened, { open, close }] = useDisclosure(false);
const [isLoading, setLoading] = useState(false);
const [idData, setIdData] = useState("");
- const [data, setData] = useState(dataReject.data);
- const [isNPage, setNPage] = useState(dataReject.nPage);
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
const [isActivePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
- async function onSearch(s: string) {
- setSearch(s);
- const loadData = await adminDonasi_getListReject({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ useShallowEffect(() => {
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminDonasiByStatus({
+ name: "Reject",
+ page: `${isActivePage}`,
+ search: isSearch,
+ });
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminDonasi_getListReject({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ if (response?.success && response?.data.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format recieved:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved:", error);
+ setData([]);
+ }
+ };
+ loadInitialData();
+ }, [isActivePage, isSearch]);
- const TableRows = data.map((e, i) => (
-
- |
- {e?.Author?.username}
- |
-
- {e?.title}
- |
-
-
-
-
- |
-
- {e?.DonasiMaster_Ketegori.name}
- |
-
- {e?.DonasiMaster_Durasi.name} hari
- |
-
-
- }
- radius={"xl"}
- variant="outline"
- onClick={() =>
- router.push(RouterAdminDonasi_OLD.detail_reject + `${e.id}`)
- }
- >
- Lihat Alasan
-
-
+ const onSearch = (searchTerm: string) => {
+ setSearch(searchTerm);
+ setActivePage(1);
+ };
- {/* */}
- |
-
- ));
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
+
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+ return data.map((e, i) => (
+
+ |
+
+
+ {e?.Author?.username}
+
+
+ |
+
+
+
+ {e.title}
+
+
+ |
+
+
+
+
+ |
+
+ {e?.DonasiMaster_Ketegori.name}
+ |
+
+
+ {e?.DonasiMaster_Durasi.name} hari
+
+ |
+
+
+
+
+
+ {/* */}
+ |
+
+ ));
+ };
return (
<>
{/* {JSON.stringify(listUser, null, 2)} */}
- }
+ radius={"xl"}
+ placeholder="Masukan judul"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
+ {/*
-
+ */}
-
-
-
-
-
- |
- Username
- |
-
- Judul
- |
-
- Target
- |
-
- Ketegori
- |
-
- Durasi
- |
-
- Alasan
- |
-
-
- {TableRows}
-
-
- {/*
- */}
-
-
+ ) : (
+
+
+
+
+
+ |
+ Username
+ |
+
+ Judul
+ |
+
+ Target
+ |
+
+ Ketegori
+ |
+
+ Durasi
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+
+ {
onPageClick(val);
}}
/>
-
-
+
+ )}
-
- {data.map((e, i) => (
+ {/* {data.map((e, i) => (
{i}
- ))}
+ ))} */}
>
);
}
diff --git a/src/app_modules/admin/donasi/sub_menu/table_review.tsx b/src/app_modules/admin/donasi/sub_menu/table_review.tsx
index caa488ff..aa881760 100644
--- a/src/app_modules/admin/donasi/sub_menu/table_review.tsx
+++ b/src/app_modules/admin/donasi/sub_menu/table_review.tsx
@@ -1,53 +1,55 @@
"use client";
-import { gs_adminDonasi_triggerReview } from "@/app/lib/global_state";
-import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin";
-import { AccentColor } from "@/app_modules/_global/color";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_TampilanRupiah } from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { MODEL_DONASI } from "@/app_modules/donasi/model/interface";
+import { gs_adminDonasi_triggerReview } from "@/lib/global_state";
+import { RouterAdminDonasi_OLD } from "@/lib/router_hipmi/router_admin";
+import { clientLogger } from "@/util/clientLogger";
import {
Affix,
+ Box,
Button,
Center,
- Group,
Pagination,
Paper,
rem,
ScrollArea,
Stack,
Table,
+ Text,
TextInput,
- Title,
} from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { IconEyeCheck, IconRefresh, IconSearch } from "@tabler/icons-react";
import { useAtom } from "jotai";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
-import adminDonasi_getListReview from "../fun/get/get_list_review";
+import { apiGetAdminDonasiByStatus } from "../lib/api_fetch_admin_donasi";
+import Admin_DetailButton from "../../_admin_global/_component/button/detail_button";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
-export default function AdminDonasi_TableReview({
- listReview,
-}: {
- listReview: MODEL_DONASI[];
-}) {
+export default function AdminDonasi_TableReview() {
return (
<>
-
+
>
);
}
-function TableStatus({ listReview }: { listReview: any }) {
+function TableStatus() {
const router = useRouter();
const [isLoading, setLoading] = useState(false);
const [idData, setIdData] = useState("");
- const [data, setData] = useState(listReview.data);
- const [isNPage, setNPage] = useState(listReview.nPage);
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
const [isActivePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
@@ -59,87 +61,135 @@ function TableStatus({ listReview }: { listReview: any }) {
const [isLoadingReload, setLoadingReload] = useState(false);
useShallowEffect(() => {
- if (isAdminDonasi_TriggerReview) {
- setIsShowReload(true);
+ loadInitialData();
+ }, [isActivePage, isSearch]);
+
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminDonasiByStatus({
+ name: "Review",
+ page: `${isActivePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
}
- }, [isAdminDonasi_TriggerReview, setIsShowReload]);
-
+ };
async function onLoadData() {
- const loadData = await adminDonasi_getListReview({ page: 1 });
-
- setData(loadData.data as any);
- setNPage(loadData.nPage);
+ loadInitialData();
setLoadingReload(false);
setIsShowReload(false);
setIsAdminDonasi_TriggerReview(false);
}
- async function onSearch(s: string) {
- setSearch(s);
- const loadData = await adminDonasi_getListReview({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ const onSearch = async (searchTerm: string) => {
+ setSearch(searchTerm);
+ setActivePage(1);
+ };
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminDonasi_getListReview({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
- const TableRows = data.map((e, i) => (
-
- |
- {e?.Author?.username}
- |
-
- {e?.title}
- |
-
-
-
-
- |
-
- {e?.DonasiMaster_Ketegori.name}
- |
-
- {e?.DonasiMaster_Durasi.name} hari
- |
-
-
- }
- radius={"xl"}
- variant="outline"
- onClick={() => {
- setLoading(true);
- setIdData(e?.id);
- router.push(RouterAdminDonasi_OLD.detail_review + `${e?.id}`);
- }}
- >
- Tampilkan
-
-
- |
-
- ));
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+
+ return data.map((e, i) => (
+
+ |
+
+
+ {e?.Author?.username}
+
+
+ |
+
+
+
+ {e.title}
+
+
+ |
+
+
+
+
+ |
+
+ {e?.DonasiMaster_Ketegori.name}
+ |
+
+
+ {e?.DonasiMaster_Durasi.name} hari
+
+ |
+
+
+ {/* }
+ radius={"xl"}
+ onClick={() => {
+ setLoading(true);
+ setIdData(e?.id);
+ router.push(RouterAdminDonasi_OLD.detail_review + `${e?.id}`);
+ }}
+ >
+ Tampilkan
+ */}
+
+
+
+ |
+
+ ));
+ };
return (
<>
{/* {JSON.stringify(listUser, null, 2)} */}
- }
+ radius={"xl"}
+ placeholder="Masukan judul"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
+ {/*
-
+ */}
+ {!data ? (
+
+ ) : (
+
+ {isShowReload && (
+
+
+ onLoadData()}
+ leftIcon={}
+ >
+ Update Data
+
+
+
+ )}
+
+
+
+
+ |
+ Username
+ |
+
+ Judul
+ |
+
+ Target
+ |
+
+ Ketegori
+ |
+
+ Durasi
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
-
- {isShowReload && (
-
-
- onLoadData()}
- leftIcon={}
- >
- Update Data
-
-
-
- )}
-
-
-
-
- |
- Username
- |
-
- Judul
- |
-
- Target
- |
-
- Ketegori
- |
-
- Durasi
- |
-
- Aksi
- |
-
-
- {TableRows}
-
-
-
- {
onPageClick(val);
}}
/>
-
-
+
+ )}
>
);
diff --git a/src/app_modules/admin/event/_component/comp_detail_data.tsx b/src/app_modules/admin/event/_component/comp_detail_data.tsx
new file mode 100644
index 00000000..1b785c7b
--- /dev/null
+++ b/src/app_modules/admin/event/_component/comp_detail_data.tsx
@@ -0,0 +1,73 @@
+import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
+import { Badge, Grid, Stack, Text } from "@mantine/core";
+import moment from "moment";
+import "moment/locale/id";
+import { Admin_ComponentBoxStyle } from "../../_admin_global/_component/comp_admin_boxstyle";
+import { Admin_V3_ComponentDetail } from "../../_components_v3/comp_detail_data";
+import { Comp_SetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
+
+function AdminEvent_ComponentDetailData({
+ data,
+}: {
+ data: MODEL_EVENT | null;
+}) {
+ const listData = [
+ {
+ label: "Nama",
+ value: data?.Author.Profile.name,
+ },
+ {
+ label: "Username",
+ value: data?.Author.username,
+ },
+ {
+ label: "Nomor",
+ value: `+ ${data?.Author.nomor}`,
+ },
+ {
+ label: "Status",
+ value: (
+
+ {data?.EventMaster_Status.name === "Publish" &&
+ moment(data.tanggalSelesai).diff(new Date(), "minutes") < 0
+ ? "Riwayat"
+ : data?.EventMaster_Status.name}
+
+ ),
+ },
+ {
+ label: "Judul",
+ value: data?.title,
+ },
+ {
+ label: "Lokasi",
+ value: data?.lokasi,
+ },
+ {
+ label: "Tipe acara",
+ value: data?.EventMaster_TipeAcara.name,
+ },
+ {
+ label: "Tanggal & Waktu mulai",
+ value: moment(data?.tanggal).format("LLLL"),
+ },
+ {
+ label: "Tanggal & Waktu selesai",
+ value: moment(data?.tanggalSelesai).format("LLLL"),
+ },
+ {
+ label: "Deskripsi",
+ value: ,
+ },
+ ];
+
+ return (
+ <>
+ {listData.map((item, index) => (
+
+ ))}
+ >
+ );
+}
+
+export default AdminEvent_ComponentDetailData;
diff --git a/src/app_modules/admin/event/_component/comp_detail_publish.tsx b/src/app_modules/admin/event/_component/comp_detail_publish.tsx
new file mode 100644
index 00000000..d9f07d41
--- /dev/null
+++ b/src/app_modules/admin/event/_component/comp_detail_publish.tsx
@@ -0,0 +1,75 @@
+import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
+import { Button, Grid, Stack, Text } from "@mantine/core";
+import { Admin_ComponentBoxStyle } from "../../_admin_global/_component/comp_admin_boxstyle";
+import AdminEvent_ComponentDetailData from "./comp_detail_data";
+import QRCode from "react-qr-code";
+import { Admin_V3_ComponentDetail } from "../../_components_v3/comp_detail_data";
+
+function AdminEvent_ComponentDetailPublish({ data }: { data: MODEL_EVENT }) {
+ const handleDownloadQR = () => {
+ const svg: any = document.getElementById(data.id);
+ const svgData = new XMLSerializer().serializeToString(svg);
+ const canvas = document.createElement("canvas");
+ const ctx: any = canvas.getContext("2d");
+ const img = new Image();
+ img.onload = () => {
+ canvas.width = img.width;
+ canvas.height = img.height;
+ ctx.drawImage(img, 0, 0);
+ const pngFile = canvas.toDataURL("image/png");
+ const downloadLink = document.createElement("a");
+ downloadLink.download = `QRCode ${data.title}`;
+ downloadLink.href = `${pngFile}`;
+ downloadLink.click();
+ };
+ img.src = `data:image/svg+xml;base64,${btoa(svgData)}`;
+ };
+
+ const donwloadButton = () => {
+ return (
+ <>
+
+ ),
+ }}
+ />
+ {/*
+
+ QR Code
+
+
+ :
+
+
+
+
+ */}
+ >
+ );
+ };
+
+ return (
+ <>
+
+
+
+ {donwloadButton()}
+
+
+ {/* */}
+ >
+ );
+}
+
+export default AdminEvent_ComponentDetailPublish;
diff --git a/src/app_modules/admin/event/_component/detail_data_event.tsx b/src/app_modules/admin/event/_component/detail_data_event.tsx
new file mode 100644
index 00000000..406e583f
--- /dev/null
+++ b/src/app_modules/admin/event/_component/detail_data_event.tsx
@@ -0,0 +1,68 @@
+import { AdminColor } from '@/app_modules/_global/color/color_pallet';
+import { MODEL_EVENT } from '@/app_modules/event/_lib/interface';
+import { Box, Grid, Paper, Stack, Text, Title } from '@mantine/core';
+import moment from 'moment';
+import React from 'react';
+import "moment/locale/id";
+import CustomSkeleton from '@/app_modules/components/CustomSkeleton';
+
+function ComponentEvent_DetailDataEvent({ data }: { data: MODEL_EVENT | null }) {
+
+ return (
+ <>
+ {/* {!data ? (
+
+ ) : (
+
+ )
+ } */}
+
+
+ {data ? {data?.title} : }
+
+
+
+ Lokasi:
+
+
+ {data ? {data?.lokasi} : }
+
+
+
+
+ Tipe Acara:
+
+
+ {data ? {data?.EventMaster_TipeAcara?.name} : }
+
+
+
+
+ Tanggal & Waktu Mulai:
+
+
+ {data ? {moment(data?.tanggal).format("LLLL")} : }
+
+
+
+
+ Tanggal & Waktu Selesai:
+
+
+ {data ? {moment(data?.tanggalSelesai).format("LLLL")} : }
+
+
+
+
+ Deskripsi:
+ {data ? {data?.deskripsi} : }
+
+
+
+
+
+ >
+ );
+}
+
+export default ComponentEvent_DetailDataEvent;
diff --git a/src/app_modules/admin/event/_component/detail_data_sponsor.tsx b/src/app_modules/admin/event/_component/detail_data_sponsor.tsx
new file mode 100644
index 00000000..7265b4dd
--- /dev/null
+++ b/src/app_modules/admin/event/_component/detail_data_sponsor.tsx
@@ -0,0 +1,111 @@
+import { RouterAdminEvent } from '@/lib/router_admin/router_admin_event';
+import { AdminColor } from '@/app_modules/_global/color/color_pallet';
+import { Button, Center, Pagination, Paper, ScrollArea, Stack, Table, Title } from '@mantine/core';
+import { IconDeviceDesktop, IconDownload, IconImageInPicture } from '@tabler/icons-react';
+import { useRouter } from 'next/navigation';
+import React from 'react';
+
+const tableRows = [
+ {
+ id: 1,
+ sponsor: ,
+ username: "@NicoArya",
+ name: "Nico Arya",
+ nomor: "+628123456789",
+ email: "nicoarya@gmail.com",
+
+ }
+]
+function AdminEvent_DetailDataSponsor() {
+ const router = useRouter();
+ const rows = tableRows.map((row, i) => (
+
+ |
+ {row.sponsor}
+ |
+
+
+ } size='xs' style={{ borderColor: "black", color: "black" }} bg={"#e6e6e6"}>Download
+
+ |
+
+ {row.username}
+ |
+
+ {row.name}
+ |
+
+ {row.nomor}
+ |
+
+ {row.email}
+ |
+
+
+ } onClick={() => router.push(RouterAdminEvent.detail_sponsor)} radius={"xl"} bg={"green"}>Tampilkan
+
+ |
+
+ ))
+ return (
+ <>
+
+
+ Daftar Sponsor
+
+
+
+
+
+
+
+ |
+ Sponsor
+ |
+
+ Download
+ |
+
+ Username
+ |
+
+ Nama
+ |
+
+ Nomor
+ |
+
+ Email
+ |
+
+ Aksi
+ |
+
+
+ {rows}
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+export default AdminEvent_DetailDataSponsor;
diff --git a/src/app_modules/admin/event/_lib/api_fecth_admin_event.ts b/src/app_modules/admin/event/_lib/api_fecth_admin_event.ts
new file mode 100644
index 00000000..7ca22fa6
--- /dev/null
+++ b/src/app_modules/admin/event/_lib/api_fecth_admin_event.ts
@@ -0,0 +1,181 @@
+export {
+ apiGetAdminEventStatusCountDashboard as apiGetEventStatusCountDashboard,
+ apiGetAdminEventCountTipeAcara as apiGetEventTipeAcara,
+ apiGetAdminEventRiwayatCount as apiGetEventRiwayatCount,
+ apiGetAdminEventByStatus as apiGetDataEventByStatus,
+ apiGetAdminEventRiwayat,
+ apiGetAdminEventTipeAcara,
+ apiGetAdminDetailEventById,
+ apiGetAdminDetailEventPesertaById
+};
+
+const apiGetAdminEventStatusCountDashboard = async ({
+ name,
+}: {
+ name: "Publish" | "Review" | "Reject";
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/event/dashboard/${name}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminEventRiwayatCount = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/event/dashboard/riwayat`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminEventCountTipeAcara = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/event/dashboard/tipe-acara`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminEventByStatus = async ({
+ name,
+ page,
+ search,
+}: {
+ name: "Publish" | "Review" | "Reject";
+ page: string;
+ search: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isPage = page ? `?page=${page}` : "";
+ const isSearch = search ? `&search=${search}` : "";
+ const respone = await fetch(
+ `/api/admin/event/status/${name}${isPage}${isSearch}`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ return await respone.json().catch(() => null);
+};
+
+const apiGetAdminEventRiwayat = async ({
+ page,
+ search,
+}: {
+ page: string;
+ search: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isPage = page ? `?page=${page}` : "";
+ const isSearch = search ? `&search=${search}` : "";
+ const response = await fetch(`/api/admin/event/riwayat${isPage}${isSearch}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminEventTipeAcara = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/event/tipe-acara`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminDetailEventById = async ({ id }: { id: string }) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/event/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ })
+
+ return await response.json().catch(() => null);
+}
+
+const apiGetAdminDetailEventPesertaById = async ({
+ page,
+ search,
+ id
+}: {
+ page: string;
+ search: string;
+ id: string
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isPage = page ? `?page=${page}` : "";
+ const isSearch = search ? `&search=${search}` : "";
+
+ const response = await fetch(`/api/admin/event/${id}/peserta${isPage}${isSearch}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ })
+
+ return await response.json().catch(() => null);
+}
diff --git a/src/app_modules/admin/event/_lib/global_state.ts b/src/app_modules/admin/event/_lib/global_state.ts
new file mode 100644
index 00000000..c601a664
--- /dev/null
+++ b/src/app_modules/admin/event/_lib/global_state.ts
@@ -0,0 +1,5 @@
+import { atomWithStorage } from "jotai/utils";
+
+const gs_admin_event_menu_publish = atomWithStorage("gs_admin_event_menu_publish", "1")
+
+export { gs_admin_event_menu_publish }
\ No newline at end of file
diff --git a/src/app_modules/admin/event/_ui/ui_detail_peserta.tsx b/src/app_modules/admin/event/_ui/ui_detail_peserta.tsx
index a291c2f4..7d9aac48 100644
--- a/src/app_modules/admin/event/_ui/ui_detail_peserta.tsx
+++ b/src/app_modules/admin/event/_ui/ui_detail_peserta.tsx
@@ -1,26 +1,18 @@
"use client";
import { Stack } from "@mantine/core";
-import AdminGlobal_ComponentBackButton from "../../_admin_global/back_button";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
import { AdminEvent_ViewDetailPeserta } from "../_view";
-import { MODEL_EVENT_PESERTA } from "@/app_modules/event/model/interface";
+import { MODEL_EVENT_PESERTA } from "@/app_modules/event/_lib/interface";
import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
-export function AdminEvent_UiDetailPeserta({
- dataPeserta,
- eventId,
-}: {
- dataPeserta: any;
- eventId: string
-}) {
+export function AdminEvent_UiDetailPeserta() {
return (
<>
-
+
>
diff --git a/src/app_modules/admin/event/_ui/ui_new_detail.tsx b/src/app_modules/admin/event/_ui/ui_new_detail.tsx
new file mode 100644
index 00000000..f838fa4a
--- /dev/null
+++ b/src/app_modules/admin/event/_ui/ui_new_detail.tsx
@@ -0,0 +1,68 @@
+"use client";
+
+import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
+import { clientLogger } from "@/util/clientLogger";
+import { SimpleGrid, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import { apiGetAdminDetailEventById } from "../_lib/api_fecth_admin_event";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
+import { AdminEvent_ViewDetailPublish } from "../_view/view_detail_publish";
+import { AdminEvent_ViewDetailReview } from "../_view/view_detail_review";
+import { AdminEvent_ViewDetailReject } from "../_view/view_detail_reject";
+import { Admin_V3_ComponentSkeletonBreakpoint } from "../../_components_v3/comp_skeleton_breakpoint";
+
+export function AdminEvent_UiNewDetail() {
+ const params = useParams<{ id: string }>();
+ const [loading, setLoading] = useState(true);
+ const [data, setData] = useState();
+
+ useShallowEffect(() => {
+ getDetailData();
+ }, []);
+ async function getDetailData() {
+ try {
+ setLoading(true);
+ const response = await apiGetAdminDetailEventById({
+ id: params.id,
+ });
+
+ if (response?.success && response?.data) {
+ setData(response.data);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table detail publish", error);
+ setData(null);
+ }
+ }
+
+ return (
+ <>
+
+
+
+
+ {data === undefined ? (
+
+ ) : !data ? (
+
+ ) : data.EventMaster_Status.name === "Publish" ? (
+
+ ) : data.EventMaster_Status.name === "Review" ? (
+
+ ) : data.EventMaster_Status.name === "Reject" ? (
+
+ ) : (
+ ""
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/event/_view/view_detail_peserta.tsx b/src/app_modules/admin/event/_view/view_detail_peserta.tsx
index 6c09ef87..ad4d6337 100644
--- a/src/app_modules/admin/event/_view/view_detail_peserta.tsx
+++ b/src/app_modules/admin/event/_view/view_detail_peserta.tsx
@@ -1,111 +1,169 @@
"use client";
-import { MODEL_EVENT_PESERTA } from "@/app_modules/event/model/interface";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { MODEL_EVENT_PESERTA } from "@/app_modules/event/_lib/interface";
+import { clientLogger } from "@/util/clientLogger";
import {
- Button,
+ Badge,
Center,
- Pagination,
Paper,
ScrollArea,
Stack,
Table,
+ Text,
+ TextInput,
} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconSearch } from "@tabler/icons-react";
+import { useParams } from "next/navigation";
import { useState } from "react";
-import { adminEvent_getListPesertaById } from "../fun";
-import _ from "lodash";
-import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
+import { apiGetAdminDetailEventPesertaById } from "../_lib/api_fecth_admin_event";
-export function AdminEvent_ViewDetailPeserta({
- dataPeserta,
- eventId,
-}: {
- dataPeserta: any;
- eventId: string;
-}) {
- const [data, setData] = useState(dataPeserta.data);
- const [isNPage, setNPage] = useState(dataPeserta.nPage);
+export function AdminEvent_ViewDetailPeserta() {
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
const [isActivePage, setActivePage] = useState(1);
+ const [isSearch, setSearch] = useState("");
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminEvent_getListPesertaById({
- eventId: eventId,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ useShallowEffect(() => {
+ loadInitialData();
+ }, [isActivePage, isSearch]);
- const tableRow = _.isEmpty(data)
- ? []
- : data.map((e, i) => (
-
- |
- {e?.User?.username}
- |
-
- {e?.User?.Profile?.name}
- |
-
- +{e?.User?.nomor}
- |
-
- {e?.User?.Profile?.email}
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminDetailEventPesertaById({
+ id: params.id,
+ page: `${isActivePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format recieved:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved:", error);
+ setData([]);
+ }
+ };
+
+ const onSearch = async (searchTerm: string) => {
+ setSearch(searchTerm);
+ setActivePage(1);
+ };
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
+
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+ |
+ |
+
+ Tidak ada data
+
|
- ));
+ );
+ }
+
+ return data?.map((e, i) => (
+
+ |
+ {e?.User?.username}
+ |
+
+ {e?.User?.Profile?.name}
+ |
+
+ +{e?.User?.nomor}
+ |
+
+ {e?.User?.Profile?.email}
+ |
+
+
+ {e.isPresent ? (
+ Hadir
+ ) : (
+ Tidak Hadir
+ )}
+
+ |
+
+ ));
+ };
return (
<>
-
-
-
-
-
- |
- Username
- |
-
- Name
- |
-
- Nomor
- |
-
- Email
- |
-
-
- {tableRow}
-
- {_.isEmpty(data) ? (
-
+ }
+ radius={"xl"}
+ placeholder="Masukan username"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
/>
- ) : (
- ""
- )}
-
-
-
- {
- onPageClick(val);
- }}
- />
-
-
+ }
+ />
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Username
+ |
+
+ Name
+ |
+
+ Nomor
+ |
+
+ Email
+ |
+
+ Konfirmasi Kehadiran
+ |
+
+
+ {renderTableBody()}
+
+
+ {
+ onPageClick(val);
+ }}
+ />
+
+ )}
+
{/* {JSON.stringify(dataPeserta, null, 2)} */}
>
);
diff --git a/src/app_modules/admin/event/_view/view_detail_publish.tsx b/src/app_modules/admin/event/_view/view_detail_publish.tsx
new file mode 100644
index 00000000..76d834cd
--- /dev/null
+++ b/src/app_modules/admin/event/_view/view_detail_publish.tsx
@@ -0,0 +1,48 @@
+import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
+import { IconCircleCheck } from "@tabler/icons-react";
+import { useAtom } from "jotai";
+import { gs_admin_event_menu_publish } from "../_lib/global_state";
+import { Stack, Group, Button } from "@mantine/core";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
+import AdminEvent_ComponentDetailPublish from "../_component/comp_detail_publish";
+import { AdminEvent_ViewDetailPeserta } from "./view_detail_peserta";
+
+export function AdminEvent_ViewDetailPublish({ data }: { data: MODEL_EVENT }) {
+ const [selectPage, setSelectPage] = useAtom(gs_admin_event_menu_publish);
+ const listPage = [
+ {
+ id: "1",
+ name: "Detail Event",
+ icon: ,
+ },
+ {
+ id: "2",
+ name: "Daftar Peserta",
+ icon: ,
+ },
+ ];
+
+ return (
+ <>
+
+
+ {listPage.map((e) => (
+ setSelectPage(e.id)}
+ style={{
+ transition: "all 0.5s",
+ }}
+ >
+ {e.name}
+
+ ))}
+
+ {selectPage == "1" && }
+ {selectPage == "2" && }
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/event/_view/view_detail_reject.tsx b/src/app_modules/admin/event/_view/view_detail_reject.tsx
new file mode 100644
index 00000000..ef32fece
--- /dev/null
+++ b/src/app_modules/admin/event/_view/view_detail_reject.tsx
@@ -0,0 +1,125 @@
+import {
+ ComponentGlobal_NotifikasiBerhasil,
+ ComponentGlobal_NotifikasiGagal,
+ ComponentGlobal_NotifikasiPeringatan,
+} from "@/app_modules/_global/notif_global";
+import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
+import { Button, Grid, Group, Stack, Textarea, Text} from "@mantine/core";
+import { useDisclosure } from "@mantine/hooks";
+import { IconPencilPlus } from "@tabler/icons-react";
+import { useState } from "react";
+import { Admin_ComponentBoxStyle } from "../../_admin_global/_component/comp_admin_boxstyle";
+import { Admin_ComponentModal } from "../../_admin_global/_component/comp_admin_modal";
+import AdminEvent_ComponentDetailData from "../_component/comp_detail_data";
+import { AdminEvent_funEditCatatanById } from "../fun/edit/fun_edit_status_reject_by_id";
+import { Admin_V3_ComponentDetail } from "../../_components_v3/comp_detail_data";
+
+export function AdminEvent_ViewDetailReject({ data }: { data: MODEL_EVENT }) {
+ const [newData, setNewData] = useState(data);
+ const [catatan, setCatatan] = useState(data.catatan);
+ const [opened, { open, close }] = useDisclosure(false);
+ const [isLoading, setLoading] = useState(false);
+
+ async function handleUpdateReject() {
+ if (catatan === "")
+ return ComponentGlobal_NotifikasiPeringatan("Lengkapi Catatan");
+
+ const body = {
+ id: newData.id,
+ catatan: catatan,
+ };
+
+ try {
+ setLoading(true);
+ const res = await AdminEvent_funEditCatatanById(body as any, "4");
+ if (res.status === 200) {
+ setNewData({
+ ...newData,
+ catatan: catatan,
+ });
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ close();
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ console.log("Error add note reject", error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ return (
+ <>
+
+
+
+
+ {/*
+
+ Catatan report
+
+
+ :
+
+
+ {newData.catatan}
+
+ */}
+
+
+ }
+ radius={"xl"}
+ onClick={open}
+ >
+ Tambah catatan
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/event/_view/view_detail_review.tsx b/src/app_modules/admin/event/_view/view_detail_review.tsx
new file mode 100644
index 00000000..1dfabda6
--- /dev/null
+++ b/src/app_modules/admin/event/_view/view_detail_review.tsx
@@ -0,0 +1,233 @@
+import {
+ ComponentGlobal_NotifikasiBerhasil,
+ ComponentGlobal_NotifikasiGagal,
+ ComponentGlobal_NotifikasiPeringatan,
+} from "@/app_modules/_global/notif_global";
+import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
+import { IRealtimeData } from "@/lib/global_state";
+import { Button, Group, Stack, Textarea } from "@mantine/core";
+import { useDisclosure } from "@mantine/hooks";
+import { IconBan, IconCircleCheck } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { WibuRealtime } from "wibu-pkg";
+import { Admin_ComponentBoxStyle } from "../../_admin_global/_component/comp_admin_boxstyle";
+import { Admin_ComponentModal } from "../../_admin_global/_component/comp_admin_modal";
+import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
+import adminNotifikasi_funCreateToUser from "../../notifikasi/fun/create/fun_create_notif_user";
+import AdminEvent_ComponentDetailData from "../_component/comp_detail_data";
+import { AdminEvent_funEditCatatanById } from "../fun/edit/fun_edit_status_reject_by_id";
+import { event_checkStatus } from "@/app_modules/event/fun/get/fun_check_status_by_id";
+import moment from "moment";
+import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
+import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
+import { AdminEvent_funEditStatusPublishById } from "../fun/edit/fun_edit_status_publish_by_id";
+
+export function AdminEvent_ViewDetailReview({ data }: { data: MODEL_EVENT }) {
+ const router = useRouter();
+ const [openedReject, { open: openReject, close: closeReject }] =
+ useDisclosure();
+ const [openedPublish, { open: openPublish, close: closePublish }] =
+ useDisclosure();
+ const [catatan, setCatatan] = useState("");
+ const [isLoadingReject, setLoadingReject] = useState(false);
+ const [isLoadingPublish, setLoadingPublish] = useState(false);
+
+ async function handleReject() {
+ if (catatan === "")
+ return ComponentGlobal_NotifikasiPeringatan("Lengkapi Catatan");
+
+ try {
+ const body = {
+ id: data.id,
+ catatan: catatan,
+ };
+
+ setLoadingReject(true);
+ const res = await AdminEvent_funEditCatatanById(body as any, "4");
+ if (res.status === 200) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res.data?.id as any,
+ status: res.data?.EventMaster_Status?.name as any,
+ userId: res.data?.authorId as any,
+ pesan: res.data?.title as any,
+ kategoriApp: "EVENT",
+ title: "Event reject",
+ };
+
+ const notif = await adminNotifikasi_funCreateToUser({
+ data: dataNotifikasi as any,
+ });
+
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+ }
+
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ closeReject();
+ router.back();
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ console.log("Error reject event", error);
+ } finally {
+ setLoadingReject(false);
+ }
+ }
+
+ async function handlePublish() {
+ try {
+ setLoadingPublish(true);
+ const checkStatus = await event_checkStatus({ id: data.id });
+
+ if (checkStatus) {
+ if (moment(data.tanggal).diff(Date.now(), "minutes") < 0)
+ return ComponentGlobal_NotifikasiPeringatan(
+ "Waktu acara telah lewat, Report untuk memberitahu user !"
+ );
+
+ const res = await AdminEvent_funEditStatusPublishById(data.id, "1");
+ if (res.status === 200) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res.data?.id as any,
+ status: res.data?.EventMaster_Status?.name as any,
+ userId: res.data?.authorId as any,
+ pesan: res.data?.title as any,
+ kategoriApp: "EVENT",
+ title: "Event publish",
+ };
+
+ const notif = await adminNotifikasi_funCreateToUser({
+ data: dataNotifikasi as any,
+ });
+
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+ }
+ closePublish();
+ ComponentAdminGlobal_NotifikasiBerhasil("Berhasil update status");
+ router.back();
+ } else {
+ closePublish();
+ ComponentAdminGlobal_NotifikasiGagal(res.message);
+ }
+ } else {
+ closePublish();
+ ComponentAdminGlobal_NotifikasiPeringatan(
+ "Review di batalkan oleh user, reload halaman review !"
+ );
+ }
+ } catch (error) {
+ console.log("Error publish event", error);
+ } finally {
+ setLoadingPublish(false);
+ }
+ }
+
+ return (
+ <>
+
+
+
+
+
+ }
+ radius={"xl"}
+ onClick={openPublish}
+ >
+ Publish
+
+
+ }
+ radius={"xl"}
+ onClick={openReject}
+ >
+ Reject
+
+
+
+
+
+ {/* MODAL REJECT */}
+
+
+
+
+
+ {/* MODAL PUBLISH */}
+
+
+
+
+ Batal
+
+ {
+ handlePublish();
+ }}
+ >
+ Simpan
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/event/_view/view_table_review.tsx b/src/app_modules/admin/event/_view/view_table_review.tsx
index 4b9ab12c..e3740df7 100644
--- a/src/app_modules/admin/event/_view/view_table_review.tsx
+++ b/src/app_modules/admin/event/_view/view_table_review.tsx
@@ -1,14 +1,15 @@
-import {
- gs_adminEvent_triggerReview,
- IRealtimeData,
-} from "@/app/lib/global_state";
+import { apiGetDataEventByStatus } from "@/app_modules/admin/event/_lib/api_fecth_admin_event";
+import { gs_adminEvent_triggerReview, IRealtimeData } from "@/lib/global_state";
import { AccentColor } from "@/app_modules/_global/color";
import {
ComponentGlobal_NotifikasiBerhasil,
ComponentGlobal_NotifikasiGagal,
ComponentGlobal_NotifikasiPeringatan,
} from "@/app_modules/_global/notif_global";
-import { MODEL_EVENT } from "@/app_modules/event/model/interface";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
+import { event_checkStatus } from "@/app_modules/event/fun/get/fun_check_status_by_id";
+import { clientLogger } from "@/util/clientLogger";
import {
Affix,
Box,
@@ -26,7 +27,6 @@ import {
Text,
Textarea,
TextInput,
- Title,
} from "@mantine/core";
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
import {
@@ -39,26 +39,26 @@ import { useAtom } from "jotai";
import moment from "moment";
import { useState } from "react";
import { WibuRealtime } from "wibu-pkg";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
+import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
import adminNotifikasi_funCreateToUser from "../../notifikasi/fun/create/fun_create_notif_user";
import { adminEvent_funGetListReview } from "../fun";
import { AdminEvent_funEditStatusPublishById } from "../fun/edit/fun_edit_status_publish_by_id";
import { AdminEvent_funEditCatatanById } from "../fun/edit/fun_edit_status_reject_by_id";
-import { event_checkStatus } from "@/app_modules/event/fun/get/fun_check_status_by_id";
-import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import Admin_DetailButton from "../../_admin_global/_component/button/detail_button";
+import { RouterAdminEvent } from "@/lib/router_admin/router_admin_event";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
-export default function AdminEvent_ComponentTableReview({
- listData,
-}: {
- listData: any;
-}) {
- const [data, setData] = useState(listData.data);
- const [isNPage, setNPage] = useState(listData.nPage);
- const [isActivePage, setActivePage] = useState(1);
+export default function AdminEvent_ComponentTableReview() {
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
+ const [activePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
const [isLoading, setIsLoading] = useState(false);
-
+ const [isModal, setModal] = useState(false);
const [opened, { open, close }] = useDisclosure(false);
const [catatan, setCatatan] = useState("");
const [eventId, setEventId] = useState("");
@@ -70,37 +70,41 @@ export default function AdminEvent_ComponentTableReview({
const [isShowReload, setIsShowReload] = useState(false);
useShallowEffect(() => {
- if (isAdminTriggerReview) {
- setIsShowReload(true);
+ loadInitialData();
+ }, [activePage, isSearch]);
+
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetDataEventByStatus({
+ name: "Review",
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
}
- }, [isAdminTriggerReview, setIsShowReload]);
+ };
- async function onSearch(s: string) {
- setSearch(s);
- const loadData = await adminEvent_funGetListReview({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ const onSearch = async (searchTerm: string) => {
+ setSearch(searchTerm);
+ setActivePage(1);
+ };
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminEvent_funGetListReview({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
async function onLoadData() {
- const loadData = await adminEvent_funGetListReview({
- page: 1,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
+ loadInitialData();
setIsLoading(false);
setIsShowReload(false);
setIsAdminTriggerReview(false);
@@ -108,21 +112,22 @@ export default function AdminEvent_ComponentTableReview({
async function onPublish({
eventId,
- tanggalSelesai,
+ tanggal,
}: {
eventId: string;
- tanggalSelesai: Date;
+ tanggal: Date;
}) {
const checkStatus = await event_checkStatus({ id: eventId });
if (checkStatus) {
- if (moment(tanggalSelesai).diff(Date.now(), "minutes") < 0)
+ if (moment(tanggal).diff(Date.now(), "minutes") < 0)
return ComponentGlobal_NotifikasiPeringatan(
"Waktu acara telah lewat, Report untuk memberitahu user !"
);
const res = await AdminEvent_funEditStatusPublishById(eventId, "1");
if (res.status === 200) {
+ setIsLoading(true);
const dataNotifikasi: IRealtimeData = {
appId: res.data?.id as any,
status: res.data?.EventMaster_Status?.name as any,
@@ -150,18 +155,32 @@ export default function AdminEvent_ComponentTableReview({
});
}
- const loadData = await adminEvent_funGetListReview({
- search: isSearch,
- page: isActivePage,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
+ try {
+ const response = await apiGetDataEventByStatus({
+ name: "Review",
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
ComponentAdminGlobal_NotifikasiBerhasil("Berhasil update status");
} else {
+ setModal(false);
+ setIsLoading(false);
ComponentAdminGlobal_NotifikasiGagal(res.message);
}
} else {
+ setModal(false);
ComponentAdminGlobal_NotifikasiPeringatan(
"Review di batalkan oleh user, reload halaman review !"
);
@@ -199,12 +218,25 @@ export default function AdminEvent_ComponentTableReview({
});
}
- const loadData = await adminEvent_funGetListReview({
- search: isSearch,
- page: isActivePage,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
+ try {
+ const response = await apiGetDataEventByStatus({
+ name: "Review",
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
+
ComponentGlobal_NotifikasiBerhasil(res.message);
close();
} else {
@@ -212,206 +244,200 @@ export default function AdminEvent_ComponentTableReview({
}
}
- const TableRows = data.map((e, i) => (
-
- |
-
- {e?.Author?.username}
-
- |
-
-
- {e.title}
-
- |
-
-
- {e.lokasi}
-
- |
-
-
- {e.EventMaster_TipeAcara.name}
-
- |
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
-
-
-
- {" "}
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "full",
- }).format(e?.tanggal)}
- ,{" "}
-
+ return data.map((e, i) => (
+
+ |
+
+
+ {e?.Author?.username}
+
+
+ |
+
+
+
+ {e.title}
+
+
+ |
+
+
+
{new Intl.DateTimeFormat("id-ID", {
- timeStyle: "short",
- }).format(e?.tanggal)}
+ dateStyle: "full",
+ }).format(new Date(e?.tanggal))}
+ ,{" "}
+
+ {new Intl.DateTimeFormat("id-ID", {
+ timeStyle: "short",
+ }).format(new Date(e?.tanggal))}
+
-
-
- |
-
-
-
- {" "}
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "full",
- }).format(e?.tanggalSelesai)}
- ,{" "}
-
+
+ |
+
+
+
{new Intl.DateTimeFormat("id-ID", {
- timeStyle: "short",
- }).format(e?.tanggalSelesai)}
+ dateStyle: "full",
+ }).format(new Date(e?.tanggalSelesai))}
+ ,{" "}
+
+ {new Intl.DateTimeFormat("id-ID", {
+ timeStyle: "short",
+ }).format(new Date(e?.tanggalSelesai))}
+
-
-
- |
-
-
-
-
- {e.deskripsi}
-
-
- |
+
+
-
-
-
- }
- radius={"xl"}
- onClick={() =>
- onPublish({
- eventId: e.id,
- tanggalSelesai: e.tanggalSelesai,
- })
- }
- >
- Publish
-
- }
- radius={"xl"}
- onClick={async () => {
- const checkStatus = await event_checkStatus({ id: eventId });
-
- if (checkStatus) {
- open();
- setEventId(e.id);
- } else {
- ComponentAdminGlobal_NotifikasiPeringatan(
- "Review di batalkan oleh user, muat kembali halaman ini !"
- );
+ {/* |
+
+
+ }
+ radius={"xl"}
+ onClick={() =>
+ onPublish({
+ eventId: e.id,
+ tanggal: e.tanggal,
+ })
}
- }}
- >
- Reject
-
-
-
- |
- |
- ));
+ >
+ Publish
+
+ }
+ radius={"xl"}
+ onClick={async () => {
+ const checkStatus = await event_checkStatus({ id: e.id });
+
+ if (checkStatus) {
+ open();
+ setEventId(e.id);
+ } else {
+ ComponentAdminGlobal_NotifikasiPeringatan(
+ "Review di batalkan oleh user, muat kembali halaman ini !"
+ );
+ }
+ }}
+ >
+ Reject
+
+
+
+ | */}
+
+
+
+
+
+ |
+
+ ));
+ };
return (
<>
-
- Review
- }
- radius={"xl"}
- placeholder="Masukan judul"
- onChange={(val) => {
- onSearch(val.currentTarget.value);
- }}
- />
-
-
-
- {isShowReload && (
-
-
- onLoadData()}
- leftIcon={}
- >
- Update Data
-
-
-
- )}
-
-
-
-
-
- |
- Username
- |
-
- Judul
- |
-
- Lokasi
- |
-
- Tipe Acara
- |
-
- Tanggal & Waktu Mulai
- |
-
- Tanggal & Waktu Selesai
- |
-
- Deskripsi
- |
-
-
- Aksi
- |
-
-
- {TableRows}
-
-
-
-
- }
+ radius={"xl"}
+ placeholder="Masukan judul"
onChange={(val) => {
- onPageClick(val);
+ onSearch(val.currentTarget.value);
}}
/>
-
-
+ }
+ />
+
+ {!data ? (
+
+ ) : (
+
+ {isShowReload && (
+
+
+ onLoadData()}
+ leftIcon={}
+ >
+ Update Data
+
+
+
+ )}
+
+
+
+
+
+ |
+ Username
+ |
+
+ Judul
+ |
+
+
+
+ Tanggal & Waktu Mulai
+
+ |
+
+
+ Tanggal & Waktu Selesai
+
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+
+ {
+ onPageClick(val);
+ }}
+ />
+
+ )}
+
+ {/* setModal(false)}
+ centered
+ withCloseButton={false}
+ size={"md"}
+ >
+
+
+
+ Batal
+
+ {
+ // onPublish(eventId, tanggal);
+ // }}
+ >
+ Simpan
+
+
+
+ */}
>
);
}
diff --git a/src/app_modules/admin/event/_view/view_table_review.txt b/src/app_modules/admin/event/_view/view_table_review.txt
new file mode 100644
index 00000000..12e72c4c
--- /dev/null
+++ b/src/app_modules/admin/event/_view/view_table_review.txt
@@ -0,0 +1,510 @@
+import { apiGetDataEventByStatus } from "@/app_modules/admin/event/_lib/api_fecth_admin_event";
+import {
+ gs_adminEvent_triggerReview,
+ IRealtimeData,
+} from "@/lib/global_state";
+import { AccentColor } from "@/app_modules/_global/color";
+import {
+ ComponentGlobal_NotifikasiBerhasil,
+ ComponentGlobal_NotifikasiGagal,
+ ComponentGlobal_NotifikasiPeringatan,
+} from "@/app_modules/_global/notif_global";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
+import { event_checkStatus } from "@/app_modules/event/fun/get/fun_check_status_by_id";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ Affix,
+ Box,
+ Button,
+ Center,
+ Group,
+ Modal,
+ Pagination,
+ Paper,
+ rem,
+ ScrollArea,
+ Spoiler,
+ Stack,
+ Table,
+ Text,
+ Textarea,
+ TextInput,
+} from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import {
+ IconBan,
+ IconCircleCheck,
+ IconEyeCheck,
+ IconRefresh,
+ IconSearch,
+} from "@tabler/icons-react";
+import { useAtom } from "jotai";
+import moment from "moment";
+import { useState } from "react";
+import { WibuRealtime } from "wibu-pkg";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
+import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
+import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
+import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
+import adminNotifikasi_funCreateToUser from "../../notifikasi/fun/create/fun_create_notif_user";
+import { adminEvent_funGetListReview } from "../fun";
+import { AdminEvent_funEditStatusPublishById } from "../fun/edit/fun_edit_status_publish_by_id";
+import { AdminEvent_funEditCatatanById } from "../fun/edit/fun_edit_status_reject_by_id";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+
+export default function AdminEvent_ComponentTableReview() {
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
+ const [activePage, setActivePage] = useState(1);
+ const [isSearch, setSearch] = useState("");
+ const [isLoading, setIsLoading] = useState(false);
+ const [isModal, setModal] = useState(false);
+ const [opened, { open, close }] = useDisclosure(false);
+ const [catatan, setCatatan] = useState("");
+ const [eventId, setEventId] = useState("");
+
+ // Realtime state
+ const [isAdminTriggerReview, setIsAdminTriggerReview] = useAtom(
+ gs_adminEvent_triggerReview
+ );
+ const [isShowReload, setIsShowReload] = useState(false);
+
+ useShallowEffect(() => {
+ loadInitialData();
+ }, [activePage, isSearch]);
+
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetDataEventByStatus({
+ name: "Review",
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
+ };
+
+ const onSearch = async (searchTerm: string) => {
+ setSearch(searchTerm);
+ setActivePage(1);
+ };
+
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
+
+ async function onLoadData() {
+ loadInitialData();
+ setIsLoading(false);
+ setIsShowReload(false);
+ setIsAdminTriggerReview(false);
+ }
+
+ async function onPublish({
+ eventId,
+ tanggal,
+ }: {
+ eventId: string;
+ tanggal: Date;
+ }) {
+ const checkStatus = await event_checkStatus({ id: eventId });
+
+ if (checkStatus) {
+ if (moment(tanggal).diff(Date.now(), "minutes") < 0)
+ return ComponentGlobal_NotifikasiPeringatan(
+ "Waktu acara telah lewat, Report untuk memberitahu user !"
+ );
+
+ const res = await AdminEvent_funEditStatusPublishById(eventId, "1");
+ if (res.status === 200) {
+ setIsLoading(true);
+ const dataNotifikasi: IRealtimeData = {
+ appId: res.data?.id as any,
+ status: res.data?.EventMaster_Status?.name as any,
+ userId: res.data?.authorId as any,
+ pesan: res.data?.title as any,
+ kategoriApp: "EVENT",
+ title: "Event publish",
+ };
+
+ const notif = await adminNotifikasi_funCreateToUser({
+ data: dataNotifikasi as any,
+ });
+
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+ }
+
+ try {
+ const response = await apiGetDataEventByStatus({
+ name: "Review",
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
+
+ ComponentAdminGlobal_NotifikasiBerhasil("Berhasil update status");
+ } else {
+ setModal(false);
+ setIsLoading(false);
+ ComponentAdminGlobal_NotifikasiGagal(res.message);
+ }
+ } else {
+ setModal(false);
+ ComponentAdminGlobal_NotifikasiPeringatan(
+ "Review di batalkan oleh user, reload halaman review !"
+ );
+ }
+ }
+
+ async function onReject(eventId: string, catatan: string) {
+ if (catatan === "")
+ return ComponentGlobal_NotifikasiPeringatan("Lengkapi Catatan");
+ const body = {
+ id: eventId,
+ catatan: catatan,
+ };
+
+ const res = await AdminEvent_funEditCatatanById(body as any, "4");
+ if (res.status === 200) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res.data?.id as any,
+ status: res.data?.EventMaster_Status?.name as any,
+ userId: res.data?.authorId as any,
+ pesan: res.data?.title as any,
+ kategoriApp: "EVENT",
+ title: "Event reject",
+ };
+
+ const notif = await adminNotifikasi_funCreateToUser({
+ data: dataNotifikasi as any,
+ });
+
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+ }
+
+ try {
+ const response = await apiGetDataEventByStatus({
+ name: "Review",
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
+
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ close();
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ }
+
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+
+ return data.map((e, i) => (
+
+ |
+
+ {e?.Author?.username}
+
+ |
+
+
+ {e.title}
+
+ |
+
+
+ {e.lokasi}
+
+ |
+
+
+
+
+
+
+
+ {new Intl.DateTimeFormat("id-ID", {
+ dateStyle: "full",
+ }).format(new Date(e?.tanggal))}
+ ,{" "}
+
+ {new Intl.DateTimeFormat("id-ID", {
+ timeStyle: "short",
+ }).format(new Date(e?.tanggal))}
+
+
+
+ -
+
+
+ {new Intl.DateTimeFormat("id-ID", {
+ dateStyle: "full",
+ }).format(new Date(e?.tanggalSelesai))}
+ ,{" "}
+
+ {new Intl.DateTimeFormat("id-ID", {
+ timeStyle: "short",
+ }).format(new Date(e?.tanggalSelesai))}
+
+
+
+
+
+ |
+
+
+
+ }
+ radius={"xl"}
+ // onClick={() =>
+ // onPublish({
+ // eventId: e.id,
+ // tanggal: e.tanggal,
+ // })
+ // }
+ >
+ Detail
+
+ {/* }
+ radius={"xl"}
+ onClick={async () => {
+ const checkStatus = await event_checkStatus({ id: e.id });
+
+ if (checkStatus) {
+ open();
+ setEventId(e.id);
+ } else {
+ ComponentAdminGlobal_NotifikasiPeringatan(
+ "Review di batalkan oleh user, muat kembali halaman ini !"
+ );
+ }
+ }}
+ >
+ Reject
+ */}
+
+
+ |
+
+ ));
+ };
+
+
+ return (
+ <>
+
+ }
+ radius={"xl"}
+ placeholder="Masukan judul"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
+
+
+
+ {!data ? (
+
+ ) : (
+
+ {isShowReload && (
+
+
+ onLoadData()}
+ leftIcon={}
+ >
+ Update Data
+
+
+
+ )}
+
+
+
+
+
+ |
+ Username
+ |
+
+ Judul
+ |
+
+ Lokasi
+ |
+
+ Tanggal & Waktu Mulai - Selesai
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+
+
+ {
+ onPageClick(val);
+ }}
+ />
+
+
+ )}
+
+
+
+
+
+
+
+ {/* setModal(false)}
+ centered
+ withCloseButton={false}
+ size={"md"}
+ >
+
+
+
+ Batal
+
+ {
+ // onPublish(eventId, tanggal);
+ // }}
+ >
+ Simpan
+
+
+
+ */}
+ >
+ );
+}
diff --git a/src/app_modules/admin/event/child/riwayat.tsx b/src/app_modules/admin/event/child/riwayat.tsx
index 1bee7757..6e00f88e 100644
--- a/src/app_modules/admin/event/child/riwayat.tsx
+++ b/src/app_modules/admin/event/child/riwayat.tsx
@@ -1,165 +1,168 @@
"use client";
-import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
-import { MODEL_EVENT } from "@/app_modules/event/model/interface";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { apiGetAdminEventRiwayat } from "@/app_modules/admin/event/_lib/api_fecth_admin_event";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
+import { RouterAdminEvent } from "@/lib/router_admin/router_admin_event";
+import { clientLogger } from "@/util/clientLogger";
import {
- Button,
+ Box,
Center,
Group,
- Pagination,
Paper,
ScrollArea,
- Spoiler,
Stack,
Table,
Text,
TextInput,
- Title,
+ Title
} from "@mantine/core";
-import { IconCircleCheck, IconSearch } from "@tabler/icons-react";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconSearch } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import Admin_DetailButton from "../../_admin_global/_component/button/detail_button";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
-import { adminEvent_funGetListAllRiwayat } from "../fun";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
-export default function AdminEvent_Riwayat({
- listRiwayat,
-}: {
- listRiwayat: any;
-}) {
+export default function AdminEvent_Riwayat() {
return (
<>
-
+
>
);
}
-function DetailRiwayat({ listRiwayat }: { listRiwayat: any }) {
+function DetailRiwayat() {
const router = useRouter();
const [eventId, setEventId] = useState("");
const [loading, setLoading] = useState(false);
- const [data, setData] = useState(listRiwayat.data);
- const [isNPage, setNPage] = useState(listRiwayat.nPage);
- const [isActivePage, setActivePage] = useState(1);
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
+ const [activePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
- async function onSearch(s: string) {
- setSearch(s);
- const loadData = await adminEvent_funGetListAllRiwayat({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ useShallowEffect(() => {
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminEventRiwayat({
+ page: `${activePage}`,
+ search: isSearch,
+ });
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminEvent_funGetListAllRiwayat({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
+ };
- const TableRows = data.map((e, i) => (
-
- |
- }
- radius={"xl"}
- onClick={() => {
- setEventId(e.id);
- setLoading(true);
- router.push(RouterAdminEvent.detail_peserta + e.id);
- }}
- >
- Lihat Peserta
-
- |
+ loadInitialData();
+ }, [activePage, isSearch]);
-
-
- {e?.Author?.username}
-
- |
-
-
- {e.title}
-
- |
-
-
- {e.lokasi}
-
- |
-
-
- {e.EventMaster_TipeAcara.name}
-
- |
+ const onSearch = async (searchTerm: string) => {
+ setSearch(searchTerm);
+ setActivePage(1);
+ };
-
-
-
- {" "}
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "full",
- }).format(e?.tanggal)}
- ,{" "}
-
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
+
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+
+ return data.map((e, i) => (
+
+ |
+
+
+ {e?.Author?.username}
+
+
+ |
+
+
+
+ {e.title}
+
+
+ |
+
+
+
{new Intl.DateTimeFormat("id-ID", {
- timeStyle: "short",
- }).format(e?.tanggal)}
+ dateStyle: "full",
+ }).format(new Date(e?.tanggal))}
+ ,{" "}
+
+ {new Intl.DateTimeFormat("id-ID", {
+ timeStyle: "short",
+ }).format(new Date(e?.tanggal))}
+
-
-
- |
-
-
-
- {" "}
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "full",
- }).format(e?.tanggalSelesai)}
- ,{" "}
-
+
+ |
+
+
+
{new Intl.DateTimeFormat("id-ID", {
- timeStyle: "short",
- }).format(e?.tanggalSelesai)}
+ dateStyle: "full",
+ }).format(new Date(e?.tanggalSelesai))}
+ ,{" "}
+
+ {new Intl.DateTimeFormat("id-ID", {
+ timeStyle: "short",
+ }).format(new Date(e?.tanggalSelesai))}
+
-
-
- |
+
+
-
-
-
- {e.deskripsi}
-
-
- |
-
- ));
+
+
+
+
+ |
+ |
+ ));
+ };
return (
<>
- Riwayat
+
+ Riwayat
+
}
radius={"xl"}
@@ -170,58 +173,53 @@ function DetailRiwayat({ listRiwayat }: { listRiwayat: any }) {
/>
-
-
-
-
-
- |
- Aksi
- |
-
- Username
- |
-
- Judul
- |
-
- Lokasi
- |
-
- Tipe Acara
- |
-
- Tanggal & Waktu Mulai
- |
-
- Tanggal & Waktu Selesai
- |
-
- Deskripsi
- |
-
-
- {TableRows}
-
-
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Username
+ |
+
+ Judul
+ |
+
+
+ Tanggal & Waktu Mulai
+
+ |
+
+
+ Tanggal & Waktu Selesai
+
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
-
- {
onPageClick(val);
}}
/>
-
-
+
+ )}
>
);
diff --git a/src/app_modules/admin/event/child/tipe_acara.tsx b/src/app_modules/admin/event/child/tipe_acara.tsx
index 77e37a58..f90fb89f 100644
--- a/src/app_modules/admin/event/child/tipe_acara.tsx
+++ b/src/app_modules/admin/event/child/tipe_acara.tsx
@@ -1,9 +1,12 @@
"use client";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
+import { apiGetAdminEventTipeAcara } from "@/app_modules/admin/event/_lib/api_fecth_admin_event";
import { MODEL_DEFAULT_MASTER_OLD } from "@/app_modules/model_global/interface";
+import { clientLogger } from "@/util/clientLogger";
import {
ActionIcon,
Button,
@@ -11,43 +14,36 @@ import {
Group,
Modal,
Paper,
- SimpleGrid,
Stack,
Text,
TextInput,
Title,
} from "@mantine/core";
-import { useDisclosure } from "@mantine/hooks";
-import { IconCirclePlus, IconEditCircle, IconTrash } from "@tabler/icons-react";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { IconEdit, IconEditCircle, IconTrash } from "@tabler/icons-react";
import { useState } from "react";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import { Admin_V3_ComponentBreakpoint } from "../../_components_v3/comp_simple_grid_breakpoint";
+import { Admin_V3_ComponentSkeletonBreakpoint } from "../../_components_v3/comp_skeleton_breakpoint";
import { AdminEvent_funCreateTipeAcara } from "../fun/create/fun_create_tipe_acara";
import { AdminEvent_funEditActivationTipeAcaraById } from "../fun/edit/fun_edit_activation_tipe_acara";
import { AdminEvent_funEditTipeAcara } from "../fun/edit/fun_edit_tipe_acara";
import { AdminEvent_getListTipeAcara } from "../fun/get/get_list_tipe_acara";
-export default function AdminEvent_DetailTipeAcara({
- listTipe,
-}: {
- listTipe: any;
-}) {
+export default function AdminEvent_DetailTipeAcara() {
return (
<>
-
-
+
>
);
}
-function DetailTipeAcara({
- listTipe,
-}: {
- listTipe: MODEL_DEFAULT_MASTER_OLD[];
-}) {
- const [tipe, setTipe] = useState(listTipe);
+function DetailTipeAcara() {
+ const [tipe, setTipe] = useState(null);
const [name, setName] = useState("");
const [openEditor, setOpenEditor] = useState(false);
const [edit, setEdit] = useState(null);
@@ -56,7 +52,25 @@ function DetailTipeAcara({
id: "",
name: "",
});
- const [openCreate, setOpenCreate] = useState(false);
+ const [openCreate, setOpenCreate] = useState(true);
+
+ const [isLoadingCreate, setIsLoadingCreate] = useState(false);
+ const [isLoadingUpdate, setIsLoadingUpdate] = useState(false);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetAdminEventTipeAcara();
+ if (respone) {
+ setTipe(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get tipe acara", error);
+ }
+ }
return (
<>
@@ -81,13 +95,18 @@ function DetailTipeAcara({
-
+
+ {/*
- Tipe Acara
+ Tipe Acara
}
radius={"xl"}
@@ -99,137 +118,148 @@ function DetailTipeAcara({
>
Tambah
-
+ */}
-
-
-
-
- Tipe Acara Yang Tersedia
-
- {tipe.map((e, i) => (
-
-
- {e.name}
-
- {
- setOpenEditor(true);
- setOpenCreate(false);
- setEdit(e);
- }}
- >
-
- {" "}
- {
- open();
- setHapusTipe({
- ...hapusTipe,
- id: e.id,
- name: e.name,
- });
- }}
- >
-
-
-
-
-
-
- ))}
-
-
-
-
-
- {openCreate ? (
+ {!tipe ? (
+
+ ) : (
+
-
-
- {
- setName(val.currentTarget.value);
- }}
- />
-
- setOpenCreate(false)}>
- Batal
-
-
+
+ {
+ setName(val.currentTarget.value);
}}
- color="green"
- radius={"xl"}
- onClick={() => onSave(name, setName, setTipe)}
- >
- Simpan
-
-
-
-
-
- ) : (
- ""
- )}
-
-
- {openEditor ? (
-
-
- {
- setEdit({
- ...(edit as any),
- namaBank: val.target.value,
- });
- }}
- />
-
-
- setOpenEditor(false)}>
+ />
+
+ {/* setOpenCreate(false)}>
Batal
-
+ */}
- onUpdate(edit?.id, edit?.name, setTipe, setOpenEditor)
- }
+ radius={"xl"}
+ onClick={() => onSave(name, setName, setTipe)}
>
- Update
+ Simpan
-
+
+
+ )}
+
+ {openEditor && (
+
+
+ {
+ setEdit({
+ ...(edit as any),
+ name: val.target.value,
+ });
+ }}
+ />
+
+
+ {
+ setOpenEditor(false), setOpenCreate(true);
+ }}
+ >
+ Batal
+
+
+ onUpdate(
+ edit?.id,
+ edit?.name,
+ setTipe,
+ setOpenEditor,
+ setOpenCreate
+ )
+ }
+ >
+ Update
+
+
+
+
+
+ )}
+
+
+
+
+
+
+ Tipe Acara Yang Tersedia{" "}
+
+
+
+ {tipe.map((e, i) => (
+
+
+
+ {e.name}
+
+
+ {
+ setOpenEditor(true);
+ setOpenCreate(false);
+ setEdit(e);
+ }}
+ >
+
+ {" "}
+ {/* {
+ open();
+ setHapusTipe({
+ ...hapusTipe,
+ id: e.id,
+ name: e.name,
+ });
+ }}
+ >
+
+ */}
+
+
+
+
+ ))}
+
+
- ) : (
- ""
- )}
-
-
+
+
+ )}
>
);
}
@@ -251,13 +281,20 @@ async function onSave(name: string, setName: any, setTipe: any) {
});
}
-async function onUpdate(id: any, edit: any, setTipe: any, setOpenEditor: any) {
+async function onUpdate(
+ id: any,
+ edit: any,
+ setTipe: any,
+ setOpenEditor: any,
+ setOpenCreate: any
+) {
await AdminEvent_funEditTipeAcara(id, edit).then(async (res) => {
if (res.status === 200) {
await AdminEvent_getListTipeAcara().then((val) => {
setTipe(val);
ComponentGlobal_NotifikasiBerhasil(res.message);
setOpenEditor(false);
+ setOpenCreate(true);
});
} else {
ComponentGlobal_NotifikasiGagal(res.message);
diff --git a/src/app_modules/admin/event/fun/count/fun_count_event_by_status_id.ts b/src/app_modules/admin/event/fun/count/fun_count_event_by_status_id.ts
index 0246c7ac..39a4c950 100644
--- a/src/app_modules/admin/event/fun/count/fun_count_event_by_status_id.ts
+++ b/src/app_modules/admin/event/fun/count/fun_count_event_by_status_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
/**
*
diff --git a/src/app_modules/admin/event/fun/count/fun_count_riwayat.ts b/src/app_modules/admin/event/fun/count/fun_count_riwayat.ts
index 76fb0a0c..b8f2ec65 100644
--- a/src/app_modules/admin/event/fun/count/fun_count_riwayat.ts
+++ b/src/app_modules/admin/event/fun/count/fun_count_riwayat.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function AdminEvent_funCountRiwayat() {
const data = await prisma.event.count({
diff --git a/src/app_modules/admin/event/fun/count/fun_count_tipe_acara.ts b/src/app_modules/admin/event/fun/count/fun_count_tipe_acara.ts
index 590dcb98..178affda 100644
--- a/src/app_modules/admin/event/fun/count/fun_count_tipe_acara.ts
+++ b/src/app_modules/admin/event/fun/count/fun_count_tipe_acara.ts
@@ -1,6 +1,6 @@
"use server"
-import prisma from "@/app/lib/prisma"
+import prisma from "@/lib/prisma"
export async function AdminEvent_funCountTipeAcara() {
const data = await prisma.eventMaster_TipeAcara.count({})
diff --git a/src/app_modules/admin/event/fun/create/fun_create_tipe_acara.ts b/src/app_modules/admin/event/fun/create/fun_create_tipe_acara.ts
index 126d10e8..55f4a7f5 100644
--- a/src/app_modules/admin/event/fun/create/fun_create_tipe_acara.ts
+++ b/src/app_modules/admin/event/fun/create/fun_create_tipe_acara.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function AdminEvent_funCreateTipeAcara(name: string) {
diff --git a/src/app_modules/admin/event/fun/edit/fun_edit_activation_tipe_acara.ts b/src/app_modules/admin/event/fun/edit/fun_edit_activation_tipe_acara.ts
index 86980a97..d63cec78 100644
--- a/src/app_modules/admin/event/fun/edit/fun_edit_activation_tipe_acara.ts
+++ b/src/app_modules/admin/event/fun/edit/fun_edit_activation_tipe_acara.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function AdminEvent_funEditActivationTipeAcaraById(id: number) {
diff --git a/src/app_modules/admin/event/fun/edit/fun_edit_status_publish_by_id.ts b/src/app_modules/admin/event/fun/edit/fun_edit_status_publish_by_id.ts
index 01d85962..aee0565a 100644
--- a/src/app_modules/admin/event/fun/edit/fun_edit_status_publish_by_id.ts
+++ b/src/app_modules/admin/event/fun/edit/fun_edit_status_publish_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function AdminEvent_funEditStatusPublishById(
diff --git a/src/app_modules/admin/event/fun/edit/fun_edit_status_reject_by_id.ts b/src/app_modules/admin/event/fun/edit/fun_edit_status_reject_by_id.ts
index 28961c33..4740f1d2 100644
--- a/src/app_modules/admin/event/fun/edit/fun_edit_status_reject_by_id.ts
+++ b/src/app_modules/admin/event/fun/edit/fun_edit_status_reject_by_id.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { MODEL_EVENT } from "@/app_modules/event/model/interface";
+import prisma from "@/lib/prisma";
+import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
import { revalidatePath } from "next/cache";
export async function AdminEvent_funEditCatatanById(
diff --git a/src/app_modules/admin/event/fun/edit/fun_edit_tipe_acara.ts b/src/app_modules/admin/event/fun/edit/fun_edit_tipe_acara.ts
index 7152f41c..22436ab2 100644
--- a/src/app_modules/admin/event/fun/edit/fun_edit_tipe_acara.ts
+++ b/src/app_modules/admin/event/fun/edit/fun_edit_tipe_acara.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function AdminEvent_funEditTipeAcara(id: number, name: string) {
diff --git a/src/app_modules/admin/event/fun/get/get_list_all_riwayat.ts b/src/app_modules/admin/event/fun/get/get_list_all_riwayat.ts
index 02551435..3b800fe7 100644
--- a/src/app_modules/admin/event/fun/get/get_list_all_riwayat.ts
+++ b/src/app_modules/admin/event/fun/get/get_list_all_riwayat.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _, { ceil } from "lodash";
export async function adminEvent_funGetListAllRiwayat({
diff --git a/src/app_modules/admin/event/fun/get/get_list_peserta_by_id.ts b/src/app_modules/admin/event/fun/get/get_list_peserta_by_id.ts
index 7809a34a..73a6d235 100644
--- a/src/app_modules/admin/event/fun/get/get_list_peserta_by_id.ts
+++ b/src/app_modules/admin/event/fun/get/get_list_peserta_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { ceil } from "lodash";
export async function adminEvent_getListPesertaById({
@@ -22,6 +22,7 @@ export async function adminEvent_getListPesertaById({
eventId: eventId,
},
select: {
+ isPresent: true,
User: {
include: {
Profile: true,
diff --git a/src/app_modules/admin/event/fun/get/get_list_tipe_acara.ts b/src/app_modules/admin/event/fun/get/get_list_tipe_acara.ts
index 9f2ead65..9999ff75 100644
--- a/src/app_modules/admin/event/fun/get/get_list_tipe_acara.ts
+++ b/src/app_modules/admin/event/fun/get/get_list_tipe_acara.ts
@@ -1,6 +1,6 @@
"use server"
-import prisma from "@/app/lib/prisma"
+import prisma from "@/lib/prisma"
export async function AdminEvent_getListTipeAcara(){
const data = await prisma.eventMaster_TipeAcara.findMany({
diff --git a/src/app_modules/admin/event/fun/get/status/fun_get_list_publish.ts b/src/app_modules/admin/event/fun/get/status/fun_get_list_publish.ts
index 04eb5096..6ddf6012 100644
--- a/src/app_modules/admin/event/fun/get/status/fun_get_list_publish.ts
+++ b/src/app_modules/admin/event/fun/get/status/fun_get_list_publish.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { ComponentAdminGlobal_NotifikasiPeringatan } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_peringatan";
import { ceil } from "lodash";
import moment from "moment";
diff --git a/src/app_modules/admin/event/fun/get/status/fun_get_list_reject.ts b/src/app_modules/admin/event/fun/get/status/fun_get_list_reject.ts
index c4ebc38c..c0006254 100644
--- a/src/app_modules/admin/event/fun/get/status/fun_get_list_reject.ts
+++ b/src/app_modules/admin/event/fun/get/status/fun_get_list_reject.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { ceil } from "lodash";
export async function adminEvent_funGetListReject({
diff --git a/src/app_modules/admin/event/fun/get/status/fun_get_list_review.ts b/src/app_modules/admin/event/fun/get/status/fun_get_list_review.ts
index c5570b64..4de1efc2 100644
--- a/src/app_modules/admin/event/fun/get/status/fun_get_list_review.ts
+++ b/src/app_modules/admin/event/fun/get/status/fun_get_list_review.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { ceil } from "lodash";
export async function adminEvent_funGetListReview({
diff --git a/src/app_modules/admin/event/main/index.tsx b/src/app_modules/admin/event/main/index.tsx
index 7259f6b0..eda87af7 100644
--- a/src/app_modules/admin/event/main/index.tsx
+++ b/src/app_modules/admin/event/main/index.tsx
@@ -1,80 +1,210 @@
"use client";
-import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
+import { RouterAdminEvent } from "@/lib/router_admin/router_admin_event";
import {
- Group,
+ apiGetEventRiwayatCount,
+ apiGetEventStatusCountDashboard,
+ apiGetEventTipeAcara,
+} from "@/app_modules/admin/event/_lib/api_fecth_admin_event";
+import global_limit from "@/lib/limit";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ Flex,
Paper,
SimpleGrid,
Stack,
Text,
- Title
+ ThemeIcon,
+ Title,
} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import {
+ IconAlertTriangle,
+ IconBookmark,
+ IconBriefcase,
+ IconHistory,
+ IconUpload,
+} from "@tabler/icons-react";
import { useRouter } from "next/navigation";
+import { useState } from "react";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
-export default function AdminEvent_Main({
- countPublish,
- countReview,
- countDraft,
- countReject,
- countTipeAcara,
- countRiwayat,
-}: {
- countPublish: number;
- countReview: number;
- countDraft: number;
- countReject: number;
- countTipeAcara: number;
- countRiwayat: number
-}) {
+export default function AdminEvent_Main() {
const router = useRouter();
+ const [countPublish, setCountPublish] = useState(null);
+ const [countReview, setCountReview] = useState(null);
+ const [countReject, setCountReject] = useState(null);
+ const [countTipeAcara, setCountTipeAcara] = useState(null);
+ const [countRiwayat, setCountRiwayat] = useState(null);
+
+ useShallowEffect(() => {
+ handlerLoadData();
+ }, []);
+
+ async function handlerLoadData() {
+ try {
+ const listLoadData = [
+ global_limit(() => onLoadCountPublish()),
+ global_limit(() => onLoadCountReview()),
+ global_limit(() => onLoadCountReject()),
+ global_limit(() => onLoadCountRiwayat()),
+ global_limit(() => onLoadCountTipeAcara()),
+ ];
+ const result = await Promise.all(listLoadData);
+ } catch (error) {
+ clientLogger.error("Error handler load data", error);
+ }
+ }
+
+ async function onLoadCountPublish() {
+ try {
+ const respone = await apiGetEventStatusCountDashboard({
+ name: "Publish",
+ });
+
+ if (respone) {
+ setCountPublish(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count publish", error);
+ }
+ }
+
+ async function onLoadCountReview() {
+ try {
+ const respone = await apiGetEventStatusCountDashboard({
+ name: "Review",
+ });
+
+ if (respone) {
+ setCountReview(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count review", error);
+ }
+ }
+
+ async function onLoadCountReject() {
+ try {
+ const respone = await apiGetEventStatusCountDashboard({
+ name: "Reject",
+ });
+
+ if (respone) {
+ setCountReject(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count reject", error);
+ }
+ }
+
+ async function onLoadCountRiwayat() {
+ try {
+ const respone = await apiGetEventRiwayatCount();
+
+ if (respone) {
+ setCountRiwayat(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count riwayat", error);
+ }
+ }
+
+ async function onLoadCountTipeAcara() {
+ try {
+ const respone = await apiGetEventTipeAcara();
+
+ if (respone) {
+ setCountTipeAcara(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count tipe acara", error);
+ }
+ }
const listStatus = [
{
id: 1,
name: "Publish",
- jumlah: countPublish,
+ jumlah:
+ countPublish == null ? (
+
+ ) : countPublish ? (
+ countPublish
+ ) : (
+ "-"
+ ),
path: RouterAdminEvent.table_publish,
- color: "green",
+ color: MainColor.green,
+ icon: ,
},
{
id: 2,
name: "Review",
- jumlah: countReview,
+ jumlah:
+ countReview == null ? (
+
+ ) : countReview ? (
+ countReview
+ ) : (
+ "-"
+ ),
path: RouterAdminEvent.table_review,
- color: "orange",
+ color: MainColor.orange,
+ icon: ,
+ },
+
+ {
+ id: 3,
+ name: "Reject",
+ jumlah:
+ countReject == null ? (
+
+ ) : countReject ? (
+ countReject
+ ) : (
+ "-"
+ ),
+ path: RouterAdminEvent.table_reject,
+ color: MainColor.red,
+ icon: ,
},
- // {
- // id: 3,
- // name: "Draft",
- // jumlah: countDraft,
- // path: "",
- // color: "yellow",
- // },
{
id: 4,
- name: "Reject",
- jumlah: countReject,
- path: RouterAdminEvent.table_reject,
- color: "red",
+ name: "Riwayat Event",
+ jumlah:
+ countRiwayat == null ? (
+
+ ) : countRiwayat ? (
+ countRiwayat
+ ) : (
+ "-"
+ ),
+ path: RouterAdminEvent.table_publish,
+ color: AccentColor.softblue,
+ icon: ,
},
];
const listBox2 = [
{
id: 1,
- name: "Riwayat Event",
- jumlah: countRiwayat,
- path: RouterAdminEvent.table_publish,
- color: "gray",
- },
- {
- id: 2,
name: "Tipe Acara",
- jumlah: countTipeAcara,
+ jumlah:
+ countTipeAcara == null ? (
+
+ ) : countTipeAcara ? (
+ countTipeAcara
+ ) : (
+ "-"
+ ),
path: RouterAdminEvent.table_publish,
- color: "gray",
+ color: "#A888E2",
+ icon: ,
},
];
@@ -95,18 +225,27 @@ export default function AdminEvent_Main({
{listStatus.map((e, i) => (
-
-
- {e.name}
- {e.jumlah}
-
-
+
+
+ {e.name}
+
+
+ {e.jumlah}
+
+ {e.icon}
+
+
+
))}
@@ -122,18 +261,23 @@ export default function AdminEvent_Main({
{listBox2.map((e, i) => (
-
-
- {e.name}
- {e.jumlah}
-
-
+
+
+ {e.name}
+
+
+ {e.jumlah}
+
+ {e.icon}
+
+
+
))}
diff --git a/src/app_modules/admin/event/table_status/detail_publish.tsx b/src/app_modules/admin/event/table_status/detail_publish.tsx
new file mode 100644
index 00000000..ac1dfa70
--- /dev/null
+++ b/src/app_modules/admin/event/table_status/detail_publish.tsx
@@ -0,0 +1,64 @@
+'use client'
+import { Button, Group, Stack } from '@mantine/core';
+import { IconCircleCheck } from '@tabler/icons-react';
+import { useAtom } from 'jotai';
+import Admin_ComponentBackButton from '../../_admin_global/back_button';
+import AdminEvent_ComponentDetailPublish from '../_component/comp_detail_publish';
+import { gs_admin_event_menu_publish } from '../_lib/global_state';
+import { AdminEvent_ViewDetailPeserta } from '../_view';
+
+function AdminEvent_DetailPublish() {
+ const [selectPage, setSelectPage] = useAtom(gs_admin_event_menu_publish);
+ const listPage = [
+ {
+ id: "1",
+ name: "Detail Event",
+ icon: ,
+ },
+ {
+ id: "2",
+ name: "Daftar Peserta",
+ icon: ,
+ },
+ // {
+ // id: "3",
+ // name: "Daftar Sponsor",
+ // icon: ,
+ // }
+ ]
+ return (
+ <>
+
+
+
+
+ {listPage.map((e) => (
+ setSelectPage(e.id)}
+ style={{
+ transition: "all 0.5s",
+ }}
+ >
+ {e.name}
+
+
+ ))}
+
+ {selectPage == "1" ? (
+
+ ) : null}
+ {selectPage == "2" ? (
+
+ ) : null}
+ {/* {selectPage == "3" ? (
+
+ ) : null} */}
+
+ >
+ );
+}
+
+export default AdminEvent_DetailPublish;
diff --git a/src/app_modules/admin/event/table_status/detail_sponsor.tsx b/src/app_modules/admin/event/table_status/detail_sponsor.tsx
new file mode 100644
index 00000000..2d64bdff
--- /dev/null
+++ b/src/app_modules/admin/event/table_status/detail_sponsor.tsx
@@ -0,0 +1,129 @@
+'use client'
+import { ActionIcon, Badge, Button, Center, Group, Paper, ScrollArea, Select, Stack, Table, Title } from '@mantine/core';
+import React from 'react';
+import Admin_ComponentBackButton from '../../_admin_global/back_button';
+import { IconImageInPicture, IconReload } from '@tabler/icons-react';
+
+const tableRows = [
+ {
+ id: 1,
+ donatur: "Keiko",
+ bank: "BRI",
+ nominal: "Rp. 100.000",
+ tanggal: "Kamis, 16 Januari 2025",
+
+ }
+]
+function AdminEvent_DetailSponsor() {
+ const rows = tableRows.map((row, i) => (
+
+ |
+ {row.donatur}
+ |
+
+ {row.bank}
+ |
+
+ {row.nominal}
+ |
+
+ {row.tanggal}
+ |
+
+
+ Berhasil
+
+ |
+
+
+ Cek
+
+ |
+
+
+ Cek
+
+ |
+
+
+ Terima
+
+ |
+
+ ))
+ return (
+ <>
+
+
+
+
+ Detail Sponsor
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ Nama Sponsor
+ |
+
+ Nama Bank
+ |
+
+ Nominal Sponsor
+ |
+
+ Tanggal
+ |
+
+ Status
+ |
+
+ Bukti Transfer
+ |
+
+ Gambar Sponsor
+ |
+
+ Aksi
+ |
+
+
+ {rows}
+
+
+
+
+
+
+ >
+ );
+}
+
+export default AdminEvent_DetailSponsor;
diff --git a/src/app_modules/admin/event/table_status/table_publish.tsx b/src/app_modules/admin/event/table_status/table_publish.tsx
index 10ec7cd1..1f92f633 100644
--- a/src/app_modules/admin/event/table_status/table_publish.tsx
+++ b/src/app_modules/admin/event/table_status/table_publish.tsx
@@ -1,144 +1,192 @@
"use client";
-import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
-import { MODEL_EVENT } from "@/app_modules/event/model/interface";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { apiGetDataEventByStatus } from "@/app_modules/admin/event/_lib/api_fecth_admin_event";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
+import { RouterAdminEvent } from "@/lib/router_admin/router_admin_event";
+import { clientLogger } from "@/util/clientLogger";
import {
Box,
Button,
Center,
- Group,
- Pagination,
Paper,
ScrollArea,
- Spoiler,
Stack,
Table,
Text,
- TextInput,
- Title,
+ TextInput
} from "@mantine/core";
-import { IconCircleCheck, IconSearch } from "@tabler/icons-react";
-import _ from "lodash";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconDownload, IconSearch } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
+import Admin_DetailButton from "../../_admin_global/_component/button/detail_button";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
-import { adminEvent_funGetListPublish } from "../fun";
-import QRCode from "react-qr-code";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
-export default function AdminEvent_TablePublish({
- listPublish,
-}: {
- listPublish: any;
-}) {
+export default function AdminEvent_TablePublish() {
return (
- <>
-
-
-
-
- >
+
+
+
+
);
}
-function TableStatus({ listPublish }: { listPublish: any }) {
+function TableStatus() {
const router = useRouter();
- const [data, setData] = useState(listPublish.data);
- const [isNPage, setNPage] = useState(listPublish.nPage);
- const [isActivePage, setActivePage] = useState(1);
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
+ const [activePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
const [eventId, setEventId] = useState("");
const [loading, setLoading] = useState(false);
+ const [origin, setOrigin] = useState("");
- async function onSearch(s: string) {
- setSearch(s);
- const loadData = await adminEvent_funGetListPublish({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ useShallowEffect(() => {
+ if (typeof window !== "undefined") {
+ setOrigin(window.location.origin);
+ }
+ }, []);
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminEvent_funGetListPublish({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ useShallowEffect(() => {
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetDataEventByStatus({
+ name: "Publish",
+ page: `${activePage}`,
+ search: isSearch,
+ });
- const TableRows = _.isEmpty(data) ? (
-
- |
- Belum Ada Data
- |
-
- ) : (
- data.map((e, i) => (
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
+ };
+
+ loadInitialData();
+ }, [activePage, isSearch]);
+
+ const onSearch = async (searchTerm: string) => {
+ setSearch(searchTerm);
+ setActivePage(1);
+ };
+
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
+
+ const handleDownloadQR = (id: string, title: string) => {
+ const svg: any = document.getElementById(id);
+ const svgData = new XMLSerializer().serializeToString(svg);
+ const canvas = document.createElement("canvas");
+ const ctx: any = canvas.getContext("2d");
+ const img = new Image();
+ img.onload = () => {
+ canvas.width = img.width;
+ canvas.height = img.height;
+ ctx.drawImage(img, 0, 0);
+ const pngFile = canvas.toDataURL("image/png");
+ const downloadLink = document.createElement("a");
+ downloadLink.download = `QRCode ${title}`;
+ downloadLink.href = `${pngFile}`;
+ downloadLink.click();
+ };
+ img.src = `data:image/svg+xml;base64,${btoa(svgData)}`;
+ };
+
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+
+ return data.map((e, i) => (
+ {/* |
+
+
+
+ | */}
+
-
-
+
+
+ {e?.Author?.username}
+
|
-
- {e?.Author?.username}
+
+
+ {e.title}
+
|
-
-
- {e.title}
-
- |
-
-
+ {/* |
+
{e.lokasi}
|
-
- {e.EventMaster_TipeAcara.name}
+
+ {e.EventMaster_TipeAcara?.name}
- |
+ | */}
-
+
- {" "}
{new Intl.DateTimeFormat("id-ID", {
dateStyle: "full",
- }).format(e?.tanggal)}
+ }).format(new Date(e?.tanggal))}
,{" "}
{new Intl.DateTimeFormat("id-ID", {
timeStyle: "short",
- }).format(e?.tanggal)}
+ }).format(new Date(e?.tanggal))}
|
-
+
- {" "}
{new Intl.DateTimeFormat("id-ID", {
dateStyle: "full",
- }).format(e?.tanggalSelesai)}
+ }).format(new Date(e?.tanggalSelesai))}
,{" "}
{new Intl.DateTimeFormat("id-ID", {
timeStyle: "short",
- }).format(e?.tanggalSelesai)}
+ }).format(new Date(e?.tanggalSelesai))}
|
-
-
+ {/* |
+
+ | */}
+
+ {/*
+ }
+ radius="xl"
+ onClick={() => {
+ setEventId(e.id);
+ setLoading(true);
+ router.push(RouterAdminEvent.detail_publish + e.id);
+ }}
+ >
+ Detail
+
+ | */}
+
+
+
+ }
+ radius="xl"
+ onClick={() => handleDownloadQR(e.id, e.title)}
+ >
+ Download QR
+
+
|
- }
- radius={"xl"}
- onClick={async () => {
- setEventId(e.id);
- setLoading(true);
- router.push(RouterAdminEvent.detail_peserta + e.id);
- }}
- >
- Lihat Peserta
-
+
+
+
|
|
- ))
- );
+ ));
+ };
return (
- <>
-
-
- Publish
+
+ }
- radius={"xl"}
+ radius="xl"
placeholder="Masukan judul"
- onChange={(val) => {
- onSearch(val.currentTarget.value);
- }}
+ value={isSearch}
+ onChange={(e) => onSearch(e.currentTarget.value)}
/>
-
+ }
+ />
-
-
-
+ {!data ? (
+
+ ) : (
+
+
+
|
- QR Code
- |
-
-
- Username
+ Username
|
- Judul
+ Judul
|
- Lokasi
+ Tanggal & Waktu Mulai
|
- Tipe Acara
+
+ Tanggal & Waktu Selesai
+
|
- Tanggal & Waktu Mulai
+ QR Code
|
- Tanggal & Waktu Selesai
- |
-
-
- Deskripsi
- |
-
- Aksi
+ Aksi
|
- {TableRows}
+ {renderTableBody()}
-
- {
- onPageClick(val);
- }}
- />
-
+
-
- >
+ )}
+
);
}
diff --git a/src/app_modules/admin/event/table_status/table_reject.tsx b/src/app_modules/admin/event/table_status/table_reject.tsx
index fd786fd1..8d1d3b3f 100644
--- a/src/app_modules/admin/event/table_status/table_reject.tsx
+++ b/src/app_modules/admin/event/table_status/table_reject.tsx
@@ -1,77 +1,92 @@
"use client";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import { apiGetDataEventByStatus } from "@/app_modules/admin/event/_lib/api_fecth_admin_event";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
+import { RouterAdminEvent } from "@/lib/router_admin/router_admin_event";
+import { clientLogger } from "@/util/clientLogger";
import {
+ Box,
Button,
Center,
Group,
Modal,
- Pagination,
Paper,
ScrollArea,
- Spoiler,
Stack,
Table,
Text,
Textarea,
- TextInput,
- Title,
+ TextInput
} from "@mantine/core";
-import { IconPencilPlus, IconSearch } from "@tabler/icons-react";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { IconSearch } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
-import { useDisclosure } from "@mantine/hooks";
-import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import { MODEL_EVENT } from "@/app_modules/event/model/interface";
import { useState } from "react";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
+import Admin_DetailButton from "../../_admin_global/_component/button/detail_button";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
-import { adminEvent_funGetListReject } from "../fun";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
import { AdminEvent_funEditCatatanById } from "../fun/edit/fun_edit_status_reject_by_id";
-export default function AdminEvent_TableReject({
- listReject,
-}: {
- listReject: any;
-}) {
+export default function AdminEvent_TableReject() {
return (
<>
-
+
>
);
}
-function TableStatus({ listReject }: { listReject: any }) {
+function TableStatus() {
const router = useRouter();
- const [data, setData] = useState(listReject.data);
- const [isNPage, setNPage] = useState(listReject.nPage);
- const [isActivePage, setActivePage] = useState(1);
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
+ const [activePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
const [opened, { open, close }] = useDisclosure(false);
const [eventId, setEventId] = useState("");
const [catatan, setCatatan] = useState("");
- async function onSearch(s: string) {
- setSearch(s);
- const loadData = await adminEvent_funGetListReject({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ useShallowEffect(() => {
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetDataEventByStatus({
+ name: "Reject",
+ page: `${activePage}`,
+ search: isSearch,
+ });
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminEvent_funGetListReject({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
+ };
+
+ loadInitialData();
+ }, [activePage, isSearch]);
+
+ const onSearch = async (searchTerm: string) => {
+ setSearch(searchTerm);
+ setActivePage(1);
+ };
+
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
async function onUpdate(eventId: string, catatan: string) {
const body = {
@@ -80,12 +95,24 @@ function TableStatus({ listReject }: { listReject: any }) {
};
const res = await AdminEvent_funEditCatatanById(body as any, "4");
if (res.status === 200) {
- const loadData = await adminEvent_funGetListReject({
- search: isSearch,
- page: isActivePage,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
+ try {
+ const response = await apiGetDataEventByStatus({
+ name: "Reject",
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
ComponentGlobal_NotifikasiBerhasil(res.message);
close();
} else {
@@ -93,162 +120,177 @@ function TableStatus({ listReject }: { listReject: any }) {
}
}
- const TableRows = data.map((e, i) => (
-
- |
- {e?.Author?.username}
- |
-
- {e.title}
- |
-
- {e.lokasi}
- |
-
- {e.EventMaster_TipeAcara.name}
- |
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
-
-
-
- {" "}
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "full",
- }).format(e?.tanggal)}
- ,{" "}
-
+ return data.map((e, i) => (
+
+ |
+
+
+ {e?.Author?.username}
+
+
+ |
+
+
+
+ {e.title}
+
+
+ |
+
+
+
+
{new Intl.DateTimeFormat("id-ID", {
- timeStyle: "short",
- }).format(e?.tanggal)}
+ dateStyle: "full",
+ }).format(new Date(e?.tanggal))}
+ ,{" "}
+
+ {new Intl.DateTimeFormat("id-ID", {
+ timeStyle: "short",
+ }).format(new Date(e?.tanggal))}
+
-
-
- |
-
-
-
- {" "}
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "full",
- }).format(e?.tanggalSelesai)}
- ,{" "}
-
+
+ |
+
+
+
{new Intl.DateTimeFormat("id-ID", {
- timeStyle: "short",
- }).format(e?.tanggalSelesai)}
+ dateStyle: "full",
+ }).format(new Date(e?.tanggalSelesai))}
+ ,{" "}
+
+ {new Intl.DateTimeFormat("id-ID", {
+ timeStyle: "short",
+ }).format(new Date(e?.tanggalSelesai))}
+
-
-
- |
+
+
-
-
-
- {e.deskripsi}
-
-
- |
-
- {" "}
-
-
- {e.catatan}
-
-
- |
+ {/*
+
+
+ {e.deskripsi}
+
+
+ |
+
+ {" "}
+
+
+ {e.catatan}
+
+
+ | */}
-
- }
- radius={"xl"}
- onClick={() => {
- setEventId(e.id);
- setCatatan(e.catatan);
- open();
- }}
- >
- Tambah Catatan
-
- |
-
- ));
+
+ {/* }
+ radius={"xl"}
+ onClick={() => {
+ setEventId(e.id);
+ setCatatan(e.catatan);
+ open();
+ }}
+ >
+ Tambah Catatan
+ */}
+
+
+ {" "}
+ |
+
+ ));
+ };
return (
<>
-
- Reject
- }
- radius={"xl"}
- placeholder="Masukan judul"
- onChange={(val) => {
- onSearch(val.currentTarget.value);
- }}
- />
-
+ }
+ radius={"xl"}
+ placeholder="Masukan judul"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
-
-
-
-
-
- |
- Username
- |
-
- Judul
- |
-
- Lokasi
- |
-
- Tipe Acara
- |
-
- Tanggal & Waktu Mulai
- |
-
- Tanggal & Waktu Selesai
- |
-
- Cacatan
- |
-
- Deskripsi
- |
-
- Aksi
- |
-
-
- {TableRows}
-
-
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Username
+ |
+
+ Judul
+ |
-
-
+
+ Tanggal & Waktu Mulai
+
+
+
+
+ Tanggal & Waktu Selesai
+
+ |
+
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+
+ {
onPageClick(val);
}}
/>
-
-
+
+ )}
+
+
+
+
+ >
+ );
+}
+
+function TableStatus() {
+ const router = useRouter();
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
+ const [activePage, setActivePage] = useState(1);
+ const [isSearch, setSearch] = useState("");
+
+ const [opened, { open, close }] = useDisclosure(false);
+ const [eventId, setEventId] = useState("");
+ const [catatan, setCatatan] = useState("");
+
+ useShallowEffect(() => {
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetDataEventByStatus({
+ name: "Reject",
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
+ };
+
+ loadInitialData();
+ }, [activePage, isSearch]);
+
+ const onSearch = async (searchTerm: string) => {
+ setSearch(searchTerm);
+ setActivePage(1);
+ };
+
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
+
+ async function onUpdate(eventId: string, catatan: string) {
+ const body = {
+ id: eventId,
+ catatan: catatan,
+ };
+ const res = await AdminEvent_funEditCatatanById(body as any, "4");
+ if (res.status === 200) {
+ try {
+ const response = await apiGetDataEventByStatus({
+ name: "Reject",
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ close();
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ }
+
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+
+ return data.map((e, i) => (
+
+ |
+ {e?.Author?.username}
+ |
+
+ {e.title}
+ |
+
+ {e.lokasi}
+ |
+
+
+
+
+
+ {new Intl.DateTimeFormat("id-ID", {
+ dateStyle: "full",
+ }).format(new Date(e?.tanggal))}
+ ,{" "}
+
+ {new Intl.DateTimeFormat("id-ID", {
+ timeStyle: "short",
+ }).format(new Date(e?.tanggal))}
+
+
+
+
+ -
+
+
+
+ {new Intl.DateTimeFormat("id-ID", {
+ dateStyle: "full",
+ }).format(new Date(e?.tanggalSelesai))}
+ ,{" "}
+
+ {new Intl.DateTimeFormat("id-ID", {
+ timeStyle: "short",
+ }).format(new Date(e?.tanggalSelesai))}
+
+
+
+
+
+ |
+
+
+ }
+ radius={"xl"}
+ onClick={() => {
+ setEventId(e.id);
+ setCatatan(e.catatan);
+ open();
+ }}
+ >
+ Detail
+
+
+ |
+
+ ));
+ };
+
+ return (
+ <>
+
+ }
+ radius={"xl"}
+ placeholder="Masukan judul"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
+
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Username
+ |
+
+ Judul
+ |
+
+ Lokasi
+ |
+
+ Tanggal & Waktu Mulai - Selesai
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+
+
+ {
+ onPageClick(val);
+ }}
+ />
+
+
+ )}
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/event/table_status/table_review.tsx b/src/app_modules/admin/event/table_status/table_review.tsx
index ed12f7e3..41bb448b 100644
--- a/src/app_modules/admin/event/table_status/table_review.tsx
+++ b/src/app_modules/admin/event/table_status/table_review.tsx
@@ -1,24 +1,16 @@
"use client";
-import {
- Stack
-} from "@mantine/core";
+import { Stack } from "@mantine/core";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
import { AdminEvent_ComponentTableReview } from "../_view";
-export default function AdminEvent_TableReview({
- listData,
-}: {
- listData: any;
-}) {
+export default function AdminEvent_TableReview({}: {}) {
return (
<>
-
+
>
);
}
-
-
diff --git a/src/app_modules/admin/forum/component/button_delete.tsx b/src/app_modules/admin/forum/component/button_delete.tsx
index e741108c..0e1fd1ed 100644
--- a/src/app_modules/admin/forum/component/button_delete.tsx
+++ b/src/app_modules/admin/forum/component/button_delete.tsx
@@ -7,6 +7,12 @@ import { useDisclosure } from "@mantine/hooks";
import { IconTrash } from "@tabler/icons-react";
import { useState } from "react";
import { adminForum_funDeletePostingById } from "../fun/delete/fun_delete_posting_by_id";
+import { Admin_ComponentModal } from "../../_admin_global/_component/comp_admin_modal";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
+import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
+import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
export default function ComponentAdminForum_ButtonDeletePosting({
postingId,
@@ -19,28 +25,40 @@ export default function ComponentAdminForum_ButtonDeletePosting({
const [loadingDel2, setLoadingDel2] = useState(false);
async function onDelete() {
- await adminForum_funDeletePostingById(postingId).then((res) => {
- if (res.status === 200) {
- setLoadingDel2(false);
- close();
- ComponentGlobal_NotifikasiBerhasil(res.message);
- onSuccesDelete(true);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
+ try {
+ setLoadingDel2(true);
+
+ await adminForum_funDeletePostingById(postingId).then((res) => {
+ if (res.status === 200) {
+ setLoadingDel2(false);
+ ComponentAdminGlobal_NotifikasiBerhasil(res.message);
+ onSuccesDelete(true);
+ } else {
+ ComponentAdminGlobal_NotifikasiPeringatan(res.message);
+ }
+ });
+ } catch (error) {
+ console.log("error delete", error);
+ ComponentAdminGlobal_NotifikasiGagal(
+ "Terjadi kesalahan, silahkan coba lagi"
+ );
+ } finally {
+ close();
+ setLoadingDel2(false);
+ }
}
return (
<>
-
- Anda yakin menghapus posting ini
+
+ Anda yakin menghapus posting ini ?
+
{
onDelete();
- setLoadingDel2(true);
}}
>
Hapus
-
+
{
+ return (
+ <>
+
+
+
+
+
+ >
+ );
+};
diff --git a/src/app_modules/admin/forum/component/detail_one_komentar.tsx b/src/app_modules/admin/forum/component/detail_one_komentar.tsx
index a2ff9e49..fd4f0dc5 100644
--- a/src/app_modules/admin/forum/component/detail_one_komentar.tsx
+++ b/src/app_modules/admin/forum/component/detail_one_komentar.tsx
@@ -1,6 +1,11 @@
"use client";
-import { MODEL_FORUM_KOMENTAR, MODEL_FORUM_POSTING } from "@/app_modules/forum/model/interface";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { Comp_SetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
+import {
+ MODEL_FORUM_KOMENTAR,
+ MODEL_FORUM_POSTING,
+} from "@/app_modules/forum/model/interface";
import {
Badge,
Box,
@@ -12,53 +17,53 @@ import {
Text,
Title,
} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { AdminForum_CompTableSetHtmlStiker } from "./comp_table_set_html_stiker";
export default function ComponentAdminForum_ViewOneDetailKomentar({
dataKomentar,
}: {
dataKomentar: MODEL_FORUM_KOMENTAR;
}) {
+ useShallowEffect(() => {
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .chat-content img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ `;
+ document.head.appendChild(style);
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(style);
+ };
+ }, []);
+
return (
<>
-
-
-
- Detail Komentar
-
-
-
-
+
-
+
Username:{" "}
{dataKomentar?.Author?.username}
-
{/* */}
-
-
-
-
-
+
-
-
+
>
);
}
diff --git a/src/app_modules/admin/forum/component/detail_one_posting.tsx b/src/app_modules/admin/forum/component/detail_one_posting.tsx
index 13312433..0ae17ea9 100644
--- a/src/app_modules/admin/forum/component/detail_one_posting.tsx
+++ b/src/app_modules/admin/forum/component/detail_one_posting.tsx
@@ -1,43 +1,53 @@
"use client";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import { MODEL_FORUM_POSTING } from "@/app_modules/forum/model/interface";
import {
Badge,
- Box,
- Divider,
Group,
Paper,
- Spoiler,
Stack,
- Text,
- Title,
+ Text
} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { Admin_V3_ComponentBreakpoint } from "../../_components_v3/comp_simple_grid_breakpoint";
+import { AdminForum_CompTableSetHtmlStiker } from "./comp_table_set_html_stiker";
export default function ComponentAdminForum_ViewOneDetailPosting({
dataPosting,
}: {
dataPosting: MODEL_FORUM_POSTING;
}) {
+ useShallowEffect(() => {
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .chat-content img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ `;
+ document.head.appendChild(style);
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(style);
+ };
+ }, []);
+
return (
<>
-
-
-
- Detail Posting
-
-
-
-
-
-
-
-
- Username:{" "}
-
- {dataPosting?.Author?.username}
-
+
+
+
+
+
+ Username:{" "}
+
+ {dataPosting?.Author?.username}
+
+
- {/* */}
-
-
-
-
-
-
-
+
+ {/* */}
-
-
+
+
+
+
>
);
}
diff --git a/src/app_modules/admin/forum/detail/detail_posting.tsx b/src/app_modules/admin/forum/detail/detail_posting.tsx
index 3fc2fd87..ee6a6ae6 100644
--- a/src/app_modules/admin/forum/detail/detail_posting.tsx
+++ b/src/app_modules/admin/forum/detail/detail_posting.tsx
@@ -1,21 +1,20 @@
"use client";
-import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
-import ComponentAdminDonasi_TombolKembali from "@/app_modules/admin/donasi/component/tombol_kembali";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import {
MODEL_FORUM_KOMENTAR,
MODEL_FORUM_POSTING,
} from "@/app_modules/forum/model/interface";
+import { RouterAdminForum } from "@/lib/router_admin/router_admin_forum";
import {
- Badge,
Box,
Button,
Center,
- Grid,
Group,
- Modal,
- Pagination,
Paper,
ScrollArea,
Spoiler,
@@ -25,180 +24,236 @@ import {
TextInput,
Title,
} from "@mantine/core";
-import { IconSearch, IconTrash } from "@tabler/icons-react";
-import { IconFlag3 } from "@tabler/icons-react";
-import _ from "lodash";
-import { useRouter } from "next/navigation";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { IconFlag3, IconSearch, IconTrash } from "@tabler/icons-react";
+import moment from "moment";
+import "moment/locale/id";
+import { useParams, 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/_global/notif_global/notifikasi_berhasil";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import { useDisclosure } from "@mantine/hooks";
-import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
-import { adminForum_getListKomentarById } from "../fun/get/get_list_komentar_by_id";
-import AdminGlobal_ComponentBackButton from "../../_admin_global/back_button";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
+import { Admin_ComponentModal } from "../../_admin_global/_component/comp_admin_modal";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
import ComponentAdminForum_ViewOneDetailPosting from "../component/detail_one_posting";
+import { adminForum_funDeleteKomentarById } from "../fun/delete/fun_delete_komentar_by_id";
+import {
+ apiAdminGetKomentarForumById,
+ apiAdminGetPostingForumById,
+} from "../lib/api_fetch_admin_forum";
+import { AdminForum_CompTableSetHtmlStiker } from "../component/comp_table_set_html_stiker";
+import { Admin_V3_ComponentBreakpoint } from "../../_components_v3/comp_simple_grid_breakpoint";
+
+export default function AdminForum_DetailPosting() {
+ const { id } = useParams();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiAdminGetPostingForumById({ id: id as string });
+ if (response && response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error("Invalid data format received:", error);
+ setData(null);
+ }
+ }
-export default function AdminForum_DetailPosting({
- listKomentar,
- dataPosting,
- countKomentar,
-}: {
- listKomentar: any;
- dataPosting: MODEL_FORUM_POSTING;
- countKomentar: number;
-}) {
return (
<>
- {/* {JSON.stringify(listKomentar, null, 2)} */}
-
-
-
-
+
+
+ {!data ? (
+
+ ) : (
+ <>
+
+
+
+
+ >
+ )}
>
);
}
-
-
function TableKomentar({
- listKomentar,
postingId,
- countKomentar,
+ totalComments,
}: {
- listKomentar: any;
postingId: string;
- countKomentar: number;
+ totalComments: number;
}) {
const router = useRouter();
- const [data, setData] = useState(listKomentar.data);
- const [nPage, setNPage] = useState(listKomentar.nPage);
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
const [isLoadingReport, setLoadingReport] = useState(false);
const [idData, setIdData] = useState("");
+ const [isDelete, setDelete] = useState(false);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, [isSearch, activePage, isDelete]);
+
+ async function handleLoadData() {
+ try {
+ const response = await apiAdminGetKomentarForumById({
+ id: postingId,
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response && response.success) {
+ setData(response.data.data);
+ setDelete(false);
+ setNPage(response.data.nPage || 1);
+ }
+ } catch (error) {
+ console.error("Invalid data format received:", error);
+ setData([]);
+ }
+ }
async function onSearch(s: string) {
setSearch(s);
setActivePage(1);
- const loadData = await adminForum_getListKomentarById({
- postingId: postingId,
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
}
async function onPageClick(p: any) {
setActivePage(p);
- const loadData = await adminForum_getListKomentarById({
- postingId: postingId,
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
}
- const rowTable = data?.map((e, i) => (
-
- |
-
- {e?.Author?.username}
-
- |
-
-
-
- {
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .chat-content img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ `;
+ document.head.appendChild(style);
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(style);
+ };
+ }, []);
+
+ const rowTable = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+
+ return data?.map((e, i) => (
+
+ |
+
+ {e?.Author?.username}
+
+ |
+
+
+ |
+
+
+ {moment(e?.createdAt).format("DD-MM-YYYY")}
+
+ |
+
+
+ = 3 ? "red" : AdminColor.white
+ }
+ fw={"bold"}
+ fz={"lg"}
+ >
+ {e?.Forum_ReportKomentar.length}
+
+
+ |
+
+
+ }
+ onClick={() => {
+ setIdData(e?.id);
+ setLoadingReport(true);
+ router.push(RouterAdminForum.report_komentar + e?.id);
+ }}
+ >
+ Lihat Report
+
+ {
+ setDelete(val);
+ }}
/>
-
-
- |
-
-
-
- {new Intl.DateTimeFormat(["id-ID"], { dateStyle: "medium" }).format(
- e.createdAt
- )}
-
-
- |
-
-
- = 3 ? "red" : "black"}
- fw={"bold"}
- fz={"lg"}
- >
- {e?.Forum_ReportKomentar.length}
-
-
- |
-
-
- }
- onClick={() => {
- setIdData(e?.id);
- setLoadingReport(true);
- router.push(RouterAdminForum.report_komentar + e?.id);
- }}
- >
- Lihat Report
-
-
-
- |
-
- ));
+
+ |
+
+ ));
+ };
return (
<>
-
-
-
- Komentar
-
-
- {`(${countKomentar})`}
-
-
- }
- radius={"xl"}
- placeholder="Cari komentar"
- onChange={(val) => {
- onSearch(val.currentTarget.value);
- }}
- />
-
+
+
+ Komentar:
+
+
+ {totalComments}
+
+
+ }
+ component={
+ }
+ radius={"xl"}
+ placeholder="Cari komentar"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
- {_.isEmpty(data) ? (
-
+ {!data ? (
+
) : (
-
+
|
- Username
+ Username
|
- Komentar
+ Komentar
|
- Tgl Komentar
+ Tgl Komentar
|
- Total Report
+ Total Report
|
- Aksi
+ Aksi
|
- {rowTable}
+ {rowTable()}
-
- {
- onPageClick(val);
- }}
- />
-
+ {
+ onPageClick(val);
+ }}
+ />
)}
@@ -247,7 +298,13 @@ function TableKomentar({
);
}
-function ButtonDeleteKomentar({ komentarId }: { komentarId: string }) {
+function ButtonDeleteKomentar({
+ komentarId,
+ onSuccessDelete,
+}: {
+ komentarId: string;
+ onSuccessDelete: (val: any) => void;
+}) {
const router = useRouter();
const [opened, { open, close }] = useDisclosure(false);
const [loadindDel, setLoadingDel] = useState(false);
@@ -258,7 +315,9 @@ function ButtonDeleteKomentar({ komentarId }: { komentarId: string }) {
if (res.status === 200) {
setLoadingDel(false);
setLoadingDel2(false);
+ onSuccessDelete(true);
ComponentGlobal_NotifikasiBerhasil(res.message);
+
close();
} else {
ComponentGlobal_NotifikasiGagal(res.message);
@@ -267,9 +326,15 @@ function ButtonDeleteKomentar({ komentarId }: { komentarId: string }) {
}
return (
<>
-
+
- Anda yakin menghapus komentar ini ?
+
+ Anda yakin menghapus komentar ini ?
+
{
@@ -294,10 +359,10 @@ function ButtonDeleteKomentar({ komentarId }: { komentarId: string }) {
-
+
{
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/forum/dashboard/publish`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminCountForumReportPosting = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/forum/dashboard/report_posting`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminCountForumReportKomentar = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/forum/dashboard/report_komentar`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+const apiGetAdminForumReportPosting = async ({
+ page,
+ search,
+}: {
+ page?: string;
+ search?: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isPage = page ? `?page=${page}` : "";
+ const isSeach = search ? `&search=${search}` : "";
+ const response = await fetch(`/api/admin/forum/posting${isPage}${isSeach}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+const apiGetAdminForumReportKomentar = async ({
+ page,
+ search,
+}: {
+ page?: string;
+ search?: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isPage = page ? `?page=${page}` : "";
+ const isSeach = search ? `&search=${search}` : "";
+ const response = await fetch(`/api/admin/forum/komentar${isPage}${isSeach}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+const apiGetAdminForumPublish = async ({
+ page,
+ search,
+}: {
+ page?: string;
+ search?: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isPage = page ? `?page=${page}` : "";
+ const isSearch = search ? `&search=${search}` : "";
+ const response = await fetch(
+ `/api/admin/forum/publish/${isPage}${isSearch}`,
+ {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminHasilReportPosting = async ({
+ page,
+ id,
+}: {
+ page?: string;
+ id: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isPage = page ? `?page=${page}` : "";
+ const response = await fetch(
+ `/api/admin/forum/${id}/report_posting${isPage}`,
+ {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ return await response.json().catch(() => null);
+};
+
+const apiAdminGetListKomentarForumById = async ({
+ id,
+ page,
+ search,
+}: {
+ id: string;
+ page?: string;
+ search?: string;
+}) => {
+ try {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const isPage = page ? `?page=${page}` : "";
+ const isSearch = search ? `&search=${search}` : "";
+ const response = await fetch(
+ `/api/admin/forum/${id}/komentar${isPage}${isSearch}`,
+ {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get admin komentar forum",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to get admin komentar forum"
+ );
+ }
+
+ // Return the JSON response
+ const resulst = await response.json();
+ return resulst;
+ } catch (error) {
+ console.error("Error get admin komentar forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiAdminGetPostingForumById = async ({ id }: { id: string }) => {
+ try {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/forum/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get admin posting forum",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to get admin posting forum"
+ );
+ }
+
+ // Return the JSON response
+ const resulst = await response.json();
+ return resulst;
+ } catch (error) {
+ console.error("Error get admin posting forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiAdminGetOneKomentarForumById = async ({ id }: { id: string }) => {
+ try {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/forum/komentar/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get admin komentar forum",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to get admin komentar forum"
+ );
+ }
+
+ // Return the JSON response
+ const resulst = await response.json();
+ return resulst;
+ } catch (error) {
+ console.error("Error get admin komentar forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiAdminGetListReportKomentarById = async ({ id, page }: { id: string; page?: string }) => {
+ try {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/forum/${id}/report-komentar${page ? `?page=${page}` : ""}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get admin list report komentar forum",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to get admin list report komentar forum"
+ );
+ }
+
+ // Return the JSON response
+ const resulst = await response.json();
+ return resulst;
+ } catch (error) {
+ console.error("Error get admin list report komentar forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
diff --git a/src/app_modules/admin/forum/main/dashboard.tsx b/src/app_modules/admin/forum/main/dashboard.tsx
index fc46ab20..b6e11873 100644
--- a/src/app_modules/admin/forum/main/dashboard.tsx
+++ b/src/app_modules/admin/forum/main/dashboard.tsx
@@ -1,58 +1,144 @@
"use client";
-import { Group, Paper, SimpleGrid, Stack, Text, Title } from "@mantine/core";
+import { AccentColor } from "@/app_modules/_global/color";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import global_limit from "@/lib/limit";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ Flex,
+ Paper,
+ SimpleGrid,
+ Stack,
+ Text,
+ ThemeIcon,
+ Title,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconFlag, IconMessageReport, IconUpload } from "@tabler/icons-react";
+import { useState } from "react";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import {
+ apiGetAdminCountForumReportKomentar,
+ apiGetAdminCountForumReportPosting,
+ apiGetAdminForumPublish,
+ apiGetAdminForumPublishCountDasboard,
+ apiGetAdminForumReportKomentar,
+ apiGetAdminForumReportPosting,
+} from "../lib/api_fetch_admin_forum";
-export default function AdminForum_Main({
- countPublish,
- countLaporanPosting,
- countLaporanKomentar,
-}: {
- countPublish: number;
- countLaporanPosting: number;
- countLaporanKomentar: number;
-}) {
+export default function AdminForum_Main() {
return (
<>
-
+
>
);
}
-function ForumMain({
- countPublish,
- countLaporanPosting,
- countLaporanKomentar,
-}: {
- countPublish: number;
- countLaporanPosting: number;
- countLaporanKomentar: number;
-}) {
+function ForumMain() {
+ const [countPublish, setCountPublish] = useState(null);
+ const [countLaporanPosting, setCountLaporanPosting] = useState(
+ null
+ );
+ const [countLaporanKomentar, setCountLaporanKomentar] = useState<
+ number | null
+ >(null);
+
+ useShallowEffect(() => {
+ handlerLoadData();
+ }, []);
+
+ async function handlerLoadData() {
+ try {
+ const listLoadData = [
+ global_limit(() => onLoadCountPublish()),
+ global_limit(() => onLoadCountReportPosting()),
+ global_limit(() => onLoadCountReportKomentar()),
+ ];
+ const result = await Promise.all(listLoadData);
+ } catch (error) {
+ clientLogger.error("Error handler load data", error);
+ }
+ }
+
+ async function onLoadCountPublish() {
+ try {
+ const response = await apiGetAdminForumPublish({});
+ if (response) {
+ setCountPublish(response.data.length);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count publish", error);
+ }
+ }
+
+ async function onLoadCountReportPosting() {
+ try {
+ const response = await apiGetAdminForumReportPosting({});
+ if (response) {
+ setCountLaporanPosting(response.data.length);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count publish", error);
+ }
+ }
+
+ async function onLoadCountReportKomentar() {
+ try {
+ const response = await apiGetAdminForumReportKomentar({});
+ if (response) {
+ setCountLaporanKomentar(response.data.length);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count publish", error);
+ }
+ }
+
const listBox = [
{
id: 1,
name: "Publish",
- jumlah: countPublish,
+ jumlah:
+ countPublish == null ? (
+
+ ) : countPublish ? (
+ countPublish
+ ) : (
+ "-"
+ ),
color: "green",
+ icon: ,
},
{
id: 2,
name: "Report Posting",
- jumlah: countLaporanPosting,
+ jumlah:
+ countLaporanPosting == null ? (
+
+ ) : countLaporanPosting ? (
+ countLaporanPosting
+ ) : (
+ "-"
+ ),
color: "orange",
+ icon: ,
},
{
id: 3,
name: "Report Komentar",
- jumlah: countLaporanKomentar,
+ jumlah:
+ countLaporanKomentar == null ? (
+
+ ) : countLaporanKomentar ? (
+ countLaporanKomentar
+ ) : (
+ "-"
+ ),
color: "red",
+ icon: ,
},
];
return (
@@ -69,18 +155,25 @@ function ForumMain({
{listBox.map((e, i) => (
-
-
- {e.name}
- {e.jumlah ? e.jumlah : 0}
-
-
+
+
+ {e.name}
+
+
+
+ {e.jumlah ? e.jumlah : 0}
+
+
+ {e.icon}
+
+
+
))}
diff --git a/src/app_modules/admin/forum/sub_detail/hasil_report_komentar.tsx b/src/app_modules/admin/forum/sub_detail/hasil_report_komentar.tsx
index 6c506cca..f41686ed 100644
--- a/src/app_modules/admin/forum/sub_detail/hasil_report_komentar.tsx
+++ b/src/app_modules/admin/forum/sub_detail/hasil_report_komentar.tsx
@@ -1,71 +1,105 @@
"use client";
-import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
+import {
+ AdminColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import {
MODEL_FORUM_KOMENTAR,
- MODEL_FORUM_REPORT_POSTING
+ MODEL_FORUM_REPORT_POSTING,
} from "@/app_modules/forum/model/interface";
import mqtt_client from "@/util/mqtt_client";
import {
+ Box,
Button,
Center,
Group,
- Modal,
- Pagination,
Paper,
ScrollArea,
Spoiler,
Stack,
Table,
Text,
- Title
+ Title,
} from "@mantine/core";
-import { useDisclosure } from "@mantine/hooks";
-import {
- IconTrash
-} from "@tabler/icons-react";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { IconTrash } from "@tabler/icons-react";
import _ from "lodash";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
-import AdminGlobal_ComponentBackButton from "../../_admin_global/back_button";
+import { Admin_ComponentModal } from "../../_admin_global/_component/comp_admin_modal";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
+import { Admin_V3_ComponentBreakpoint } from "../../_components_v3/comp_simple_grid_breakpoint";
import adminNotifikasi_funCreateToUser from "../../notifikasi/fun/create/fun_create_notif_user";
import ComponentAdminForum_ViewOneDetailKomentar from "../component/detail_one_komentar";
import { adminForum_funDeleteKomentarById } from "../fun/delete/fun_delete_komentar_by_id";
-import { adminForum_getListReportKomentarbyId } from "../fun/get/get_list_report_komentar_by_id";
-import adminForum_funGetOneKomentarById from "../fun/get/get_one_komentar_by_id";
+import {
+ apiAdminGetListReportKomentarById,
+ apiAdminGetOneKomentarForumById,
+} from "../lib/api_fetch_admin_forum";
-export default function AdminForum_HasilReportKomentar({
- komentarId,
- listReport,
- dataKomentar,
-}: {
- komentarId: string;
- listReport: any;
- dataKomentar: MODEL_FORUM_KOMENTAR;
-}) {
- const [data, setData] = useState(dataKomentar);
- console.log(komentarId);
+export default function AdminForum_HasilReportKomentar(
+// {
+// komentarId,
+// listReport,
+// dataKomentar,
+// }: {
+// komentarId: string;
+// listReport: any;
+// dataKomentar: MODEL_FORUM_KOMENTAR;
+// }
+) {
+ const { id } = useParams();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiAdminGetOneKomentarForumById({
+ id: id as string,
+ });
+ if (response && response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error("Invalid data get one forum", error);
+ setData(null);
+ }
+ }
return (
<>
-
-
-
- {
- setData(val);
- }}
- />
-
-
-
- {/* {JSON.stringify(listReport, null, 2)} */}
+
+
+
+ {!data ? (
+
+ ) : (
+
+
+
+ {
+ setData(val);
+ }}
+ />
+
+
+ )}
+
+
>
);
@@ -82,18 +116,17 @@ function ButtonDeleteKomentar({
}) {
const router = useRouter();
const [opened, { open, close }] = useDisclosure(false);
- const [loadingDel2, setLoadingDel2] = useState(false);
+ const [loading, setLoading] = useState(false);
async function onDelete() {
- await adminForum_funDeleteKomentarById(komentarId).then(async (res) => {
+ try {
+ setLoading(true);
+ const res = await adminForum_funDeleteKomentarById(komentarId);
if (res.status === 200) {
- setLoadingDel2(false);
- close();
-
- const dataKomentar = await adminForum_funGetOneKomentarById({
- komentarId: komentarId,
- });
- onSuccess(dataKomentar);
+ // const dataKomentar = await adminForum_funGetOneKomentarById({
+ // komentarId: komentarId,
+ // });
+ // onSuccess(dataKomentar);
const dataNotif = {
appId: data.id,
@@ -116,17 +149,30 @@ function ButtonDeleteKomentar({
}
ComponentGlobal_NotifikasiBerhasil(res.message);
+ setLoading(false);
+ close();
+ router.back();
} else {
ComponentGlobal_NotifikasiGagal(res.message);
}
- });
+ } catch (error) {
+ console.log("error delete", error);
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal("Terjadi kesalahan, silahkan coba lagi");
+ }
}
return (
<>
-
+
- Anda yakin menghapus komentar ini ?
+
+ Anda yakin menghapus komentar ini ?
+
{
onDelete();
- setLoadingDel2(true);
+ setLoading(true);
}}
>
Hapus
-
+
- {data.isActive ? (
+ {data?.isActive ? (
(
- listReport.data
- );
- const [nPage, setNPage] = useState(listReport.nPage);
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
- const [isSearch, setSearch] = useState("");
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, [komentarId, activePage]);
+
+ async function onLoadData() {
+ try {
+ const response = await apiAdminGetListReportKomentarById({
+ id: komentarId,
+ page: `${activePage}`,
+ });
+ if (response && response.success) {
+ setData(response.data.data);
+ setNPage(response.data.nPage);
+ }
+ } catch (error) {
+ console.error("Invalid data format received:", error);
+ setData([]);
+ setNPage(1);
+ }
+ }
async function onPageClick(p: any) {
setActivePage(p);
- const loadData = await adminForum_getListReportKomentarbyId({
- komentarId: komentarId,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
}
- const TableRows = data?.map((e, i) => (
-
- |
-
- {e?.User?.Profile?.name}
-
- |
-
-
-
- {e?.ForumMaster_KategoriReport?.title
- ? e?.ForumMaster_KategoriReport?.title
- : "-"}
-
-
- |
+ const TableRows = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
-
-
-
- {e?.ForumMaster_KategoriReport?.deskripsi ? (
- {e?.ForumMaster_KategoriReport?.deskripsi}
- ) : (
- -
- )}
-
-
- |
+ return data?.map((e, i) => (
+
+ |
+
+ {e?.User?.username}
+
+ |
+
+
+
+ {e?.ForumMaster_KategoriReport?.title
+ ? e?.ForumMaster_KategoriReport?.title
+ : "-"}
+
+
+ |
-
-
-
- {e?.deskripsi ? {e?.deskripsi} : -}
-
-
- |
-
- ));
+
+
+
+ {e?.ForumMaster_KategoriReport?.deskripsi ? (
+ {e?.ForumMaster_KategoriReport?.deskripsi}
+ ) : (
+ -
+ )}
+
+
+ |
+
+
+
+
+ {e?.deskripsi ? {e?.deskripsi} : -}
+
+
+ |
+
+ ));
+ };
+
+ if (!data) {
+ return ;
+ }
return (
<>
- Report Komentar
+ Hasil Report Komentar
- {/* }
- radius={"xl"}
- placeholder="Cari postingan"
- onChange={(val) => {
- onSearch(val.currentTarget.value);
- }}
- /> */}
{_.isEmpty(data) ? (
) : (
-
+
|
- Username
+ Username
|
- Kategori
+ Kategori
|
- Deskripsi
+ Deskripsi
|
- Deskripsi Lainnya
+ Deskripsi Lainnya
|
- {TableRows}
+ {TableRows()}
-
- {
- onPageClick(val);
- }}
- />
-
+
)}
diff --git a/src/app_modules/admin/forum/sub_detail/hasil_report_posting.tsx b/src/app_modules/admin/forum/sub_detail/hasil_report_posting.tsx
index 64cc7eae..a47612f3 100644
--- a/src/app_modules/admin/forum/sub_detail/hasil_report_posting.tsx
+++ b/src/app_modules/admin/forum/sub_detail/hasil_report_posting.tsx
@@ -1,18 +1,22 @@
"use client";
-import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
+import {
+ AdminColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import {
MODEL_FORUM_POSTING,
MODEL_FORUM_REPORT_POSTING,
} from "@/app_modules/forum/model/interface";
+import mqtt_client from "@/util/mqtt_client";
import {
Button,
Center,
Group,
- Modal,
- Pagination,
Paper,
ScrollArea,
Spoiler,
@@ -21,40 +25,74 @@ import {
Text,
Title,
} from "@mantine/core";
-import { useDisclosure } from "@mantine/hooks";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
import { IconTrash } from "@tabler/icons-react";
import _ from "lodash";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
-import AdminGlobal_ComponentBackButton from "../../_admin_global/back_button";
+import { Admin_ComponentModal } from "../../_admin_global/_component/comp_admin_modal";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
-import { adminForum_funDeletePostingById } from "../fun/delete/fun_delete_posting_by_id";
-import { adminForum_getListReportPostingById } from "../fun/get/get_list_report_posting_by_id";
-import ComponentAdminForum_ViewOneDetailPosting from "../component/detail_one_posting";
-import mqtt_client from "@/util/mqtt_client";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
+import { Admin_V3_ComponentBreakpoint } from "../../_components_v3/comp_simple_grid_breakpoint";
import adminNotifikasi_funCreateToUser from "../../notifikasi/fun/create/fun_create_notif_user";
+import ComponentAdminForum_ViewOneDetailPosting from "../component/detail_one_posting";
+import { adminForum_funDeletePostingById } from "../fun/delete/fun_delete_posting_by_id";
+import {
+ apiAdminGetPostingForumById,
+ apiGetAdminForumReportPosting,
+} from "../lib/api_fetch_admin_forum";
+
+export default function AdminForum_HasilReportPosting(
+ {
+ // dataPosting,
+ // listReport,
+ }: {
+ // dataPosting: MODEL_FORUM_POSTING;
+ // listReport: any;
+ }
+) {
+ const { id } = useParams();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiAdminGetPostingForumById({
+ id: id as string,
+ });
+ if (response && response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error("Invalid data format received:", error);
+ setData(null);
+ }
+ }
-export default function AdminForum_HasilReportPosting({
- dataPosting,
- listReport,
-}: {
- dataPosting: MODEL_FORUM_POSTING;
- listReport: any;
-}) {
return (
<>
-
-
-
-
-
-
-
- {/* {JSON.stringify(listReport, null, 2)} */}
+
+
+
+ {!data ? (
+
+ ) : (
+ <>
+
+
+
+
+
+
+ >
+ )}
+
+
>
);
@@ -67,50 +105,55 @@ function ButtonDeletePosting({
}) {
const router = useRouter();
const [opened, { open, close }] = useDisclosure(false);
-
- const [loadingDel2, setLoadingDel2] = useState(false);
+ const [loading, setLoading] = useState(false);
async function onDelete() {
- const del = await adminForum_funDeletePostingById(dataPosting.id);
- if (del.status === 200) {
- setLoadingDel2(false);
- close();
- router.back();
+ try {
+ setLoading(true);
+ const del = await adminForum_funDeletePostingById(dataPosting.id);
+ if (del.status === 200) {
+ const dataNotif = {
+ appId: dataPosting.id,
+ status: "Report Posting",
+ userId: dataPosting.authorId,
+ pesan: dataPosting.diskusi,
+ kategoriApp: "FORUM",
+ title: "Postingan anda telah di laporkan",
+ };
+ const notif = await adminNotifikasi_funCreateToUser({
+ data: dataNotif as any,
+ });
+ if (notif.status === 201) {
+ mqtt_client.publish(
+ "USER",
+ JSON.stringify({ userId: dataPosting.authorId, count: 1 })
+ );
+ }
- const dataNotif = {
- appId: dataPosting.id,
- status: "Report Posting",
- userId: dataPosting.authorId,
- pesan: dataPosting.diskusi,
- kategoriApp: "FORUM",
- title: "Postingan anda telah di laporkan",
- };
- const notif = await adminNotifikasi_funCreateToUser({
- data: dataNotif as any,
- });
- if (notif.status === 201) {
- mqtt_client.publish(
- "USER",
- JSON.stringify({ userId: dataPosting.authorId, count: 1 })
- );
+ ComponentGlobal_NotifikasiBerhasil(del.message);
+ setLoading(false);
+ close();
+ router.back();
+ } else {
+ ComponentGlobal_NotifikasiGagal(del.message);
}
-
- ComponentGlobal_NotifikasiBerhasil(del.message);
- } else {
- ComponentGlobal_NotifikasiGagal(del.message);
+ } catch (error) {
+ console.log("error delete", error);
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal("Terjadi kesalahan, silahkan coba lagi");
}
}
return (
<>
-
- Anda yakin menghapus posting ini
+
+ Anda yakin menghapus ini ?
+
{
onDelete();
- setLoadingDel2(true);
+ setLoading(true);
}}
>
Hapus
-
+
(
- listReport.data
- );
- const [nPage, setNPage] = useState(listReport.nPage);
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
+ const [isSearch, setSearch] = useState("");
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminForum_getListReportPostingById({
- postingId: postingId,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
+ useShallowEffect(() => {
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminForumReportPosting({
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data.data) {
+ setData(response.data.data);
+ setNPage(response.data.nCount || 1);
+ } else {
+ console.error("Invalid data format recieved", response), setData([]);
+ }
+ } catch (error) {
+ console.error("Invalid data format recieved", error);
+ setData([]);
+ }
+ };
+ loadInitialData();
+ }, [activePage, isSearch]);
+ async function onSearch(searchTerm: string) {
+ setSearch(searchTerm);
+ setActivePage(1);
}
- const TableRows = data?.map((e, i) => (
-
- |
-
- {e?.User?.username}
-
- |
-
-
-
- {e?.ForumMaster_KategoriReport?.title
- ? e?.ForumMaster_KategoriReport?.title
- : "-"}
-
-
- |
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
-
-
-
- {e?.ForumMaster_KategoriReport?.deskripsi ? (
- {e?.ForumMaster_KategoriReport?.deskripsi}
- ) : (
- -
- )}
-
-
- |
+ // async function onPageClick(p: any) {
+ // setActivePage(p);
+ // const loadData = await adminForum_getListReportPostingById({
+ // postingId: postingId,
+ // page: p,
+ // });
+ // setData(loadData.data as any);
+ // setNPage(loadData.nPage);
+ // }
-
-
-
- {e?.deskripsi ? {e?.deskripsi} : -}
-
-
- |
-
- ));
+ const TableRows = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+
+ return data?.map((e, i) => (
+
+ |
+
+ {e?.User?.username}
+
+ |
+
+
+
+ {e?.ForumMaster_KategoriReport?.title
+ ? e?.ForumMaster_KategoriReport?.title
+ : "-"}
+
+
+ |
+
+
+
+
+ {e?.ForumMaster_KategoriReport?.deskripsi ? (
+
+ {e?.ForumMaster_KategoriReport?.deskripsi}
+
+ ) : (
+ -
+ )}
+
+
+ |
+
+
+
+
+ {e?.deskripsi ? (
+
+ {e?.deskripsi}
+
+ ) : (
+ -
+ )}
+
+
+ |
+
+ ));
+ };
+
+ if (!data) return ;
return (
<>
- Report Postingan
+ Hasil Report Postingan
{/* }
@@ -238,7 +342,7 @@ function HasilReportPosting({
{_.isEmpty(data) ? (
) : (
-
+
|
- Username
+
+ Username
+
|
- Kategori
+
+ Kategori
+
|
- Deskripsi
+
+ Deskripsi
+
|
- Deskripsi Lainnya
+
+ Deskripsi Lainnya
+
|
- {TableRows}
+ {TableRows()}
-
- {
- onPageClick(val);
- }}
- />
-
+
+ {
+ onPageClick(val);
+ }}
+ />
)}
diff --git a/src/app_modules/admin/forum/sub_menu/table_posting.tsx b/src/app_modules/admin/forum/sub_menu/table_posting.tsx
index f69340d2..f2b1228f 100644
--- a/src/app_modules/admin/forum/sub_menu/table_posting.tsx
+++ b/src/app_modules/admin/forum/sub_menu/table_posting.tsx
@@ -1,17 +1,16 @@
"use client";
-import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { MODEL_FORUM_POSTING } from "@/app_modules/forum/model/interface";
+import { RouterAdminForum } from "@/lib/router_admin/router_admin_forum";
+import { clientLogger } from "@/util/clientLogger";
import {
Badge,
Box,
Button,
Center,
- Group,
- Modal,
- Pagination,
Paper,
ScrollArea,
Spoiler,
@@ -19,178 +18,206 @@ import {
Table,
Text,
TextInput,
- Title,
} from "@mantine/core";
-import { IconMessageCircle, IconSearch } from "@tabler/icons-react";
-import { IconFlag3 } from "@tabler/icons-react";
-import { IconEyeCheck, IconTrash } from "@tabler/icons-react";
-import _, { isEmpty } from "lodash";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconFlag3, IconMessageCircle, IconSearch } from "@tabler/icons-react";
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/_global/notif_global/notifikasi_berhasil";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import { useDisclosure } from "@mantine/hooks";
-import { adminForum_getListPosting } from "../fun/get/get_list_publish";
-import adminJob_getListPublish from "@/app_modules/admin/job/fun/get/get_list_publish";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
import ComponentAdminForum_ButtonDeletePosting from "../component/button_delete";
-import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
+import { apiGetAdminForumPublish } from "../lib/api_fetch_admin_forum";
+import { Comp_SetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
+import { Comp_V3_SetInnerHTMLWithStiker } from "@/app_modules/_global/component/new/comp_V3_set_html_with_stiker";
+import { AdminForum_CompTableSetHtmlStiker } from "../component/comp_table_set_html_stiker";
-export default function AdminForum_TablePosting({
- listPublish,
-}: {
- listPublish: any;
-}) {
+export default function AdminForum_TablePosting() {
return (
<>
-
- {/* {JSON.stringify(listPublish, null, 2)} */}
+
>
);
}
-function TablePublish({ listPublish }: { listPublish: any }) {
+function TablePublish() {
const router = useRouter();
- const [data, setData] = useState(listPublish.data);
- const [nPage, setNPage] = useState(listPublish.nPage);
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
+ const [isDelete, setDelete] = useState(false);
- async function onSearch(s: string) {
- setSearch(s);
+ useShallowEffect(() => {
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .chat-content img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ `;
+ document.head.appendChild(style);
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(style);
+ };
+ }, []);
+
+ useShallowEffect(() => {
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminForumPublish({
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data.data) {
+ setData(response.data.data);
+ setNPage(response.data.nCount || 1);
+ } else {
+ console.error("Invalid data format recieved:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Invlid data format recieved:", error);
+ setData([]);
+ }
+ };
+ loadInitialData();
+ }, [activePage, isSearch, isDelete]);
+
+ const onSearch = (searchTerm: string) => {
+ setSearch(searchTerm);
setActivePage(1);
- const loadData = await adminForum_getListPosting({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
+ };
+
+ async function onDelete(val: boolean) {
+ setDelete(val);
}
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminForum_getListPosting({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
- async function onLoadData() {
- const loadData = await adminForum_getListPosting({
- page: 1,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+ return data?.map((e, i) => (
+
+ {/* Author */}
+ |
+
+ {e?.Author?.username}
+
+ |
- const TableRows = data?.map((e, i) => (
-
- |
-
- {e?.Author?.username}
-
- |
-
-
-
- {e?.ForumMaster_StatusPosting?.status}
-
-
- |
-
-
-
-
+
+
+ {e?.ForumMaster_StatusPosting?.status}
+
+
+ |
+
+ {/* Deskripsi */}
+
+
+ |
+
+ {/* Jumlah komentar */}
+
+
+
+ {e?.Forum_Komentar.length}
+
+
+ |
+
+ {/* Jumlah report */}
+
+
+ = 3 ? "red" : AdminColor.white}
+ fw={"bold"}
+ fz={"lg"}
+ >
+ {e?.Forum_ReportPosting.length}
+
+
+ |
+
+ {/* Aksi */}
+
+
+
+ {
+ onDelete(val);
}}
/>
-
-
- |
-
-
-
- {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}
-
-
- |
-
-
-
- {
- if (val) {
- onLoadData();
- }
- }}
- />
-
- |
-
- ));
+
+ |
+
+ {/*
+
+
+ {new Intl.DateTimeFormat("id-ID", { dateStyle: "medium" }).format(
+ new Date(e?.createdAt)
+ )}
+
+
+ | */}
+
+ ));
+ };
return (
<>
-
-
- Posting
-
- }
- radius={"xl"}
- placeholder="Cari postingan"
- onChange={(val) => {
- onSearch(val.currentTarget.value);
- }}
- />
-
-
- {isEmpty(data) ? (
-
+ }
+ radius={"xl"}
+ placeholder="Cari postingan"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
+
+ {!data ? (
+
) : (
-
+
|
- Username
+ Username
|
- Status
+ Status
|
- Postingan
+ Postingan
|
- Tanggal Publish
+ Komentar Aktif
|
- Komentar Aktif
+ Total Report Posting
|
+
- Total Report Posting
- |
-
- Aksi
+ Aksi
|
- {TableRows}
+ {renderTableBody()}
-
- {
- onPageClick(val);
- }}
- />
-
+ {
+ onPageClick(val);
+ }}
+ />
)}
diff --git a/src/app_modules/admin/forum/sub_menu/table_report_komentar.tsx b/src/app_modules/admin/forum/sub_menu/table_report_komentar.tsx
index ab099e82..196683b0 100644
--- a/src/app_modules/admin/forum/sub_menu/table_report_komentar.tsx
+++ b/src/app_modules/admin/forum/sub_menu/table_report_komentar.tsx
@@ -1,16 +1,15 @@
"use client";
-import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
-import {
- MODEL_FORUM_REPORT_KOMENTAR
-} from "@/app_modules/forum/model/interface";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { MODEL_FORUM_REPORT_KOMENTAR } from "@/app_modules/forum/model/interface";
+import { RouterAdminForum } from "@/lib/router_admin/router_admin_forum";
+import { clientLogger } from "@/util/clientLogger";
import {
Box,
Button,
Center,
- Group,
- Pagination,
Paper,
ScrollArea,
Spoiler,
@@ -18,167 +17,164 @@ import {
Table,
Text,
TextInput,
- Title
} from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { IconFlag3, IconSearch } from "@tabler/icons-react";
-import { isEmpty } from "lodash";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
-import adminForum_funGetAllReportKomentar from "../fun/get/get_all_report_komentar";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
+import { apiGetAdminForumReportKomentar } from "../lib/api_fetch_admin_forum";
+import { AdminForum_CompTableSetHtmlStiker } from "../component/comp_table_set_html_stiker";
-export default function AdminForum_TableReportKomentar({
- listData,
-}: {
- listData: any;
-}) {
+export default function AdminForum_TableReportKomentar() {
return (
<>
-
+
{/* {JSON.stringify(listPublish, null, 2)} */}
>
);
}
-function TableView({ listData }: { listData: any }) {
+function TableView() {
const router = useRouter();
- const [data, setData] = useState(
- listData.data
- );
- const [nPage, setNPage] = useState(listData.nPage);
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
useShallowEffect(() => {
- onLoadData({
- onLoad(val) {
- setData(val.data as any);
- setNPage(val.nPage);
- setActivePage(1);
- },
- });
- }, [setData, setNPage]);
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .chat-content img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ `;
+ document.head.appendChild(style);
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(style);
+ };
+ }, []);
- async function onLoadData({ onLoad }: { onLoad: (val: any) => void }) {
- const loadData = await adminForum_funGetAllReportKomentar({ page: 1 });
- onLoad(loadData);
+ useShallowEffect(() => {
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminForumReportKomentar({
+ page: `${activePage}`,
+ search: isSearch,
+ });
- // setData(loadData.data as any);
- // setNPage(loadData.nPage);
- }
+ if (response?.success && response?.data.data) {
+ setData(response.data.data);
+ setNPage(response.data.nCount || 1);
+ } else {
+ console.error("Invalid data format recieved", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved", error);
+ setData([]);
+ }
+ };
+ loadInitialData();
+ }, [activePage, isSearch]);
- async function onSearch(s: string) {
- setSearch(s);
+ const onSearch = (searchTerm: string) => {
+ setSearch(searchTerm);
setActivePage(1);
- const loadData = await adminForum_funGetAllReportKomentar({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ };
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminForum_funGetAllReportKomentar({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
- const TableRows = data?.map((e, i) => (
-
- |
-
- {e?.User.username}
-
- |
-
-
- {e?.forumMaster_KategoriReportId === null ? (
- Lainnya
- ) : (
- {e?.ForumMaster_KategoriReport.title}
- )}
-
- |
-
-
-
-
-
-
-
- |
-
-
-
-
- {new Intl.DateTimeFormat(["id-ID"], { dateStyle: "medium" }).format(
- e.createdAt
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+ return data?.map((e, i) => (
+
+ |
+
+
+ {e?.User?.username}
+
+
+ |
+
+
+ {!e?.ForumMaster_KategoriReport ? (
+ Lainnya
+ ) : (
+
+ {e?.ForumMaster_KategoriReport?.title}
+
)}
-
-
- |
+
+
-
-
- {/* */}
-
- {/* {
- if (val) {
- onLoadData();
- }
- }}
- /> */}
-
- |
-
- ));
+
+
+ |
+
+
+
+
+ {new Intl.DateTimeFormat("id-ID", { dateStyle: "medium" }).format(
+ new Date(e?.createdAt)
+ )}
+
+
+ |
+
+
+
+
+
+ |
+ |
+ ));
+ };
return (
<>
-
-
- Report Komentar
-
- }
- radius={"xl"}
- placeholder="Cari postingan"
- onChange={(val) => {
- onSearch(val.currentTarget.value);
- }}
- />
-
+ }
+ radius={"xl"}
+ placeholder="Cari Komentar"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
- {isEmpty(data) ? (
-
+ {!data ? (
+
) : (
-
+
|
- Pelapor
- |
-
-
- Jenis Laporan
+ Pelaporr
|
- Komentar
+ Jenis Laporan
|
- Tanggal Report
+ Komentar
|
- Aksi
+ Tanggal Report
|
+
+ Aksi
+ |
- {TableRows}
+ {renderTableBody()}
-
- {
- onPageClick(val);
- }}
- />
-
+ {
+ onPageClick(val);
+ }}
+ />
)}
diff --git a/src/app_modules/admin/forum/sub_menu/table_report_posting.tsx b/src/app_modules/admin/forum/sub_menu/table_report_posting.tsx
index c85bbf50..99fa5848 100644
--- a/src/app_modules/admin/forum/sub_menu/table_report_posting.tsx
+++ b/src/app_modules/admin/forum/sub_menu/table_report_posting.tsx
@@ -1,194 +1,176 @@
"use client";
-import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
-import {
- MODEL_FORUM_REPORT_POSTING
-} from "@/app_modules/forum/model/interface";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { MODEL_FORUM_REPORT_POSTING } from "@/app_modules/forum/model/interface";
+import { RouterAdminForum } from "@/lib/router_admin/router_admin_forum";
+import { clientLogger } from "@/util/clientLogger";
import {
Badge,
- Box,
Button,
Center,
- Group,
- Pagination,
Paper,
ScrollArea,
- Spoiler,
Stack,
Table,
Text,
- TextInput,
- Title
+ TextInput
} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import { IconFlag3, IconSearch } from "@tabler/icons-react";
-import { isEmpty } from "lodash";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
-import ComponentAdminForum_ButtonDeletePosting from "../component/button_delete";
-import adminForum_funGetAllReportPosting from "../fun/get/get_all_report_posting";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
+import { AdminForum_CompTableSetHtmlStiker } from "../component/comp_table_set_html_stiker";
+import { apiGetAdminForumReportPosting } from "../lib/api_fetch_admin_forum";
-export default function AdminForum_TableReportPosting({
- listData,
-}: {
- listData: any;
-}) {
+export default function AdminForum_TableReportPosting() {
return (
<>
-
- {/* {JSON.stringify(listPublish, null, 2)} */}
+
>
);
}
-function TableView({ listData }: { listData: any }) {
+function TableView() {
const router = useRouter();
- const [data, setData] = useState(listData.data);
- const [nPage, setNPage] = useState(listData.nPage);
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
- async function onSearch(s: string) {
- setSearch(s);
+ useShallowEffect(() => {
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .chat-content img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ `;
+ document.head.appendChild(style);
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(style);
+ };
+ }, []);
+
+ useShallowEffect(() => {
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminForumReportPosting({
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data.data) {
+ setData(response.data.data);
+ setNPage(response.data.nCount || 1);
+ } else {
+ console.error("Invalid data format recieved", response), setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved", error);
+ setData([]);
+ }
+ };
+ loadInitialData();
+ }, [activePage, isSearch]);
+ async function onSearch(searchTerm: string) {
+ setSearch(searchTerm);
setActivePage(1);
- const loadData = await adminForum_funGetAllReportPosting({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
}
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminForum_funGetAllReportPosting({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
- async function onLoadData() {
- const loadData = await adminForum_funGetAllReportPosting({
- page: 1,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
-
- const TableRows = data?.map((e, i) => (
-
- |
-
- {e?.User.username}
-
- |
-
-
- {e?.forumMaster_KategoriReportId === null ? (
- Lainnya
- ) : (
- {e?.ForumMaster_KategoriReport.title}
- )}
-
- |
-
- {/*
-
- {e?.Forum_Posting.Author.username}
-
- |
-
-
-
-
-
-
-
- | */}
-
-
-
-
- {e?.Forum_Posting.ForumMaster_StatusPosting?.status}
-
-
- |
-
-
-
-
- {new Intl.DateTimeFormat(["id-ID"], { dateStyle: "medium" }).format(
- e.createdAt
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+ return data?.map((e, i) => (
+
+ |
+
+ {e?.User.username}
+
+ |
+
+
+ {e?.forumMaster_KategoriReportId === null ? (
+ Lainnya
+ ) : (
+ {e?.ForumMaster_KategoriReport.title}
)}
-
- |
+
-
-
- {/* */}
-
- {/* {
- if (val) {
- onLoadData();
+ |
+
+ |
+
+
+
+ */}
-
- |
- |
- ));
+ >
+ {e?.Forum_Posting?.ForumMaster_StatusPosting?.status}
+
+
+ |
+
+
+
+
+
+ |
+
+ ));
+ };
return (
<>
-
-
- Report Posting
-
- }
- radius={"xl"}
- placeholder="Cari postingan"
- onChange={(val) => {
+ }
+ radius={"xl"}
+ placeholder="Cari postingan"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
- onSearch(val.currentTarget.value);
- }}
- />
-
-
- {isEmpty(data) ? (
-
+ {!data ? (
+
) : (
-
+
|
- Pelapor
+ Pelapor
|
- Jenis Laporan
- |
- {/*
- Author
+ Jenis Laporan
|
- Postingan
- | */}
-
- Status Posting
+ Postingan
|
- Tanggal Report
+ Status Posting
|
- Aksi
+ Aksi
|
- {TableRows}
+ {renderTableBody()}
-
- {
- onPageClick(val);
- }}
- />
-
+ {
+ onPageClick(val);
+ }}
+ />
)}
@@ -250,8 +222,7 @@ function ButtonLihatReportLainnya({ postingId }: { postingId: string }) {
return (
<>
- Lihat Report Lain
+ Report Lain
>
);
diff --git a/src/app_modules/admin/investasi/_component/button/button_banding_transaksi.tsx b/src/app_modules/admin/investasi/_component/button/button_banding_transaksi.tsx
index 6a2ed8aa..74416837 100644
--- a/src/app_modules/admin/investasi/_component/button/button_banding_transaksi.tsx
+++ b/src/app_modules/admin/investasi/_component/button/button_banding_transaksi.tsx
@@ -1,13 +1,15 @@
"use client";
-import { Button } from "@mantine/core";
-import {
- adminInvestasi_funAcceptTransaksiById,
- adminInvestasi_funGetAllTransaksiById,
-} from "../../fun";
import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil";
-import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal";
+import { notifikasiToUser_funCreate } from "@/app_modules/notifikasi/fun";
+import { IRealtimeData } from "@/lib/global_state";
+import { Button } from "@mantine/core";
+import { useRouter } from "next/navigation";
import { useState } from "react";
+import { WibuRealtime } from "wibu-pkg";
+import {
+ adminInvestasi_funAcceptTransaksiById
+} from "../../fun";
export function AdminInvestasi_ComponentButtonBandingTransaksi({
invoiceId,
@@ -18,8 +20,9 @@ export function AdminInvestasi_ComponentButtonBandingTransaksi({
invoiceId: string;
investasiId: string;
lembarTerbeli: string;
- onLoadData: (val: any) => void;
+ onLoadData?: (val: any) => void;
}) {
+ const router = useRouter();
const [isLoading, setLoading] = useState(false);
async function onAccept() {
const res = await adminInvestasi_funAcceptTransaksiById({
@@ -29,20 +32,50 @@ export function AdminInvestasi_ComponentButtonBandingTransaksi({
});
if (res.status == 200) {
- try {
- const dataTransaksi = await adminInvestasi_funGetAllTransaksiById({
- investasiId,
- page: 1,
+ const dataNotifikasi: IRealtimeData = {
+ appId: investasiId,
+ status: res.data?.dataInvestasi?.MasterStatusInvestasi?.name as any,
+ userId: res.data?.dataInvestasi.authorId as string,
+ pesan: "Cek investasi anda, Anda memiliki investor baru",
+ kategoriApp: "INVESTASI",
+ title: "Investor baru",
+ };
+
+ const notif = await notifikasiToUser_funCreate({
+ data: dataNotifikasi as any,
+ });
+
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
});
- onLoadData(dataTransaksi);
- } catch (error) {
- console.log(error);
- } finally {
- ComponentAdminGlobal_NotifikasiBerhasil(res.message);
- setLoading(true);
}
- } else {
- ComponentAdminGlobal_NotifikasiGagal(res.message);
+
+ const notifikasiInvestor: IRealtimeData = {
+ appId: res.data?.dataInvestor.id as string,
+ status: "Berhasil",
+ userId: res.data?.dataInvestor.authorId as string,
+ pesan: "Selamat, anda telah menjadi investor baru",
+ kategoriApp: "INVESTASI",
+ title: "Investasi berhasil",
+ };
+
+ const notifToInvestor = await notifikasiToUser_funCreate({
+ data: notifikasiInvestor as any,
+ });
+
+ if (notifToInvestor.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: notifikasiInvestor,
+ });
+ }
+
+ ComponentAdminGlobal_NotifikasiBerhasil(res.message);
+ router.back();
}
}
diff --git a/src/app_modules/admin/investasi/_component/button/button_cek_bukti_transaksi.tsx b/src/app_modules/admin/investasi/_component/button/button_cek_bukti_transaksi.tsx
index 238e5da7..8e4d4d1a 100644
--- a/src/app_modules/admin/investasi/_component/button/button_cek_bukti_transaksi.tsx
+++ b/src/app_modules/admin/investasi/_component/button/button_cek_bukti_transaksi.tsx
@@ -1,4 +1,4 @@
-import { RouterAdminGlobal } from "@/app/lib";
+import { RouterAdminGlobal } from "@/lib";
import { Button } from "@mantine/core";
import { useRouter } from "next/navigation";
import { useState } from "react";
diff --git a/src/app_modules/admin/investasi/_component/button/button_konfirmasi_transaksi.tsx b/src/app_modules/admin/investasi/_component/button/button_konfirmasi_transaksi.tsx
index 624a25ee..7f9b7510 100644
--- a/src/app_modules/admin/investasi/_component/button/button_konfirmasi_transaksi.tsx
+++ b/src/app_modules/admin/investasi/_component/button/button_konfirmasi_transaksi.tsx
@@ -1,15 +1,21 @@
-import { Button, Stack } from "@mantine/core";
-import {
- adminInvestasi_funAcceptTransaksiById,
- adminInvestasi_funGetAllTransaksiById,
- adminInvestasi_funRejectInvoiceById,
-} from "../../fun";
+"use client";
+
import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil";
import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal";
+import {
+ notifikasiToUser_funCreate
+} from "@/app_modules/notifikasi/fun";
+import { IRealtimeData } from "@/lib/global_state";
+import { clientLogger } from "@/util/clientLogger";
+import { Button, Group } from "@mantine/core";
+import { IconBan, IconCircleCheck } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
import { useState } from "react";
-import { IconCircleCheck } from "@tabler/icons-react";
-import { IconBan } from "@tabler/icons-react";
-import { MODEL_INVOICE_INVESTASI } from "@/app_modules/investasi/_lib/interface";
+import { WibuRealtime } from "wibu-pkg";
+import {
+ adminInvestasi_funAcceptTransaksiById,
+ adminInvestasi_funRejectInvoiceById
+} from "../../fun";
export function AdminInvestasi_ComponentButtonKonfirmasiTransaksi({
invoiceId,
@@ -20,59 +26,124 @@ export function AdminInvestasi_ComponentButtonKonfirmasiTransaksi({
invoiceId: string;
investasiId: string;
lembarTerbeli: string;
- onLoadData: (val: any) => void;
+ onLoadData?: (val: any) => void;
}) {
+ const router = useRouter()
const [isLoadingAccpet, setLoadingAccept] = useState(false);
const [isLoadingReject, setLoadingReject] = useState(false);
async function onReject() {
- const res = await adminInvestasi_funRejectInvoiceById({ invoiceId });
- if (res.status == 200) {
- try {
- const dataTransaksi = await adminInvestasi_funGetAllTransaksiById({
- investasiId,
- page: 1,
+ try {
+ setLoadingReject(true);
+
+ const res = await adminInvestasi_funRejectInvoiceById({ invoiceId });
+ if (res.status == 200) {
+ const notifikasiInvestor: IRealtimeData = {
+ appId: invoiceId as string,
+ userId: res.userId as string,
+ status: res.statusName as any,
+ pesan: "Transaksi anda gagal, coba hubungi admin",
+ kategoriApp: "INVESTASI",
+ title: "Transaksi Gagal",
+ };
+
+ const notifToInvestor = await notifikasiToUser_funCreate({
+ data: notifikasiInvestor as any,
});
- onLoadData(dataTransaksi);
- } catch (error) {
- console.log(error);
- } finally {
- ComponentAdminGlobal_NotifikasiBerhasil(res.message);
- setLoadingReject(true);
+
+ if (notifToInvestor.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: notifikasiInvestor,
+ });
+
+
+ ComponentAdminGlobal_NotifikasiBerhasil(res.message);
+ router.back();
+ }
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(res.message);
}
- } else {
- ComponentAdminGlobal_NotifikasiGagal(res.message);
+ } catch (error) {
+ clientLogger.error("Error rejected investasi:", error);
+ } finally {
+ setLoadingReject(false);
}
}
async function onAccept() {
- const res = await adminInvestasi_funAcceptTransaksiById({
- invoiceId,
- investasiId,
- lembarTerbeli,
- });
+ try {
+ setLoadingAccept(true);
+ const res = await adminInvestasi_funAcceptTransaksiById({
+ invoiceId,
+ investasiId,
+ lembarTerbeli,
+ });
- if (res.status == 200) {
- try {
- const dataTransaksi = await adminInvestasi_funGetAllTransaksiById({
- investasiId,
- page: 1,
+ if (res.status == 200) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: investasiId,
+ status: res.data?.dataInvestasi?.MasterStatusInvestasi?.name as any,
+ userId: res.data?.dataInvestasi.authorId as string,
+ pesan: "Cek investasi anda, Anda memiliki investor baru",
+ kategoriApp: "INVESTASI",
+ title: "Investor baru",
+ };
+
+ const notif = await notifikasiToUser_funCreate({
+ data: dataNotifikasi as any,
});
- onLoadData(dataTransaksi);
- } catch (error) {
- console.log(error);
- } finally {
+
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+ }
+
+ const notifikasiInvestor: IRealtimeData = {
+ appId: res.data?.dataInvestor.id as string,
+ status: "Berhasil",
+ userId: res.data?.dataInvestor.authorId as string,
+ pesan: "Selamat, anda telah menjadi investor baru",
+ kategoriApp: "INVESTASI",
+ title: "Investasi berhasil",
+ };
+
+ const notifToInvestor = await notifikasiToUser_funCreate({
+ data: notifikasiInvestor as any,
+ });
+
+ if (notifToInvestor.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: notifikasiInvestor,
+ });
+ }
+
+ // const dataTransaksi = await adminInvestasi_funGetAllTransaksiById({
+ // investasiId,
+ // page: 1,
+ // });
+ // onLoadData?.(dataTransaksi);
+
+
ComponentAdminGlobal_NotifikasiBerhasil(res.message);
- setLoadingAccept(true);
+ router.back();
}
- } else {
- ComponentAdminGlobal_NotifikasiGagal(res.message);
+ } catch (error) {
+ clientLogger.error("Error accept invoice", error);
+ } finally {
+ setLoadingAccept(false);
}
}
return (
<>
-
+
Tolak
-
+
>
);
}
diff --git a/src/app_modules/admin/investasi/_component/detail_data_author.tsx b/src/app_modules/admin/investasi/_component/detail_data_author.tsx
index be480f97..97b1d703 100644
--- a/src/app_modules/admin/investasi/_component/detail_data_author.tsx
+++ b/src/app_modules/admin/investasi/_component/detail_data_author.tsx
@@ -1,50 +1,56 @@
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { MODEL_USER } from "@/app_modules/home/model/interface";
import { Paper, Stack, Title, Grid, Text } from "@mantine/core";
export function ComponentAdminInvestasi_DetailDataAuthor({
data,
}: {
- data: any;
+ data: MODEL_USER;
}) {
return (
-
-
- Data User
-
-
-
- Nama:
-
-
- {data?.Profile?.name}
-
-
-
-
- Username:
-
-
- @{data?.username}
-
-
-
-
- Nomor:
-
-
- + {data?.nomor}
-
-
-
-
- Alamat:
-
-
- {data?.Profile?.alamat}
-
-
+ <>
+ {!data ? ()
+ : (
+
+ Data User
+
+
+
+ Nama:
+
+
+ {data?.Profile?.name}
+
+
+
+
+ Username:
+
+
+ @{data?.username}
+
+
+
+
+ Nomor:
+
+
+ + {data?.nomor}
+
+
+
+
+ Alamat:
+
+
+ {data?.Profile?.alamat}
+
+
+
-
-
+ )}
+ >
);
}
+{/* */ }
diff --git a/src/app_modules/admin/investasi/_component/detail_data_investasi.tsx b/src/app_modules/admin/investasi/_component/detail_data_investasi.tsx
index 09b4ba1b..8e7e1c22 100644
--- a/src/app_modules/admin/investasi/_component/detail_data_investasi.tsx
+++ b/src/app_modules/admin/investasi/_component/detail_data_investasi.tsx
@@ -1,82 +1,85 @@
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { Paper, Stack, Title, Grid, Box, Text } from "@mantine/core";
export function ComponentAdminInvestasi_DetailData({ data }: { data: any }) {
return (
<>
-
-
- Rincian Data Investasi
-
-
-
-
- Judul
- {data?.title}
-
+ {!data ? () :
+ (
+
+ Rincian Data Investasi
+
+
+
+
+ Judul
+ {data?.title}
+
-
- Dana Dibutuhkan
-
- Rp.{" "}
- {new Intl.NumberFormat("id-ID", {
- maximumFractionDigits: 10,
- }).format(+data.targetDana)}
-
-
+
+ Dana Dibutuhkan
+
+ Rp.{" "}
+ {new Intl.NumberFormat("id-ID", {
+ maximumFractionDigits: 10,
+ }).format(+data?.targetDana)}
+
+
-
- Harga Per Lembar
-
- Rp.{" "}
- {new Intl.NumberFormat("id-ID", {
- maximumFractionDigits: 10,
- }).format(+data.hargaLembar)}{" "}
-
-
+
+ Harga Per Lembar
+
+ Rp.{" "}
+ {new Intl.NumberFormat("id-ID", {
+ maximumFractionDigits: 10,
+ }).format(+data?.hargaLembar)}{" "}
+
+
-
- Total Lembar
-
- {" "}
- {new Intl.NumberFormat("id-ID", {
- maximumFractionDigits: 10,
- }).format(+data.totalLembar)}{" "}
- lembar
-
-
-
-
+
+ Total Lembar
+
+ {" "}
+ {new Intl.NumberFormat("id-ID", {
+ maximumFractionDigits: 10,
+ }).format(+data?.totalLembar)}{" "}
+ lembar
+
+
+
+
-
-
-
- ROI
- {data.roi} %
-
+
+
+
+ ROI
+ {data?.roi} %
+
-
- Pembagian Deviden
- {data.MasterPeriodeDeviden.name}
-
+
+ Pembagian Deviden
+ {data?.MasterPeriodeDeviden.name}
+
-
- Jadwal Pembagian
-
- {data.MasterPembagianDeviden.name} bulan{" "}
-
-
+
+ Jadwal Pembagian
+
+ {data?.MasterPembagianDeviden.name} bulan{" "}
+
+
-
- Pencarian Investor
-
- {data.MasterPencarianInvestor.name} hari{" "}
-
-
-
-
-
-
-
+
+ Pencarian Investor
+
+ {data?.MasterPencarianInvestor.name} hari{" "}
+
+
+
+
+
+
+ )}
>
);
}
diff --git a/src/app_modules/admin/investasi/_component/detail_gambar_investasi.tsx b/src/app_modules/admin/investasi/_component/detail_gambar_investasi.tsx
index 42ff54bc..bb4eca28 100644
--- a/src/app_modules/admin/investasi/_component/detail_gambar_investasi.tsx
+++ b/src/app_modules/admin/investasi/_component/detail_gambar_investasi.tsx
@@ -1,12 +1,13 @@
import { Paper, Stack, Title } from "@mantine/core";
import { Admin_ComponentLoadImageLandscape } from "../../_admin_global";
+import { AccentColor, AdminColor } from "@/app_modules/_global/color/color_pallet";
export function ComponentAdminInvestasi_DetailGambar({imagesId}: {imagesId: any}) {
return (
<>
-
+
-
+
Gambar Proyek
diff --git a/src/app_modules/admin/investasi/_component/new_button/button_banding_transaksi.tsx b/src/app_modules/admin/investasi/_component/new_button/button_banding_transaksi.tsx
new file mode 100644
index 00000000..d468d436
--- /dev/null
+++ b/src/app_modules/admin/investasi/_component/new_button/button_banding_transaksi.tsx
@@ -0,0 +1,62 @@
+"use client";
+
+import { Button } from "@mantine/core";
+import {
+ adminInvestasi_funAcceptTransaksiById,
+ adminInvestasi_funGetAllTransaksiById,
+} from "../../fun";
+import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil";
+import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal";
+import { useState } from "react";
+import { useRouter } from "next/navigation";
+
+export function AdminInvestasi_ComponentButtonBandingTransaksi({
+ invoiceId,
+ investasiId,
+ lembarTerbeli,
+
+}: {
+ invoiceId: string;
+ investasiId: string;
+ lembarTerbeli: string;
+
+}) {
+ console.log("Ini invoiceid", invoiceId)
+ console.log("Ini investasiid", investasiId)
+ console.log("Ini lembar terbeli", lembarTerbeli)
+ const [isLoading, setLoading] = useState(false);
+ const router = useRouter();
+ async function onAccept() {
+ try {
+ setLoading(true);
+ const res = await adminInvestasi_funAcceptTransaksiById({
+ invoiceId,
+ investasiId,
+ lembarTerbeli,
+ });
+ if (res.status == 200) {
+ router.back();
+ ComponentAdminGlobal_NotifikasiBerhasil(res.message);
+ } else {
+ console.error("reject error", res.message);
+ ComponentAdminGlobal_NotifikasiGagal(res.message);
+ }
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ return (
+ <>
+ {
+ onAccept();
+ }}
+ >
+ Banding Diterima
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/investasi/_component/new_button/button_cek_bukti_transfer.tsx b/src/app_modules/admin/investasi/_component/new_button/button_cek_bukti_transfer.tsx
new file mode 100644
index 00000000..8e4d4d1a
--- /dev/null
+++ b/src/app_modules/admin/investasi/_component/new_button/button_cek_bukti_transfer.tsx
@@ -0,0 +1,28 @@
+import { RouterAdminGlobal } from "@/lib";
+import { Button } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+
+export function AdminInvestasi_ComponentCekBuktiTransfer({
+ imageId,
+}: {
+ imageId: string;
+}) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ return (
+ <>
+ {
+ setLoading(true);
+ router.push(RouterAdminGlobal.preview_image({ id: imageId }));
+ }}
+ >
+ Cek Transaksi
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/investasi/_component/new_button/button_konfirmasi_transaksi.tsx b/src/app_modules/admin/investasi/_component/new_button/button_konfirmasi_transaksi.tsx
new file mode 100644
index 00000000..0463f77e
--- /dev/null
+++ b/src/app_modules/admin/investasi/_component/new_button/button_konfirmasi_transaksi.tsx
@@ -0,0 +1,168 @@
+"use client";
+
+import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil";
+import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal";
+import { Box, Button, Flex, Stack } from "@mantine/core";
+import { IconBan, IconCircleCheck } from "@tabler/icons-react";
+import { useState } from "react";
+import {
+ adminInvestasi_funAcceptTransaksiById,
+ adminInvestasi_funGetAllTransaksiById,
+ adminInvestasi_funRejectInvoiceById,
+} from "../../fun";
+import { clientLogger } from "@/util/clientLogger";
+import { IRealtimeData } from "@/lib/global_state";
+import {
+ notifikasiToAdmin_funCreate,
+ notifikasiToUser_funCreate,
+} from "@/app_modules/notifikasi/fun";
+import { WibuRealtime } from "wibu-pkg";
+import { useRouter } from "next/navigation";
+
+export function AdminInvestasi_ComponentButtonKonfirmasiTransaksi({
+ invoiceId,
+ investasiId,
+ lembarTerbeli,
+
+}: {
+ invoiceId: string;
+ investasiId: string;
+ lembarTerbeli: string;
+
+}) {
+ const [isLoadingAccpet, setLoadingAccept] = useState(false);
+ const [isLoadingReject, setLoadingReject] = useState(false);
+ const router = useRouter();
+
+ async function onReject() {
+ try {
+ setLoadingReject(true);
+
+ const res = await adminInvestasi_funRejectInvoiceById({ invoiceId });
+ if (res.status == 200) {
+ const notifikasiInvestor: IRealtimeData = {
+ appId: invoiceId as string,
+ userId: res.userId as string,
+ status: res.statusName as any,
+ pesan: "Transaksi anda gagal, coba hubungi admin",
+ kategoriApp: "INVESTASI",
+ title: "Transaksi Gagal",
+ };
+
+ const notifToInvestor = await notifikasiToUser_funCreate({
+ data: notifikasiInvestor as any,
+ });
+
+ if (notifToInvestor.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: notifikasiInvestor,
+ });
+ ComponentAdminGlobal_NotifikasiBerhasil(res.message);
+ }
+ router.back();
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ clientLogger.error("Error rejected investasi:", error);
+ } finally {
+ setLoadingReject(false);
+ }
+ }
+
+ async function onAccept() {
+ try {
+ setLoadingAccept(true);
+ const res = await adminInvestasi_funAcceptTransaksiById({
+ invoiceId,
+ investasiId,
+ lembarTerbeli,
+ });
+ if (res.status == 200) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: investasiId,
+ status: res.data?.dataInvestasi?.MasterStatusInvestasi?.name as any,
+ userId: res.data?.dataInvestasi.authorId as string,
+ pesan: "Cek investasi anda, Anda memiliki investor baru",
+ kategoriApp: "INVESTASI",
+ title: "Investor baru",
+ };
+
+ const notif = await notifikasiToUser_funCreate({
+ data: dataNotifikasi as any,
+ });
+
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+ }
+
+ const notifikasiInvestor: IRealtimeData = {
+ appId: res.data?.dataInvestor.id as string,
+ status: "Berhasil",
+ userId: res.data?.dataInvestor.authorId as string,
+ pesan: "Selamat, anda telah menjadi investor baru",
+ kategoriApp: "INVESTASI",
+ title: "Investasi berhasil",
+ };
+
+ const notifToInvestor = await notifikasiToUser_funCreate({
+ data: notifikasiInvestor as any,
+ });
+
+ if (notifToInvestor.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: notifikasiInvestor,
+ });
+ }
+ ComponentAdminGlobal_NotifikasiBerhasil(res.message);
+ router.back();
+ }
+ } catch (error) {
+ clientLogger.error("Error accept invoice", error);
+ setLoadingAccept(false);
+ } finally {
+ setLoadingAccept(false);
+ }
+ }
+
+ return (
+ <>
+
+
+ }
+ radius={"xl"}
+ color="green"
+ onClick={() => {
+ onAccept();
+ }}
+ >
+ Terima
+
+
+
+ }
+ radius={"xl"}
+ color="red"
+ onClick={() => onReject()}
+ >
+ Tolak
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/investasi/_component/new_detail_data.tsx b/src/app_modules/admin/investasi/_component/new_detail_data.tsx
new file mode 100644
index 00000000..91ae8a11
--- /dev/null
+++ b/src/app_modules/admin/investasi/_component/new_detail_data.tsx
@@ -0,0 +1,77 @@
+import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
+import { Admin_ComponentBoxStyle } from "../../_admin_global/_component/comp_admin_boxstyle";
+import { Stack } from "@mantine/core";
+import { Admin_V3_ComponentDetail } from "../../_components_v3/comp_detail_data";
+import { ComponentGlobal_TampilanAngkaRatusan, ComponentGlobal_TampilanRupiah } from "@/app_modules/_global/component";
+
+export function AdminInvestasi_ComponentNewDetailData({
+ data,
+}: {
+ data: MODEL_INVESTASI;
+}) {
+ const listItem = [
+ {
+ label: "Nama",
+ value: data?.author.username,
+ },
+ {
+ label: "Nomor",
+ value: `+${data?.author.nomor}`,
+ },
+ {
+ label: "Judul",
+ value: data?.title,
+ },
+ {
+ label: "Dana Dibutuhkan",
+ value: (
+
+ ),
+ },
+ {
+ label: "Harga Perlembar",
+ value: (
+
+ ),
+ },
+ {
+ label: "Total Lembar",
+ value: (
+
+ ),
+ },
+ {
+ label: "ROI",
+ value: `${data?.roi} %`,
+ },
+ {
+ label: "Pembagian Deviden",
+ value: data?.MasterPembagianDeviden.name,
+ },
+ {
+ label: "Jadwal Pembagian",
+ value: data?.MasterPeriodeDeviden.name,
+ },
+ {
+ label: "Pencarian Investor",
+ value: data?.MasterPencarianInvestor.name,
+ },
+ ];
+ return (
+ <>
+
+
+ {listItem.map((e, i) => (
+
+ ))}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/investasi/_component/skeleton_admin_investasi.tsx b/src/app_modules/admin/investasi/_component/skeleton_admin_investasi.tsx
new file mode 100644
index 00000000..bb41f911
--- /dev/null
+++ b/src/app_modules/admin/investasi/_component/skeleton_admin_investasi.tsx
@@ -0,0 +1,38 @@
+import CustomSkeleton from '@/app_modules/components/CustomSkeleton';
+import { Box, SimpleGrid, Stack } from '@mantine/core';
+import React from 'react';
+
+function SkeletonAdminInvestasi() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+export default SkeletonAdminInvestasi;
diff --git a/src/app_modules/admin/investasi/_component/ui_detail_file.tsx b/src/app_modules/admin/investasi/_component/ui_detail_file.tsx
index a2dcb554..a52184b6 100644
--- a/src/app_modules/admin/investasi/_component/ui_detail_file.tsx
+++ b/src/app_modules/admin/investasi/_component/ui_detail_file.tsx
@@ -1,5 +1,6 @@
-import { APIs } from "@/app/lib";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { APIs } from "@/lib";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import { MODEL_INVESTASI_DOKUMEN } from "@/app_modules/investasi/_lib/interface";
import {
SimpleGrid,
@@ -10,10 +11,13 @@ import {
Group,
Button,
Text,
+ Box,
} from "@mantine/core";
import { IconFileTypePdf } from "@tabler/icons-react";
import _ from "lodash";
import Link from "next/link";
+import { Admin_ComponentBoxStyle } from "../../_admin_global/_component/comp_admin_boxstyle";
+import { Admin_V3_ComponentDetail } from "../../_components_v3/comp_detail_data";
export function ComponentAdminInvestasi_UIDetailFile({
title,
@@ -26,73 +30,57 @@ export function ComponentAdminInvestasi_UIDetailFile({
listDokumen: any[];
prospektusFileId: string;
}) {
+ const listItem = [
+ {
+ label: "File ",
+ value: (
+
+ Prospek {title}
+
+ } radius={50}>
+ Lihat
+
+
+
+ ),
+ },
+ {
+ label: "Dokumen",
+ value: _.isEmpty(listDokumen) ? (
+ -
+ ) : (
+ listDokumen.map((e: MODEL_INVESTASI_DOKUMEN) => (
+
+
+ {e.title}
+
+ }
+ radius={50}
+ >
+ Lihat
+
+
+
+
+ ))
+ ),
+ },
+ ];
+
return (
<>
-
-
+
+
+ File & Dokumen
+
- File & Dokumen
-
-
- {/* File */}
-
-
- File:
-
-
-
-
- Prospek {title}
-
- Lihat
-
-
-
-
-
- {/* Dokumen */}
-
-
- Dokumen:
-
-
-
- {_.isEmpty(listDokumen) ? (
- -
- ) : (
- listDokumen.map((e: MODEL_INVESTASI_DOKUMEN) => (
-
-
-
- {e.title}
-
- Lihat
-
-
-
- ))
- )}
-
-
-
-
+ {listItem.map((e, i) => (
+
+ ))}
-
-
+
+
>
);
}
diff --git a/src/app_modules/admin/investasi/_lib/api_fetch_admin_investasi.ts b/src/app_modules/admin/investasi/_lib/api_fetch_admin_investasi.ts
new file mode 100644
index 00000000..ec32af8b
--- /dev/null
+++ b/src/app_modules/admin/investasi/_lib/api_fetch_admin_investasi.ts
@@ -0,0 +1,166 @@
+import { globalStatusTransaksi } from "@/app_modules/_global/lib/master_list_app";
+
+export {
+ apiGetAdminInvestasiCountDashboard,
+ apiGetAdminInvestasiByStatus,
+ apiGetAdminInvestasiById,
+ apiGetAdminAllTransaksiById,
+ apiGetAdminStatusTransaksi,
+ apiGetAdminDetailTransaksi
+
+
+};
+const apiGetAdminInvestasiCountDashboard = async ({
+ name,
+}: {
+ name: "Publish" | "Review" | "Reject";
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/investasi/dashboard/${name}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminInvestasiByStatus = async ({
+ name,
+ page,
+ search,
+}: {
+ name: "Publish" | "Review" | "Reject";
+ page: string;
+ search: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isPage = page ? `?page=${page}` : "";
+ const isSearch = search ? `&search=${search}` : "";
+ const response = await fetch(
+ `/api/admin/investasi/status/${name}${isPage}${isSearch}`,
+ {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminDetailTransaksi = async ({ id }: { id: string }) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/investasi/${id}/detail_transaksi`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+}
+
+const apiGetAdminInvestasiById = async ({ id }: { id: string }) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/investasi/${id}/detail`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminAllTransaksiById = async ({
+ id,
+ page,
+ status,
+}: {
+ id: string;
+ page: string;
+ status?: string | undefined;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ // Fetch data
+ const isStatus = status ? `&status=${status}` : "";
+ const isPage = page ? `?page=${page}` : "";
+ const response = await fetch(
+ `/api/admin/investasi/${id}/transaksi${isPage}${isStatus}`,
+ {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error get data transaksi invetsasi",
+ errorData?.message || "Unknown error"
+ );
+ return null;
+ }
+
+ return response.json();
+ } catch (error) {
+ console.error("Error get data transaksi invetsasi", error);
+ throw error;
+ }
+};
+
+
+const apiGetAdminStatusTransaksi = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/master/status_transaksi`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+
diff --git a/src/app_modules/admin/investasi/_view/detail/view_bukti_transfer.tsx b/src/app_modules/admin/investasi/_view/detail/view_bukti_transfer.tsx
index 6da81662..44cab77a 100644
--- a/src/app_modules/admin/investasi/_view/detail/view_bukti_transfer.tsx
+++ b/src/app_modules/admin/investasi/_view/detail/view_bukti_transfer.tsx
@@ -1,4 +1,4 @@
-import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
+import { RouterAdminInvestasi } from "@/lib/router_admin/router_admin_investasi";
import { Center, Image, Paper, Text } from "@mantine/core";
export function AdminInvestasi_ViewBuktiTransfer({
diff --git a/src/app_modules/admin/investasi/_view/detail/view_daftar_transaksi.tsx b/src/app_modules/admin/investasi/_view/detail/view_daftar_transaksi.tsx
index 0aa1a94f..5cea3bcc 100644
--- a/src/app_modules/admin/investasi/_view/detail/view_daftar_transaksi.tsx
+++ b/src/app_modules/admin/investasi/_view/detail/view_daftar_transaksi.tsx
@@ -1,258 +1,640 @@
-import { ComponentAdminGlobal_TampilanRupiah } from "@/app_modules/admin/_admin_global/_component";
+// import { ComponentAdminGlobal_TampilanRupiah, ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
+// import {
+// MODEL_INVOICE_INVESTASI,
+// MODEL_STATUS_INVOICE_INVESTASI,
+// } from "@/app_modules/investasi/_lib/interface";
+// import {
+// ActionIcon,
+// Badge,
+// Center,
+// Group,
+// Pagination,
+// Paper,
+// ScrollArea,
+// Select,
+// Stack,
+// Table,
+// Text,
+// Title,
+// } from "@mantine/core";
+// import { IconReload } from "@tabler/icons-react";
+// import { isEmpty } from "lodash";
+// import { useParams, useRouter } from "next/navigation";
+// import { useState } from "react";
+// import {
+// AdminInvestasi_ComponentButtonBandingTransaksi,
+// AdminInvestasi_ComponentButtonKonfirmasiTransaksi,
+// AdminInvestasi_ComponentCekBuktiTransfer,
+// } from "../../_component";
+// import { adminInvestasi_funGetAllTransaksiById } from "../../fun";
+// import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+// import { useShallowEffect } from "@mantine/hooks";
+// import { apiGetAdminAllTransaksiById, apiGetAdminStatusTransaksi } from "../../_lib/api_fetch_admin_investasi";
+// import { clientLogger } from "@/util/clientLogger";
+// import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+// import { apiGetMasterStatusTransaksi } from "@/app_modules/_global/lib/api_fetch_master";
+
+// export function AdminInvestasi_ViewDaftarTransaksi() {
+// const params = useParams<{ id: string }>();
+// const investasiId = params.id;
+// const router = useRouter();
+// const [isLoading, setLoading] = useState(false);
+// const [idData, setIdData] = useState("");
+// const [listStatus, setListStatus] = useState(null);
+
+// const [data, setData] = useState(null);
+// const [isNPage, setNPage] = useState(1);
+// const [isActivePage, setActivePage] = useState(1);
+// const [selectedStatus, setSelectedStatus] = useState("");
+
+// useShallowEffect(() => {
+// loadInitialData();
+// }, [isActivePage, selectedStatus])
+
+// useShallowEffect(() => {
+// loadStatus();
+// }, [])
+
+// const loadInitialData = async () => {
+// try {
+// const response = await apiGetAdminAllTransaksiById({
+// id: investasiId,
+// page: `${isNPage}`,
+// status: selectedStatus,
+// })
+
+// if (response?.success && response?.data?.data) {
+// setData(response.data.data);
+// setNPage(response.nPage || 1);
+// setListStatus(response.data.data);
+// } else {
+// console.error("Invalid data format received:", response);
+// setData([]);
+// }
+// } catch (error) {
+// clientLogger.error("Error get data daftar tramnsaksi", error);
+// setData([]);
+// }
+// }
+
+// const loadStatus = async () => {
+// try {
+// const response = await apiGetMasterStatusTransaksi()
+
+// if (response?.success && response?.data) {
+// setListStatus(response.data);
+// console.log("status", response.data)
+// } else {
+// console.error("Invalid data format received:", response);
+// setListStatus(null);
+// }
+// } catch (error) {
+// clientLogger.error("Error get status transaksi", error);
+// setListStatus(null);
+// }
+// }
+
+// const onPageClick = async (page: number) => {
+// const loadData = await apiGetAdminAllTransaksiById({
+// id: investasiId,
+// page: `${isNPage}`
+// })
+// setActivePage(page);
+// setData(loadData.data as any);
+// setNPage(loadData.nPage);
+
+// }
+
+// async function onSelected(selectStatus: any) {
+// setSelectedStatus(selectStatus);
+// // const loadData = await apiGetAdminStatusTransaksi();
+// // setData(loadData.data as any);
+// // setNPage(loadData.nPage);
+// }
+
+// async function onReload() {
+// const loadData = await apiGetAdminAllTransaksiById({
+// id: investasiId,
+// page: '1'
+// });
+// setData(loadData.data as any);
+// setNPage(loadData.nPage);
+// }
+
+// const renderTableBody = () => {
+// if (!Array.isArray(data) || data.length === 0) {
+// return (
+//
+// |
+//
+// Tidak ada data
+//
+// |
+//
+// );
+// }
+// return data?.map((e, i) => (
+//
+// |
+// {e?.Author?.username}
+// |
+//
+// {e?.MasterBank?.namaBank}
+// |
+//
+//
+//
+//
+// |
+//
+//
+// {new Intl.NumberFormat("id-ID", { maximumFractionDigits: 10 }).format(
+// +e?.lembarTerbeli
+// )}
+//
+// |
+//
+//
+// {new Intl.DateTimeFormat("id-ID", { dateStyle: "full" }).format(new Date(e?.createdAt))}
+//
+// |
+//
+//
+//
+// {e?.StatusInvoice?.name}
+//
+//
+// |
+//
+//
+// {e?.statusInvoiceId !== "3" ? (
+//
+// ) : (
+// "-"
+// )}
+//
+// |
+//
+//
+// {e.statusInvoiceId === "1" && "-"}
+// {e.statusInvoiceId === "2" && (
+// {
+// setData(val.data);
+// setNPage(val.nPage);
+// }}
+// />
+// )}
+// {e.statusInvoiceId === "3" && "-"}
+// {e.statusInvoiceId === "4" && (
+// {
+// setData(val.data);
+// setNPage(val.nPage);
+// }}
+// />
+// )}
+//
+// |
+//
+// ));
+// }
+
+// return (
+// <>
+//
+//
+// {
+// onReload();
+// }}
+// >
+//
+//
+//
+// >
+// );
+// }
+
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { apiGetMasterStatusTransaksi } from "@/app_modules/_global/lib/api_fetch_master";
+import { globalStatusTransaksi } from "@/app_modules/_global/lib/master_list_app";
+import {
+ ComponentAdminGlobal_TampilanRupiah,
+ ComponentAdminGlobal_TitlePage,
+} from "@/app_modules/admin/_admin_global/_component";
+import { Admin_V3_ComponentPaginationBreakpoint } from "@/app_modules/admin/_components_v3/comp_pagination_breakpoint";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import {
MODEL_INVOICE_INVESTASI,
MODEL_STATUS_INVOICE_INVESTASI,
} from "@/app_modules/investasi/_lib/interface";
+import { RouterAdminInvestasi } from "@/lib/router_admin/router_admin_investasi";
+import { clientLogger } from "@/util/clientLogger";
import {
ActionIcon,
Badge,
+ Button,
Center,
Group,
- Pagination,
Paper,
ScrollArea,
Select,
Stack,
Table,
- Title,
+ Text
} from "@mantine/core";
-import { IconReload } from "@tabler/icons-react";
-import { isEmpty } from "lodash";
-import { useRouter } from "next/navigation";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconEyeCheck, IconReload } from "@tabler/icons-react";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
-import {
- AdminInvestasi_ComponentButtonBandingTransaksi,
- AdminInvestasi_ComponentButtonKonfirmasiTransaksi,
- AdminInvestasi_ComponentCekBuktiTransfer,
-} from "../../_component";
-import { adminInvestasi_funGetAllTransaksiById } from "../../fun";
+import { AdminInvestasi_ComponentCekBuktiTransfer } from "../../_component/new_button/button_cek_bukti_transfer";
+import { apiGetAdminAllTransaksiById } from "../../_lib/api_fetch_admin_investasi";
-export function AdminInvestasi_ViewDaftarTransaksi({
- dataTransaksi,
- statusTransaksi,
- investasiId,
-}: {
- dataTransaksi: any;
- statusTransaksi: MODEL_STATUS_INVOICE_INVESTASI[];
- investasiId: string;
-}) {
- const router = useRouter();
- const [isLoading, setLoading] = useState(false);
- const [idData, setIdData] = useState("");
- const [listStatsus, setListStatus] = useState(statusTransaksi);
+export function AdminInvestasi_ViewDaftarTransaksi() {
+ const params = useParams<{ id: string }>();
+ const investasiId = params.id;
+ const [listStatus, setListStatus] = useState<
+ MODEL_STATUS_INVOICE_INVESTASI[] | null
+ >(null);
- const [data, setData] = useState(
- dataTransaksi.data
- );
- const [isNPage, setNPage] = useState(dataTransaksi.nPage);
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
const [isActivePage, setActivePage] = useState(1);
const [selectedStatus, setSelectedStatus] = useState("");
+ const [isLoading, setLoading] = useState(false);
+ const [idData, setIdData] = useState("");
+ const router = useRouter();
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminInvestasi_funGetAllTransaksiById({
- investasiId: investasiId,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ useShallowEffect(() => {
+ handleLoadData();
+ }, [isActivePage, selectedStatus]);
+
+ useShallowEffect(() => {
+ handleLoadStatus();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const cek = globalStatusTransaksi.find((e) => e.id === selectedStatus);
+ const response = await apiGetAdminAllTransaksiById({
+ id: investasiId,
+ page: `${isActivePage}`,
+ status: cek?.name,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data daftar tramnsaksi", error);
+ setData([]);
+ }
+ };
+
+ const handleLoadStatus = async () => {
+ try {
+ const response = await apiGetMasterStatusTransaksi();
+
+ if (response?.success && response?.data) {
+ setListStatus(response.data);
+ } else {
+ console.error("Invalid data format received:", response);
+ setListStatus(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get status transaksi", error);
+ setListStatus(null);
+ }
+ };
+
+ const onPageClick = async (page: number) => {
+ setActivePage(page);
+ };
async function onSelected(selectStatus: any) {
setSelectedStatus(selectStatus);
- const loadData = await adminInvestasi_funGetAllTransaksiById({
- investasiId: investasiId,
- page: isActivePage,
- selectStatus: selectStatus,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
}
async function onReload() {
- const loadData = await adminInvestasi_funGetAllTransaksiById({
- investasiId: investasiId,
- page: 1,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
+ setSelectedStatus("");
+ handleLoadData();
}
- const tableRows = data?.map((e, i) => (
-
- |
- {e?.Author.username}
- |
-
- {e?.MasterBank.namaBank}
- |
-
-
-
-
- |
-
-
- {new Intl.NumberFormat("id-ID", { maximumFractionDigits: 10 }).format(
- +e?.lembarTerbeli
- )}
-
- |
-
-
- {new Intl.DateTimeFormat("id-ID", { dateStyle: "full" }).format(
- e?.createdAt
- )}
-
- |
-
-
-
- {e?.StatusInvoice?.name}
-
-
- |
-
-
- {e?.statusInvoiceId !== "3" ? (
-
- ) : (
- "-"
- )}
-
- |
-
-
- {e.statusInvoiceId === "1" && "-"}
- {e.statusInvoiceId === "2" && (
- {
- setData(val.data);
- setNPage(val.nPage);
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+ return data?.map((e, i) => (
+
+ |
+ {e?.Author?.username}
+ |
+
+
+
+
+ |
+
+
+ {new Intl.DateTimeFormat("id-ID", { dateStyle: "full" }).format(
+ new Date(e?.createdAt)
+ )}
+
+ |
+
+
+
+ {e?.StatusInvoice?.name}
+
+
+ |
+
+
+ {e?.statusInvoiceId !== "3" ? (
+
+ ) : (
+ "-"
+ )}
+
+ |
+
+
+ {/* {e.statusInvoiceId === "1" && "-"}
+ {e.statusInvoiceId === "2" && (
+ {
+ setData(val.data);
+ setNPage(val.nPage);
+ }}
+ />
+ )}
+ {e.statusInvoiceId === "3" && "-"}
+ {e.statusInvoiceId === "4" && (
+ {
+ setData(val.data);
+ setNPage(val.nPage);
+ }}
+ />
+ )} */}
+ }
+ radius={"xl"}
+ onClick={() => {
+ setIdData(e.id);
+ setLoading(true);
+ router.push(RouterAdminInvestasi.detail_transaksi + e.id);
}}
- />
- )}
- {e.statusInvoiceId === "3" && "-"}
- {e.statusInvoiceId === "4" && (
- {
- setData(val.data);
- setNPage(val.nPage);
- }}
- />
- )}
-
- |
-
- ));
+ >
+ Detail
+
+
+ |
+
+ ));
+ };
+
+ if (!data && !listStatus) return ;
return (
<>
-
- Transaksi
-
- {
- onReload();
- }}
- >
-
-
- ({
- value: e.id,
- label: e.name,
- }))
- }
- onChange={(val: any) => {
- onSelected(val);
- }}
- />
-
-
+
+ {
+ onReload();
+ }}
+ >
+
+
+ ({
+ value: e.id,
+ label: e.name,
+ })) || []
+ }
+ onChange={(val: any) => {
+ onSelected(val);
+ }}
+ />
+
+ }
+ />
-
-
-
-
-
- |
- Nama Investor
- |
-
- Nama Bank
- |
-
- Jumlah Investasi
- |
-
- Lembar Terbeli
- |
-
- Tanggal
- |
-
- Status
- |
-
- Bukti Transfer
- |
-
- Aksi
- |
-
-
- {tableRows}
-
-
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Nama Investor
+ |
+
+ Jumlah Investasi
+ |
+
+ Tanggal
+ |
+
+ Status
+ |
+
+ Bukti Transfer
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
-
- {
onPageClick(val);
}}
/>
-
-
+
+ )}
>
);
diff --git a/src/app_modules/admin/investasi/_view/detail/view_daftar_transaksi.txt b/src/app_modules/admin/investasi/_view/detail/view_daftar_transaksi.txt
new file mode 100644
index 00000000..b1d64403
--- /dev/null
+++ b/src/app_modules/admin/investasi/_view/detail/view_daftar_transaksi.txt
@@ -0,0 +1,305 @@
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { apiGetMasterStatusTransaksi } from "@/app_modules/_global/lib/api_fetch_master";
+import { globalStatusTransaksi } from "@/app_modules/_global/lib/master_list_app";
+import {
+ ComponentAdminGlobal_TampilanRupiah,
+ ComponentAdminGlobal_TitlePage,
+} from "@/app_modules/admin/_admin_global/_component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import {
+ MODEL_INVOICE_INVESTASI,
+ MODEL_STATUS_INVOICE_INVESTASI,
+} from "@/app_modules/investasi/_lib/interface";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ ActionIcon,
+ Badge,
+ Button,
+ Center,
+ Group,
+ Pagination,
+ Paper,
+ ScrollArea,
+ Select,
+ Stack,
+ Table,
+ Text,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconEyeCheck, IconReload } from "@tabler/icons-react";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import {
+ AdminInvestasi_ComponentButtonBandingTransaksi,
+ AdminInvestasi_ComponentButtonKonfirmasiTransaksi,
+ AdminInvestasi_ComponentCekBuktiTransfer,
+} from "../../_component";
+import { apiGetAdminAllTransaksiById } from "../../_lib/api_fetch_admin_investasi";
+
+export function AdminInvestasi_ViewDaftarTransaksi() {
+ const params = useParams<{ id: string }>();
+ const investasiId = params.id;
+ const [listStatus, setListStatus] = useState<
+ MODEL_STATUS_INVOICE_INVESTASI[] | null
+ >(null);
+
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
+ const [isActivePage, setActivePage] = useState(1);
+ const [selectedStatus, setSelectedStatus] = useState("");
+ const [isLoading, setLoading] = useState(false);
+ const [idData, setIdData] = useState("");
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, [isActivePage, selectedStatus]);
+
+ useShallowEffect(() => {
+ handleLoadStatus();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const cek = globalStatusTransaksi.find((e) => e.id === selectedStatus);
+ const response = await apiGetAdminAllTransaksiById({
+ id: investasiId,
+ page: `${isActivePage}`,
+ status: cek?.name,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data daftar tramnsaksi", error);
+ setData([]);
+ }
+ };
+
+ const handleLoadStatus = async () => {
+ try {
+ const response = await apiGetMasterStatusTransaksi();
+
+ if (response?.success && response?.data) {
+ setListStatus(response.data);
+ } else {
+ console.error("Invalid data format received:", response);
+ setListStatus(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get status transaksi", error);
+ setListStatus(null);
+ }
+ };
+
+ const onPageClick = async (page: number) => {
+ setActivePage(page);
+ };
+
+ async function onSelected(selectStatus: any) {
+ setSelectedStatus(selectStatus);
+ }
+
+ async function onReload() {
+ setSelectedStatus("");
+ handleLoadData();
+ }
+
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+ return data?.map((e, i) => (
+
+ |
+ {e?.Author?.username}
+ |
+
+
+
+
+ |
+
+
+ {new Intl.DateTimeFormat("id-ID", { dateStyle: "full" }).format(
+ new Date(e?.createdAt)
+ )}
+
+ |
+
+
+
+ {e?.StatusInvoice?.name}
+
+
+ |
+
+
+ {e?.statusInvoiceId !== "3" ? (
+
+ ) : (
+ "-"
+ )}
+
+ |
+
+
+ {e.statusInvoiceId === "1" && "-"}
+ {e.statusInvoiceId === "2" && (
+ {
+ setData(val.data);
+ setNPage(val.nPage);
+ }}
+ />
+ )}
+ {e.statusInvoiceId === "3" && "-"}
+ {e.statusInvoiceId === "4" && (
+ {
+ setData(val.data);
+ setNPage(val.nPage);
+ }}
+ />
+ )}
+
+ |
+ )} */}
+ }
+ radius={"xl"}
+ onClick={() => {
+ setIdData(e.id);
+ setLoading(true);
+
+ }}
+ >
+ Detail
+
+
+
+
+ ));
+ };
+
+ if (!data && !listStatus) return ;
+
+ return (
+ <>
+
+
+ {
+ onReload();
+ }}
+ >
+
+
+ ({
+ value: e.id,
+ label: e.name,
+ })) || []
+ }
+ onChange={(val: any) => {
+ onSelected(val);
+ }}
+ />
+
+ }
+ />
+
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Nama Investor
+ |
+
+ Jumlah Investasi
+ |
+
+ Tanggal
+ |
+
+ Status
+ |
+
+ Bukti Transfer
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+
+
+ {
+ onPageClick(val);
+ }}
+ />
+
+
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/investasi/_view/detail/view_detail_data.tsx b/src/app_modules/admin/investasi/_view/detail/view_detail_data.tsx
index 7761be7c..eddc769a 100644
--- a/src/app_modules/admin/investasi/_view/detail/view_detail_data.tsx
+++ b/src/app_modules/admin/investasi/_view/detail/view_detail_data.tsx
@@ -1,41 +1,92 @@
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
+import { clientLogger } from "@/util/clientLogger";
import { SimpleGrid } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import { useState } from "react";
import { ComponentAdminInvestasi_DetailDataAuthor } from "../../_component/detail_data_author";
import { ComponentAdminInvestasi_DetailData } from "../../_component/detail_data_investasi";
import { ComponentAdminInvestasi_DetailGambar } from "../../_component/detail_gambar_investasi";
+import SkeletonAdminInvestasi from "../../_component/skeleton_admin_investasi";
import { ComponentAdminInvestasi_UIDetailFile } from "../../_component/ui_detail_file";
+import { apiGetAdminInvestasiById } from "../../_lib/api_fetch_admin_investasi";
+import { Admin_V3_ComponentBreakpoint } from "@/app_modules/admin/_components_v3/comp_simple_grid_breakpoint";
+import { AdminInvestasi_ComponentNewDetailData } from "../../_component/new_detail_data";
+import { Admin_V3_ComponentSkeletonBreakpoint } from "@/app_modules/admin/_components_v3/comp_skeleton_breakpoint";
-export function AdminInvestasi_ViewDetailData({
- data,
-}: {
- data: MODEL_INVESTASI;
-}) {
+export function AdminInvestasi_ViewDetailData() {
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ loadInitialData();
+ }, []);
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminInvestasiById({
+ id: params.id,
+ });
+
+ if (response?.success && response?.data) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved:", error);
+ setData(null);
+ }
+ };
return (
<>
-
- {/* Data Author */}
-
+ {!data ? (
+
+ ) : (
+
+
+ {/* Data Foto */}
+
+
+
+
+
+ )}
- {/* Data Foto */}
-
+{/*
+ {!data ? (
+
+ ) : (
+ <>
+
- {/* Data Detail */}
-
-
-
+
+
+
+
+
+
+
+ >
+ )}
+ */}
>
);
}
diff --git a/src/app_modules/admin/investasi/_view/detail/view_detail_transaksi.tsx b/src/app_modules/admin/investasi/_view/detail/view_detail_transaksi.tsx
new file mode 100644
index 00000000..7d258d98
--- /dev/null
+++ b/src/app_modules/admin/investasi/_view/detail/view_detail_transaksi.tsx
@@ -0,0 +1,262 @@
+"use client";
+import Admin_ComponentBackButton from "@/app_modules/admin/_admin_global/back_button";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { MODEL_INVOICE_INVESTASI } from "@/app_modules/investasi/_lib/interface";
+import { clientLogger } from "@/util/clientLogger";
+import { Badge, Box, Grid, Group, Stack, Text } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+
+import { apiGetAdminDetailTransaksi } from "../../_lib/api_fetch_admin_investasi";
+
+import { Admin_ComponentBoxStyle } from "@/app_modules/admin/_admin_global/_component/comp_admin_boxstyle";
+import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
+import { Admin_V3_ComponentDetail } from "@/app_modules/admin/_components_v3/comp_detail_data";
+import { AdminInvestasi_ComponentCekBuktiTransfer } from "../../_component/new_button/button_cek_bukti_transfer";
+import {
+ AdminInvestasi_ComponentButtonKonfirmasiTransaksi,
+ AdminInvestasi_ComponentButtonBandingTransaksi,
+} from "../../_component";
+
+function DetailTransaksi() {
+ const params = useParams<{ id: string }>();
+ const investasiId = params.id;
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ loadInitialData();
+ }, []);
+
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminDetailTransaksi({
+ id: investasiId,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ } else {
+ console.error("Invalid data format recieved:", response);
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved:", error);
+ setData(null);
+ }
+ };
+
+ const listData = [
+ {
+ label: "Nama Investor",
+ value: data?.Author?.username,
+ },
+ {
+ label: "Nama Bank",
+ value: data?.Author?.username,
+ },
+ {
+ label: "Nomor",
+ value: data?.Author?.nomor,
+ },
+ {
+ label: "Jumlah Investasi",
+ value: data?.nominal,
+ },
+ {
+ label: "Lembar Terbeli",
+ value: data?.lembarTerbeli,
+ },
+ {
+ label: "Tanggal Transaksi",
+ value: data?.createdAt
+ ? new Date(data.createdAt).toLocaleDateString()
+ : "",
+ },
+ {
+ label: "Status",
+ value: (
+
+ {data?.StatusInvoice?.name}
+
+ ),
+ },
+ {
+ label: "Bukti Transfer",
+ value: (
+
+ {data?.statusInvoiceId !== "3" ? (
+
+ ) : (
+ "-"
+ )}
+
+ ),
+ },
+ ];
+
+ return (
+
+
+
+
+ <>
+ {!data ? (
+
+ ) : (
+
+
+ {listData.map((e, i) => (
+
+ ))}
+
+
+ {data?.statusInvoiceId === "1" && "-"}
+ {data?.statusInvoiceId === "2" && (
+
+ )}
+ {data?.statusInvoiceId === "3" && "-"}
+ {data?.statusInvoiceId === "4" && (
+
+ )}
+
+
+
+
+ //
+ //
+ // Detail Transaksi
+ //
+ //
+ //
+ // Nama Investor:
+ //
+ //
+ // {data?.Author?.username}
+ //
+ //
+ //
+ //
+ // Nama Bank:
+ //
+ //
+ // @{data?.Author?.username}
+ //
+ //
+ //
+ //
+ // Nomor:
+ //
+ //
+ // + {data?.Author?.nomor}
+ //
+ //
+ //
+ //
+ // Jumlah Investasi:
+ //
+ //
+ // {data?.nominal}
+ //
+ //
+ //
+ //
+ // Lembar Terbeli:
+ //
+ //
+ // {data?.lembarTerbeli}
+ //
+ //
+ //
+ //
+ // Tanggal:
+ //
+ //
+ // {data?.createdAt ? new Date(data.createdAt).toLocaleDateString() : ""}
+ //
+ //
+ //
+ //
+ // Status:
+ //
+ //
+ // {data?.StatusInvoice?.name}
+ //
+ //
+ //
+ //
+ // Bukti Transfer:
+ //
+ //
+ //
+ // {data?.statusInvoiceId !== "3" ? (
+ //
+ // ) : (
+ // "-"
+ // )}
+ //
+ //
+ //
+ //
+ //
+ //
+ // {data?.statusInvoiceId === "1" && "-"}
+ // {data?.statusInvoiceId === "2" && (
+ //
+ // )}
+ // {data?.statusInvoiceId === "3" && "-"}
+ // {data?.statusInvoiceId === "4" && (
+ //
+ // )}
+ //
+ //
+ //
+ //
+ //
+ //
+ )}
+ >
+
+ );
+}
+
+export default DetailTransaksi;
diff --git a/src/app_modules/admin/investasi/detail/detail_bukti_transfer.tsx b/src/app_modules/admin/investasi/detail/detail_bukti_transfer.tsx
index 3532579c..1d5dad6a 100644
--- a/src/app_modules/admin/investasi/detail/detail_bukti_transfer.tsx
+++ b/src/app_modules/admin/investasi/detail/detail_bukti_transfer.tsx
@@ -1,14 +1,14 @@
"use client";
import { Stack } from "@mantine/core";
-import AdminGlobal_ComponentBackButton from "../../_admin_global/back_button";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
import { AdminInvestasi_ViewBuktiTransfer } from "../_view";
import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
export function AdminInvestasi_DetailBuktiTransfer({ imageId }: { imageId: string }) {
return (
-
+
diff --git a/src/app_modules/admin/investasi/detail/detail_publish.tsx b/src/app_modules/admin/investasi/detail/detail_publish.tsx
index 141d562c..8ca572ac 100644
--- a/src/app_modules/admin/investasi/detail/detail_publish.tsx
+++ b/src/app_modules/admin/investasi/detail/detail_publish.tsx
@@ -1,29 +1,17 @@
"use client";
-import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
import { Button, Group, Stack } from "@mantine/core";
import { IconCircleCheck } from "@tabler/icons-react";
-import { useState } from "react";
-import AdminGlobal_ComponentBackButton from "../../_admin_global/back_button";
+import { useAtom } from "jotai";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import { gs_admin_invetasi_menu_publish } from "../_lib/global_state";
import {
- AdminInvestasi_ViewDaftarInvestor,
AdminInvestasi_ViewDaftarTransaksi,
AdminInvestasi_ViewDetailData,
} from "../_view";
-import { useAtom } from "jotai";
-import { gs_admin_invetasi_menu_publish } from "../_lib/global_state";
-export function AdminInvestasi_DetailPublish({
- data,
- dataTransaksi,
- statusTransaksi,
- investasiId,
-}: {
- data: MODEL_INVESTASI;
- dataTransaksi: any[];
- statusTransaksi: any[];
- investasiId: string;
-}) {
+export function AdminInvestasi_DetailPublish() {
const [selectPage, setSelectPage] = useAtom(gs_admin_invetasi_menu_publish);
const listPage = [
{
@@ -45,12 +33,14 @@ export function AdminInvestasi_DetailPublish({
return (
<>
-
-
+
+
+
{listPage.map((e) => (
- {selectPage == "1" ? (
-
- ) : null}
- {selectPage == "2" ? (
-
- ) : null}
- {/* {selectPage == "3" ? : null} */}
+ {selectPage == "1" ? : null}
+ {selectPage == "2" ? : null}
>
);
diff --git a/src/app_modules/admin/investasi/detail/detail_reject.tsx b/src/app_modules/admin/investasi/detail/detail_reject.tsx
index 81976beb..5180a955 100644
--- a/src/app_modules/admin/investasi/detail/detail_reject.tsx
+++ b/src/app_modules/admin/investasi/detail/detail_reject.tsx
@@ -1,71 +1,91 @@
"use client";
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
-import {
- Paper,
- SimpleGrid,
- Stack,
- Text,
- Title
-} from "@mantine/core";
-import AdminGlobal_ComponentBackButton from "../../_admin_global/back_button";
+import { Paper, SimpleGrid, Stack, Text, Title } from "@mantine/core";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
import { ComponentAdminInvestasi_DetailDataAuthor } from "../_component/detail_data_author";
import { ComponentAdminInvestasi_DetailData } from "../_component/detail_data_investasi";
import { ComponentAdminInvestasi_DetailGambar } from "../_component/detail_gambar_investasi";
import { ComponentAdminInvestasi_UIDetailFile } from "../_component/ui_detail_file";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import { useParams } from "next/navigation";
+import { clientLogger } from "@/util/clientLogger";
+import { useShallowEffect } from "@mantine/hooks";
+import { useState } from "react";
+import { apiGetAdminInvestasiById } from "../_lib/api_fetch_admin_investasi";
+import { Admin_V3_ComponentBreakpoint } from "../../_components_v3/comp_simple_grid_breakpoint";
+import { Admin_V3_ComponentSkeletonBreakpoint } from "../../_components_v3/comp_skeleton_breakpoint";
+import { AdminInvestasi_ComponentNewDetailData } from "../_component/new_detail_data";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Admin_ComponentBoxStyle } from "../../_admin_global/_component/comp_admin_boxstyle";
+
+export function AdminInvestasi_DetailReject() {
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ loadInitialData();
+ }, []);
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminInvestasiById({
+ id: params.id,
+ });
+
+ if (response?.success && response?.data) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved:", error);
+ setData(null);
+ }
+ };
-export function AdminInvestasi_DetailReject({ data }: { data: MODEL_INVESTASI }) {
return (
<>
-
-
-
-
+
+
+
+
+ {!data ? (
+
+ ) : (
+
+
+
#{" "}
-
+
Alasan penolakan
- {data.catatan}
+ {data?.catatan}
-
-
+
+
+ )}
-
- {/* Data Author */}
-
+ {!data ? (
+
+ ) : (
+
+
+ {/* Data Foto */}
+
+
+
+
+
+ )}
- {/* Data Foto */}
-
-
- {/* Data Detail */}
-
-
-
-
+
{/* {JSON.stringify(data, null, 2)} */}
>
diff --git a/src/app_modules/admin/investasi/detail/detail_review.tsx b/src/app_modules/admin/investasi/detail/detail_review.tsx
index 7db97675..7169a802 100644
--- a/src/app_modules/admin/investasi/detail/detail_review.tsx
+++ b/src/app_modules/admin/investasi/detail/detail_review.tsx
@@ -1,162 +1,197 @@
"use client";
+import { MainColor } from "@/app_modules/_global/color";
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
-import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
-import mqtt_client from "@/util/mqtt_client";
-import {
- Button,
- Group,
- SimpleGrid,
- Stack
-} from "@mantine/core";
+import { IRealtimeData } from "@/lib/global_state";
+import { clientLogger } from "@/util/clientLogger";
+import { Button, Group, SimpleGrid, Stack } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import { WibuRealtime } from "wibu-pkg";
import { Admin_ComponentModalReport } from "../../_admin_global/_component";
+import Admin_ComponentModalPublish from "../../_admin_global/_component/comp_admin_modal_publish";
import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
-import AdminGlobal_ComponentBackButton from "../../_admin_global/back_button";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
import adminNotifikasi_funCreateToUser from "../../notifikasi/fun/create/fun_create_notif_user";
import { ComponentAdminInvestasi_DetailDataAuthor } from "../_component/detail_data_author";
import { ComponentAdminInvestasi_DetailData } from "../_component/detail_data_investasi";
import { ComponentAdminInvestasi_DetailGambar } from "../_component/detail_gambar_investasi";
+import SkeletonAdminInvestasi from "../_component/skeleton_admin_investasi";
import { ComponentAdminInvestasi_UIDetailFile } from "../_component/ui_detail_file";
+import { apiGetAdminInvestasiById } from "../_lib/api_fetch_admin_investasi";
import { adminInvestasi_funEditStatusPublishById } from "../fun/edit/fun_status_publish_by_id";
import Admin_funRejectInvestasi from "../fun/fun_reject_investasi";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import { AdminInvestasi_ViewDetailData } from "../_view";
+import { Admin_V3_ComponentBreakpoint } from "../../_components_v3/comp_simple_grid_breakpoint";
+import { Admin_V3_ComponentSkeletonBreakpoint } from "../../_components_v3/comp_skeleton_breakpoint";
+import { AdminInvestasi_ComponentNewDetailData } from "../_component/new_detail_data";
-export default function AdminInvestasi_DetailReview({
- dataInvestasi,
-}: {
- dataInvestasi: MODEL_INVESTASI;
-}) {
+export default function AdminInvestasi_DetailReview() {
+ const params = useParams<{ id: string }>();
const router = useRouter();
- const [data, setData] = useState(dataInvestasi);
+ const [data, setData] = useState(null);
const [publish, setPublish] = useState(true);
- const [openModal, setOpenModal] = useState(false);
+ const [openModalPublish, setOpenModalPublish] = useState(false);
+ const [openModalReject, setOpenModalReject] = useState(false);
const [isLoadingPublish, setIsLoadingPublish] = useState(false);
const [isLoadingReject, setIsLoadingReject] = useState(false);
const [report, setReport] = useState("");
+ const investasiId = params;
useShallowEffect(() => {
cekStatusPublish();
+ loadInitialData();
}, []);
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminInvestasiById({
+ id: params.id,
+ });
+
+ if (response?.success && response?.data) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved:", error);
+ setData(null);
+ }
+ };
+
async function cekStatusPublish() {
- if (data.MasterStatusInvestasi.id === "3") setPublish(false);
+ if (data?.MasterStatusInvestasi.id === "3") setPublish(false);
}
async function onReject() {
const body = {
- id: data.id,
+ id: data?.id,
catatan: report,
status: "4",
};
if (_.isEmpty(body.catatan))
return ComponentAdminGlobal_NotifikasiPeringatan("Lengkapi alasan");
- const res = await Admin_funRejectInvestasi(body);
- if (res.status === 200) {
+ try {
setIsLoadingReject(true);
+ const res = await Admin_funRejectInvestasi(body);
+ if (res.status === 200) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res.data?.id as string,
+ userId: res.data?.authorId as string,
+ pesan: res.data?.title as string,
+ status: res.data?.MasterStatusInvestasi?.name as any,
+ kategoriApp: "INVESTASI",
+ title: "Investasi anda di tolak !",
+ };
- const dataNotif = {
- appId: res.data?.id,
- userId: res.data?.authorId,
- pesan: res.data?.title,
- status: res.data?.MasterStatusInvestasi?.name,
- kategoriApp: "INVESTASI",
- title: "Investasi anda di tolak !",
- };
+ const notif = await adminNotifikasi_funCreateToUser({
+ data: dataNotifikasi as any,
+ });
- const notif = await adminNotifikasi_funCreateToUser({
- data: dataNotif as any,
- });
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+ }
- if (notif.status === 201) {
- mqtt_client.publish(
- "USER",
- JSON.stringify({ userId: res?.data?.authorId, count: 1 })
- );
+ ComponentAdminGlobal_NotifikasiBerhasil(res.message);
+ router.back();
+ setOpenModalReject(false);
+ setIsLoadingReject(false);
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(res.message);
+ setOpenModalReject(false);
+ setIsLoadingReject(false);
}
-
- const loadData = await getOneInvestasiById(data.id);
- setData(loadData as any);
-
- ComponentAdminGlobal_NotifikasiBerhasil(res.message);
- router.back();
- setOpenModal(false);
+ } catch (error) {
+ console.log(error);
+ setOpenModalReject(false);
setIsLoadingReject(false);
- } else {
- ComponentAdminGlobal_NotifikasiGagal(res.message);
- setOpenModal(false);
}
}
async function onPublish() {
- const res = await adminInvestasi_funEditStatusPublishById({
- investasiId: data.id,
- statusId: "1",
- progesInvestasiId: "1",
- });
- if (res.status === 200) {
- const dataNotif = {
- appId: res.data?.id,
- userId: res.data?.authorId as any,
- pesan: res.data?.title as any,
- status: res.data?.MasterStatusInvestasi?.name as any,
- kategoriApp: "INVESTASI",
- title: "Investasi publish",
- };
-
- const notif = await adminNotifikasi_funCreateToUser({
- data: dataNotif as any,
+ try {
+ setIsLoadingPublish(true);
+ const res = await adminInvestasi_funEditStatusPublishById({
+ investasiId: data?.id as any,
+ statusId: "1",
+ progesInvestasiId: "1",
});
+ if (res.status === 200) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res.data?.id as string,
+ userId: res.data?.authorId as any,
+ pesan: res.data?.title as any,
+ status: res.data?.MasterStatusInvestasi?.name as any,
+ kategoriApp: "INVESTASI",
+ title: "Investasi publish",
+ };
- if (notif.status === 201) {
- mqtt_client.publish(
- "USER",
- JSON.stringify({ userId: res?.data?.authorId, count: 1 })
- );
+ const notif = await adminNotifikasi_funCreateToUser({
+ data: dataNotifikasi as any,
+ });
- mqtt_client.publish(
- "Beranda_Investasi",
- JSON.stringify({ update: true })
- );
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
- const loadData = await getOneInvestasiById(data.id);
- setData(loadData as any);
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
- ComponentAdminGlobal_NotifikasiBerhasil("Proyek Investasi Di Publish");
- router.back();
- // router.push(RouterAdminInvestasi_OLD.table_status_review);
+ ComponentAdminGlobal_NotifikasiBerhasil(
+ "Proyek Investasi Di Publish"
+ );
+ setOpenModalPublish(false);
+ setIsLoadingPublish(false);
+ router.back();
+ // router.push(RouterAdminInvestasi_OLD.table_status_review);
+ }
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(res.message);
+ setOpenModalPublish(false);
+ setIsLoadingPublish(false);
}
- } else {
- ComponentAdminGlobal_NotifikasiGagal(res.message);
+ } catch (error) {
+ console.log(error);
+ setOpenModalPublish(false);
+ setIsLoadingPublish(false);
}
}
return (
<>
-
+
+
-
+
- {data.masterStatusInvestasiId === "2" ? (
+ {data?.masterStatusInvestasiId === "2" ? (
onPublish()}
+ onClick={() => setOpenModalPublish(true)}
>
Publish
setOpenModal(true)}
+ onClick={() => setOpenModalReject(true)}
>
Reject
@@ -166,7 +201,7 @@ export default function AdminInvestasi_DetailReview({
)}
-
- {/* Data Author */}
-
+
- {/* Data Foto */}
-
+
- {/* Data Detail */}
-
+ */}
-
+ {!data ? (
+
+ ) : (
+
+
+ {/* Data Foto */}
+
+
+
+
+
+ )}
setOpenModal(false)}
+ opened={openModalReject}
+ onClose={() => setOpenModalReject(false)}
title="Alasan Penolakan"
onHandlerChange={(val) => setReport(val.target.value)}
buttonKiri={
- setOpenModal(false)}>
+ setOpenModalReject(false)}>
Batal
}
buttonKanan={
{
@@ -216,8 +262,29 @@ export default function AdminInvestasi_DetailReview({
}
/>
-
-
+ setOpenModalPublish(false)}
+ title="Anda Yakin Ingin Mempublish Investasi Ini ?"
+ buttonKiri={
+ setOpenModalPublish(false)}>
+ Batal
+
+ }
+ buttonKanan={
+ {
+ onPublish();
+ }}
+ >
+ Simpan
+
+ }
+ />
>
);
}
diff --git a/src/app_modules/admin/investasi/fun/count_status.ts b/src/app_modules/admin/investasi/fun/count_status.ts
index 22fe1409..a489c5e5 100644
--- a/src/app_modules/admin/investasi/fun/count_status.ts
+++ b/src/app_modules/admin/investasi/fun/count_status.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _ from "lodash";
/**
diff --git a/src/app_modules/admin/investasi/fun/edit/fun_accept_invoice_by_id.ts b/src/app_modules/admin/investasi/fun/edit/fun_accept_invoice_by_id.ts
index 61081ad6..a95503aa 100644
--- a/src/app_modules/admin/investasi/fun/edit/fun_accept_invoice_by_id.ts
+++ b/src/app_modules/admin/investasi/fun/edit/fun_accept_invoice_by_id.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
+import prisma from "@/lib/prisma";
+import { RouterAdminInvestasi } from "@/lib/router_admin/router_admin_investasi";
import { toNumber } from "lodash";
import { revalidatePath } from "next/cache";
@@ -13,7 +13,11 @@ export async function adminInvestasi_funAcceptTransaksiById({
invoiceId: string;
investasiId: string;
lembarTerbeli: string;
-}) {
+ }) {
+ console.log("Ini invoiceid", invoiceId)
+ console.log("Ini investasid", investasiId)
+ console.log("Ini lembar terbeli", lembarTerbeli)
+
const dataInvestasi: any = await prisma.investasi.findFirst({
where: {
id: investasiId,
@@ -24,7 +28,6 @@ export async function adminInvestasi_funAcceptTransaksiById({
lembarTerbeli: true,
},
});
-
// Hitung TOTAL SISA LEMBAR
const investasi_sisaLembar = toNumber(dataInvestasi?.sisaLembar);
const invoice_lembarTerbeli = toNumber(lembarTerbeli);
@@ -47,6 +50,7 @@ export async function adminInvestasi_funAcceptTransaksiById({
statusInvoiceId: "1",
},
});
+
if (!updt) {
return { status: 400, message: "Gagal Update Status" };
@@ -60,15 +64,29 @@ export async function adminInvestasi_funAcceptTransaksiById({
lembarTerbeli: resultLembarTerbeli.toString(),
progress: resultProgres,
},
+ include: {
+ MasterStatusInvestasi: true,
+ },
});
if (!updateInvestasi)
return { status: 400, message: "Gagal Update Data Investasi" };
+ const newData = updateInvestasi;
+
+ const allData = {
+ dataInvestasi: updateInvestasi,
+ dataInvestor: updt,
+ };
+
revalidatePath(RouterAdminInvestasi.detail_publish);
return {
status: 200,
message: "Update Berhasil",
+ data: allData,
};
}
}
+
+
+
diff --git a/src/app_modules/admin/investasi/fun/edit/fun_reject_invoice_by_id.ts b/src/app_modules/admin/investasi/fun/edit/fun_reject_invoice_by_id.ts
index 1facc575..abe71ee0 100644
--- a/src/app_modules/admin/investasi/fun/edit/fun_reject_invoice_by_id.ts
+++ b/src/app_modules/admin/investasi/fun/edit/fun_reject_invoice_by_id.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
+import prisma from "@/lib/prisma";
+import { RouterAdminInvestasi } from "@/lib/router_admin/router_admin_investasi";
import { revalidatePath } from "next/cache";
export async function adminInvestasi_funRejectInvoiceById({
@@ -9,9 +9,6 @@ export async function adminInvestasi_funRejectInvoiceById({
}: {
invoiceId: string;
}) {
-
-
-
const updt = await prisma.investasi_Invoice.update({
where: {
id: invoiceId,
@@ -19,12 +16,19 @@ export async function adminInvestasi_funRejectInvoiceById({
data: {
statusInvoiceId: "4",
},
+ select: {
+ StatusInvoice: true,
+ authorId: true,
+ },
});
- if (!updt) return { status: 400, message: "Gagal Update" };
+ if (!updt)
+ return { status: 400, message: "Gagal Melakukan Reject", statusName: "" , userId: ""};
revalidatePath(RouterAdminInvestasi.detail_publish);
return {
status: 200,
- message: "Update Berhasil",
+ message: "Reject Berhasil",
+ statusName: updt.StatusInvoice?.name,
+ userId: updt.authorId,
};
}
diff --git a/src/app_modules/admin/investasi/fun/edit/fun_status_publish_by_id.ts b/src/app_modules/admin/investasi/fun/edit/fun_status_publish_by_id.ts
index c7c5f4a2..dc6e282c 100644
--- a/src/app_modules/admin/investasi/fun/edit/fun_status_publish_by_id.ts
+++ b/src/app_modules/admin/investasi/fun/edit/fun_status_publish_by_id.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import prisma from "@/lib/prisma";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { revalidatePath } from "next/cache";
export async function adminInvestasi_funEditStatusPublishById({
diff --git a/src/app_modules/admin/investasi/fun/fun_reject_investasi.ts b/src/app_modules/admin/investasi/fun/fun_reject_investasi.ts
index 40d3081e..af9052ac 100644
--- a/src/app_modules/admin/investasi/fun/fun_reject_investasi.ts
+++ b/src/app_modules/admin/investasi/fun/fun_reject_investasi.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
+import prisma from "@/lib/prisma";
+import { RouterAdminInvestasi } from "@/lib/router_admin/router_admin_investasi";
import { revalidatePath } from "next/cache";
export default async function Admin_funRejectInvestasi(data: any) {
diff --git a/src/app_modules/admin/investasi/fun/get/fun_get_all_transaksi_by_id.ts b/src/app_modules/admin/investasi/fun/get/fun_get_all_transaksi_by_id.ts
index 299e67ea..b9c51f14 100644
--- a/src/app_modules/admin/investasi/fun/get/fun_get_all_transaksi_by_id.ts
+++ b/src/app_modules/admin/investasi/fun/get/fun_get_all_transaksi_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { ceil } from "lodash";
export async function adminInvestasi_funGetAllTransaksiById({
diff --git a/src/app_modules/admin/investasi/fun/get/fun_get_investasi_by_id.ts b/src/app_modules/admin/investasi/fun/get/fun_get_investasi_by_id.ts
index 486f4d2f..09dfd313 100644
--- a/src/app_modules/admin/investasi/fun/get/fun_get_investasi_by_id.ts
+++ b/src/app_modules/admin/investasi/fun/get/fun_get_investasi_by_id.ts
@@ -1,5 +1,5 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function adminInvestasi_getOneById({
investasiId,
diff --git a/src/app_modules/admin/investasi/fun/get/fun_get_status_transaksi.ts b/src/app_modules/admin/investasi/fun/get/fun_get_status_transaksi.ts
index e8e4acdc..d07ca3fd 100644
--- a/src/app_modules/admin/investasi/fun/get/fun_get_status_transaksi.ts
+++ b/src/app_modules/admin/investasi/fun/get/fun_get_status_transaksi.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function adminInvestasi_getStatusInvestasi() {
const data = await prisma.investasiMaster_StatusInvoice.findMany({
diff --git a/src/app_modules/admin/investasi/fun/get/get_all_publish.ts b/src/app_modules/admin/investasi/fun/get/get_all_publish.ts
index 6458c89b..58295160 100644
--- a/src/app_modules/admin/investasi/fun/get/get_all_publish.ts
+++ b/src/app_modules/admin/investasi/fun/get/get_all_publish.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { ceil } from "lodash";
export async function adminInvestasi_funGetAllPublish({
diff --git a/src/app_modules/admin/investasi/fun/get/get_all_reject.ts b/src/app_modules/admin/investasi/fun/get/get_all_reject.ts
index 52325f8e..50fb2b6b 100644
--- a/src/app_modules/admin/investasi/fun/get/get_all_reject.ts
+++ b/src/app_modules/admin/investasi/fun/get/get_all_reject.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { ceil } from "lodash";
export async function adminInvestasi_funGetAllReject({
diff --git a/src/app_modules/admin/investasi/fun/get/get_all_review.ts b/src/app_modules/admin/investasi/fun/get/get_all_review.ts
index 94b9334a..0f8aa613 100644
--- a/src/app_modules/admin/investasi/fun/get/get_all_review.ts
+++ b/src/app_modules/admin/investasi/fun/get/get_all_review.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { ceil } from "lodash";
export async function adminInvestasi_funGetAllReview({
diff --git a/src/app_modules/admin/investasi/fun/get_all_investasi.ts b/src/app_modules/admin/investasi/fun/get_all_investasi.ts
index 69504d5c..d99050c6 100644
--- a/src/app_modules/admin/investasi/fun/get_all_investasi.ts
+++ b/src/app_modules/admin/investasi/fun/get_all_investasi.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function Admin_funGetAllInvestasi() {
const res = await prisma.investasi.findMany({
diff --git a/src/app_modules/admin/investasi/fun/get_publish_progres.ts b/src/app_modules/admin/investasi/fun/get_publish_progres.ts
index d920aa62..e5dcd708 100644
--- a/src/app_modules/admin/investasi/fun/get_publish_progres.ts
+++ b/src/app_modules/admin/investasi/fun/get_publish_progres.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _ from "lodash";
export default async function Admin_getPublishProgresInvestasi() {
diff --git a/src/app_modules/admin/investasi/fun/get_total_investasi_by_user.ts b/src/app_modules/admin/investasi/fun/get_total_investasi_by_user.ts
index 0438306c..654ff228 100644
--- a/src/app_modules/admin/investasi/fun/get_total_investasi_by_user.ts
+++ b/src/app_modules/admin/investasi/fun/get_total_investasi_by_user.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function Admin_getTotalInvestasiByUser() {
const data = await prisma.user.findMany({
diff --git a/src/app_modules/admin/investasi/main/table_publish.tsx b/src/app_modules/admin/investasi/main/table_publish.tsx
index 38b5bd18..d3e7a257 100644
--- a/src/app_modules/admin/investasi/main/table_publish.tsx
+++ b/src/app_modules/admin/investasi/main/table_publish.tsx
@@ -1,8 +1,9 @@
"use client";
-import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
+import { RouterAdminInvestasi } from "@/lib/router_admin/router_admin_investasi";
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
import {
+ Box,
Button,
Center,
Group,
@@ -15,119 +16,186 @@ import {
TextInput,
Title,
} from "@mantine/core";
-import { IconSearch } from "@tabler/icons-react";
+import {
+ IconDetails,
+ IconEye,
+ IconEyeCheck,
+ IconInfoCircle,
+ IconSearch,
+} from "@tabler/icons-react";
import _ from "lodash";
import { useRouter } from "next/navigation";
import { useState } from "react";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
import { adminInvestasi_funGetAllPublish } from "../fun/get/get_all_publish";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
+import { MainColor } from "@/app_modules/_global/color";
+import {
+ AccentColor,
+ AdminColor,
+} from "@/app_modules/_global/color/color_pallet";
+import { apiGetAdminInvestasiByStatus } from "../_lib/api_fetch_admin_investasi";
+import { useShallowEffect } from "@mantine/hooks";
+import { clientLogger } from "@/util/clientLogger";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
-export default function Admin_TablePublishInvestasi({
- dataInvestsi,
-}: {
- dataInvestsi: MODEL_INVESTASI[];
-}) {
+export default function Admin_TablePublishInvestasi() {
return (
<>
-
+
{/* {JSON.stringify(listPublish, null, 2)} */}
>
);
}
-function TableView({ listData }: { listData: any }) {
+function TableView() {
const router = useRouter();
- const [data, setData] = useState(listData.data);
- const [nPage, setNPage] = useState(listData.nPage);
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
const [isLoading, setLoading] = useState(false);
const [idData, setIdData] = useState("");
+ const [origin, setOrigin] = useState("");
- async function onSearch(s: string) {
- setSearch(s);
- setActivePage(1);
- const loadData = await adminInvestasi_funGetAllPublish({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ useShallowEffect(() => {
+ if (typeof window !== "undefined") {
+ setOrigin(window.location.origin);
+ }
+ }, []);
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminInvestasi_funGetAllPublish({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ useShallowEffect(() => {
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminInvestasiByStatus({
+ name: "Publish",
+ page: `${activePage}`,
+ search: isSearch,
+ });
- const tableBody = data.map((e) => (
-
- |
-
- {e.author.username}
-
- |
-
-
- {e.title}
-
- |
-
- {_.toNumber(e.progress).toFixed(2)} %
- |
-
-
- {new Intl.NumberFormat("id-ID", {
- maximumFractionDigits: 10,
- }).format(+e.sisaLembar)}
-
- |
-
-
- {new Intl.NumberFormat("id-ID", {
- maximumFractionDigits: 10,
- }).format(+e.totalLembar)}
-
- |
-
-
- {e.Investasi_Invoice.length}
-
- |
-
-
- {
- setIdData(e.id);
- setLoading(true);
- router.push(RouterAdminInvestasi.detail_publish + `${e.id}`);
- }}
- >
- Detail
-
-
- |
-
- ));
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
+ };
+
+ loadInitialData();
+ }, [activePage, isSearch]);
+ const onSearch = async (searchTerm: string) => {
+ setSearch(searchTerm);
+ };
+
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
+
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+ return data.map((e, i) => (
+
+ |
+
+
+ {e.author.username}
+
+
+ |
+
+
+
+ {e.title}
+
+
+ |
+
+
+ {_.toNumber(e.progress).toFixed(2)} %
+
+ |
+
+
+ {new Intl.NumberFormat("id-ID", {
+ maximumFractionDigits: 10,
+ }).format(+e.sisaLembar)}
+
+ |
+
+
+ {new Intl.NumberFormat("id-ID", {
+ maximumFractionDigits: 10,
+ }).format(+e.totalLembar)}
+
+ |
+
+
+
+ {e.Investasi_Invoice.length}
+
+
+ |
+
+
+ }
+ onClick={() => {
+ setIdData(e.id);
+ setLoading(true);
+ router.push(RouterAdminInvestasi.detail_publish + `${e.id}`);
+ }}
+ >
+ Detail
+
+
+ |
+
+ ));
+ };
return (
<>
- }
+ radius={"xl"}
+ placeholder={"Cari nama proyek"}
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
+ {/*
-
+ */}
- {_.isEmpty(data) ? (
-
+ {!data ? (
+
) : (
-
+
|
- Username
+ Username
|
- Nama Proyek
+ Nama Proyek
|
- Progres
+ Progres
|
- Sisa Saham
+ Sisa Saham
|
- Total Saham
+ Total Saham
|
- Validasi
+ Validasi
|
- Aksi
+ Aksi
|
- {tableBody}
+ {renderTableBody()}
-
- {
- onPageClick(val);
- }}
- />
-
+ {
+ onPageClick(val);
+ }}
+ />
)}
diff --git a/src/app_modules/admin/investasi/main/table_reject.tsx b/src/app_modules/admin/investasi/main/table_reject.tsx
index 8f3647cb..301faefd 100644
--- a/src/app_modules/admin/investasi/main/table_reject.tsx
+++ b/src/app_modules/admin/investasi/main/table_reject.tsx
@@ -1,193 +1,229 @@
"use client";
-import { RouterAdminInvestasi_OLD } from "@/app/lib/router_hipmi/router_admin";
-import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
import {
- Badge,
- ActionIcon,
- Box,
- ScrollArea,
- Table,
- Tooltip,
- Stack,
- Center,
- Avatar,
- Group,
- Text,
+ AccentColor,
+ AdminColor,
+} from "@/app_modules/_global/color/color_pallet";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
+import { RouterAdminInvestasi } from "@/lib/router_admin/router_admin_investasi";
+import { clientLogger } from "@/util/clientLogger";
+import {
Button,
+ Center,
Pagination,
Paper,
+ ScrollArea,
+ Stack,
+ Table,
+ Text,
TextInput,
- Title,
} from "@mantine/core";
-import { IconChevronLeft, IconEdit, IconSearch } from "@tabler/icons-react";
-import _ from "lodash";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconEyeCheck, IconSearch } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
-import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
-import { adminInvestasi_funGetAllReview } from "../fun/get/get_all_review";
-import { adminInvestasi_funGetAllReject } from "../fun/get/get_all_reject";
-import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
-
-export default function Admin_TableRejectInvestasi({
- dataInvestsi,
-}: {
- dataInvestsi: any[];
-}) {
- const [investasi, setInvestasi] = useState(dataInvestsi);
- const router = useRouter();
+import { apiGetAdminInvestasiByStatus } from "../_lib/api_fetch_admin_investasi";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
+export default function Admin_TableRejectInvestasi() {
return (
<>
-
+
>
);
- const tableBody = investasi.map((e) =>
- e.MasterStatusInvestasi.id === "4" ? (
-
- |
-
-
- {e.author.username}
-
- |
- {_.capitalize(e.title)} |
- {e.catatan} |
-
-
-
-
- router.push(RouterAdminInvestasi_OLD.konfirmasi + `${e.id}`)
- }
- >
-
-
-
-
- |
-
- ) : (
- ""
- )
- );
+ // const tableBody = investasi.map((e) =>
+ // e.MasterStatusInvestasi.id === "4" ? (
+ //
+ // |
+ //
+ //
+ // {e.author.username}
+ //
+ // |
+ // {_.capitalize(e.title)} |
+ // {e.catatan} |
+ //
+ //
+ //
+ //
+ // router.push(RouterAdminInvestasi_OLD.konfirmasi + `${e.id}`)
+ // }
+ // >
+ //
+ //
+ //
+ //
+ // |
+ //
+ // ) : (
+ // ""
+ // )
+ // );
- return (
- <>
-
- router.push(RouterAdminInvestasi_OLD.main_investasi)}
- >
-
-
-
-
-
- Reject
-
-
-
-
- | Username |
- Nama Proyek Investasi |
- Catatan |
-
- Aksi
- |
-
-
- {tableBody}
-
-
-
-
- >
- );
+ // return (
+ // <>
+ //
+ // router.push(RouterAdminInvestasi_OLD.main_investasi)}
+ // >
+ //
+ //
+ //
+ //
+ //
+ // Reject
+ //
+ //
+ //
+ //
+ // | Username |
+ // Nama Proyek Investasi |
+ // Catatan |
+ //
+ // Aksi
+ // |
+ //
+ //
+ // {tableBody}
+ //
+ //
+ //
+ //
+ // >
+ // );
}
-function TableView({ listData }: { listData: any }) {
+function TableView() {
const router = useRouter();
- const [data, setData] = useState(listData.data);
- const [nPage, setNPage] = useState(listData.nPage);
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
const [isLoading, setLoading] = useState(false);
const [idData, setIdData] = useState("");
- async function onSearch(s: string) {
- setSearch(s);
+ useShallowEffect(() => {
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminInvestasiByStatus({
+ name: "Reject",
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format recieved:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data reject", error);
+ setData([]);
+ }
+ };
+ loadInitialData();
+ }, [activePage, isSearch]);
+ const onSearch = async (searchTerm: string) => {
+ setSearch(searchTerm);
setActivePage(1);
- const loadData = await adminInvestasi_funGetAllReject({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
+ };
+
+ async function onPageClick(page: number) {
+ setActivePage(page);
}
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminInvestasi_funGetAllReject({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+ return data.map((e, i) => (
+
+ |
+
+
+ {e.author.username}
+
+
+ |
+
+
+
+ {e.title}
+
+
+ |
+
+
+
+ {e.catatan}
+
+
+ |
- const tableBody = data.map((e) => (
-
- |
-
- {e.author.username}
-
- |
-
-
- {e.title}
-
- |
-
-
- {e.catatan}
-
- |
-
-
-
- {
- setIdData(e.id);
- setLoading(true);
- router.push(RouterAdminInvestasi.detail_reject + `${e.id}`);
- }}
- >
- Detail
-
-
- |
-
- ));
+
+
+ }
+ radius={"xl"}
+ onClick={() => {
+ setIdData(e.id);
+ setLoading(true);
+ router.push(RouterAdminInvestasi.detail_reject + `${e.id}`);
+ }}
+ >
+ Detail
+
+
+ |
+
+ ));
+ };
return (
<>
- }
+ radius={"xl"}
+ placeholder="Cari nama proyek"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
+ {/*
-
+ */}
- {_.isEmpty(data) ? (
-
+ {!data ? (
+
) : (
-
+
|
- Username
+ Username
|
- Nama Proyek
+ Nama Proyek
|
- Catatan Penolakan
+ Catatan Penolakan
|
- Aksi
+ Aksi
|
- {tableBody}
+ {renderTableBody()}
-
- {
- onPageClick(val);
- }}
- />
-
+ {
+ onPageClick(val);
+ }}
+ />
)}
diff --git a/src/app_modules/admin/investasi/main/table_review.tsx b/src/app_modules/admin/investasi/main/table_review.tsx
index b8e45c46..884cd711 100644
--- a/src/app_modules/admin/investasi/main/table_review.tsx
+++ b/src/app_modules/admin/investasi/main/table_review.tsx
@@ -1,134 +1,182 @@
"use client";
-import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
-import { RouterAdminInvestasi_OLD } from "@/app/lib/router_hipmi/router_admin";
+import { AccentColor } from "@/app_modules/_global/color";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
+import { gs_adminInvestasi_triggerReview } from "@/lib/global_state";
+import { RouterAdminInvestasi_OLD } from "@/lib/router_hipmi/router_admin";
+import { clientLogger } from "@/util/clientLogger";
import {
- Badge,
- ActionIcon,
- Box,
- ScrollArea,
- Table,
- Tooltip,
- Stack,
- Group,
- Avatar,
- Text,
- Center,
+ Affix,
Button,
- Pagination,
+ Center,
Paper,
+ rem,
+ ScrollArea,
+ Stack,
+ Table,
+ Text,
TextInput,
- Title,
} from "@mantine/core";
-import { IconChevronLeft, IconEdit, IconSearch } from "@tabler/icons-react";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconEyeCheck, IconRefresh, IconSearch } from "@tabler/icons-react";
+import { useAtom } from "jotai";
+import _ from "lodash";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
-import { adminInvestasi_funGetAllReview } from "../fun/get/get_all_review";
-import _ from "lodash";
-import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
import ComponentAdminGlobal_TampilanRupiahDonasi from "../../_admin_global/tampilan_rupiah";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
+import { apiGetAdminInvestasiByStatus } from "../_lib/api_fetch_admin_investasi";
-export default function Admin_TableReviewInvestasi({
- dataInvestsi,
-}: {
- dataInvestsi: any[];
-}) {
+export default function Admin_TableReviewInvestasi() {
return (
<>
-
+
>
);
}
-function TableView({ listData }: { listData: any }) {
+function TableView() {
const router = useRouter();
- const [data, setData] = useState(listData.data);
- const [nPage, setNPage] = useState(listData.nPage);
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
const [isLoading, setLoading] = useState(false);
const [idData, setIdData] = useState("");
- async function onSearch(s: string) {
- setSearch(s);
+ // Realtime
+ const [isAdminInvestasi_TriggerReview, setIsAdminInvestasi_TriggerReview] =
+ useAtom(gs_adminInvestasi_triggerReview);
+ const [isShowReload, setIsShowReload] = useState(false);
+ const [isLoadingReload, setLoadingReload] = useState(false);
+
+ useShallowEffect(() => {
+ loadInitialData();
+ }, [activePage, isSearch]);
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminInvestasiByStatus({
+ name: "Review",
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table review", error);
+ setData([]);
+ }
+ };
+ const onSearch = async (searchTerm: string) => {
+ setSearch(searchTerm);
setActivePage(1);
- const loadData = await adminInvestasi_funGetAllReview({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
+ };
+
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
+ async function onLoadData() {
+ loadInitialData();
+ setLoading(false);
+ setIsShowReload(false);
+ setIsAdminInvestasi_TriggerReview(false);
}
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminInvestasi_funGetAllReview({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
-
- const tableBody = data.map((e) => (
-
- |
-
- {e.author.username}
-
- |
-
-
- {e.title}
-
- |
-
-
- {e.roi} %
-
- |
-
-
-
-
- |
-
-
-
-
- |
-
-
- {
- setIdData(e.id);
- setLoading(true);
- router.push(RouterAdminInvestasi_OLD.konfirmasi + `${e.id}`);
- }}
- >
- Detail
-
-
- |
-
- ));
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+ return data.map((e, i) => (
+
+ |
+
+ {e.author.username}
+
+ |
+
+
+ {e.title}
+
+ |
+
+
+ {e.roi} %
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+ }
+ radius={"xl"}
+ onClick={() => {
+ setIdData(e.id);
+ setLoading(true);
+ router.push(RouterAdminInvestasi_OLD.konfirmasi + `${e.id}`);
+ }}
+ >
+ Detail
+
+
+ |
+
+ ));
+ };
return (
<>
- }
+ radius={"xl"}
+ placeholder="Cari nama proyek"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
+ {/*
-
+ */}
- {_.isEmpty(data) ? (
-
+ {!data ? (
+
) : (
-
+
+ {isShowReload && (
+
+
+
+ onLoadData()}
+ leftIcon={}
+ >
+ Update Data
+
+
+
+
+ )}
+
|
- Username
+ Username
|
- Nama Proyek
+ Nama Proyek
|
- ROI
+ ROI
|
- Target Dana
+ Target Dana
|
- Harga Perlembar
+ Harga Perlembar
|
- Aksi
+ Aksi
|
- {tableBody}
+ {renderTableBody()}
-
- {
- onPageClick(val);
- }}
- />
-
+
+ {
+ onPageClick(val);
+ }}
+ />
)}
diff --git a/src/app_modules/admin/investasi/main/view.tsx b/src/app_modules/admin/investasi/main/view.tsx
index 8528afad..30498ca5 100644
--- a/src/app_modules/admin/investasi/main/view.tsx
+++ b/src/app_modules/admin/investasi/main/view.tsx
@@ -1,7 +1,7 @@
"use client";
-import { RouterAdminInvestasi_OLD } from "@/app/lib/router_hipmi/router_admin";
-import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
+import { RouterAdminInvestasi_OLD } from "@/lib/router_hipmi/router_admin";
+import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
import {
ActionIcon,
Avatar,
@@ -9,6 +9,7 @@ import {
Box,
Center,
Divider,
+ Flex,
Grid,
Group,
Paper,
@@ -17,16 +18,20 @@ import {
Stack,
Table,
Text,
+ ThemeIcon,
Title,
} from "@mantine/core";
import {
+ IconAlertTriangle,
IconArrowBadgeRight,
IconArrowBigRightLine,
IconArrowsMaximize,
+ IconBookmark,
IconCaretRight,
IconChevronsDownRight,
IconChevronsRight,
IconEdit,
+ IconUpload,
IconZoomCheck,
} from "@tabler/icons-react";
import { useRouter } from "next/navigation";
@@ -39,48 +44,121 @@ import _ from "lodash";
import TableTotalInvestasi from "./table_total_investasi";
import TablePublikasiProgresInvestasi from "./table_publikasi_progres";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { clientLogger } from "@/util/clientLogger";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import global_limit from "@/lib/limit";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetAdminInvestasiCountDashboard } from "../_lib/api_fetch_admin_investasi";
-export default function Admin_Investasi({
- listInvestasi,
- countDraft,
- countReview,
- countPublish,
- countReject,
- totalInvestasiByUser,
- publishProgres,
-}: {
- listInvestasi: MODEL_INVESTASI[];
- countDraft: number | any;
- countReview: number | any;
- countPublish: number | any;
- countReject: number | any;
- totalInvestasiByUser: any[];
- publishProgres: any[];
-}) {
- const [investasi, setInvestasi] = useState(listInvestasi);
- const router = useRouter();
+export default function Admin_Investasi() {
+ const [countPublish, setCountPublish] = useState(null);
+ const [countReview, setCountReview] = useState(null);
+ const [countReject, setCountReject] = useState(null);
+
+ useShallowEffect(() => {
+ handlerLoadData();
+ }, []);
+ async function handlerLoadData() {
+ try {
+ const listLoadData = [
+ global_limit(() => onLoadCountPublish()),
+ global_limit(() => onLoadCountReview()),
+ global_limit(() => onLoadCountReject()),
+ ];
+
+ const result = await Promise.all(listLoadData);
+ } catch (error) {
+ clientLogger.error("Error handler load data", error);
+ }
+ }
+
+ async function onLoadCountPublish() {
+ try {
+ const response = await apiGetAdminInvestasiCountDashboard({
+ name: "Publish",
+ });
+
+ if (response) {
+ setCountPublish(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count publish", error);
+ }
+ }
+ async function onLoadCountReview() {
+ try {
+ const response = await apiGetAdminInvestasiCountDashboard({
+ name: "Review",
+ });
+
+ if (response) {
+ setCountReview(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count review", error);
+ }
+ }
+ async function onLoadCountReject() {
+ try {
+ const response = await apiGetAdminInvestasiCountDashboard({
+ name: "Reject",
+ });
+
+ if (response) {
+ setCountReject(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count reject", error);
+ }
+ }
const listBox = [
{
id: 1,
name: "Publish",
- jumlah: countPublish,
- link: RouterAdminInvestasi_OLD.table_status_publish,
- color: "green",
+ jumlah:
+ countPublish == null ? (
+
+ ) : countPublish ? (
+ countPublish
+ ) : (
+ "-"
+ ),
+ path: RouterAdminInvestasi_OLD.table_status_publish,
+ color: MainColor.green,
+ icon: ,
},
{
id: 2,
name: "Review",
- jumlah: countReview,
- link: RouterAdminInvestasi_OLD.table_status_review,
- color: "orange",
+ jumlah:
+ countReview == null ? (
+
+ ) : countReview ? (
+ countReview
+ ) : (
+ "-"
+ ),
+ path: RouterAdminInvestasi_OLD.table_status_review,
+ color: MainColor.orange,
+ icon: ,
},
{
id: 3,
name: "Reject",
- jumlah: countReject,
- link: RouterAdminInvestasi_OLD.table_status_reject,
- color: "red",
+ jumlah:
+ countReject == null ? (
+
+ ) : countReject ? (
+ countReject
+ ) : (
+ "-"
+ ),
+ path: RouterAdminInvestasi_OLD.table_status_reject,
+ color: MainColor.red,
+ icon: ,
},
];
@@ -101,18 +179,27 @@ export default function Admin_Investasi({
{listBox.map((e, i) => (
-
-
- {e.name}
- {e.jumlah}
-
-
+
+
+ {e.name}
+
+
+ {e.jumlah}
+
+ {e.icon}
+
+
+
))}
diff --git a/src/app_modules/admin/job/_components/detail/image_view.tsx b/src/app_modules/admin/job/_components/detail/image_view.tsx
new file mode 100644
index 00000000..3e2ae8b0
--- /dev/null
+++ b/src/app_modules/admin/job/_components/detail/image_view.tsx
@@ -0,0 +1,47 @@
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { Admin_ComponentBoxStyle } from "@/app_modules/admin/_admin_global/_component/comp_admin_boxstyle";
+import { APIs, pathAssetImage } from "@/lib";
+import { Center, Image } from "@mantine/core";
+import { IconError404 } from "@tabler/icons-react";
+import { data } from "autoprefixer";
+import { useState } from "react";
+
+export function AdminJob_ComponentImageView({ imageId }: { imageId: string }) {
+ const [isLoading, setLoading] = useState(false);
+ const [isError, setError] = useState(false);
+
+ return (
+ <>
+
+
+ {isError ? (
+
+ ) : (
+ setLoading(false)}
+ onError={() => {
+ setError(true);
+ }}
+ alt="Foto"
+ src={APIs.GET({ fileId: imageId })}
+ mah={500}
+ maw={300}
+ />
+ )}
+
+ {isLoading ? (
+
+
+
+ ) : (
+ ""
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/job/_components/detail/publish.tsx b/src/app_modules/admin/job/_components/detail/publish.tsx
new file mode 100644
index 00000000..4630f491
--- /dev/null
+++ b/src/app_modules/admin/job/_components/detail/publish.tsx
@@ -0,0 +1,60 @@
+"use client";
+
+import { Admin_ComponentBoxStyle } from "@/app_modules/admin/_admin_global/_component/comp_admin_boxstyle";
+import { Admin_V3_ComponentBreakpoint } from "@/app_modules/admin/_components_v3/comp_simple_grid_breakpoint";
+import { MODEL_JOB } from "@/app_modules/job/model/interface";
+import { Badge, Grid, Stack, Text } from "@mantine/core";
+import { useState } from "react";
+import { AdminJob_ComponentImageView } from "./image_view";
+import { MainColor } from "@/app_modules/_global/color";
+import { Admin_V3_ComponentDetail } from "@/app_modules/admin/_components_v3/comp_detail_data";
+
+export function AdminJob_DetailPublish({ data }: { data: MODEL_JOB }) {
+ const [isLoading, setLoading] = useState(false);
+
+ const listData = [
+ {
+ title: "Username",
+ value: data.Author.username,
+ },
+ {
+ title: "Judul",
+ value: data.title,
+ },
+ {
+ title: "Status",
+ value: data.isArsip ? (
+ Arsip
+ ) : (
+ Publish
+ ),
+ },
+
+ {
+ title: "Konten",
+ value: ,
+ },
+ {
+ title: "Deskripsi ",
+ value: ,
+ },
+ ];
+
+ return (
+ <>
+
+
+
+ {listData.map((item, index) => (
+
+ ))}
+
+
+
+ {data.imageId && }
+
+ >
+ );
+}
+
+
diff --git a/src/app_modules/admin/job/_components/detail/reject.tsx b/src/app_modules/admin/job/_components/detail/reject.tsx
new file mode 100644
index 00000000..d06bd642
--- /dev/null
+++ b/src/app_modules/admin/job/_components/detail/reject.tsx
@@ -0,0 +1,186 @@
+"use client";
+
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_InputCountDown } from "@/app_modules/_global/component";
+import {
+ ComponentGlobal_NotifikasiBerhasil,
+ ComponentGlobal_NotifikasiGagal,
+} from "@/app_modules/_global/notif_global";
+import { Admin_ComponentBoxStyle } from "@/app_modules/admin/_admin_global/_component/comp_admin_boxstyle";
+import adminNotifikasi_funCreateToUser from "@/app_modules/admin/notifikasi/fun/create/fun_create_notif_user";
+import { MODEL_JOB } from "@/app_modules/job/model/interface";
+import { IRealtimeData } from "@/lib/global_state";
+import {
+ Button,
+ Grid,
+ Group,
+ Modal,
+ SimpleGrid,
+ Stack,
+ Text,
+ Textarea,
+} from "@mantine/core";
+import { IconBan } from "@tabler/icons-react";
+import { useState } from "react";
+import { WibuRealtime } from "wibu-pkg";
+import { AdminJob_funEditCatatanById } from "../../fun/edit/fun_edit_catatan_by_id";
+import { AdminJob_ComponentImageView } from "./image_view";
+import { Admin_V3_ComponentBreakpoint } from "@/app_modules/admin/_components_v3/comp_simple_grid_breakpoint";
+import { Admin_V3_ComponentDetail } from "@/app_modules/admin/_components_v3/comp_detail_data";
+
+export function AdminJob_DetailReject({ data }: { data: MODEL_JOB }) {
+ const [isLoading, setLoading] = useState(false);
+ const [isModal, setModal] = useState(false);
+ const [newData, setNewData] = useState(data);
+ const [catatan, setCatatan] = useState(data.catatan);
+
+ const listData = [
+ {
+ title: "Username",
+ value: newData.Author.username,
+ },
+ {
+ title: "Judul",
+ value: newData.title,
+ },
+ {
+ title: "Report",
+ value: newData.catatan,
+ },
+ {
+ title: "Konten",
+ value: ,
+ },
+ {
+ title: "Deskripsi",
+ value: ,
+ },
+ ];
+
+ async function onReject() {
+ try {
+ setLoading(true);
+ const reject = await AdminJob_funEditCatatanById(newData.id, catatan);
+ if (reject.status === 200) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: reject.data?.id as any,
+ status: reject.data?.MasterStatus?.name as any,
+ userId: reject.data?.authorId as any,
+ pesan: reject.data?.title as any,
+ kategoriApp: "JOB",
+ title: "Report tambahan",
+ };
+
+ const notif = await adminNotifikasi_funCreateToUser({
+ data: dataNotifikasi as any,
+ });
+
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+ }
+ setModal(false);
+ setNewData({ ...newData, catatan: catatan });
+ ComponentGlobal_NotifikasiBerhasil(reject.message);
+ } else {
+ ComponentGlobal_NotifikasiGagal(reject.message);
+ }
+ } catch (error) {
+ console.log("Error reject", error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ return (
+ <>
+
+
+
+ {listData.map((item, index) => (
+
+ ))}
+
+
+
+ }
+ radius={"xl"}
+ c={AdminColor.white}
+ onClick={() => {
+ setModal(true);
+ }}
+ >
+ Tambah Catatan
+
+
+
+
+ {newData.imageId && (
+
+ )}
+
+
+ {
+ setModal(false);
+ }}
+ withCloseButton={false}
+ size={"sm"}
+ centered
+ >
+
+
+
+
+ setModal(false)}>
+ Batal
+
+ {
+ onReject();
+ }}
+ >
+ Simpan
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/job/_components/detail/review.tsx b/src/app_modules/admin/job/_components/detail/review.tsx
new file mode 100644
index 00000000..8267f89a
--- /dev/null
+++ b/src/app_modules/admin/job/_components/detail/review.tsx
@@ -0,0 +1,285 @@
+"use client";
+
+import { MainColor } from "@/app_modules/_global/color";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_InputCountDown } from "@/app_modules/_global/component";
+import {
+ ComponentGlobal_NotifikasiBerhasil,
+ ComponentGlobal_NotifikasiGagal,
+} from "@/app_modules/_global/notif_global";
+import { Admin_ComponentBoxStyle } from "@/app_modules/admin/_admin_global/_component/comp_admin_boxstyle";
+import adminNotifikasi_funCreateToUser from "@/app_modules/admin/notifikasi/fun/create/fun_create_notif_user";
+import { MODEL_JOB } from "@/app_modules/job/model/interface";
+import { IRealtimeData } from "@/lib/global_state";
+import {
+ Button,
+ Grid,
+ Group,
+ Modal,
+ SimpleGrid,
+ Stack,
+ Text,
+ Textarea,
+} from "@mantine/core";
+import { IconBan, IconCircleCheck } from "@tabler/icons-react";
+import { useState } from "react";
+import { WibuRealtime } from "wibu-pkg";
+import { AdminJob_funEditCatatanById } from "../../fun/edit/fun_edit_catatan_by_id";
+import { AdminJob_funEditStatusPublishById } from "../../fun/edit/fun_edit_status_publish_by_id";
+import { AdminJob_ComponentImageView } from "./image_view";
+import { useRouter } from "next/navigation";
+import { Admin_V3_ComponentBreakpoint } from "@/app_modules/admin/_components_v3/comp_simple_grid_breakpoint";
+import { Admin_V3_ComponentDetail } from "@/app_modules/admin/_components_v3/comp_detail_data";
+
+export function AdminJob_DetailReview({ data }: { data: MODEL_JOB }) {
+ const router = useRouter();
+ const [publish, setPublish] = useState(false);
+ const [reject, setReject] = useState(false);
+ const [catatan, setCatatan] = useState("");
+ const [isLoadingPublish, setLoadingPublish] = useState(false);
+ const [isLoadingReject, setLoadingReject] = useState(false);
+
+ const listData = [
+ {
+ title: "Username",
+ value: data.Author.username,
+ },
+ {
+ title: "Judul",
+ value: data.title,
+ },
+ {
+ title: "Konten",
+ value: ,
+ },
+ {
+ title: "Deskripsi",
+ value: ,
+ },
+ ];
+
+ async function onPublish() {
+ try {
+ setLoadingPublish(true);
+ const publish = await AdminJob_funEditStatusPublishById(data.id);
+ if (publish.status === 200) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: publish.data?.id as any,
+ status: publish.data?.MasterStatus?.name as any,
+ userId: publish.data?.authorId as any,
+ pesan: publish.data?.title as any,
+ kategoriApp: "JOB",
+ title: "Job publish",
+ };
+
+ const createNotifikasi = await adminNotifikasi_funCreateToUser({
+ data: dataNotifikasi as any,
+ });
+
+ if (createNotifikasi.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+ }
+ setPublish(false);
+ ComponentGlobal_NotifikasiBerhasil(publish.message);
+
+ router.back();
+ } else {
+ ComponentGlobal_NotifikasiGagal(publish.message);
+ }
+ } catch (error) {
+ console.log("Error,", error);
+ } finally {
+ setLoadingPublish(false);
+ }
+ }
+
+ async function onReject() {
+ try {
+ setLoadingReject(true);
+ const reject = await AdminJob_funEditCatatanById(data.id, catatan);
+
+ if (reject.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(reject.message);
+ const dataNotifikasi: IRealtimeData = {
+ appId: reject.data?.id as any,
+ status: reject.data?.MasterStatus?.name as any,
+ userId: reject.data?.authorId as any,
+ pesan: reject.data?.title as any,
+ kategoriApp: "JOB",
+ title: "Job reject",
+ };
+
+ const createRejectNotifikasi = await adminNotifikasi_funCreateToUser({
+ data: dataNotifikasi as any,
+ });
+
+ if (createRejectNotifikasi.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+ }
+ setReject(false);
+ router.back();
+ } else {
+ ComponentGlobal_NotifikasiGagal(reject.message);
+ }
+ } catch (error) {
+ console.log("Error reject", error);
+ } finally {
+ setLoadingReject(false);
+ }
+ }
+
+ return (
+ <>
+
+
+
+ {listData.map((item, index) => (
+
+ ))}
+
+
+
+
+
+
+
+ }
+ radius={"xl"}
+ onClick={() => {
+ setPublish(true);
+ }}
+ >
+ Publish
+
+
+ }
+ radius={"xl"}
+ onClick={() => {
+ setReject(true);
+ }}
+ >
+ Reject
+
+
+
+
+
+
+ {data.imageId && }
+
+
+ {/* PUBLISH MODAL */}
+ {
+ setPublish(false);
+ }}
+ size={"sm"}
+ centered
+ >
+
+
+ setPublish(false)}>
+ Batal
+
+ {
+ onPublish();
+ }}
+ >
+ Simpan
+
+
+
+
+
+ {/* REJECT MODAL */}
+ {
+ setReject(false);
+ }}
+ withCloseButton={false}
+ size={"sm"}
+ centered
+ >
+
+
+
+
+ setReject(false)}>
+ Batal
+
+ {
+ onReject();
+ }}
+ >
+ Simpan
+
+
+
+
+
+ {/* {JSON.stringify(data, null, 2)} */}
+ >
+ );
+}
diff --git a/src/app_modules/admin/job/_view/detail.tsx b/src/app_modules/admin/job/_view/detail.tsx
new file mode 100644
index 00000000..1b9b6e95
--- /dev/null
+++ b/src/app_modules/admin/job/_view/detail.tsx
@@ -0,0 +1,59 @@
+"use client";
+
+import { MODEL_JOB } from "@/app_modules/job/model/interface";
+import { clientLogger } from "@/util/clientLogger";
+import { Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import { Admin_V3_ComponentSkeletonBreakpoint } from "../../_components_v3/comp_skeleton_breakpoint";
+import { AdminJob_DetailPublish } from "../_components/detail/publish";
+import { AdminJob_DetailReject } from "../_components/detail/reject";
+import { AdminJob_DetailReview } from "../_components/detail/review";
+import { apiGetOneJobById } from "../lib/api_fetch_admin_job";
+
+export function AdminJob_ViewDetailPublish() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState();
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetOneJobById({
+ id: param.id,
+ });
+
+ if (response) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data job", error);
+ }
+ };
+
+ return (
+ <>
+
+
+
+
+ {!data ? (
+
+ ) : data.MasterStatus.name === "Publish" ? (
+
+ ) : data.MasterStatus.name === "Review" ? (
+
+ ) : data.MasterStatus.name === "Reject" ? (
+
+ ) : (
+ null
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/admin/job/_view/view_table_review.tsx b/src/app_modules/admin/job/_view/view_table_review.tsx
index 23ce9b50..8f96cb4d 100644
--- a/src/app_modules/admin/job/_view/view_table_review.tsx
+++ b/src/app_modules/admin/job/_view/view_table_review.tsx
@@ -1,8 +1,5 @@
-import { RouterAdminGlobal } from "@/app/lib";
-import {
- gs_adminJob_triggerReview,
- IRealtimeData,
-} from "@/app/lib/global_state";
+import { RouterAdminGlobal } from "@/lib";
+import { gs_adminJob_triggerReview, IRealtimeData } from "@/lib/global_state";
import { ComponentGlobal_InputCountDown } from "@/app_modules/_global/component";
import {
ComponentGlobal_NotifikasiBerhasil,
@@ -25,6 +22,7 @@ import {
Text,
Affix,
rem,
+ Box,
} from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import {
@@ -33,6 +31,7 @@ import {
IconBan,
IconSearch,
IconRefresh,
+ IconCircleCheck,
} from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
@@ -44,22 +43,30 @@ import { AdminJob_funEditStatusPublishById } from "../fun/edit/fun_edit_status_p
import adminJob_getListReview from "../fun/get/get_list_review";
import { useAtom } from "jotai";
import { AccentColor } from "@/app_modules/_global/color";
+import {
+ AdminColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
+import { clientLogger } from "@/util/clientLogger";
+import { apiGetAdminJobByStatus } from "../lib/api_fetch_admin_job";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import Admin_DetailButton from "../../_admin_global/_component/button/detail_button";
+import { RouterAdminJob } from "@/lib/router_admin/router_admin_job";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
-export default function AdminJob_ViewTavleReview({
- listReview,
-}: {
- listReview: any;
-}) {
+export default function AdminJob_ViewTavleReview() {
const router = useRouter();
- const [data, setData] = useState(listReview.data);
- const [nPage, setNPage] = useState(listReview.nPage);
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
-
+ const [publish, setPublish] = useState(false);
const [reject, setReject] = useState(false);
const [jobId, setJobId] = useState("");
const [isLoading, setIsLoading] = useState(false);
const [catatan, setCatatan] = useState("");
+ const [isLoadingShowImage, setLoadingShowImage] = useState(false);
+ const [dataId, setDataId] = useState("");
// Realtime
const [isAdminJob_TriggerReview, setIsAdminJob_TriggerReview] = useAtom(
@@ -68,160 +75,161 @@ export default function AdminJob_ViewTavleReview({
const [isShowReload, setIsShowReload] = useState(false);
useShallowEffect(() => {
- if (isAdminJob_TriggerReview) {
- setIsShowReload(true);
+ loadInitialData();
+ }, [activePage, isSearch]);
+
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminJobByStatus({
+ name: "Review",
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invliad data format recieved", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
}
- }, [isAdminJob_TriggerReview, setIsShowReload]);
-
- // useShallowEffect(() => {
- // onLoadData({
- // onSuccessLoad(val) {
- // setData(val.data);
- // setNPage(val.nPage);
- // },
- // });
- // }, [setData, setNPage]);
- // async function onLoadData({
- // onSuccessLoad,
- // }: {
- // onSuccessLoad: (val: any) => any;
- // }) {
- // const loadData = await adminJob_getListReview({ page: 1 });
- // onSuccessLoad(loadData);
- // }
-
+ };
async function onLoadData() {
- const loadData = await adminJob_getListReview({ page: 1 });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
+ loadInitialData();
setIsLoading(false);
setIsShowReload(false);
setIsAdminJob_TriggerReview(false);
}
- async function onSearch(s: string) {
- setSearch(s);
+ const onSearch = async (searchTerm: string) => {
+ setSearch(searchTerm);
setActivePage(1);
- const loadData = await adminJob_getListReview({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ };
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminJob_getListReview({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
- const rowTable = data?.map((e, i) => (
-
- |
-
- {e?.Author?.username}
-
- |
-
-
- {e.title}
-
- |
-
-
- {e.imageId ? (
- }
- onClick={() => {
- setJobId(e?.id);
- setIsLoading(true);
- router.push(RouterAdminGlobal.preview_image({ id: e.imageId }));
- }}
- >
- Lihat
-
- ) : (
-
-
- Tidak ada poster
-
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
- )}
-
- |
-
-
-
-
- |
-
-
-
-
- |
-
-
-
- }
- radius={"xl"}
- onClick={() =>
- onPublish({
- jobId: e?.id,
- onLoadData(val: any) {
- setData(val.data);
- setNPage(val.nPage);
- },
- })
- }
- >
- Publish
-
- }
- radius={"xl"}
- onClick={() => {
- setReject(true);
- setJobId(e.id);
- }}
- >
- Reject
-
-
-
- |
-
- ));
+ |
+
+ );
+ }
+ return data?.map((e, i) => (
+
+ |
+
+ {e?.Author?.username}
+
+ |
+
+
+
+
+
+ {e.title}
+
+
+
+ |
+
+
+ {e.imageId ? (
+ }
+ onClick={() => {
+ setLoadingShowImage(true);
+ setDataId(e.id);
+ router.push(
+ RouterAdminGlobal.preview_image({ id: e.imageId })
+ );
+ }}
+ >
+ Lihat
+
+ ) : (
+
+
+ Tidak ada poster
+
+
+ )}
+
+ |
+
+
+
+
+ |
+
+ ));
+
+
+ };
return (
<>
{
+ setPublish(false);
+ }}
+ size={"sm"}
+ centered
+ >
+
+
+ setPublish(false)}>
+ Batal
+
+ {
+ onPublish({
+ jobId: jobId,
+ onLoadData(val: any) {
+ setData(val.data);
+ setNPage(val.nPage);
+ },
+ });
+ setPublish(false);
+ }}
+ >
+ Simpan
+
+
+
+
+
+ {
setReject(false);
@@ -237,7 +245,11 @@ export default function AdminJob_ViewTavleReview({
maxRows={5}
maxLength={300}
autosize
- label={Alasan Penolakan}
+ label={
+
+ Alasan Penolakan
+
+ }
placeholder="Masukkan alasan penolakan lowongan ini"
onChange={(val) => setCatatan(val.currentTarget.value)}
/>
@@ -252,6 +264,7 @@ export default function AdminJob_ViewTavleReview({
{
@@ -275,7 +288,7 @@ export default function AdminJob_ViewTavleReview({
}
@@ -287,77 +300,72 @@ export default function AdminJob_ViewTavleReview({
/>
}
/>
+ {!data ? (
+
+ ) : (
+
+ {isShowReload && (
+
+
+
+ onLoadData()}
+ leftIcon={}
+ >
+ Update Data
+
+
+
+
+ )}
-
- {isShowReload && (
-
-
-
- onLoadData()}
- leftIcon={}
- >
- Update Data
-
-
-
-
- )}
-
-
-
-
-
- |
- Author
- |
-
- Judul
- |
-
- Poster
- |
-
- Syarat Ketentuan
- |
-
- Deskripsi
- |
-
- Aksi
- |
-
-
- {rowTable}
-
-
-
- {
- onPageClick(val);
- }}
- />
-
-
+
+
+
+
+ |
+ Author
+ |
+
+ Judul
+ |
+
+ Poster
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+
+ {
+ onPageClick(val);
+ }}
+ />
+
+
+ )}
>
);
diff --git a/src/app_modules/admin/job/child/publish/index.tsx b/src/app_modules/admin/job/child/publish/index.tsx
index ae1272d8..9493d42d 100644
--- a/src/app_modules/admin/job/child/publish/index.tsx
+++ b/src/app_modules/admin/job/child/publish/index.tsx
@@ -1,158 +1,170 @@
"use client";
-import { RouterAdminJob } from "@/app/lib/router_admin/router_admin_job";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
+import Admin_DetailButton from "@/app_modules/admin/_admin_global/_component/button/detail_button";
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { MODEL_JOB } from "@/app_modules/job/model/interface";
+import { RouterAdminGlobal } from "@/lib";
+import { RouterAdminJob } from "@/lib/router_admin/router_admin_job";
+import { clientLogger } from "@/util/clientLogger";
import {
Badge,
+ Box,
Button,
Center,
Pagination,
Paper,
ScrollArea,
- Spoiler,
Stack,
Table,
Text,
TextInput,
} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import { IconPhotoCheck, IconSearch } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import adminJob_getListPublish from "../../fun/get/get_list_publish";
-import { RouterAdminGlobal } from "@/app/lib";
+import { apiGetAdminJobByStatus } from "../../lib/api_fetch_admin_job";
+import { Admin_V3_ComponentPaginationBreakpoint } from "@/app_modules/admin/_components_v3/comp_pagination_breakpoint";
-export default function AdminJob_TablePublish({
- dataPublish,
-}: {
- dataPublish: any;
-}) {
+export default function AdminJob_TablePublish() {
return (
<>
-
+
>
);
}
-function TableStatus({ dataPublish }: { dataPublish: any }) {
+function TableStatus() {
const router = useRouter();
- const [data, setData] = useState(dataPublish.data);
- const [nPage, setNPage] = useState(dataPublish.nPage);
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
const [isLoadingShowImage, setLoadingShowImage] = useState(false);
const [dataId, setDataId] = useState("");
- async function onSearch(s: string) {
- setSearch(s);
+ useShallowEffect(() => {
+ loadInitialData();
+ }, [activePage, isSearch]);
+
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminJobByStatus({
+ name: "Publish",
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format recieved", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieved:", error);
+ setData([]);
+ }
+ };
+ const onSearch = async (searchTerm: string) => {
+ setSearch(searchTerm);
setActivePage(1);
- const loadData = await adminJob_getListPublish({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ };
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminJob_getListPublish({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ const onPageClick = (page: number) => {
+ setActivePage(page);
+ };
- const TableRows = data?.map((e, i) => (
-
- |
-
- {e?.Author?.username}
-
- |
-
-
-
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+ return data?.map((e, i) => (
+
+ |
+
+ {e?.Author?.username}
+
+ |
+
+
{e?.isArsip ? (
Arsip
) : (
Publish
)}
-
-
- |
-
-
- {e.title}
-
- |
-
-
- {e.imageId ? (
- }
- onClick={() => {
- setLoadingShowImage(true);
- setDataId(e.id);
- router.push(RouterAdminGlobal.preview_image({ id: e.imageId }));
- }}
- >
- Lihat
-
- ) : (
-
-
- Tidak ada poster
+
+ |
+
+
+
+
+ {e.title}
-
- )}
-
- |
-
-
-
-
- |
-
-
-
-
- |
-
- ));
+
+
+ |
+
+
+ {e.imageId ? (
+ }
+ onClick={() => {
+ setLoadingShowImage(true);
+ setDataId(e.id);
+ router.push(
+ RouterAdminGlobal.preview_image({ id: e.imageId })
+ );
+ }}
+ >
+ Lihat
+
+ ) : (
+
+
+ Tidak ada poster
+
+
+ )}
+
+ |
+
+
+
+
+ |
+
+ ));
+ };
return (
<>
- {/* {JSON.stringify(listUser, null, 2)} */}
}
@@ -164,53 +176,43 @@ function TableStatus({ dataPublish }: { dataPublish: any }) {
/>
}
/>
-
-
-
-
-
-
- |
- Author
- |
-
- Status
- |
-
- Judul
- |
-
- Poster
- |
-
- Syarat Ketentuan
- |
-
- Deskripsi
- |
-
-
- {TableRows}
-
-
-
-
+ ) : (
+
+
+
+
+
+ |
+ Author
+ |
+
+ Status
+ |
+
+ Judul
+ |
+
+ Poster
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+ {
onPageClick(val);
}}
/>
-
-
+
+ )}
>
);
diff --git a/src/app_modules/admin/job/child/reject/index.tsx b/src/app_modules/admin/job/child/reject/index.tsx
index 8ba05154..e19f4c90 100644
--- a/src/app_modules/admin/job/child/reject/index.tsx
+++ b/src/app_modules/admin/job/child/reject/index.tsx
@@ -1,15 +1,21 @@
"use client";
-import { RouterAdminJob } from "@/app/lib/router_admin/router_admin_job";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
+import Admin_DetailButton from "@/app_modules/admin/_admin_global/_component/button/detail_button";
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
import adminNotifikasi_funCreateToUser from "@/app_modules/admin/notifikasi/fun/create/fun_create_notif_user";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { MODEL_JOB } from "@/app_modules/job/model/interface";
-import mqtt_client from "@/util/mqtt_client";
+import { RouterAdminGlobal } from "@/lib";
+import { IRealtimeData } from "@/lib/global_state";
+import { RouterAdminJob } from "@/lib/router_admin/router_admin_job";
+import { clientLogger } from "@/util/clientLogger";
import {
+ Box,
Button,
Center,
Group,
@@ -17,159 +23,146 @@ import {
Pagination,
Paper,
ScrollArea,
- Spoiler,
Stack,
Table,
Text,
TextInput,
- Textarea
+ Textarea,
} from "@mantine/core";
-import { IconBan, IconPhotoCheck, IconSearch } from "@tabler/icons-react";
+import { useMediaQuery, useShallowEffect } from "@mantine/hooks";
+import { IconPhotoCheck, IconSearch } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { WibuRealtime } from "wibu-pkg";
import { AdminJob_funEditCatatanById } from "../../fun/edit/fun_edit_catatan_by_id";
import adminJob_getListReject from "../../fun/get/get_list_reject";
+import { apiGetAdminJobByStatus } from "../../lib/api_fetch_admin_job";
+import { Admin_V3_ComponentPaginationBreakpoint } from "@/app_modules/admin/_components_v3/comp_pagination_breakpoint";
-export default function AdminJob_TableReject({
- dataReject,
-}: {
- dataReject: any;
-}) {
+export default function AdminJob_TableReject() {
return (
<>
-
+
>
);
}
-function TableStatus({ listReject }: { listReject: any }) {
+function TableStatus() {
const router = useRouter();
- const [data, setData] = useState(listReject.data);
- const [nPage, setNPage] = useState(listReject.nPage);
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
const [activePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
const [reject, setReject] = useState(false);
const [jobId, setJobId] = useState("");
- const [isLoading, setIsLoading] = useState(false);
+
const [catatan, setCatatan] = useState("");
+ const [isLoadingShowImage, setLoadingShowImage] = useState(false);
+ const [dataId, setDataId] = useState("");
- async function onSearch(s: string) {
- setSearch(s);
- const loadData = await adminJob_getListReject({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
+ useShallowEffect(() => {
+ loadInitialData();
+ }, [activePage, isSearch]);
+ const loadInitialData = async () => {
+ try {
+ const response = await apiGetAdminJobByStatus({
+ name: "Reject",
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format recieved:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Invalid data format recieced:", error);
+ setData([]);
+ }
+ };
+
+ const onSearch = async (searchTerm: string) => {
+ setSearch(searchTerm);
setActivePage(1);
- }
+ };
- async function onPageClick(p: any) {
- setActivePage(p);
- const loadData = await adminJob_getListReject({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- }
+ const onNextPage = (page: number) => {
+ setActivePage(page);
+ };
- const rowTable = data?.map((e, i) => (
-
- |
-
- {e?.Author?.username}
-
- |
-
-
- {e.title}
-
- |
-
-
- {e.imageId ? (
- }
- onClick={() => {
- setJobId(e?.imageId);
- setIsLoading(true);
- router.push(RouterAdminJob.detail_poster + e?.imageId);
- }}
- >
- Lihat
-
- ) : (
-
-
- Tidak ada poster
-
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
- )}
-
- |
-
-
-
-
- |
-
-
-
-
- |
-
-
- {e.catatan}
-
- |
-
- }
- radius={"xl"}
- onClick={() => {
- setReject(true);
- setJobId(e.id);
- setCatatan(e.catatan);
- }}
- >
-
- Tambah
- Catatan
-
-
- |
-
- ));
+ |
+
+ );
+ }
+
+ return data?.map((e, i) => (
+
+ |
+
+ {e?.Author?.username}
+
+ |
+
+
+
+
+
+ {e.title}
+
+
+
+ |
+
+
+ {e.imageId ? (
+ }
+ onClick={() => {
+ setLoadingShowImage(true);
+ setDataId(e.id);
+ router.push(
+ RouterAdminGlobal.preview_image({ id: e.imageId })
+ );
+ }}
+ >
+ Lihat
+
+ ) : (
+
+
+ Tidak ada poster
+
+
+ )}
+
+ |
+
+
+
+
+ |
+
+ ));
+ };
return (
<>
@@ -230,7 +223,7 @@ function TableStatus({ listReject }: { listReject: any }) {
}
@@ -243,60 +236,53 @@ function TableStatus({ listReject }: { listReject: any }) {
}
/>
-
-
-
-
-
- |
- Author
- |
-
- Judul
- |
-
- Poster
- |
-
- Syarat Ketentuan
- |
-
- Deskripsi
- |
-
- Report
- |
-
- Aksi
- |
-
-
- {rowTable}
-
-
-
-
+ ) : (
+
+
+
+
+
+ |
+ Author
+ |
+
+ Judul
+ |
+
+ Poster
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+ {
- onPageClick(val);
+ onNextPage(val);
}}
/>
-
-
+
+ )}
>
);
}
+
+
async function onReject({
jobId,
catatan,
@@ -311,7 +297,7 @@ async function onReject({
const loadData = await adminJob_getListReject({ page: 1 });
onSetData(loadData);
- const dataNotif = {
+ const dataNotifikasi: IRealtimeData = {
appId: reject.data?.id as any,
status: reject.data?.MasterStatus?.name as any,
userId: reject.data?.authorId as any,
@@ -321,14 +307,15 @@ async function onReject({
};
const notif = await adminNotifikasi_funCreateToUser({
- data: dataNotif as any,
+ data: dataNotifikasi as any,
});
if (notif.status === 201) {
- mqtt_client.publish(
- "USER",
- JSON.stringify({ userId: reject?.data?.authorId, count: 1 })
- );
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
}
ComponentGlobal_NotifikasiBerhasil(reject.message);
diff --git a/src/app_modules/admin/job/child/review/index.tsx b/src/app_modules/admin/job/child/review/index.tsx
index 4d877cdd..8b00718a 100644
--- a/src/app_modules/admin/job/child/review/index.tsx
+++ b/src/app_modules/admin/job/child/review/index.tsx
@@ -4,16 +4,12 @@ import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_glob
import { Stack } from "@mantine/core";
import { AdminJob_ViewTavleReview } from "../../_view";
-export default function AdminJob_TableReview({
- dataReview,
-}: {
- dataReview: any;
-}) {
+export default function AdminJob_TableReview() {
return (
<>
-
+
>
);
diff --git a/src/app_modules/admin/job/detail/detail_poster.tsx b/src/app_modules/admin/job/detail/detail_poster.tsx
index 1aa1602a..535026d3 100644
--- a/src/app_modules/admin/job/detail/detail_poster.tsx
+++ b/src/app_modules/admin/job/detail/detail_poster.tsx
@@ -1,9 +1,9 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
import { Center, Image, Stack } from "@mantine/core";
-import AdminGlobal_ComponentBackButton from "../../_admin_global/back_button";
-import { APIs } from "@/app/lib";
+import Admin_ComponentBackButton from "../../_admin_global/back_button";
+import { APIs } from "@/lib";
import { useState } from "react";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
@@ -17,7 +17,7 @@ export default function AdminJob_DetailPoster({
return (
<>
-
+
setLoading(false)}
diff --git a/src/app_modules/admin/job/fun/count/fun_count_job_by_status_id.ts b/src/app_modules/admin/job/fun/count/fun_count_job_by_status_id.ts
index 6f28bed0..74ec07bd 100644
--- a/src/app_modules/admin/job/fun/count/fun_count_job_by_status_id.ts
+++ b/src/app_modules/admin/job/fun/count/fun_count_job_by_status_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function AdminJob_funCountStatusByStatusId(statusId: string) {
if (statusId === "0") {
diff --git a/src/app_modules/admin/job/fun/edit/fun_edit_catatan_by_id.ts b/src/app_modules/admin/job/fun/edit/fun_edit_catatan_by_id.ts
index 18aee664..73a8762c 100644
--- a/src/app_modules/admin/job/fun/edit/fun_edit_catatan_by_id.ts
+++ b/src/app_modules/admin/job/fun/edit/fun_edit_catatan_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function AdminJob_funEditCatatanById(
diff --git a/src/app_modules/admin/job/fun/edit/fun_edit_status_publish_by_id.ts b/src/app_modules/admin/job/fun/edit/fun_edit_status_publish_by_id.ts
index b2933fde..b62776df 100644
--- a/src/app_modules/admin/job/fun/edit/fun_edit_status_publish_by_id.ts
+++ b/src/app_modules/admin/job/fun/edit/fun_edit_status_publish_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function AdminJob_funEditStatusPublishById(jobId: string) {
diff --git a/src/app_modules/admin/job/fun/get/get_list_publish.ts b/src/app_modules/admin/job/fun/get/get_list_publish.ts
index 9fdccfe8..819a00a9 100644
--- a/src/app_modules/admin/job/fun/get/get_list_publish.ts
+++ b/src/app_modules/admin/job/fun/get/get_list_publish.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { ceil } from "lodash";
export default async function adminJob_getListPublish({
diff --git a/src/app_modules/admin/job/fun/get/get_list_reject.ts b/src/app_modules/admin/job/fun/get/get_list_reject.ts
index 639fe807..6dd339dd 100644
--- a/src/app_modules/admin/job/fun/get/get_list_reject.ts
+++ b/src/app_modules/admin/job/fun/get/get_list_reject.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { ceil } from "lodash";
export default async function adminJob_getListReject({
diff --git a/src/app_modules/admin/job/fun/get/get_list_review.ts b/src/app_modules/admin/job/fun/get/get_list_review.ts
index bdfd4033..2496c1cb 100644
--- a/src/app_modules/admin/job/fun/get/get_list_review.ts
+++ b/src/app_modules/admin/job/fun/get/get_list_review.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { ceil } from "lodash";
export default async function adminJob_getListReview({
diff --git a/src/app_modules/admin/job/fun/get/get_list_table_by_status_id.ts b/src/app_modules/admin/job/fun/get/get_list_table_by_status_id.ts
index 7f91e870..8108e6be 100644
--- a/src/app_modules/admin/job/fun/get/get_list_table_by_status_id.ts
+++ b/src/app_modules/admin/job/fun/get/get_list_table_by_status_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function AdminJob_getListTableByStatusId(statusId: string) {
if (statusId === "0") {
diff --git a/src/app_modules/admin/job/lib/api_fetch_admin_job.ts b/src/app_modules/admin/job/lib/api_fetch_admin_job.ts
new file mode 100644
index 00000000..e6970ff8
--- /dev/null
+++ b/src/app_modules/admin/job/lib/api_fetch_admin_job.ts
@@ -0,0 +1,102 @@
+export {
+ apiGetAdminJobStatusCountDashboard as apiGetJobStatusCountDashboard,
+ apiGetAdminJobArsipCount as apiGetJobArsipCount,
+ apiGetAdminJobByStatus,
+ apiGetOneJobById,
+};
+
+const apiGetAdminJobStatusCountDashboard = async ({
+ name,
+}: {
+ name: "Publish" | "Review" | "Reject";
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/job/dashboard/${name}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ return await response.json().catch(() => null);
+};
+
+const apiGetAdminJobArsipCount = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/job/dashboard/arsip`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ return await response.json().catch(() => null);
+};
+const apiGetAdminJobByStatus = async ({
+ name,
+ page,
+ search,
+}: {
+ name: "Publish" | "Review" | "Reject";
+ page: string;
+ search: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isPage = page ? `?page=${page}` : "";
+ const isSearch = search ? `&search=${search}` : "";
+ const response = await fetch(
+ `/api/admin/job/status/${name}${isPage}${isSearch}`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+ return await response.json().catch(() => null);
+};
+
+const apiGetOneJobById = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/job/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get one job", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get one job");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get one job", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
diff --git a/src/app_modules/admin/job/main/index.tsx b/src/app_modules/admin/job/main/index.tsx
index 79a1fd27..bf4f702c 100644
--- a/src/app_modules/admin/job/main/index.tsx
+++ b/src/app_modules/admin/job/main/index.tsx
@@ -1,50 +1,152 @@
"use client";
-import { Group, Paper, SimpleGrid, Stack, Text, Title } from "@mantine/core";
+import { Flex, Group, Paper, SimpleGrid, Stack, Text, ThemeIcon, Title } from "@mantine/core";
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { clientLogger } from "@/util/clientLogger";
+import { IconAlertTriangle, IconArchive, IconBookmark, IconUpload } from "@tabler/icons-react";
+import { AccentColor } from "@/app_modules/_global/color";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import global_limit from "@/lib/limit";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetJobArsipCount, apiGetJobStatusCountDashboard } from "../lib/api_fetch_admin_job";
-export default function AdminJob_Main({
- countPublish,
- countReview,
- countReject,
- countArsip,
-}: {
- countPublish: number;
- countReview: number;
- countReject: number;
- countArsip: number
-}) {
+export default function AdminJob_Main() {
+ const [countPublish, setCountPublish] = useState(null);
+ const [countReview, setCountReview] = useState(null);
+ const [countReject, setCountReject] = useState(null);
+ const [countArsip, setCountArsip] = useState(null);
const router = useRouter();
+
+ useShallowEffect(() => {
+ handlerLoadData();
+ }, []);
+ async function handlerLoadData() {
+ try {
+ const listLoadData = [
+ global_limit(() => onLoadCountPublish()),
+ global_limit(() => onLoadCountReview()),
+ global_limit(() => onLoadCountReject()),
+ global_limit(() => onLoadCountArsip()),
+ ]
+ } catch (error) {
+ clientLogger.error("Error handler load data", error)
+ }
+ }
+
+ async function onLoadCountPublish() {
+ try {
+ const response = await apiGetJobStatusCountDashboard({
+ name: "Publish",
+ })
+ if (response) {
+ setCountPublish(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count publish", error)
+ }
+ }
+
+ async function onLoadCountReview() {
+ try {
+ const response = await apiGetJobStatusCountDashboard({
+ name: "Review",
+ })
+
+ if (response) {
+ setCountReview(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count review", error)
+ }
+ }
+
+ async function onLoadCountReject() {
+ try {
+ const response = await apiGetJobStatusCountDashboard({
+ name: "Reject",
+ })
+
+ if (response) {
+ setCountReject(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count reject", error)
+ }
+ }
+
+ async function onLoadCountArsip() {
+ try {
+ const response = await apiGetJobArsipCount()
+
+ if (response) {
+ setCountArsip(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get count arsip", error)
+ }
+ }
const listStatus = [
{
id: 1,
name: "Publish",
- jumlah: countPublish,
+ jumlah: countPublish == null ? (
+
+ ) : countPublish ? (
+ countPublish
+ ) : (
+ "-"
+ ),
color: "green",
text_color: "white",
+ icon:
+
+
},
{
id: 2,
name: "Review",
- jumlah: countReview,
+ jumlah: countReview == null ? (
+
+ ) : countReview ? (
+ countReview
+ ) : (
+ "-"
+ ),
color: "orange",
text_color: "white",
+ icon:
},
{
id: 3,
name: "Reject",
- jumlah: countReject,
+ jumlah: countReject == null ? (
+
+ ) : countReject ? (
+ countReject
+ ) : (
+ "-"
+ ),
color: "red",
text_color: "white",
+ icon:
},
{
id: 4,
name: "Arsip",
- jumlah: countArsip,
+ jumlah: countArsip == null ? (
+
+ ) : countArsip ? (
+ countArsip
+ ) : (
+ "-"
+ ),
color: "gray",
text_color: "white",
+ icon:
},
];
return (
@@ -63,18 +165,27 @@ export default function AdminJob_Main({
{listStatus.map((e, i) => (
-
-
- {e.name}
- {e.jumlah ? e.jumlah : 0}
-
-
+
+
+ {e.name}
+
+ {e.jumlah ? e.jumlah : 0}
+
+ {e.icon}
+
+
+
+
))}
diff --git a/src/app_modules/admin/list_page.tsx b/src/app_modules/admin/list_page.tsx
index aafdeeca..ff10445f 100644
--- a/src/app_modules/admin/list_page.tsx
+++ b/src/app_modules/admin/list_page.tsx
@@ -1,15 +1,15 @@
-import { RouterAdminColab } from "@/app/lib/router_admin/router_admin_colab";
-import { RouterAdminDeveloper } from "@/app/lib/router_admin/router_admin_developer";
-import { RouterAdminDonasi } from "@/app/lib/router_admin/router_admin_donasi";
-import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
-import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum";
-import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
-import { RouterAdminJob } from "@/app/lib/router_admin/router_admin_job";
-import { RouterAdminMap } from "@/app/lib/router_admin/router_admin_map";
-import { RouterAdminVote } from "@/app/lib/router_admin/router_admin_vote";
-import { RouterAdminUserAccess } from "@/app/lib/router_admin/router_admn_user_acces";
-import { RouterAdminAppInformation } from "@/app/lib/router_admin/router_app_information";
-import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
+import { RouterAdminColab } from "@/lib/router_admin/router_admin_colab";
+import { RouterAdminDeveloper } from "@/lib/router_admin/router_admin_developer";
+import { RouterAdminDonasi } from "@/lib/router_admin/router_admin_donasi";
+import { RouterAdminEvent } from "@/lib/router_admin/router_admin_event";
+import { RouterAdminForum } from "@/lib/router_admin/router_admin_forum";
+import { RouterAdminInvestasi } from "@/lib/router_admin/router_admin_investasi";
+import { RouterAdminJob } from "@/lib/router_admin/router_admin_job";
+import { RouterAdminMap } from "@/lib/router_admin/router_admin_map";
+import { RouterAdminVote } from "@/lib/router_admin/router_admin_vote";
+import { RouterAdminUserAccess } from "@/lib/router_admin/router_admn_user_acces";
+import { RouterAdminAppInformation } from "@/lib/router_admin/router_app_information";
+import { RouterAdminDashboard } from "@/lib/router_hipmi/router_admin";
import {
IconAffiliate,
IconBriefcase,
diff --git a/src/app_modules/admin/main_dashboard/fun/count/fun_count_portofolio.ts b/src/app_modules/admin/main_dashboard/fun/count/fun_count_portofolio.ts
index 0b2ab9d7..9b71bc4d 100644
--- a/src/app_modules/admin/main_dashboard/fun/count/fun_count_portofolio.ts
+++ b/src/app_modules/admin/main_dashboard/fun/count/fun_count_portofolio.ts
@@ -1,6 +1,6 @@
"use server"
-import prisma from "@/app/lib/prisma"
+import prisma from "@/lib/prisma"
export async function AdminMainDashboard_CountPOrtofolio() {
const data = await prisma.portofolio.count({})
diff --git a/src/app_modules/admin/main_dashboard/fun/count/fun_count_user.ts b/src/app_modules/admin/main_dashboard/fun/count/fun_count_user.ts
index d95451c8..27573f20 100644
--- a/src/app_modules/admin/main_dashboard/fun/count/fun_count_user.ts
+++ b/src/app_modules/admin/main_dashboard/fun/count/fun_count_user.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function AdminMainDashboard_CountUser() {
const data = await prisma.user.count({
diff --git a/src/app_modules/admin/main_dashboard/lib/api_fetch_main_dashboard.ts b/src/app_modules/admin/main_dashboard/lib/api_fetch_main_dashboard.ts
new file mode 100644
index 00000000..0f01f7fa
--- /dev/null
+++ b/src/app_modules/admin/main_dashboard/lib/api_fetch_main_dashboard.ts
@@ -0,0 +1,30 @@
+export const apiGetCountUserActive = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/main_dashboard/user`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+}
+export const apiGetCountPortofolio = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/main_dashboard/portofolio`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+}
\ No newline at end of file
diff --git a/src/app_modules/admin/main_dashboard/main/view.tsx b/src/app_modules/admin/main_dashboard/main/view.tsx
index 9b6bbe2c..fbd2b575 100644
--- a/src/app_modules/admin/main_dashboard/main/view.tsx
+++ b/src/app_modules/admin/main_dashboard/main/view.tsx
@@ -1,47 +1,99 @@
"use client";
-import { Divider, Grid, Group, Paper, Stack, Text, Title } from "@mantine/core";
+import { AccentColor, AdminColor, MainColor } from "@/app_modules/_global/color/color_pallet";
+import { Divider, Flex, Grid, Group, Paper, Stack, Text, ThemeIcon, Title } from "@mantine/core";
+import { IconFileText, IconUsers } from "@tabler/icons-react";
+import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
+import { useState } from "react";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetCountPortofolio, apiGetCountUserActive } from "../lib/api_fetch_main_dashboard";
+import { NextResponse } from "next/server";
+import { clientLogger } from "@/util/clientLogger";
+import MainDashboardSkeleton from "../../_admin_global/_component/skeleton/main_dashboard_skeleton";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+
+export default function AdminMain() {
+ const [countUser, setCountUser] = useState(null);
+ const [countPortofolio, setCountPortofolio] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadDataUser();
+ onLoadDataPortofolio();
+ }, []);
+
+ async function onLoadDataUser() {
+ try {
+ const response = await apiGetCountUserActive();
+ if (response) {
+ setCountUser(response.data);
+ }
+
+ } catch (error) {
+ clientLogger.error("Error get count user data", error);
+ }
+ }
+
+ async function onLoadDataPortofolio() {
+ try {
+ const response = await apiGetCountPortofolio();
+ if (response) {
+ // console.log("Response Portofolio",response);
+ setCountPortofolio(response.data);
+ }
+
+ } catch (error) {
+ clientLogger.error("Error get count portofolio data", error);
+ }
+ }
-export default function AdminMain({
- countUser,
- countPorto,
-}: {
- countUser: number;
- countPorto: number;
-}) {
const listBox = [
{
id: 1,
name: "User",
- jumlah: countUser,
+ jumlah:
+ countUser == null ? (
+ ) : countUser ? (
+ countUser
+ ) : (
+ "-"
+ ),
link: "",
- color: "green",
+ icon:
},
{
id: 2,
name: "Portofolio",
- jumlah: countPorto,
+ jumlah:
+ countPortofolio == null ? (
+ ) : countPortofolio ? (
+ countPortofolio
+ ) : (
+ "-"
+ ),
link: "",
- color: "orange",
+ icon:
},
];
+
return (
<>
- Main Dashboard
-
+
+ {/* Main Dashboard
+ */}
{listBox.map((e) => (
-
-
-
- {e.name}
- {e.jumlah}
-
-
+
+
+ {e.name}
+
+ {e.jumlah}
+ {e.icon}
+
+
))}
diff --git a/src/app_modules/admin/map/fun/fun_get_all_maps.ts b/src/app_modules/admin/map/fun/fun_get_all_maps.ts
index 40b58bfc..3c951824 100644
--- a/src/app_modules/admin/map/fun/fun_get_all_maps.ts
+++ b/src/app_modules/admin/map/fun/fun_get_all_maps.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function adminMap_funGetAllMaps() {
const data = await prisma.businessMaps.findMany({
@@ -9,6 +9,7 @@ export async function adminMap_funGetAllMaps() {
},
where: {
isActive: true,
+
},
include: {
Portofolio: true,
diff --git a/src/app_modules/admin/map/fun/fun_get_one_by_id.ts b/src/app_modules/admin/map/fun/fun_get_one_by_id.ts
index 4fc62bff..ceccc667 100644
--- a/src/app_modules/admin/map/fun/fun_get_one_by_id.ts
+++ b/src/app_modules/admin/map/fun/fun_get_one_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function adminMap_funGetOneById({ mapId }: { mapId: string }) {
const data = await prisma.businessMaps.findFirst({
diff --git a/src/app_modules/admin/map/ui/ui_map_view.tsx b/src/app_modules/admin/map/ui/ui_map_view.tsx
index 1b7ba919..eaff941c 100644
--- a/src/app_modules/admin/map/ui/ui_map_view.tsx
+++ b/src/app_modules/admin/map/ui/ui_map_view.tsx
@@ -1,13 +1,16 @@
"use client";
-import { APIs } from "@/app/lib";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { apiGetAllMap } from "@/app_modules/map/lib/api_map";
import {
defaultLatLong,
defaultMapZoom,
} from "@/app_modules/map/lib/default_lat_long";
-import { MODEL_MAP } from "@/app_modules/map/lib/interface";
+import { IDataMap } from "@/app_modules/map/lib/type_map";
+import { APIs } from "@/lib";
import { Avatar, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import "mapbox-gl/dist/mapbox-gl.css";
import { useState } from "react";
import Map, {
@@ -21,14 +24,31 @@ import { ComponentAdminMap_Drawer } from "../component";
export function UiAdminMap_MapBoxView({
mapboxToken,
- dataMap,
}: {
mapboxToken: string;
- dataMap: MODEL_MAP[];
}) {
const [mapId, setMapId] = useState("");
const [openDrawer, setOpenDrawer] = useState(false);
- const [data, setData] = useState(dataMap);
+ const [data, setData] = useState([]);
+ const [loading, setLoading] = useState(false);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ setLoading(true);
+ const response = await apiGetAllMap();
+ if (response) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
+ }
+ }
if (!mapboxToken)
return ;
@@ -42,65 +62,69 @@ export function UiAdminMap_MapBoxView({
backgroundColor: "gray",
}}
>
-
+
+
+ ))}
-
-
-
-
+
+
+
+
+ )}
>
);
diff --git a/src/app_modules/admin/new_layout.tsx b/src/app_modules/admin/new_layout.tsx
index e7e0dfef..a6a36607 100644
--- a/src/app_modules/admin/new_layout.tsx
+++ b/src/app_modules/admin/new_layout.tsx
@@ -1,6 +1,6 @@
"use client";
-import { gs_admin_ntf } from "@/app/lib/global_state";
+import { gs_admin_ntf } from "@/lib/global_state";
import {
ActionIcon,
AppShell,
@@ -36,6 +36,7 @@ import {
} from "./_admin_global/new_global_state";
import adminNotifikasi_getByUserId from "./notifikasi/fun/get/get_notifikasi_by_user_id";
import { ComponentAdmin_UIDrawerNotifikasi } from "./notifikasi/ui_drawer_notifikasi";
+import { AdminColor } from "../_global/color/color_pallet";
export function Admin_NewLayout({
children,
@@ -93,10 +94,12 @@ export function Admin_NewLayout({
return (
<>
- {userRoleId == "2" ? "Admin" : "Developer"}
+ {userRoleId == "2" ? "Admin" : "SuperAdmin"}
@@ -130,7 +133,8 @@ export function Admin_NewLayout({
onLoadListNotifikasi();
}}
>
- {countNtf == 0 ? (
+ {countNtf == 0 ||
+ dataUser.masterUserRoleId == "3" ? (
) : (
{!matches ? (
-
- Sorry !
-
+
+ Sorry !
+
View Only Available For Desktop
onClickLogout()}>Logout
diff --git a/src/app_modules/admin/new_list_page.tsx b/src/app_modules/admin/new_list_page.tsx
index b9ab8119..0a6417c9 100644
--- a/src/app_modules/admin/new_list_page.tsx
+++ b/src/app_modules/admin/new_list_page.tsx
@@ -1,15 +1,15 @@
-import { RouterAdminColab } from "@/app/lib/router_admin/router_admin_colab";
-import { RouterAdminDeveloper } from "@/app/lib/router_admin/router_admin_developer";
-import { RouterAdminDonasi } from "@/app/lib/router_admin/router_admin_donasi";
-import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
-import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum";
-import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
-import { RouterAdminJob } from "@/app/lib/router_admin/router_admin_job";
-import { RouterAdminMap } from "@/app/lib/router_admin/router_admin_map";
-import { RouterAdminVote } from "@/app/lib/router_admin/router_admin_vote";
-import { RouterAdminUserAccess } from "@/app/lib/router_admin/router_admn_user_acces";
-import { RouterAdminAppInformation } from "@/app/lib/router_admin/router_app_information";
-import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
+import { RouterAdminColab } from "@/lib/router_admin/router_admin_colab";
+import { RouterAdminDeveloper } from "@/lib/router_admin/router_admin_developer";
+import { RouterAdminDonasi } from "@/lib/router_admin/router_admin_donasi";
+import { RouterAdminEvent } from "@/lib/router_admin/router_admin_event";
+import { RouterAdminForum } from "@/lib/router_admin/router_admin_forum";
+import { RouterAdminInvestasi } from "@/lib/router_admin/router_admin_investasi";
+import { RouterAdminJob } from "@/lib/router_admin/router_admin_job";
+import { RouterAdminMap } from "@/lib/router_admin/router_admin_map";
+import { RouterAdminVote } from "@/lib/router_admin/router_admin_vote";
+import { RouterAdminUserAccess } from "@/lib/router_admin/router_admn_user_acces";
+import { RouterAdminAppInformation } from "@/lib/router_admin/router_app_information";
+import { RouterAdminDashboard } from "@/lib/router_hipmi/router_admin";
import {
IconAffiliate,
IconBriefcase,
@@ -283,7 +283,7 @@ export const newListAdminPage = [
{
id: "App Information",
name: "App Information",
- path: RouterAdminAppInformation.main,
+ path: RouterAdminAppInformation.infoBank,
icon: ,
child: [],
},
@@ -297,10 +297,10 @@ export const newListAdminPage = [
child: [],
},
- // Developer
+ // Developer | Super Admin
{
- id: "Developer",
- name: "Developer",
+ id: "Super Admin",
+ name: "Super Admin",
path: RouterAdminDeveloper.main,
icon: ,
child: [],
diff --git a/src/app_modules/admin/notifikasi/fun/count/count_is_read.ts b/src/app_modules/admin/notifikasi/fun/count/count_is_read.ts
index fd6f9357..e36b02bb 100644
--- a/src/app_modules/admin/notifikasi/fun/count/count_is_read.ts
+++ b/src/app_modules/admin/notifikasi/fun/count/count_is_read.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export default async function adminNotifikasi_countNotifikasi() {
diff --git a/src/app_modules/admin/notifikasi/fun/create/fun_create_notif_to_all_user.ts b/src/app_modules/admin/notifikasi/fun/create/fun_create_notif_to_all_user.ts
new file mode 100644
index 00000000..42c2de73
--- /dev/null
+++ b/src/app_modules/admin/notifikasi/fun/create/fun_create_notif_to_all_user.ts
@@ -0,0 +1,50 @@
+"use server";
+
+import prisma from "@/lib/prisma";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+
+export default async function adminNotifikasi_funCreateToAllUser({
+ data,
+ authorId,
+}: {
+ data: any;
+ authorId: string;
+}) {
+ const userLoginId = await funGetUserIdByToken();
+
+ const dataUser = await prisma.user.findMany({
+ where: {
+ NOT: {
+ id: authorId,
+ },
+ active: true,
+ masterUserRoleId: "1",
+ },
+ });
+
+ for (let i of dataUser) {
+ const create = await prisma.notifikasi.create({
+ data: {
+ adminId: userLoginId,
+ userId: i.id,
+ appId: data.id,
+ status: data.DonasiMaster_Status.name,
+ title: "Donasi baru terpublish",
+ pesan: data.title,
+ kategoriApp: "DONASI",
+ userRoleId: "1",
+ },
+ });
+ if (!create) {
+ await prisma.$disconnect();
+ return { status: 400, message: "Gagal mengirim notifikasi" };
+ }
+ }
+
+ await prisma.$disconnect();
+ return {
+ status: 201,
+ message: "Berhasil mengirim notifikasi",
+ data: dataUser,
+ };
+}
diff --git a/src/app_modules/admin/notifikasi/fun/create/fun_create_notif_user.ts b/src/app_modules/admin/notifikasi/fun/create/fun_create_notif_user.ts
index 6642244d..28b4c2a7 100644
--- a/src/app_modules/admin/notifikasi/fun/create/fun_create_notif_user.ts
+++ b/src/app_modules/admin/notifikasi/fun/create/fun_create_notif_user.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
@@ -23,7 +23,12 @@ export default async function adminNotifikasi_funCreateToUser({
userRoleId: "1",
},
});
-
- if (!create) return { status: 400, message: "Gagal mengirim notifikasi" };
+
+ if (!create) {
+ await prisma.$disconnect();
+ return { status: 400, message: "Gagal mengirim notifikasi" };
+ }
+
+ await prisma.$disconnect();
return { status: 201, message: "Berhasil mengirim notifikasi" };
}
diff --git a/src/app_modules/admin/notifikasi/fun/get/fun_check_status_job.ts b/src/app_modules/admin/notifikasi/fun/get/fun_check_status_job.ts
index 09a5d21d..8c0e1c01 100644
--- a/src/app_modules/admin/notifikasi/fun/get/fun_check_status_job.ts
+++ b/src/app_modules/admin/notifikasi/fun/get/fun_check_status_job.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import _ from "lodash";
export async function admin_funCheckStatusJob({ id }: { id: string }) {
diff --git a/src/app_modules/admin/notifikasi/fun/get/fun_donasi_check_status.ts b/src/app_modules/admin/notifikasi/fun/get/fun_donasi_check_status.ts
index bdaffaf7..8e2e1cda 100644
--- a/src/app_modules/admin/notifikasi/fun/get/fun_donasi_check_status.ts
+++ b/src/app_modules/admin/notifikasi/fun/get/fun_donasi_check_status.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import _ from "lodash";
export async function admin_funDonasiCheckStatus({ id }: { id: string }) {
diff --git a/src/app_modules/admin/notifikasi/fun/get/fun_event_check_status.ts b/src/app_modules/admin/notifikasi/fun/get/fun_event_check_status.ts
index a10c39d3..8c63fa87 100644
--- a/src/app_modules/admin/notifikasi/fun/get/fun_event_check_status.ts
+++ b/src/app_modules/admin/notifikasi/fun/get/fun_event_check_status.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import _ from "lodash";
export async function admin_funEventCheckStatus({ id }: { id: string }) {
diff --git a/src/app_modules/admin/notifikasi/fun/get/fun_investasi_check_status.ts b/src/app_modules/admin/notifikasi/fun/get/fun_investasi_check_status.ts
new file mode 100644
index 00000000..4e670923
--- /dev/null
+++ b/src/app_modules/admin/notifikasi/fun/get/fun_investasi_check_status.ts
@@ -0,0 +1,23 @@
+"use server";
+
+import { prisma } from "@/lib";
+import _ from "lodash";
+
+export async function admin_funInvestasiCheckStatus({ id }: { id: string }) {
+ const data = await prisma.investasi.findUnique({
+ where: {
+ id: id,
+ },
+ select: {
+ MasterStatusInvestasi: true,
+ },
+ });
+
+ if (!data)
+ return { status: 400, message: "Id tidak ditemukan", statusName: "" };
+ return {
+ status: 200,
+ message: "Id ditemukan",
+ statusName: _.lowerCase(data.MasterStatusInvestasi?.name),
+ };
+}
diff --git a/src/app_modules/admin/notifikasi/fun/get/fun_voting_check_status.ts b/src/app_modules/admin/notifikasi/fun/get/fun_voting_check_status.ts
index d8f04452..94d849f2 100644
--- a/src/app_modules/admin/notifikasi/fun/get/fun_voting_check_status.ts
+++ b/src/app_modules/admin/notifikasi/fun/get/fun_voting_check_status.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import _ from "lodash";
export async function admin_funVotingCheckStatus({ id }: { id: string }) {
diff --git a/src/app_modules/admin/notifikasi/fun/get/get_notifikasi_by_user_id.ts b/src/app_modules/admin/notifikasi/fun/get/get_notifikasi_by_user_id.ts
index f505312b..1b1f7cb3 100644
--- a/src/app_modules/admin/notifikasi/fun/get/get_notifikasi_by_user_id.ts
+++ b/src/app_modules/admin/notifikasi/fun/get/get_notifikasi_by_user_id.ts
@@ -1,12 +1,15 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-export default async function adminNotifikasi_getByUserId({page}: {page: number}) {
+export default async function adminNotifikasi_getByUserId({
+ page,
+}: {
+ page: number;
+}) {
const userLoginId = await funGetUserIdByToken();
-
const takeData = 10;
const skipData = page * takeData - takeData;
@@ -26,6 +29,6 @@ export default async function adminNotifikasi_getByUserId({page}: {page: number}
userRoleId: "2",
},
});
-
+
return data;
}
diff --git a/src/app_modules/admin/notifikasi/fun/update/fun_update_is_read_by_id.ts b/src/app_modules/admin/notifikasi/fun/update/fun_update_is_read_by_id.ts
index 39d680d8..f0a6f49b 100644
--- a/src/app_modules/admin/notifikasi/fun/update/fun_update_is_read_by_id.ts
+++ b/src/app_modules/admin/notifikasi/fun/update/fun_update_is_read_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function adminNotifikasi_funUpdateIsReadById({
notifId,
diff --git a/src/app_modules/admin/notifikasi/lib/api_fetch_notifikasi.ts b/src/app_modules/admin/notifikasi/lib/api_fetch_notifikasi.ts
new file mode 100644
index 00000000..79563a09
--- /dev/null
+++ b/src/app_modules/admin/notifikasi/lib/api_fetch_notifikasi.ts
@@ -0,0 +1,121 @@
+export {
+ apiGetNotifikasiByUserId,
+ apiPostIsReadNotifikasi,
+ apiGetCountNotifikasiByUserId,
+};
+
+const apiGetNotifikasiByUserId = async ({
+ page,
+ id,
+}: {
+ page?: string;
+ id: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const isPage = page ? `?page=${page}` : "";
+ const response = await fetch(`/api/admin/notifikasi/${id}${isPage}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get notifikasi admin", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get notifikasi admin");
+ }
+
+ // Return the JSON response
+ const data = await response.json();
+ return data
+ } catch (error) {
+ console.error("Error get all forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiPostIsReadNotifikasi = async ({
+ id,
+ isRead,
+}: {
+ id: string;
+ isRead: boolean;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/notifikasi/${id}`, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ body: JSON.stringify({ isRead }),
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to post notifikasi admin", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to post notifikasi admin");
+ }
+
+ // Return the JSON response
+ const data = await response.json();
+ return data
+ } catch (error) {
+ console.error("Error get all forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiGetCountNotifikasiByUserId = async ({id}: {id: string}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/admin/notifikasi/count?id=${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get count notifikasi admin", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get count notifikasi admin");
+ }
+
+ // Return the JSON response
+ const data = await response.json();
+ return data
+ } catch (error) {
+ console.error("Error get count notifikasi admin", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
diff --git a/src/app_modules/admin/notifikasi/route_setting/donasi.ts b/src/app_modules/admin/notifikasi/route_setting/donasi.ts
index 467184e4..a3beeca8 100644
--- a/src/app_modules/admin/notifikasi/route_setting/donasi.ts
+++ b/src/app_modules/admin/notifikasi/route_setting/donasi.ts
@@ -1,32 +1,24 @@
-import { RouterAdminDonasi } from "@/app/lib/router_admin/router_admin_donasi";
-import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin";
-import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
-import { data } from "autoprefixer";
-import _ from "lodash";
+import { ITypeStatusNotifikasi } from "@/lib/global_state";
+import { RouterAdminDonasi_OLD } from "@/lib/router_hipmi/router_admin";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
-import { IAdmin_ActivePage, IAdmin_ActiveChildId } from "./type_of_select_page";
-import { admin_funDonasiCheckStatus } from "../fun/get/fun_donasi_check_status";
-import adminNotifikasi_funUpdateIsReadById from "../fun/update/fun_update_is_read_by_id";
-import adminNotifikasi_countNotifikasi from "../fun/count/count_is_read";
-import adminNotifikasi_getByUserId from "../fun/get/get_notifikasi_by_user_id";
import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
-import { ITypeStatusNotifikasi } from "@/app/lib/global_state";
+import adminNotifikasi_countNotifikasi from "../fun/count/count_is_read";
+import { admin_funDonasiCheckStatus } from "../fun/get/fun_donasi_check_status";
+import adminNotifikasi_getByUserId from "../fun/get/get_notifikasi_by_user_id";
+import adminNotifikasi_funUpdateIsReadById from "../fun/update/fun_update_is_read_by_id";
+import { IAdmin_ActiveChildId, IAdmin_ActivePage } from "./type_of_select_page";
export default async function adminNotifikasi_findRouterDonasi({
appId,
notifikasiId,
status,
router,
- onLoadCountNotif,
- onLoadDataNotifikasi,
onChangeNavbar,
}: {
appId: string;
notifikasiId: string;
status: ITypeStatusNotifikasi;
router: AppRouterInstance;
- onLoadCountNotif: (val: any) => void;
- onLoadDataNotifikasi: (val: any) => void;
onChangeNavbar: (val: {
id: IAdmin_ActivePage;
childId: IAdmin_ActiveChildId;
@@ -38,13 +30,22 @@ export default async function adminNotifikasi_findRouterDonasi({
status == "Proses" ||
status == "Gagal"
) {
- const path = RouterAdminDonasi_OLD.detail_publish + appId;
- router.push(path, { scroll: false });
- onChangeNavbar({
- id: "Donasi",
- childId: "Donasi_2",
+ const udpateReadNotifikasi = await adminNotifikasi_funUpdateIsReadById({
+ notifId: notifikasiId,
});
+ if (udpateReadNotifikasi.status == 200) {
+ const path = RouterAdminDonasi_OLD.detail_publish + appId;
+ router.push(path, { scroll: false });
+ onChangeNavbar({
+ id: "Donasi",
+ childId: "Donasi_2",
+ });
+ } else {
+ ComponentAdminGlobal_NotifikasiPeringatan("Status tidak ditemukan");
+ return false;
+ }
+
return true;
} else {
const check = await admin_funDonasiCheckStatus({ id: appId });
@@ -54,14 +55,6 @@ export default async function adminNotifikasi_findRouterDonasi({
});
if (udpateReadNotifikasi.status == 200) {
- const loadCountNotif = await adminNotifikasi_countNotifikasi();
- onLoadCountNotif(loadCountNotif);
-
- const loadListNotifikasi = await adminNotifikasi_getByUserId({
- page: 1,
- });
- onLoadDataNotifikasi(loadListNotifikasi);
-
const path = `/dev/admin/donasi/sub-menu/${check.statusName}`;
if (check.statusName == "draft") {
diff --git a/src/app_modules/admin/notifikasi/route_setting/event.ts b/src/app_modules/admin/notifikasi/route_setting/event.ts
index 02e24733..f7f2c931 100644
--- a/src/app_modules/admin/notifikasi/route_setting/event.ts
+++ b/src/app_modules/admin/notifikasi/route_setting/event.ts
@@ -1,8 +1,6 @@
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
-import adminNotifikasi_countNotifikasi from "../fun/count/count_is_read";
import { admin_funEventCheckStatus } from "../fun/get";
-import adminNotifikasi_getByUserId from "../fun/get/get_notifikasi_by_user_id";
import adminNotifikasi_funUpdateIsReadById from "../fun/update/fun_update_is_read_by_id";
import { IAdmin_ActiveChildId, IAdmin_ActivePage } from "./type_of_select_page";
@@ -10,17 +8,11 @@ export async function adminNotifikasi_findRouterEvent({
appId,
notifikasiId,
router,
- activePage,
- onLoadCountNotif,
- onLoadDataNotifikasi,
onChangeNavbar,
}: {
appId: string;
notifikasiId: string;
router: AppRouterInstance;
- activePage: number;
- onLoadCountNotif: (val: any) => void;
- onLoadDataNotifikasi: (val: any) => void;
onChangeNavbar: (val: {
id: IAdmin_ActivePage;
childId: IAdmin_ActiveChildId;
@@ -34,14 +26,6 @@ export async function adminNotifikasi_findRouterEvent({
});
if (udpateReadNotifikasi.status == 200) {
- const loadCountNotif = await adminNotifikasi_countNotifikasi();
- onLoadCountNotif(loadCountNotif);
-
- const loadListNotifikasi = await adminNotifikasi_getByUserId({
- page: 1,
- });
- onLoadDataNotifikasi(loadListNotifikasi);
-
const path = `/dev/admin/event/table/${check.statusName}`;
if (check.statusName == "draft") {
diff --git a/src/app_modules/admin/notifikasi/route_setting/forum.ts b/src/app_modules/admin/notifikasi/route_setting/forum.ts
index 99dd044a..93a208ae 100644
--- a/src/app_modules/admin/notifikasi/route_setting/forum.ts
+++ b/src/app_modules/admin/notifikasi/route_setting/forum.ts
@@ -1,33 +1,45 @@
-import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum";
+import { RouterAdminForum } from "@/lib/router_admin/router_admin_forum";
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
+import { IAdmin_ActivePage, IAdmin_ActiveChildId } from "./type_of_select_page";
+import adminNotifikasi_funUpdateIsReadById from "../fun/update/fun_update_is_read_by_id";
export default async function adminNotifikasi_findRouterForum({
data,
router,
onChangeNavbar,
- onToggleNavbar,
}: {
data: MODEL_NOTIFIKASI;
router: AppRouterInstance;
- onChangeNavbar: (val: any) => void;
- onToggleNavbar: (val: any) => void;
+ onChangeNavbar: (val: {
+ id: IAdmin_ActivePage;
+ childId: IAdmin_ActiveChildId;
+ }) => void;
}) {
- if (data.status === "Report Posting") {
- const routeName = RouterAdminForum.table_report_posting;
- router.push(routeName);
- onChangeNavbar({
- id: 7,
- childId: 73,
- });
- }
+ const udpateReadNotifikasi = await adminNotifikasi_funUpdateIsReadById({
+ notifId: data.id,
+ });
+ if (udpateReadNotifikasi.status == 200) {
+ let pagePath = "";
+ if (data.status === "Report Posting") {
+ pagePath = RouterAdminForum.table_report_posting;
+ // router.push(routeName);
+ onChangeNavbar({
+ id: "Forum",
+ childId: "Forum_3",
+ });
+ }
- if (data.status === "Report Komentar") {
- const routeName = RouterAdminForum.table_report_komentar;
- router.push(routeName);
- onChangeNavbar({
- id: 7,
- childId: 74,
- });
+ if (data.status === "Report Komentar") {
+ pagePath = RouterAdminForum.table_report_komentar;
+ // router.push(routeName);
+ onChangeNavbar({
+ id: "Forum",
+ childId: "Forum_4",
+ });
+ }
+ return pagePath;
+ } else {
+ return "";
}
}
diff --git a/src/app_modules/admin/notifikasi/route_setting/investasi.ts b/src/app_modules/admin/notifikasi/route_setting/investasi.ts
index fa39f34b..b88c8977 100644
--- a/src/app_modules/admin/notifikasi/route_setting/investasi.ts
+++ b/src/app_modules/admin/notifikasi/route_setting/investasi.ts
@@ -1,43 +1,95 @@
-import { RouterAdminDonasi } from "@/app/lib/router_admin/router_admin_donasi";
-import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
-import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin";
-import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
-import _ from "lodash";
+import { ITypeStatusNotifikasi } from "@/lib/global_state";
+import { RouterAdminInvestasi } from "@/lib/router_admin/router_admin_investasi";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
+import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
+import { admin_funInvestasiCheckStatus } from "../fun/get/fun_investasi_check_status";
+import adminNotifikasi_funUpdateIsReadById from "../fun/update/fun_update_is_read_by_id";
+import { IAdmin_ActiveChildId, IAdmin_ActivePage } from "./type_of_select_page";
export default async function adminNotifikasi_findRouterInvestasi({
- data,
+ appId,
+ notifikasiId,
+ status,
router,
onChangeNavbar,
- onToggleNavbar,
}: {
- data: MODEL_NOTIFIKASI;
+ appId: string;
+ notifikasiId: string;
+ status: ITypeStatusNotifikasi;
router: AppRouterInstance;
- onChangeNavbar: (val: any) => void;
- onToggleNavbar: (val: any) => void;
+ onChangeNavbar: (val: {
+ id: IAdmin_ActivePage;
+ childId: IAdmin_ActiveChildId;
+ }) => void;
}) {
- if (data.status === "Review") {
- const path = RouterAdminInvestasi.table_review;
- router.push(path);
- onChangeNavbar({
- id: 2,
- childId: 23,
+ if (
+ status == "Menunggu" ||
+ status == "Berhasil" ||
+ status == "Proses" ||
+ status == "Gagal"
+ ) {
+ const udpateReadNotifikasi = await adminNotifikasi_funUpdateIsReadById({
+ notifId: notifikasiId,
});
+ if (udpateReadNotifikasi.status == 200) {
+ const path = RouterAdminInvestasi.detail_publish + appId;
+ router.push(path, { scroll: false });
+
+ onChangeNavbar({
+ id: "Investasi",
+ childId: "Investasi_2",
+ });
+
+ return true;
+ } else {
+ ComponentAdminGlobal_NotifikasiPeringatan("Status tidak ditemukan");
+ return false;
+ }
+ } else {
+ const check = await admin_funInvestasiCheckStatus({ id: appId });
+
+ if (check.status == 200) {
+ const udpateReadNotifikasi = await adminNotifikasi_funUpdateIsReadById({
+ notifId: notifikasiId,
+ });
+
+ if (udpateReadNotifikasi.status == 200) {
+ const path = `/dev/admin/investasi/sub-menu/${check.statusName}`;
+
+ if (check.statusName == "draft") {
+ ComponentAdminGlobal_NotifikasiPeringatan(
+ "Status telah dirubah oleh user"
+ );
+ } else {
+ if (check.statusName == "publish") {
+ onChangeNavbar({
+ id: "Investasi",
+ childId: "Investasi_2",
+ });
+ }
+
+ if (check.statusName == "review") {
+ onChangeNavbar({
+ id: "Investasi",
+ childId: "Investasi_3",
+ });
+ }
+
+ if (check.statusName == "reject") {
+ onChangeNavbar({
+ id: "Investasi",
+ childId: "Investasi_4",
+ });
+ }
+
+ router.push(path, { scroll: false });
+ }
+
+ return true;
+ }
+ } else {
+ ComponentAdminGlobal_NotifikasiPeringatan("Status tidak ditemukan");
+ return false;
+ }
}
-
- // if (
- // data.status === "Menunggu" ||
- // data.status === "Berhasil" ||
- // data.status === "Proses" ||
- // data.status === "Gagal"
- // ) {
- // const path = RouterAdminDonasi_OLD.detail_publish + data.appId;
- // router.push(path, { scroll: false });
- // onChangeNavbar({
- // id: 3,
- // childId: 32,
- // });
- // }
-
- onToggleNavbar(true);
}
diff --git a/src/app_modules/admin/notifikasi/route_setting/job.ts b/src/app_modules/admin/notifikasi/route_setting/job.ts
index ace989d4..1d348912 100644
--- a/src/app_modules/admin/notifikasi/route_setting/job.ts
+++ b/src/app_modules/admin/notifikasi/route_setting/job.ts
@@ -1,27 +1,18 @@
-import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
+import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../_admin_global/admin_notifikasi/notifikasi_peringatan";
import { admin_funCheckStatusJob } from "../fun/get/fun_check_status_job";
import adminNotifikasi_funUpdateIsReadById from "../fun/update/fun_update_is_read_by_id";
-import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
-import adminNotifikasi_countNotifikasi from "../fun/count/count_is_read";
-import adminNotifikasi_getByUserId from "../fun/get/get_notifikasi_by_user_id";
-import { IAdmin_ActivePage, IAdmin_ActiveChildId } from "./type_of_select_page";
+import { IAdmin_ActiveChildId, IAdmin_ActivePage } from "./type_of_select_page";
export async function adminNotifikasi_findRouterJob({
appId,
notifikasiId,
router,
- activePage,
- onLoadCountNotif,
- onLoadDataNotifikasi,
onChangeNavbar,
}: {
appId: string;
notifikasiId: string;
router: AppRouterInstance;
- activePage: number;
- onLoadCountNotif: (val: any) => void;
- onLoadDataNotifikasi: (val: any) => void;
onChangeNavbar: (val: {
id: IAdmin_ActivePage;
childId: IAdmin_ActiveChildId;
@@ -35,14 +26,6 @@ export async function adminNotifikasi_findRouterJob({
});
if (udpateReadNotifikasi.status == 200) {
- const loadCountNotif = await adminNotifikasi_countNotifikasi();
- onLoadCountNotif(loadCountNotif);
-
- const loadListNotifikasi = await adminNotifikasi_getByUserId({
- page: 1,
- });
- onLoadDataNotifikasi(loadListNotifikasi);
-
const path = `/dev/admin/job/child/${check.statusName}`;
if (check.statusName == "draft") {
diff --git a/src/app_modules/admin/notifikasi/route_setting/voting.ts b/src/app_modules/admin/notifikasi/route_setting/voting.ts
index f59e1b00..04fd2ddf 100644
--- a/src/app_modules/admin/notifikasi/route_setting/voting.ts
+++ b/src/app_modules/admin/notifikasi/route_setting/voting.ts
@@ -1,4 +1,4 @@
-import { RouterAdminVote } from "@/app/lib/router_admin/router_admin_vote";
+import { RouterAdminVote } from "@/lib/router_admin/router_admin_vote";
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
import { admin_funVotingCheckStatus } from "../fun/get/fun_voting_check_status";
@@ -12,17 +12,11 @@ export async function adminNotifikasi_findRouterVoting({
appId,
notifikasiId,
router,
- activePage,
- onLoadCountNotif,
- onLoadDataNotifikasi,
onChangeNavbar,
}: {
appId: string;
notifikasiId: string;
router: AppRouterInstance;
- activePage: number;
- onLoadCountNotif: (val: any) => void;
- onLoadDataNotifikasi: (val: any) => void;
onChangeNavbar: (val: {
id: IAdmin_ActivePage;
childId: IAdmin_ActiveChildId;
@@ -36,13 +30,6 @@ export async function adminNotifikasi_findRouterVoting({
});
if (updateReadNotifikasi.status == 200) {
- const loadCountNotif = await adminNotifikasi_countNotifikasi();
- onLoadCountNotif(loadCountNotif);
-
- const loadListNotifikasi = await adminNotifikasi_getByUserId({
- page: 1,
- });
- onLoadDataNotifikasi(loadListNotifikasi);
const path = `/dev/admin/vote/child/table_${check.statusName}`;
diff --git a/src/app_modules/admin/notifikasi/view_card_drawer.tsx b/src/app_modules/admin/notifikasi/view_card_drawer.tsx
index 37120d27..eeebba22 100644
--- a/src/app_modules/admin/notifikasi/view_card_drawer.tsx
+++ b/src/app_modules/admin/notifikasi/view_card_drawer.tsx
@@ -4,8 +4,8 @@ import {
gs_adminJob_triggerReview,
gs_adminVoting_triggerReview,
ITypeStatusNotifikasi,
-} from "@/app/lib/global_state";
-import { AccentColor } from "@/app_modules/_global/color";
+} from "@/lib/global_state";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component";
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
import { Badge, Card, Divider, Group, Stack, Text } from "@mantine/core";
@@ -13,17 +13,16 @@ import { IconCheck, IconChecks } from "@tabler/icons-react";
import { useAtom } from "jotai";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import { ComponentAdminGlobal_NotifikasiPeringatan } from "../_admin_global/admin_notifikasi/notifikasi_peringatan";
-import adminNotifikasi_countNotifikasi from "./fun/count/count_is_read";
-import adminNotifikasi_getByUserId from "./fun/get/get_notifikasi_by_user_id";
+import adminNotifikasi_findRouterDonasi from "./route_setting/donasi";
import { adminNotifikasi_findRouterEvent } from "./route_setting/event";
+import adminNotifikasi_findRouterInvestasi from "./route_setting/investasi";
import { adminNotifikasi_findRouterJob } from "./route_setting/job";
import {
IAdmin_ActiveChildId,
IAdmin_ActivePage,
} from "./route_setting/type_of_select_page";
import { adminNotifikasi_findRouterVoting } from "./route_setting/voting";
-import adminNotifikasi_findRouterDonasi from "./route_setting/donasi";
+import { clientLogger } from "@/util/clientLogger";
export default function AdminNotifikasi_ViewCardDrawer({
data,
@@ -63,193 +62,200 @@ export default function AdminNotifikasi_ViewCardDrawer({
async function onRead() {
// ========================== JOB ========================== //
- if (data?.kategoriApp === "JOB") {
+ try {
setVisible(true);
- setDataId(data.id);
- const checkJob = await adminNotifikasi_findRouterJob({
- appId: data.appId,
- notifikasiId: data.id,
- router: router,
- activePage: activePage,
- onLoadCountNotif(val) {
- onLoadCountNotif(val);
- },
- onLoadDataNotifikasi(val) {
- onLoadDataNotifikasi(val);
- },
- onChangeNavbar(val) {
- onChangeNavbar({
- id: val.id,
- childId: val.childId,
- });
- },
- });
+ if (data?.kategoriApp === "JOB") {
+ setDataId(data.id);
- if (checkJob) {
- setIsAdminJob_TriggerReview(false);
- setVisible(false);
- setDataId("");
- onToggleNavbar(false);
+ // const checkJob = await adminNotifikasi_findRouterJob({
+ // appId: data.appId,
+ // notifikasiId: data.id,
+ // router: router,
+ // activePage: activePage,
+ // onLoadCountNotif(val) {
+ // onLoadCountNotif(val);
+ // },
+ // onLoadDataNotifikasi(val) {
+ // onLoadDataNotifikasi(val);
+ // },
+ // onChangeNavbar(val) {
+ // onChangeNavbar({
+ // id: val.id,
+ // childId: val.childId,
+ // });
+ // },
+ // });
+
+ // if (checkJob) {
+ // setIsAdminJob_TriggerReview(false);
+ // setVisible(false);
+ // setDataId("");
+ // onToggleNavbar(false);
+ // }
+
+ return;
}
+ // ========================== JOB ========================== //
+
+ // ========================== EVENT ========================== //
+
+ // if (data.kategoriApp == "EVENT") {
+ // setDataId(data.id);
+
+ // const checkEvent = await adminNotifikasi_findRouterEvent({
+ // appId: data.appId,
+ // notifikasiId: data.id,
+ // router: router,
+ // activePage: activePage,
+ // onLoadCountNotif(val) {
+ // onLoadCountNotif(val);
+ // },
+ // onLoadDataNotifikasi(val) {
+ // onLoadDataNotifikasi(val);
+ // },
+ // onChangeNavbar(val) {
+ // onChangeNavbar({
+ // id: val.id,
+ // childId: val.childId,
+ // });
+ // },
+ // });
+
+ // if (checkEvent) {
+ // setIsAdminEvent_TriggerReview(false);
+ // setVisible(false);
+ // setDataId("");
+ // onToggleNavbar(false);
+ // }
+
+ // return;
+ // }
+ // // ========================== EVENT ========================== //
+
+ // // ========================== VOTING ========================== //
+
+ // if (data.kategoriApp == "VOTING") {
+ // setDataId(data.id);
+
+ // const checkVoting = await adminNotifikasi_findRouterVoting({
+ // router: router,
+ // appId: data.appId,
+ // notifikasiId: data.id,
+ // activePage: activePage,
+ // onLoadCountNotif(val) {
+ // onLoadCountNotif(val);
+ // },
+ // onLoadDataNotifikasi(val) {
+ // onLoadDataNotifikasi(val);
+ // },
+ // onChangeNavbar(val) {
+ // onChangeNavbar({
+ // id: val.id,
+ // childId: val.childId,
+ // });
+ // },
+ // });
+
+ // if (checkVoting) {
+ // setIsAdminVoting_TriggerReview(false);
+ // setVisible(false);
+ // setDataId("");
+ // onToggleNavbar(false);
+ // }
+
+ // return;
+ // }
+ // // ========================== VOTING ========================== //
+
+ // // ========================== DONASI ========================== //
+
+ // if (data.kategoriApp == "DONASI") {
+ // setDataId(data.id);
+
+ // const checkDonasi = await adminNotifikasi_findRouterDonasi({
+ // appId: data.appId,
+ // notifikasiId: data.id,
+ // router: router,
+ // status: data.status as ITypeStatusNotifikasi,
+ // onLoadCountNotif(val) {
+ // onLoadCountNotif(val);
+ // },
+ // onLoadDataNotifikasi(val) {
+ // onLoadDataNotifikasi(val);
+ // },
+ // onChangeNavbar(val) {
+ // onChangeNavbar({
+ // id: val.id,
+ // childId: val.childId,
+ // });
+ // },
+ // });
+
+ // if (checkDonasi) {
+ // setIsAdminDonasi_TriggerReview(false);
+ // setVisible(false);
+ // setDataId("");
+ // onToggleNavbar(false);
+ // }
+
+ // return;
+ // }
+
+ // // ========================== DONASI ========================== //
+
+ // // ========================== INVESTASI ========================== //
+
+ // if (data.kategoriApp == "INVESTASI") {
+ // setDataId(data.id);
+
+ // const checkInvestasi = await adminNotifikasi_findRouterInvestasi({
+ // appId: data.appId,
+ // notifikasiId: data.id,
+ // status: data.status as ITypeStatusNotifikasi,
+ // router: router,
+ // onLoadCountNotif(val) {
+ // onLoadCountNotif(val);
+ // },
+ // onLoadDataNotifikasi(val) {
+ // onLoadDataNotifikasi(val);
+ // },
+ // onChangeNavbar(val) {
+ // onChangeNavbar({
+ // id: val.id,
+ // childId: val.childId,
+ // });
+ // },
+ // });
+
+ // if (checkInvestasi) {
+ // setIsAdminDonasi_TriggerReview(false);
+ // setVisible(false);
+ // setDataId("");
+ // onToggleNavbar(false);
+ // }
+
+ // return;
+ // }
+
+ // // FORUM
+ // e?.kategoriApp === "FORUM" &&
+ // adminNotifikasi_findRouterForum({
+ // data: e,
+ // router: router,
+ // onChangeNavbar(val) {
+ // onChangeNavbar(val);
+ // },
+ // onToggleNavbar(val) {
+ // onToggleNavbar(val);
+ // },
+ // });
+
+ } catch (error) {
+ clientLogger.error("Error notifikasi function", error);
+ } finally {
+ setVisible(false);
}
- // ========================== JOB ========================== //
-
- // ========================== EVENT ========================== //
-
- if (data.kategoriApp == "EVENT") {
- setVisible(true);
- setDataId(data.id);
-
- const checkEvent = await adminNotifikasi_findRouterEvent({
- appId: data.appId,
- notifikasiId: data.id,
- router: router,
- activePage: activePage,
- onLoadCountNotif(val) {
- onLoadCountNotif(val);
- },
- onLoadDataNotifikasi(val) {
- onLoadDataNotifikasi(val);
- },
- onChangeNavbar(val) {
- onChangeNavbar({
- id: val.id,
- childId: val.childId,
- });
- },
- });
-
- if (checkEvent) {
- setIsAdminEvent_TriggerReview(false);
- setVisible(false);
- setDataId("");
- onToggleNavbar(false);
- }
- }
- // ========================== EVENT ========================== //
-
- // ========================== VOTING ========================== //
-
- if (data.kategoriApp == "VOTING") {
- setVisible(true);
- setDataId(data.id);
-
- const checkVoting = await adminNotifikasi_findRouterVoting({
- router: router,
- appId: data.appId,
- notifikasiId: data.id,
- activePage: activePage,
- onLoadCountNotif(val) {
- onLoadCountNotif(val);
- },
- onLoadDataNotifikasi(val) {
- onLoadDataNotifikasi(val);
- },
- onChangeNavbar(val) {
- onChangeNavbar({
- id: val.id,
- childId: val.childId,
- });
- },
- });
-
- if (checkVoting) {
- setIsAdminVoting_TriggerReview(false);
- setVisible(false);
- setDataId("");
- onToggleNavbar(false);
- }
- }
- // ========================== VOTING ========================== //
-
- // ========================== DONASI ========================== //
-
- if (data.kategoriApp == "DONASI") {
- const checkDonasi = await adminNotifikasi_findRouterDonasi({
- appId: data.appId,
- notifikasiId: data.id,
- router: router,
- status: data.status as ITypeStatusNotifikasi,
- onLoadCountNotif(val) {
- onLoadCountNotif(val);
- },
- onLoadDataNotifikasi(val) {
- onLoadDataNotifikasi(val);
- },
- onChangeNavbar(val) {
- onChangeNavbar({
- id: val.id,
- childId: val.childId,
- });
- },
- });
-
- if (checkDonasi) {
- setIsAdminDonasi_TriggerReview(false);
- setVisible(false);
- setDataId("");
- onToggleNavbar(false);
- }
- }
-
- // ========================== DONASI ========================== //
-
- // // FORUM
- // e?.kategoriApp === "FORUM" &&
- // adminNotifikasi_findRouterForum({
- // data: e,
- // router: router,
- // onChangeNavbar(val) {
- // onChangeNavbar(val);
- // },
- // onToggleNavbar(val) {
- // onToggleNavbar(val);
- // },
- // });
-
- // // VOTE
- // e?.kategoriApp === "VOTING" &&
- // adminNotifikasi_findRouterVoting({
- // data: e,
- // router: router,
- // onChangeNavbar(val) {
- // onChangeNavbar(val);
- // },
- // onToggleNavbar(val) {
- // onToggleNavbar(val);
- // },
- // });
-
- // // EVENT
- // e?.kategoriApp === "EVENT" &&
- //
-
- // // DONASI
- // e.kategoriApp === "DONASI" &&
- // adminNotifikasi_findRouterDonasi({
- // data: e,
- // router: router,
- // onChangeNavbar(val) {
- // onChangeNavbar(val);
- // },
- // onToggleNavbar(val) {
- // onToggleNavbar(val);
- // },
- // });
-
- // // INVESTASI
- // e.kategoriApp === "INVESTASI" &&
- // adminNotifikasi_findRouterInvestasi({
- // data: e,
- // router: router,
- // onChangeNavbar(val) {
- // onChangeNavbar(val);
- // },
- // onToggleNavbar(val) {
- // onToggleNavbar(val);
- // },
- // });
}
return (
@@ -257,11 +263,12 @@ export default function AdminNotifikasi_ViewCardDrawer({
- Welcome Admin
+ Welcome Admin
diff --git a/src/app_modules/admin/user-access/_lib/api_fetch_user_access.ts b/src/app_modules/admin/user-access/_lib/api_fetch_user_access.ts
new file mode 100644
index 00000000..e8c96da7
--- /dev/null
+++ b/src/app_modules/admin/user-access/_lib/api_fetch_user_access.ts
@@ -0,0 +1,45 @@
+export { apiGetUserAccess };
+
+const apiGetUserAccess = async ({
+ page,
+ search,
+}: {
+ page: string;
+ search?: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ // Fetch data
+ const isPage = `?page=${page}`;
+ const isSearch = search ? `&search=${search}` : "";
+ const response = await fetch(`/api/admin/user${isPage}${isSearch}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error get data user access:",
+ errorData?.message || "Unknown error"
+ );
+ return null;
+ }
+
+ return response.json();
+ } catch (error) {
+ console.error("Error get data user access:", error);
+ throw error;
+ }
+};
diff --git a/src/app_modules/admin/user-access/fun/edit/fun_edit_access.ts b/src/app_modules/admin/user-access/fun/edit/fun_edit_access.ts
index a8a9dc15..a7708deb 100644
--- a/src/app_modules/admin/user-access/fun/edit/fun_edit_access.ts
+++ b/src/app_modules/admin/user-access/fun/edit/fun_edit_access.ts
@@ -1,22 +1,59 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
+import backendLogger from "@/util/backendLogger";
import { revalidatePath } from "next/cache";
+import { headers } from "next/headers";
export default async function adminUserAccess_funEditAccess(
userId: string,
- value: boolean
+ value: boolean,
+ nomor?: string
) {
- const updt = await prisma.user.update({
- where: {
- id: userId,
- },
- data: {
- active: value,
- },
- });
+ try {
+ const updt = await prisma.user.update({
+ where: {
+ id: userId,
+ },
+ data: {
+ active: value,
+ },
+ });
- if (!updt) return { status: 400, message: "Update gagal" };
- revalidatePath("/dev/admin/user-access");
- return { status: 200, message: "Update berhasil" };
+ const headersList = headers();
+ const host = headersList.get("host");
+ const protocol = headersList.get("x-forwarded-proto") || "http";
+ const path = headersList.get("x-invoke-path");
+ const baseUrl = `${protocol}://${host}`;
+ // const fullUrl = `${protocol}://${host}${path}`;
+
+ if (value === true) {
+ const message = `Hallo rekan HIPMI, Anda telah diberikan akses ke HIPMI Apps. Silakan mulai jelajahi fitur-fitur yang tersedia melalui link berikut: ${baseUrl}`;
+ const encodedMessage = encodeURIComponent(message);
+
+ const res = await fetch(
+ `https://wa.wibudev.com/code?nom=${nomor}&text=${encodedMessage}
+ `
+ );
+
+ if (!res.ok) {
+ backendLogger.error("Error send message", res);
+ }
+
+ const result = await res.json();
+
+ backendLogger.info("Success send message", result);
+ }
+
+ if (!updt) return { status: 400, message: "Update gagal" };
+ revalidatePath("/dev/admin/user-access");
+ return { status: 200, message: "Update berhasil" };
+ } catch (error) {
+ backendLogger.error("Error update user", error);
+ return {
+ status: 500,
+ message: "Error udpate user",
+ error: (error as Error).message,
+ };
+ }
}
diff --git a/src/app_modules/admin/user-access/fun/get/get_list_all_user.ts b/src/app_modules/admin/user-access/fun/get/get_list_all_user.ts
index 55f8da17..862c8d26 100644
--- a/src/app_modules/admin/user-access/fun/get/get_list_all_user.ts
+++ b/src/app_modules/admin/user-access/fun/get/get_list_all_user.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _, { ceil } from "lodash";
export default async function adminUserAccess_getListUser({
diff --git a/src/app_modules/admin/user-access/view/index.tsx b/src/app_modules/admin/user-access/view/index.tsx
index 06c97ad4..6771788c 100644
--- a/src/app_modules/admin/user-access/view/index.tsx
+++ b/src/app_modules/admin/user-access/view/index.tsx
@@ -1,6 +1,12 @@
"use client";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { MODEL_USER } from "@/app_modules/home/model/interface";
+import { IRealtimeData } from "@/lib/global_state";
+import { clientLogger } from "@/util/clientLogger";
import {
Button,
Center,
@@ -12,117 +18,186 @@ import {
Table,
TextInput,
Title,
+ Text,
+ Box,
} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import { IconSearch } from "@tabler/icons-react";
-import adminUserAccess_funEditAccess from "../fun/edit/fun_edit_access";
import { useState } from "react";
-import adminUserAccess_getListUser from "../fun/get/get_list_all_user";
-import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import { WibuRealtime } from "wibu-pkg";
+import { apiGetUserAccess } from "../_lib/api_fetch_user_access";
+import adminUserAccess_funEditAccess from "../fun/edit/fun_edit_access";
+import { Admin_V3_ComponentPaginationBreakpoint } from "../../_components_v3/comp_pagination_breakpoint";
+import { Admin_ComponentModal } from "../../_admin_global/_component/comp_admin_modal";
-export default function AdminUserAccess_View({ listUser }: { listUser: any }) {
- const [data, setData] = useState(listUser.data);
+export default function AdminUserAccess_View() {
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
const [isActivePage, setActivePage] = useState(1);
- const [isNPage, setNPage] = useState(listUser.nPage);
const [isSearch, setSearch] = useState("");
- async function onAccess(id: string) {
- await adminUserAccess_funEditAccess(id, true).then(async (res) => {
- if (res.status === 200) {
- const value = await adminUserAccess_getListUser({
- page: 1,
- search: isSearch,
- });
- setData(value.data as any);
- setNPage(value.nPage);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
- }
+ const [isLoadingAccess, setIsLoadingAccess] = useState(false);
+ const [isLoadingDelete, setIsLoadingDelete] = useState(false);
+ const [userId, setUserId] = useState("");
+ const [openedModal, setOpenedModal] = useState(false);
+ const [dataUser, setDataUser] = useState(null);
- async function onDelAccess(id: string) {
- await adminUserAccess_funEditAccess(id, false).then(async (res) => {
- if (res.status === 200) {
- const value = await adminUserAccess_getListUser({
- page: 1,
- search: isSearch,
- });
- setData(value.data as any);
- setNPage(value.nPage);
- ComponentGlobal_NotifikasiBerhasil(res.message);
+ useShallowEffect(() => {
+ handleLoadData();
+ }, [isActivePage, isSearch]);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetUserAccess({
+ page: `${isActivePage}`,
+ search: isSearch,
+ });
+
+ if (response.success) {
+ setData(response.data.data);
+ setNPage(response.data.nPage);
} else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ setData([]);
}
- });
- }
+ } catch (error) {
+ console.error("Error get user access", error);
+ setData([]);
+ }
+ };
async function onSearch(s: any) {
setSearch(s);
- setActivePage(1);
- const loadData = await adminUserAccess_getListUser({
- search: s,
- page: 1,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
}
async function onPageClick(p: any) {
setActivePage(p);
- const loadData = await adminUserAccess_getListUser({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
}
- const tableBody = data.map((e, i) => (
-
- |
- {e.username}
- |
-
- +{e.nomor}
- |
-
- {e.active === false ? (
-
- {
- onAccess(e.id);
- }}
- >
- Give Access
-
-
- ) : (
-
- {
- onDelAccess(e.id);
- }}
- >
- Delete Access
-
-
- )}
- |
-
- ));
+ async function onAccess(id: string, nomor: string) {
+ try {
+ setUserId(id);
+ setIsLoadingAccess(true);
+ await adminUserAccess_funEditAccess(id, true, nomor).then(async (res) => {
+ if (res.status === 200) {
+ handleLoadData();
+
+ const dataNotifikasi: IRealtimeData = {
+ status: true as any,
+ userId: id,
+ kategoriApp: "ACCESS",
+ };
+
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+
+ setOpenedModal(false);
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ } else {
+ setOpenedModal(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ } catch (error) {
+ clientLogger.error("Error grand access", error);
+ } finally {
+ setIsLoadingAccess(false);
+ setUserId("");
+ }
+ }
+
+ async function onDelete(id: string) {
+ try {
+ setUserId(id);
+ setIsLoadingDelete(true);
+ await adminUserAccess_funEditAccess(id, false).then(async (res) => {
+ if (res.status === 200) {
+ handleLoadData();
+
+ setOpenedModal(false);
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ } else {
+ setOpenedModal(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ } catch (error) {
+ clientLogger.error("Error delete access", error);
+ } finally {
+ setIsLoadingDelete(false);
+ setUserId("");
+ }
+ }
+
+ const tableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+
+ return data.map((e, i) => (
+
+ |
+
+ {e.username}
+
+ |
+
+
+ +{e.nomor}
+
+ |
+
+ {e.active === false ? (
+
+ {
+ setOpenedModal(true);
+ setDataUser(e);
+ // onAccess(e.id, e.nomor);
+ }}
+ >
+ Grand Access
+
+
+ ) : (
+
+ {
+ setOpenedModal(true);
+ setDataUser(e);
+ // onDelete(e.id);
+ }}
+ >
+ Delete Access
+
+
+ )}
+ |
+
+ ));
+ };
return (
<>
@@ -137,42 +212,81 @@ export default function AdminUserAccess_View({ listUser }: { listUser: any }) {
/>
-
-
-
-
-
- |
- Username
- |
-
- Nomor
- |
-
- Aksi
- |
-
-
- {tableBody}
-
-
-
-
+ ) : (
+
+
+
+
+
+ |
+ Username
+ |
+
+ Nomor
+ |
+
+ Aksi
+ |
+
+
+ {tableBody()}
+
+
+ {
onPageClick(val);
}}
/>
-
-
+
+ )}
+
+ {
+ setOpenedModal(false);
+ }}
+ >
+
+
+ Apakah anda akan{" "}
+ {dataUser?.active === true ? "menghapus" : "memberikan"} akses ke{" "}
+ {dataUser?.username} ?
+
+
+ {
+ setOpenedModal(false);
+ }}
+ >
+ Tidak
+
+ {
+ if (dataUser?.active === true) {
+ onDelete(dataUser?.id!);
+ } else {
+ onAccess(dataUser?.id!, dataUser?.nomor!);
+ }
+ }}
+ >
+ Ya
+
+
+
+
>
);
}
diff --git a/src/app_modules/admin/vote/child/riwayat/index.tsx b/src/app_modules/admin/vote/child/riwayat/index.tsx
index db177452..e6a442a8 100644
--- a/src/app_modules/admin/vote/child/riwayat/index.tsx
+++ b/src/app_modules/admin/vote/child/riwayat/index.tsx
@@ -3,213 +3,246 @@
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
import { MODEL_VOTING } from "@/app_modules/vote/model/interface";
import {
- Box,
- Button,
Center,
- Group,
Modal,
Pagination,
Paper,
ScrollArea,
- Spoiler,
Stack,
Table,
Text,
TextInput,
- Title,
} from "@mantine/core";
-import { useDisclosure } from "@mantine/hooks";
-import { IconEyeCheck, IconSearch } from "@tabler/icons-react";
-import _ from "lodash";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { IconSearch } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
+import { AccentColor } from "@/app_modules/_global/color";
+import { AdminColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
+import Admin_DetailButton from "@/app_modules/admin/_admin_global/_component/button/detail_button";
+import ComponentAdminGlobal_IsEmptyData from "@/app_modules/admin/_admin_global/is_empty_data";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { RouterAdminVote } from "@/lib/router_admin/router_admin_vote";
+import { clientLogger } from "@/util/clientLogger";
+import _ from "lodash";
import { useState } from "react";
import ComponentAdminVote_DetailHasil from "../../component/detail_hasil";
import { AdminVote_getHasilById } from "../../fun/get/get_hasil_by_id";
import { AdminVote_getListKontributorById } from "../../fun/get/get_list_kontributor_by_id";
-import { adminVote_funGetListRiwayat } from "../../fun";
-import { IconCircleCheckFilled } from "@tabler/icons-react";
+import { apiGetAdminVotingRiwayat } from "../../lib/api_fetch_admin_voting";
+import { Admin_V3_ComponentPaginationBreakpoint } from "@/app_modules/admin/_components_v3/comp_pagination_breakpoint";
-export default function AdminVote_Riwayat({
- dataVote,
-}: {
- dataVote: MODEL_VOTING[];
-}) {
+export default function AdminVote_Riwayat() {
return (
<>
-
+
>
);
}
-function TableStatus({ listPublish }: { listPublish: any }) {
+function TableStatus() {
const router = useRouter();
const [opened, { open, close }] = useDisclosure(false);
- const [data, setData] = useState(listPublish.data);
const [hasil, setHasil] = useState();
const [kontributor, setKontributor] = useState();
const [voteId, setVoteId] = useState("");
const [loading, setLoading] = useState(false);
- const [isNPage, setNPage] = useState(listPublish.nPage);
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
const [isActivePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
+ useShallowEffect(() => {
+ handleLoadData();
+ }, [isActivePage, isSearch]);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetAdminVotingRiwayat({
+ page: `${isActivePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
+ };
+
async function onSearch(s: string) {
setSearch(s);
- const loadData = await adminVote_funGetListRiwayat({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
}
async function onPageClick(p: any) {
setActivePage(p);
- const loadData = await adminVote_funGetListRiwayat({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
}
- const TableRows = data.map((e, i) => (
-
- |
-
- }
- onClick={async () => {
- setVoteId(e?.id);
- setLoading(true);
- await new Promise((r) => setTimeout(r, 500));
- onList(e?.id, setHasil, setKontributor, setLoading, open);
- }}
- >
- Lihat Hasil
-
-
- |
-
- {e?.Author?.username}
- |
-
- {e?.title}
- |
-
-
-
- {e?.deskripsi}
-
-
- |
-
-
- {e?.Voting_DaftarNamaVote.map((v) => (
-
- - {v?.value}
-
- ))}
-
- |
-
-
- {e?.awalVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
-
- |
-
-
- {e?.akhirVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
-
- |
-
- ));
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+
+
+ |
+
+ );
+ }
+
+ return data.map((e, i) => (
+
+ {/* |
+
+ }
+ onClick={async () => {
+ setVoteId(e?.id);
+ setLoading(true);
+ await new Promise((r) => setTimeout(r, 500));
+ onList(e?.id, setHasil, setKontributor, setLoading, open);
+ }}
+ >
+ Lihat Hasil
+
+
+ | */}
+
+
+ {e?.Author?.username}
+
+ |
+
+
+ {e?.title}
+
+ |
+ {/*
+
+
+ {e?.deskripsi}
+
+
+ | */}
+ {/*
+
+ {e?.Voting_DaftarNamaVote.map((v) => (
+
+ - {v?.value}
+
+ ))}
+
+ | */}
+
+
+
+ {new Intl.DateTimeFormat("id-ID", {
+ dateStyle: "long",
+ }).format(new Date(e?.awalVote))}
+
+ |
+
+
+ {new Intl.DateTimeFormat("id-ID", {
+ dateStyle: "long",
+ }).format(new Date(e?.akhirVote))}
+
+ |
+
+
+
+
+
+ |
+
+ ));
+ };
return (
<>
{/* {JSON.stringify(listUser, null, 2)} */}
-
- Riwayat
- }
- radius={"xl"}
- placeholder="Masukan judul"
- onChange={(val) => {
- onSearch(val.currentTarget.value);
- }}
- />
-
+ }
+ radius={"xl"}
+ placeholder="Masukan judul"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
-
-
-
-
-
- |
- Aksi
- |
-
- Username
- |
-
- Judul
- |
-
- Deskripsi
- |
-
- Pilihan
- |
-
- Mulai Vote
- |
-
- Selesai Vote
- |
-
-
- {TableRows}
-
-
+ {!data ? (
+
+ ) : _.isEmpty(data) ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Username
+ |
+
+ Judul
+ |
+
+ Mulai Vote
+ |
+
+ Selesai Vote
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
-
- {
onPageClick(val);
}}
/>
-
-
+
+ )}
-
+
>
);
}
-function TableStatus({ listPublish }: { listPublish: any }) {
+function TableStatus() {
const router = useRouter();
const [opened, { open, close }] = useDisclosure(false);
- const [data, setData] = useState(listPublish.data);
const [hasil, setHasil] = useState();
const [kontributor, setKontributor] = useState();
const [voteId, setVoteId] = useState("");
const [loading, setLoading] = useState(false);
- const [isNPage, setNPage] = useState(listPublish.nPage);
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
const [isActivePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
+ useShallowEffect(() => {
+ handleLoadData();
+ }, [isActivePage, isSearch]);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetAdminVotingByStatus({
+ name: "Publish",
+ page: `${isActivePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
+ };
+
async function onSearch(s: string) {
setSearch(s);
- const loadData = await adminVote_funGetListPublish({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
}
async function onPageClick(p: any) {
setActivePage(p);
- const loadData = await adminVote_funGetListPublish({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
}
- const TableRows = data.map((e, i) => (
-
- |
-
- }
- onClick={async () => {
- setVoteId(e?.id);
- setLoading(true);
- await new Promise((r) => setTimeout(r, 500));
- onList(e?.id, setHasil, setKontributor, setLoading, open);
- }}
- >
- Lihat Hasil
-
-
- |
-
- {e?.Author?.username}
- |
-
- {e?.title}
- |
-
-
-
- {e?.deskripsi}
-
-
- |
-
-
- {e?.Voting_DaftarNamaVote.map((v) => (
-
- - {v?.value}
-
- ))}
-
- |
-
-
- {e?.awalVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
-
- |
-
-
- {e?.akhirVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
-
- |
-
- ));
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+
+
+ |
+
+ );
+ }
+
+ return data?.map((e, i) => (
+
+ |
+
+ {e?.Author?.username}
+
+ |
+
+
+ {e?.title}
+
+ |
+
+
+
+ {new Intl.DateTimeFormat("id-ID", {
+ dateStyle: "long",
+ }).format(new Date(e?.awalVote))}
+
+ |
+
+
+ {new Intl.DateTimeFormat("id-ID", {
+ dateStyle: "long",
+ }).format(new Date(e?.akhirVote))}
+
+ |
+
+
+
+
+
+ |
+
+ ));
+ };
return (
<>
- {/* {JSON.stringify(listUser, null, 2)} */}
-
- Publish
- }
- radius={"xl"}
- placeholder="Masukan judul"
- onChange={(val) => {
- onSearch(val.currentTarget.value);
- }}
- />
-
+ }
+ radius={"xl"}
+ placeholder="Masukan judul"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
-
-
-
-
-
- |
- Aksi
- |
-
- Username
- |
-
- Judul
- |
-
- Deskripsi
- |
-
- Pilihan
- |
-
- Mulai Vote
- |
-
- Selesai Vote
- |
-
-
- {TableRows}
-
-
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Username
+ |
+
+ Judul
+ |
+
+ Mulai Vote
+ |
+
+ Selesai Vote
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
-
- {
onPageClick(val);
}}
/>
-
-
+
+ )}
+
+
+
+
+ >
+ );
+}
+
+function TableStatus() {
+ const router = useRouter();
+ const [opened, { open, close }] = useDisclosure(false);
+ const [hasil, setHasil] = useState();
+ const [kontributor, setKontributor] = useState();
+ const [voteId, setVoteId] = useState("");
+ const [loading, setLoading] = useState(false);
+
+ const [data, setData] = useState(null);
+ const [isNPage, setNPage] = useState(1);
+ const [isActivePage, setActivePage] = useState(1);
+ const [isSearch, setSearch] = useState("");
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, [isActivePage, isSearch]);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetAdminVotingByStatus({
+ name: "Publish",
+ page: `${isActivePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
+ };
+
+ async function onSearch(s: string) {
+ setSearch(s);
+ }
+
+ async function onPageClick(p: any) {
+ setActivePage(p);
+ }
+
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+ Tidak ada data
+
+ |
+
+ );
+ }
+
+ return data?.map((e, i) => (
+
+ |
+ {e?.Author?.username}
+ |
+
+ {e?.title}
+ |
+
+
+
+ {e?.Voting_DaftarNamaVote.map((v) => (
+
+ - {v?.value}
+
+ ))}
+
+ |
+
+
+
+
+ }
+ onClick={async () => {
+ setVoteId(e?.id);
+ setLoading(true);
+ await new Promise((r) => setTimeout(r, 500));
+ onList(e?.id, setHasil, setKontributor, setLoading, open);
+ }}
+ >
+ Lihat Hasil
+
+
+ |
+
+ ));
+ };
+
+ return (
+ <>
+
+ }
+ radius={"xl"}
+ placeholder="Masukan judul"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
+
+ {!data ? (
+
+ ) : _.isEmpty(data) ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Username
+ |
+
+ Judul
+ |
+
+ Pilihan
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+
+
+ {
+ onPageClick(val);
+ }}
+ />
+
+
+ )}
+
+
+
+
+
+ >
+ );
+}
+
+async function onList(
+ voteId: string,
+ setHasil: any,
+ setKontributor: any,
+ setLoading: any,
+ open: any
+) {
+ await AdminVote_getHasilById(voteId).then((res) => {
+ setHasil(res);
+ setLoading(false);
+ });
+
+ await AdminVote_getListKontributorById(voteId).then((res) => {
+ setKontributor(res);
+ setLoading(false);
+ });
+
+ open();
+}
diff --git a/src/app_modules/admin/vote/child/table_reject/index.tsx b/src/app_modules/admin/vote/child/table_reject/index.tsx
index a564c4dc..f497a8d8 100644
--- a/src/app_modules/admin/vote/child/table_reject/index.tsx
+++ b/src/app_modules/admin/vote/child/table_reject/index.tsx
@@ -1,246 +1,279 @@
"use client";
+import {
+ AccentColor,
+ AdminColor,
+} from "@/app_modules/_global/color/color_pallet";
+import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
+import Admin_DetailButton from "@/app_modules/admin/_admin_global/_component/button/detail_button";
import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil";
import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal";
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
+import ComponentAdminGlobal_IsEmptyData from "@/app_modules/admin/_admin_global/is_empty_data";
+import { Admin_V3_ComponentPaginationBreakpoint } from "@/app_modules/admin/_components_v3/comp_pagination_breakpoint";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { MODEL_VOTING } from "@/app_modules/vote/model/interface";
+import { RouterAdminVote } from "@/lib/router_admin/router_admin_vote";
+import { clientLogger } from "@/util/clientLogger";
import {
- Box,
Button,
Center,
Group,
Modal,
- Pagination,
Paper,
ScrollArea,
- Spoiler,
Stack,
Table,
Text,
Textarea,
- TextInput,
- Title,
+ TextInput
} from "@mantine/core";
-import { useDisclosure } from "@mantine/hooks";
-import { IconBan, IconSearch } from "@tabler/icons-react";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { IconSearch } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import { adminVote_funGetListReject } from "../../fun";
import { AdminVote_funEditCatatanRejectById } from "../../fun/edit/fun_edit_catatan_reject_by_id";
+import { apiGetAdminVotingByStatus } from "../../lib/api_fetch_admin_voting";
-export default function AdminVote_TableReject({ dataVote }: { dataVote: any }) {
+export default function AdminVote_TableReject() {
return (
<>
-
+
>
);
}
-function TableStatus({ listData }: { listData: any }) {
+function TableStatus() {
const router = useRouter();
const [opened, { open, close }] = useDisclosure(false);
- const [data, setData] = useState(listData.data);
const [votingId, setVotingId] = useState("");
const [catatan, setCatatan] = useState("");
+ const [isLoading, setLoading] = useState(false);
- const [isNPage, setNPage] = useState(listData.nPage);
+ const [data, setData] = useState(null);
+ const [nPage, setNPage] = useState(1);
const [isActivePage, setActivePage] = useState(1);
const [isSearch, setSearch] = useState("");
+ useShallowEffect(() => {
+ handleLoadData();
+ }, [isActivePage, isSearch]);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetAdminVotingByStatus({
+ name: "Reject",
+ page: `${isActivePage}`,
+ search: isSearch,
+ });
+
+ if (response?.success && response?.data?.data) {
+ setData(response.data.data);
+ setNPage(response.data.nPage || 1);
+ } else {
+ console.error("Invalid data format received:", response);
+ setData([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data table publish", error);
+ setData([]);
+ }
+ };
+
async function onSearch(s: string) {
setSearch(s);
- const loadData = await adminVote_funGetListReject({
- page: 1,
- search: s,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
}
async function onPageClick(p: any) {
setActivePage(p);
- const loadData = await adminVote_funGetListReject({
- search: isSearch,
- page: p,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
}
- async function onReject(
- votingId: string,
- catatan: string,
- close: any,
- setData: any
- ) {
- const res = await AdminVote_funEditCatatanRejectById(votingId, catatan);
- if (res.status === 200) {
- const loadData = await adminVote_funGetListReject({
- page: 1,
- search: isSearch,
- });
- setData(loadData.data as any);
- setNPage(loadData.nPage);
- setActivePage(1);
- ComponentAdminGlobal_NotifikasiBerhasil(res.message);
+ async function onReject() {
+ try {
+ setLoading(true);
+ const res = await AdminVote_funEditCatatanRejectById(votingId, catatan);
+ if (res.status === 200) {
+ handleLoadData();
+ ComponentAdminGlobal_NotifikasiBerhasil(res.message);
+ } else {
+ ComponentAdminGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ console.log("Error get data voting review", error);
+ setVotingId("");
+ } finally {
close();
- } else {
- ComponentAdminGlobal_NotifikasiGagal(res.message);
+ setLoading(false);
+ setVotingId("");
}
}
- const TableRows = data.map((e, i) => (
-
- |
-
- }
- radius={"xl"}
- onClick={() => {
- open();
- setVotingId(e.id);
- setCatatan(e.catatan);
- }}
- >
-
- Tambah
- Catatan
-
-
-
- |
-
-
-
- {e.catatan}
-
-
- |
-
- {e?.Author?.Profile?.name}
- |
-
- {e.title}
- |
-
-
-
- {e.deskripsi}
-
-
- |
-
-
- {e.Voting_DaftarNamaVote.map((v) => (
-
- - {v.value}
-
- ))}
-
- |
-
-
- {e.awalVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
-
- |
-
-
- {e.akhirVote.toLocaleDateString("id-ID", { dateStyle: "long" })}
-
- |
-
- ));
+ const renderTableBody = () => {
+ if (!Array.isArray(data) || data.length === 0) {
+ return (
+
+ |
+
+
+
+ |
+
+ );
+ }
+
+ return data?.map((e, i) => (
+
+ {/* |
+
+ }
+ radius={"xl"}
+ onClick={() => {
+ open();
+ setVotingId(e.id);
+ setCatatan(e.catatan);
+ }}
+ >
+
+ Tambah
+ Catatan
+
+
+
+ | */}
+ {/*
+
+
+ {e.catatan}
+
+
+ | */}
+
+
+ {e?.Author?.username}
+
+ |
+
+
+ {e?.title}
+
+ |
+ {/*
+
+
+ {e.deskripsi}
+
+
+ | */}
+ {/*
+
+ {e.Voting_DaftarNamaVote.map((v) => (
+
+ - {v.value}
+
+ ))}
+
+ | */}
+
+
+
+ {new Intl.DateTimeFormat("id-ID", {
+ dateStyle: "long",
+ }).format(new Date(e?.awalVote))}
+
+ |
+
+
+ {new Intl.DateTimeFormat("id-ID", {
+ dateStyle: "long",
+ }).format(new Date(e?.akhirVote))}
+
+ |
+
+
+
+
+
+ |
+
+ ));
+ };
return (
<>
- {/* {JSON.stringify(listUser, null, 2)} */}
-
- Reject
- }
- radius={"xl"}
- placeholder="Masukan judul"
- onChange={(val) => {
- onSearch(val.currentTarget.value);
- }}
- />
-
+ }
+ radius={"xl"}
+ placeholder="Masukan judul"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+ }
+ />
-
-
-
-
-
- |
- Aksi
- |
-
- Catatan
- |
-
- Author
- |
-
- Judul
- |
-
- Deskripsi
- |
-
- Pilihan
- |
-
- Mulai Vote
- |
-
- Selesai Vote
- |
-
-
- {TableRows}
-
-
+ {!data ? (
+
+ ) : (
+
+
+
+
+
+ |
+ Author
+ |
+
+ Judul
+ |
-
-
+ Mulai Vote
+
+
+ Selesai Vote
+ |
+
+ Aksi
+ |
+
+
+ {renderTableBody()}
+
+
+
+ {
onPageClick(val);
}}
/>
-
-
+
+ )}
>
);
diff --git a/src/app_modules/auth/_lib/api_fetch_auth.ts b/src/app_modules/auth/_lib/api_fetch_auth.ts
new file mode 100644
index 00000000..c11410ef
--- /dev/null
+++ b/src/app_modules/auth/_lib/api_fetch_auth.ts
@@ -0,0 +1,85 @@
+export {
+ apiFetchLogin,
+ apiGetCheckCodeOtp,
+ apiPostVerifikasiCodeOtp,
+ apiDeleteAktivasiKodeOtpByNomor,
+ apiFetchRegister,
+ apiFetchLogout,
+};
+
+const apiFetchLogin = async ({ nomor }: { nomor: string }) => {
+ const respone = await fetch("/api/auth/login", {
+ method: "POST",
+ body: JSON.stringify({ nomor: nomor }),
+ headers: {
+ "Content-Type": "application/json",
+ },
+ });
+
+ return await respone.json().catch(() => null);
+};
+
+const apiGetCheckCodeOtp = async ({ id }: { id: string }) => {
+ const respone = await fetch(`/api/auth/check/${id}`);
+
+ return await respone.json().catch(() => null);
+};
+
+const apiPostVerifikasiCodeOtp = async ({ nomor }: { nomor: string }) => {
+ const respone = await fetch("/api/auth/validasi", {
+ method: "POST",
+ body: JSON.stringify({ nomor: nomor }),
+ headers: {
+ "Content-Type": "application/json",
+ },
+ });
+
+ return await respone.json().catch(() => null);
+};
+
+const apiDeleteAktivasiKodeOtpByNomor = async ({ id }: { id: string }) => {
+ const respone = await fetch(`/api/auth/code/${id}`, {
+ method: "DELETE",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ });
+
+ return await respone.json().catch(() => null);
+};
+
+const apiFetchRegister = async ({
+ nomor,
+ username,
+}: {
+ nomor: string;
+ username: string;
+}) => {
+ const data = {
+ username: username,
+ nomor: nomor,
+ };
+ const respone = await fetch("/api/auth/register", {
+ method: "POST",
+ body: JSON.stringify({ data }),
+ headers: {
+ "Content-Type": "application/json",
+ },
+ });
+
+ const result = await respone.json();
+
+ return result;
+ // return await respone.json().catch(() => null);
+};
+
+
+const apiFetchLogout = async ({ id }: { id: string }) => {
+ const respone = await fetch(`/api/auth/logout?id=${id}`, {
+ method: "GET",
+ });
+
+ const result = await respone.json();
+
+ return result;
+};
\ No newline at end of file
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
index 20a9ab27..82981060 100644
--- 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
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function auth_funDeleteAktivasiKodeOtpByNomor({
nomor,
diff --git a/src/app_modules/auth/fun/fun_login.ts b/src/app_modules/auth/fun/fun_login.ts
index 1f2f944f..d2227a3d 100644
--- a/src/app_modules/auth/fun/fun_login.ts
+++ b/src/app_modules/auth/fun/fun_login.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { randomOTP } from "./rondom_otp";
export async function auth_funLogin({ nomor }: { nomor: string }) {
diff --git a/src/app_modules/auth/fun/fun_logout.ts b/src/app_modules/auth/fun/fun_logout.ts
index 96dc4111..3d39a5f4 100644
--- a/src/app_modules/auth/fun/fun_logout.ts
+++ b/src/app_modules/auth/fun/fun_logout.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { revalidatePath } from "next/cache";
import { cookies } from "next/headers";
diff --git a/src/app_modules/auth/fun/fun_register.ts b/src/app_modules/auth/fun/fun_register.ts
index 304f94f8..52ea6bdb 100644
--- a/src/app_modules/auth/fun/fun_register.ts
+++ b/src/app_modules/auth/fun/fun_register.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterHome } from "@/app/lib/router_hipmi/router_home";
+import prisma from "@/lib/prisma";
+import { RouterHome } from "@/lib/router_hipmi/router_home";
import { sealData } from "iron-session";
import { revalidatePath } from "next/cache";
import { cookies } from "next/headers";
diff --git a/src/app_modules/auth/fun/fun_resend_code.ts b/src/app_modules/auth/fun/fun_resend_code.ts
index 2f645761..575daa41 100644
--- a/src/app_modules/auth/fun/fun_resend_code.ts
+++ b/src/app_modules/auth/fun/fun_resend_code.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import { randomOTP } from "./rondom_otp";
export async function auth_funResendCode({ nomor }: { nomor: string }) {
diff --git a/src/app_modules/auth/fun/fun_validasi.ts b/src/app_modules/auth/fun/fun_validasi.ts
index c91a19a7..5f532e10 100644
--- a/src/app_modules/auth/fun/fun_validasi.ts
+++ b/src/app_modules/auth/fun/fun_validasi.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterHome } from "@/app/lib/router_hipmi/router_home";
+import prisma from "@/lib/prisma";
+import { RouterHome } from "@/lib/router_hipmi/router_home";
import { sealData, unsealData } from "iron-session";
import { revalidatePath } from "next/cache";
import { cookies } from "next/headers";
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
index 67a74ce8..a045508f 100644
--- a/src/app_modules/auth/fun/get_kode_otp_by_id.ts
+++ b/src/app_modules/auth/fun/get_kode_otp_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function auth_getCodeOtpByNumber({kodeId}: {kodeId: string}) {
const data = await prisma.kodeOtp.findFirst({
diff --git a/src/app_modules/auth/index.ts b/src/app_modules/auth/index.ts
index 6dc3d259..bc5c40c2 100644
--- a/src/app_modules/auth/index.ts
+++ b/src/app_modules/auth/index.ts
@@ -3,6 +3,7 @@ import Login from "./login/view";
import Validasi from "./validasi/view";
import Register from "./register/view";
import Component_ButtonLogout from "./logout/view";
+import InvalidUser from "./invalid_user/view";
export {
SplashScreen,
@@ -10,4 +11,5 @@ export {
Validasi,
Register,
Component_ButtonLogout as Logout,
+ InvalidUser,
};
diff --git a/src/app_modules/auth/invalid_user/view.tsx b/src/app_modules/auth/invalid_user/view.tsx
new file mode 100644
index 00000000..015fcc3b
--- /dev/null
+++ b/src/app_modules/auth/invalid_user/view.tsx
@@ -0,0 +1,53 @@
+"use client";
+
+import { MainColor } from "@/app_modules/_global/color";
+import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui";
+import { Button, Stack, Title } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+
+export default function InvalidUser() {
+ const router = useRouter();
+ const [isLoading, setIsLoading] = useState(false);
+ const deleteCookie = async () => {
+ const sessionKey = process.env.NEXT_PUBLIC_BASE_SESSION_KEY!;
+ if (!sessionKey) {
+ return;
+ }
+
+ try {
+ setIsLoading(true);
+ await fetch("/api/auth/logout", {
+ method: "GET",
+ });
+ router.replace("/login", { scroll: false });
+ setIsLoading(false);
+ } catch (error) {
+ setIsLoading(false);
+ console.error("Gagal menghapus cookie:", error);
+ }
+ };
+
+ return (
+ <>
+
+
+
+ Maaf, Anda tidak memiliki izin untuk mengakses halaman ini. Silakan
+ logout terlebih dahulu.
+
+ {
+ deleteCookie();
+ }}
+ >
+ Keluar
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/auth/login/view.tsx b/src/app_modules/auth/login/view.tsx
index e2b68125..d6d890f9 100644
--- a/src/app_modules/auth/login/view.tsx
+++ b/src/app_modules/auth/login/view.tsx
@@ -11,11 +11,13 @@ import {
ComponentGlobal_NotifikasiPeringatan,
} from "@/app_modules/_global/notif_global";
import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui";
-import { Box, Button, Center, Stack, Text, Title } from "@mantine/core";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Button, Center, Group, Stack, Text, Title } from "@mantine/core";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { PhoneInput } from "react-international-phone";
import "react-international-phone/style.css";
+import { apiFetchLogin } from "../_lib/api_fetch_auth";
export default function Login({ version }: { version: string }) {
const router = useRouter();
@@ -27,26 +29,22 @@ export default function Login({ version }: { version: string }) {
const nomor = phone.substring(1);
if (nomor.length <= 4) return setError(true);
- setLoading(true);
try {
- const res = await fetch("/api/auth/login", {
- method: "POST",
- body: JSON.stringify({ nomor: nomor }),
- headers: {
- "Content-Type": "application/json",
- },
- });
+ setLoading(true);
+ const respone = await apiFetchLogin({ nomor: nomor });
- const result = await res.json();
- if (res.status === 200) {
- localStorage.setItem("hipmi_auth_code_id", result.kodeId);
- ComponentGlobal_NotifikasiBerhasil(result.message, 2000);
+ if (respone && respone.success) {
+ localStorage.setItem("hipmi_auth_code_id", respone.kodeId);
+ ComponentGlobal_NotifikasiBerhasil(respone.message, 2000);
router.push("/validasi", { scroll: false });
} else {
- ComponentGlobal_NotifikasiPeringatan(result.message);
+ setLoading(false);
+ console.log("respone >>", respone);
+ ComponentGlobal_NotifikasiPeringatan(respone?.message);
}
} catch (error) {
- console.error(error);
+ setLoading(false);
+ clientLogger.error("Error login:", error);
ComponentGlobal_NotifikasiGagal("Terjadi Kesalahan");
}
}
@@ -55,19 +53,32 @@ export default function Login({ version }: { version: string }) {
<>
-
-
- WELCOME TO
-
- HIPMI APPS
+
+
+
+ WELCOME TO
+
+
+ HIPMI BADUNG APPS
+
+
+
+
+ powered by muku.id
+
+
-
- Nomor telepon
+ Nomor telepon
{
setPhone(val);
@@ -99,7 +110,7 @@ export default function Login({ version }: { version: string }) {
-
+
v {version}
diff --git a/src/app_modules/auth/logout/view.tsx b/src/app_modules/auth/logout/view.tsx
index 04346acd..774d02df 100644
--- a/src/app_modules/auth/logout/view.tsx
+++ b/src/app_modules/auth/logout/view.tsx
@@ -1,31 +1,33 @@
"use client";
-import { Warna } from "@/app/lib/warna";
+import { MainColor } from "@/app_modules/_global/color";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
+import { Warna } from "@/lib/warna";
import { ActionIcon, Button, Stack, Text } from "@mantine/core";
import { IconLogout } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import { auth_Logout } from "../fun/fun_logout";
-import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
+import { apiFetchLogout } from "../_lib/api_fetch_auth";
-export default function Component_ButtonLogout({userId}: {userId: string}) {
+export default function Component_ButtonLogout({ userId }: { userId: string }) {
const router = useRouter();
const [opened, setOpened] = useState(false);
const [loading, setLoading] = useState(false);
async function onClickLogout() {
- setLoading(true);
- const res = await fetch(`/api/auth/logout?id=${userId}`, {
- method: "GET",
- });
+ try {
+ setLoading(true);
+ const response = await apiFetchLogout({ id: userId });
- const result = await res.json();
- if (res.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(result.message);
- router.push("/", { scroll: false });
+ if (response && response.success) {
+ ComponentGlobal_NotifikasiBerhasil(response.message);
+ router.replace("/login", { scroll: false });
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
}
}
@@ -70,9 +72,9 @@ export default function Component_ButtonLogout({userId}: {userId: string}) {
setOpened(true);
}}
>
-
+
-
+
Keluar
diff --git a/src/app_modules/auth/register/view.tsx b/src/app_modules/auth/register/view.tsx
index dedb7626..4b56e8c0 100644
--- a/src/app_modules/auth/register/view.tsx
+++ b/src/app_modules/auth/register/view.tsx
@@ -5,7 +5,7 @@ import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_in
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui";
-import { Button, Stack, Text, TextInput, Title } from "@mantine/core";
+import { Button, Center, Stack, Text, TextInput, Title } from "@mantine/core";
import { useFocusTrap, useShallowEffect } from "@mantine/hooks";
import { IconUserCircle } from "@tabler/icons-react";
import _ from "lodash";
@@ -13,6 +13,14 @@ import { useRouter } from "next/navigation";
import { useState } from "react";
import { auth_funDeleteAktivasiKodeOtpByNomor } from "../fun/fun_edit_aktivasi_kode_otp_by_id";
import Register_SkeletonView from "./skeleton";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ apiDeleteAktivasiKodeOtpByNomor,
+ apiFetchRegister,
+ apiGetCheckCodeOtp,
+} from "../_lib/api_fetch_auth";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global";
export default function Register() {
const router = useRouter();
@@ -21,136 +29,132 @@ export default function Register() {
const [isValue, setIsValue] = useState(false);
const focusTrapRef = useFocusTrap();
const [loading, setLoading] = useState(false);
+ const [idCode, setIdCode] = useState("");
useShallowEffect(() => {
const kodeId = localStorage.getItem("hipmi_auth_code_id");
if (kodeId != null) {
- onCheckAuthCode({ kodeId: kodeId as string, onSetData: setNomor });
+ onCheckAuthCode({ kodeId: kodeId as string });
} else {
console.log("code id not found");
}
- }, [setNomor]);
+ }, []);
- async function onCheckAuthCode({
- kodeId,
- onSetData,
- }: {
- kodeId: string;
- onSetData: any;
- }) {
- const res = await fetch(`/api/auth/check?id=${kodeId}`);
- const result = await res.json();
-
- onSetData(result.data.nomor);
+ async function onCheckAuthCode({ kodeId }: { kodeId: string }) {
+ try {
+ const respone = await apiGetCheckCodeOtp({ id: kodeId });
+ if (respone) {
+ setIdCode(kodeId);
+ setNomor(respone.nomor);
+ }
+ } catch (error) {
+ clientLogger.error("Error onCheckAuthCode:", error);
+ }
}
async function onRegistarsi() {
- const data = {
- username: value,
- nomor: nomor,
- };
-
try {
setLoading(true);
- const res = await fetch("/api/auth/register", {
- method: "POST",
- body: JSON.stringify({
- data,
- }),
- headers: {
- "Content-Type": "application/json",
- },
- });
+ const respone = await apiFetchRegister({ nomor: nomor, username: value });
- const result = await res.json();
-
- if (res.status === 200) {
- localStorage.removeItem("hipmi_auth_code_id");
- ComponentGlobal_NotifikasiBerhasil(result.message);
+ if (respone.success) {
router.push("/waiting-room", { scroll: false });
+ ComponentGlobal_NotifikasiBerhasil(respone.message);
- await auth_funDeleteAktivasiKodeOtpByNomor({
- nomor: data.nomor,
- });
- }
+ try {
+ const responeDelete = await apiDeleteAktivasiKodeOtpByNomor({
+ id: idCode,
+ });
- if (res.status === 400) {
+ if (responeDelete) {
+ localStorage.removeItem("hipmi_auth_code_id");
+ }
+ } catch (error) {
+ clientLogger.error("Error apiDeleteAktivasiKodeOtpByNomor:", error);
+ }
+ } else {
setLoading(false);
- ComponentGlobal_NotifikasiPeringatan(result.message);
+ ComponentGlobal_NotifikasiPeringatan(respone.message);
}
} catch (error) {
- console.log(error);
+ setLoading(false);
+ clientLogger.error("Error registrasi", error);
}
}
return (
<>
- {nomor == "" ? (
-
- ) : (
-
-
- REGISTRASI
-
+
+
+ REGISTRASI
+
-
+
-
-
- Anda akan terdaftar dengan nomor berikut{" "}
-
+
+
+
+ Anda akan terdaftar dengan nomor
+
+ {nomor == "" ? (
+
+
+
+ ) : (
+
+{nomor}
-
- 0 && value.length < 5 ? (
-
- ) : _.values(value).includes(" ") ? (
-
-
-
-
- ) : isValue ? (
-
- ) : (
- ""
- )
+ )}
+
+ 0 && value.length < 5 ? (
+
+ ) : _.values(value).includes(" ") ? (
+
+
+
+
+ ) : isValue ? (
+
+ ) : (
+ ""
+ )
+ }
+ onChange={(val) => {
+ val.currentTarget.value.length > 0 ? setIsValue(false) : "";
+ setValue(val.currentTarget.value);
+ }}
+ />
+
+ {
- val.currentTarget.value.length > 0 ? setIsValue(false) : "";
- setValue(val.currentTarget.value);
+ style={{ transition: "0.5s" }}
+ loading={loading ? true : false}
+ loaderPosition="center"
+ radius={"md"}
+ compact
+ h={40}
+ c={"black"}
+ bg={MainColor.yellow}
+ color={"yellow"}
+ onClick={() => {
+ onRegistarsi();
}}
- />
-
- {
- onRegistarsi();
- }}
- >
- DAFTAR
-
-
+ >
+ DAFTAR
+
- )}
+
>
);
diff --git a/src/app_modules/auth/validasi/skeleton.tsx b/src/app_modules/auth/validasi/skeleton.tsx
index 6006de6a..2fc8fd92 100644
--- a/src/app_modules/auth/validasi/skeleton.tsx
+++ b/src/app_modules/auth/validasi/skeleton.tsx
@@ -1,9 +1,28 @@
-import { Stack, Skeleton, Group } from "@mantine/core";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Group, Skeleton, Stack } from "@mantine/core";
export default function Validasi_SkeletonView() {
return (
- <>
-
+
+
+
+
+
+
+
+
+
+ {Array.from({ length: 4 }).map((_, i) => (
+
+ ))}
+
+
+
+
+
+ );
+}
+{/*
@@ -19,7 +38,29 @@ export default function Validasi_SkeletonView() {
-
- >
- );
-}
+ */}
+
+// import { Stack, Skeleton, Group } from "@mantine/core";
+
+// export default function Validasi_SkeletonView() {
+// return (
+//
+//
+//
+//
+//
+//
+//
+
+//
+// {Array.from({ length: 4 }).map((_, i) => (
+//
+// ))}
+//
+
+//
+//
+//
+//
+// );
+// }
diff --git a/src/app_modules/auth/validasi/view.tsx b/src/app_modules/auth/validasi/view.tsx
index d2796796..7ec0daf7 100644
--- a/src/app_modules/auth/validasi/view.tsx
+++ b/src/app_modules/auth/validasi/view.tsx
@@ -1,7 +1,6 @@
"use client";
-import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
-import { RouterHome } from "@/app/lib/router_hipmi/router_home";
+import { RouterAdminDashboard } from "@/lib/router_hipmi/router_admin";
import {
AccentColor,
MainColor,
@@ -10,8 +9,11 @@ import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui";
import {
+ ActionIcon,
+ Box,
Button,
Center,
+ Group,
Loader,
PinInput,
Stack,
@@ -23,8 +25,15 @@ import { useRouter } from "next/navigation";
import { useEffect, useState } from "react";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global";
-import { auth_funDeleteAktivasiKodeOtpByNomor } from "../fun/fun_edit_aktivasi_kode_otp_by_id";
-import Validasi_SkeletonView from "./skeleton";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
+import { IconChevronLeft } from "@tabler/icons-react";
+import {
+ apiDeleteAktivasiKodeOtpByNomor,
+ apiGetCheckCodeOtp,
+ apiPostVerifikasiCodeOtp,
+} from "../_lib/api_fetch_auth";
+import { RouterHome } from "@/lib/router_hipmi/router_home";
export default function Validasi() {
const router = useRouter();
@@ -34,6 +43,7 @@ export default function Validasi() {
const [counter, setCounter] = useState(60);
const [loadingResend, setLoadingResend] = useState(false);
const [triggerOtp, setTriggerOtp] = useState(false);
+ const [idCode, setIdCode] = useState("");
const [data, setData] = useState({
nomor: "",
@@ -43,7 +53,7 @@ export default function Validasi() {
useShallowEffect(() => {
const kodeId = localStorage.getItem("hipmi_auth_code_id");
if (kodeId != null) {
- onCheckAuthCode({ kodeId: kodeId as string, onSetData: setData });
+ onCheckAuthCode({ kodeId: kodeId as string });
} else {
console.log("code id not found");
}
@@ -51,35 +61,35 @@ export default function Validasi() {
if (triggerOtp) {
const kodeId = localStorage.getItem("hipmi_auth_code_id");
if (kodeId != null) {
- onCheckAuthCode({ kodeId: kodeId as string, onSetData: setData });
+ onCheckAuthCode({ kodeId: kodeId as string });
} else {
console.log("code id not found");
}
setTriggerOtp(false);
}
- }, [triggerOtp, setData, setTriggerOtp]);
+ }, [triggerOtp]);
- async function onCheckAuthCode({
- kodeId,
- onSetData,
- }: {
- kodeId: string;
- onSetData: any;
- }) {
- const res = await fetch(`/api/auth/check?id=${kodeId}`);
- const result = await res.json();
+ async function onCheckAuthCode({ kodeId }: { kodeId: string }) {
+ try {
+ const respone = await apiGetCheckCodeOtp({ id: kodeId });
- onSetData({
- nomor: result.data.nomor,
- code: result.data.otp,
- });
+ if (respone) {
+ setIdCode(kodeId);
+ setData({
+ nomor: respone.nomor,
+ code: respone.otp,
+ });
+ }
+ } catch (error) {
+ clientLogger.error("Error onCheckAuthCode:", error);
+ }
}
useEffect(() => {
counter > 0 && setTimeout(() => setCounter(counter - 1), 1000);
}, [counter]);
- async function onVerifikasi() {
+ async function onSubmitVerifikasi() {
if (!inputCode)
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Kode");
if (data.code != inputCode)
@@ -87,56 +97,52 @@ export default function Validasi() {
try {
setLoading(true);
- const res = await fetch("/api/auth/validasi", {
- method: "POST",
- body: JSON.stringify({
- nomor: data.nomor,
- }),
- headers: {
- "Content-Type": "application/json",
- },
- });
+ const respone = await apiPostVerifikasiCodeOtp({ nomor: data.nomor });
- const result = await res.json();
-
- if (res.status === 200) {
- localStorage.removeItem("hipmi_auth_code_id");
-
- if (result.roleId === "1") {
- if (result.active === true) {
- ComponentGlobal_NotifikasiBerhasil(result.message);
- router.push(RouterHome.main_home, { scroll: false });
- } else {
- ComponentGlobal_NotifikasiBerhasil(result.message);
- router.push("/waiting-room", { scroll: false });
- }
- } else {
- ComponentGlobal_NotifikasiBerhasil("Admin Logged in");
+ if (respone && respone.success == true) {
+ if (respone.roleId == "1") {
+ router.push(RouterHome.main_home, { scroll: false });
+ ComponentGlobal_NotifikasiBerhasil(respone.message);
+ } else if (respone.roleId != "1") {
router.push(RouterAdminDashboard.splash_admin, { scroll: false });
+ ComponentGlobal_NotifikasiBerhasil("Admin berhasil login");
}
- await auth_funDeleteAktivasiKodeOtpByNomor({
- nomor: data.nomor,
- });
- }
+ try {
+ const responeDelete = await apiDeleteAktivasiKodeOtpByNomor({
+ id: idCode,
+ });
- if (res.status === 404) {
- ComponentGlobal_NotifikasiBerhasil(result.message);
+ if (responeDelete) {
+ localStorage.removeItem("hipmi_auth_code_id");
+ }
+ } catch (error) {
+ clientLogger.error("Error apiDeleteAktivasiKodeOtpByNomor:", error);
+ }
+ // localStorage.removeItem("hipmi_auth_code_id");
+ } else if (respone && respone.success == false) {
router.push("/register", { scroll: false });
- }
-
- if (res.status === 400) {
- ComponentGlobal_NotifikasiPeringatan(result.message);
+ ComponentGlobal_NotifikasiBerhasil(respone.message);
}
} catch (error) {
- console.error(error);
+ setLoading(false);
+ clientLogger.error("Error validasi:", error);
}
}
async function onBack() {
- localStorage.removeItem("hipmi_auth_code_id");
- await auth_funDeleteAktivasiKodeOtpByNomor({ nomor: data.nomor });
- router.back();
+ try {
+ router.back();
+ const responeDelete = await apiDeleteAktivasiKodeOtpByNomor({
+ id: idCode,
+ });
+
+ if (responeDelete) {
+ localStorage.removeItem("hipmi_auth_code_id");
+ }
+ } catch (error) {
+ clientLogger.error("Error apiDeleteAktivasiKodeOtpByNomor:", error);
+ }
}
async function onResendCode() {
@@ -160,25 +166,22 @@ export default function Validasi() {
setTriggerOtp(true);
setCounter(60);
setLoadingResend(false);
- // router.push("/validasi", { scroll: false });
} else {
setLoadingResend(false);
ComponentGlobal_NotifikasiPeringatan(result.message);
}
} catch (error) {
- console.error(error);
+ clientLogger.error(" Error onResend", error);
setLoadingResend(false);
ComponentGlobal_NotifikasiGagal("Terjadi Kesalahan");
}
}
- // console.log(data.code);
-
return (
<>
- {/*
onBack()}>
-
+ {data && data.nomor !== "" ? (
+
+ ) : (
+ ""
+ )}
- */}
- {data.nomor == "" && data.code == "" ? (
-
- ) : (
-
-
- Verifikasi Kode OTP
-
+
-
-
- Masukan 4 digit kode otp
-
- Yang dikirim ke{" "}
-
- {" "}
+
+
+ Verifikasi Kode OTP
+
+
+
+
+ Masukan 4 digit kode otp
+
+ Yang dikirim ke
+ {data && data.nomor !== "" ? (
+
+{data.nomor}
-
-
-
- {
- setInputOtp(val);
- }}
- />
-
+ ) : (
+
+ )}
+
+
+
+ {
+ setInputOtp(val);
+ }}
+ />
+
-
-
+
+
+
Tidak menerima kode ?{" "}
- {counter > 0 ? (
-
+
+ {data && data.nomor !== "" ? (
+ counter > 0 ? (
+
{counter + "s"}
) : loadingResend ? (
) : (
{
onResendCode();
}}
@@ -242,31 +253,36 @@ export default function Validasi() {
>
Kirim ulang
- )}
-
-
+ )
+ ) : (
+
+ )}
+
- {
- onVerifikasi();
- }}
- >
- VERIFIKASI
-
- )}
+ {
+ data.nomor == "" && data.code == ""
+ ? null
+ : onSubmitVerifikasi();
+ }}
+ >
+ VERIFIKASI
+
+
>
diff --git a/src/app_modules/check_cookies/index.ts b/src/app_modules/check_cookies/index.ts
deleted file mode 100644
index c5fdd44c..00000000
--- a/src/app_modules/check_cookies/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { CheckCookies_UiLayout } from "./layout_cek_cookies";
-import { CheckCookies_UiView } from "./ui_check_cookies";
-
-export { CheckCookies_UiView };
-export { CheckCookies_UiLayout };
diff --git a/src/app_modules/check_cookies/layout_cek_cookies.tsx b/src/app_modules/check_cookies/layout_cek_cookies.tsx
deleted file mode 100644
index b328354d..00000000
--- a/src/app_modules/check_cookies/layout_cek_cookies.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-"use client";
-
-import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
-import { useShallowEffect } from "@mantine/hooks";
-import { redirect, useRouter } from "next/navigation";
-import { MODEL_USER } from "../home/model/interface";
-import { RouterHome } from "@/app/lib/router_hipmi/router_home";
-import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
-
-export function CheckCookies_UiLayout({
- children,
- dataUser,
-}: {
- children: React.ReactNode;
- dataUser: MODEL_USER;
-}) {
- const router = useRouter();
-
- // if (dataUser.active == false){
- // router.push(RouterHome.home_user_non_active, { scroll: false });
- // return children
- // }
-
-
- // useShallowEffect(() => {
- // onCheckCookies();
- // }, []);
-
- // async function onCheckCookies() {
- // const cek = await fetch("/api/check-cookies");
-
- // const result = await cek.json();
-
- // if (result.success === false) {
- // router.push(RouterAuth.login, { scroll: false });
- // }
- // }
-
- // if (dataUser.masterUserRoleId === "1") {
- // router.push(RouterHome.main_home, { scroll: false });
- // }
-
- // if (dataUser.masterUserRoleId !== "1") {
- // router.push(RouterAdminDashboard.splash_admin, { scroll: false });
- // }
-
- return <>{children}>;
-}
diff --git a/src/app_modules/check_cookies/ui_check_cookies.tsx b/src/app_modules/check_cookies/ui_check_cookies.tsx
deleted file mode 100644
index f7a18b31..00000000
--- a/src/app_modules/check_cookies/ui_check_cookies.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-"use client";
-
-import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
-import { Button, Center } from "@mantine/core";
-import { useRouter } from "next/navigation";
-import { UIGlobal_LayoutDefault } from "../_global/ui";
-
-export function CheckCookies_UiView() {
- const router = useRouter();
-
- return (
- <>
-
-
- router.push(RouterAuth.login)}>
- Kembali ke Halaman Login
-
-
-
- >
- );
-}
diff --git a/src/app_modules/colab/_lib/api_collaboration.ts b/src/app_modules/colab/_lib/api_collaboration.ts
new file mode 100644
index 00000000..1d1944e0
--- /dev/null
+++ b/src/app_modules/colab/_lib/api_collaboration.ts
@@ -0,0 +1,234 @@
+export const apiGetAllCollaboration = async ({
+ kategori,
+ page,
+}: {
+ kategori: "beranda" | "partisipasi" | "proyeksaya" | "grup";
+ page: string;
+}) => {
+ const respone = await fetch(
+ `/api/collaboration/get?kategori=${kategori}&page=${page}`
+ );
+ return await respone.json().catch(() => null);
+};
+
+export const apiGetOneCollaborationById = async ({
+ id,
+ kategori,
+ page,
+}: {
+ id: string;
+ kategori: "detail" | "list_partisipan" | "cek_partisipasi";
+ page?: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const respone = await fetch(
+ `/api/collaboration/${id}?kategori=${kategori}&page=${page}`,
+ {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ if (!respone.ok) {
+ const errorData = await respone.json().catch(() => null);
+ console.error(
+ "Failed to get one collaboration by id",
+ respone.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to get one collaboration by id"
+ );
+ }
+
+ const data = await respone.json();
+ return data;
+ } catch (error) {
+ console.error("Error get one collaboration by id", error);
+ return null;
+ }
+};
+
+export const apiGetDataGroupById = async ({
+ id,
+ kategori,
+ page,
+}: {
+ id: string;
+ kategori: "detail" | "info_group";
+ page?: string;
+}) => {
+ const respone = await fetch(
+ `/api/collaboration/group/${id}?kategori=${kategori}&page=${page}`
+ );
+
+ return await respone.json().catch(() => null);
+};
+
+export const apiGetMasterIndustri = async () => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/collaboration/master`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error get master industri:",
+ errorData?.message || "Unknown error"
+ );
+
+ return null;
+ }
+
+ return await response.json();
+ } catch (error) {
+ console.error("Error get master industri:", error);
+ throw error;
+ }
+};
+
+export const apiCollaborationGetMessageByRoomId = async ({
+ id,
+ page,
+}: {
+ id: string;
+ page: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+ const response = await fetch(
+ `/api/collaboration/${id}/message?page=${page}`,
+ {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error get message by room id:",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get message by room id");
+ }
+ return await response.json();
+ } catch (error) {
+ console.error("Error get message by room id:", error);
+ throw error;
+ }
+};
+
+export const apiGetMessageByRoomId = async ({
+ id,
+ lastMessageId,
+}: {
+ id: string;
+ lastMessageId?: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ console.log("lastMessageId", lastMessageId);
+
+ let url = `/api/collaboration/${id}/chat`;
+ if (lastMessageId) {
+ url += `?cursor=${lastMessageId}`;
+ }
+ const response = await fetch(url, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error get message by room id:",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get message by room id");
+ }
+ return await response.json();
+ } catch (error) {
+ console.error("Error get message by room id:", error);
+ throw error;
+ }
+};
+
+export const apiCollaborationGetRoomById = async ({
+ id,
+}: {
+ id: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+ const response = await fetch(`/api/collaboration/${id}/room`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error get room by id:",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get room by id");
+ }
+ return await response.json();
+ } catch (error) {
+ console.error("Error get room by id:", error);
+ throw error;
+ }
+};
\ No newline at end of file
diff --git a/src/app_modules/colab/component/card_view/card_beranda.tsx b/src/app_modules/colab/component/card_view/card_beranda.tsx
index 042d02b1..70764cbf 100644
--- a/src/app_modules/colab/component/card_view/card_beranda.tsx
+++ b/src/app_modules/colab/component/card_view/card_beranda.tsx
@@ -1,4 +1,4 @@
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
import { Stack } from "@mantine/core";
import { MODEL_COLLABORATION } from "../../model/interface";
diff --git a/src/app_modules/colab/component/card_view/card_section_data.tsx b/src/app_modules/colab/component/card_view/card_section_data.tsx
index c527562d..676545bb 100644
--- a/src/app_modules/colab/component/card_view/card_section_data.tsx
+++ b/src/app_modules/colab/component/card_view/card_section_data.tsx
@@ -1,11 +1,13 @@
"use client";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
-import { Card, Center, Grid, Stack, Text, Title } from "@mantine/core";
-import { useRouter } from "next/navigation";
-import { MODEL_COLLABORATION } from "../../model/interface";
-import { useState } from "react";
+import { MainColor } from "@/app_modules/_global/color";
import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component";
+import { Component_V3_GridDetailData } from "@/app_modules/_global/component/new/comp_V3_grid_detail_data";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
+import { Card, Center, Stack, Title } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { MODEL_COLLABORATION } from "../../model/interface";
export default function ComponentColab_CardSectionData({
colabId,
@@ -19,10 +21,25 @@ export default function ComponentColab_CardSectionData({
const router = useRouter();
const [visible, setVisible] = useState(false);
+ const listData = [
+ {
+ title: "Industri",
+ value: data?.ProjectCollaborationMaster_Industri.name
+ ? data.ProjectCollaborationMaster_Industri.name
+ : "Industri",
+ },
+ {
+ title: "Lokasi",
+ value: data?.lokasi ? data.lokasi : "-",
+ },
+ ];
+
return (
<>
{
if (path) {
setVisible(true);
@@ -37,51 +54,10 @@ export default function ComponentColab_CardSectionData({
{data?.title ? data.title : "Judul Proyek"}
-
-
-
-
- Industri
-
-
-
- :
-
-
-
- {data?.ProjectCollaborationMaster_Industri.name
- ? data?.ProjectCollaborationMaster_Industri?.name
- : "Industri"}
-
-
-
-
-
-
-
- Lokasi
-
-
-
- :
-
-
-
- {data?.lokasi ? data?.lokasi : "Lokasi dari proyek"}
-
-
-
-
-
-
- Tujuan proyek
-
-
- {data?.purpose
- ? data?.purpose
- : "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Maiores odio nihil in animi expedita, suscipit excepturi pariatur totam esse officiis enim cumque. Quidem, facere aliquam. Sunt laboriosam incidunt iste amet"}
-
-
+
+ {listData.map((e, i) => (
+
+ ))}
{visible && }
diff --git a/src/app_modules/colab/component/card_view/card_section_header_author_name.tsx b/src/app_modules/colab/component/card_view/card_section_header_author_name.tsx
index af952e66..c04efa2c 100644
--- a/src/app_modules/colab/component/card_view/card_section_header_author_name.tsx
+++ b/src/app_modules/colab/component/card_view/card_section_header_author_name.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
import { ComponentGlobal_AvatarAndUsername } from "@/app_modules/_global/component";
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
import { ActionIcon, Group, Stack } from "@mantine/core";
diff --git a/src/app_modules/colab/component/card_view/card_section_jumlah_partisipan.tsx b/src/app_modules/colab/component/card_view/card_section_jumlah_partisipan.tsx
index 404e7f04..48a209a8 100644
--- a/src/app_modules/colab/component/card_view/card_section_jumlah_partisipan.tsx
+++ b/src/app_modules/colab/component/card_view/card_section_jumlah_partisipan.tsx
@@ -1,5 +1,6 @@
"use client";
+import { MainColor } from "@/app_modules/_global/color";
import { Card, Center, Divider, Grid, Stack, Text } from "@mantine/core";
export default function ComponentColab_JumlahPartisipan({
@@ -11,16 +12,16 @@ export default function ComponentColab_JumlahPartisipan({
<>
-
+ {/* */}
-
+
{jumlah?.length ? jumlah?.length : 0}
-
+
Partisipan
diff --git a/src/app_modules/colab/component/card_view/crad_grup.tsx b/src/app_modules/colab/component/card_view/crad_grup.tsx
index 5b405b30..e0f613d3 100644
--- a/src/app_modules/colab/component/card_view/crad_grup.tsx
+++ b/src/app_modules/colab/component/card_view/crad_grup.tsx
@@ -1,5 +1,5 @@
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
-import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
+import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { Paper, Grid, Stack, Center, Loader, Text } from "@mantine/core";
import { IconChevronRight } from "@tabler/icons-react";
@@ -17,7 +17,7 @@ export function ComponentColab_CardGrup({ data }: { data: any }) {
style={{
border: `2px solid ${AccentColor.blue}`,
backgroundColor: AccentColor.darkblue,
- color: "white",
+ color: MainColor.white,
borderRadius: "10px",
marginBottom: "20px",
padding: "15px",
@@ -37,7 +37,7 @@ export function ComponentColab_CardGrup({ data }: { data: any }) {
{data?.ProjectCollaboration_RoomChat?.name}
-
+
{
data?.ProjectCollaboration_RoomChat
?.ProjectCollaboration_AnggotaRoomChat.length
@@ -51,7 +51,7 @@ export function ComponentColab_CardGrup({ data }: { data: any }) {
{data?.ProjectCollaboration_RoomChat?.id === idRoom ? (
) : (
-
+
)}
diff --git a/src/app_modules/colab/component/comp_new_footer_collaboration.tsx b/src/app_modules/colab/component/comp_new_footer_collaboration.tsx
new file mode 100644
index 00000000..4f41bb35
--- /dev/null
+++ b/src/app_modules/colab/component/comp_new_footer_collaboration.tsx
@@ -0,0 +1,64 @@
+import { useAtom } from "jotai";
+import { useRouter } from "next/navigation";
+import { gs_colab_hot_menu } from "../global_state";
+import { useState } from "react";
+
+import { IconHome, IconMessages, IconUsersGroup } from "@tabler/icons-react";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
+import { MainColor } from "@/app_modules/_global/color";
+import { SimpleGrid, Stack, ActionIcon, Text } from "@mantine/core";
+
+export function Collaboration_ComponentNewFooter() {
+ 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: "Partisipasi",
+ path: RouterColab.proyek,
+ icon: ,
+ },
+ {
+ id: 3,
+ name: "Grup Diskusi",
+ path: RouterColab.grup_diskusi,
+ icon: ,
+ },
+ ];
+ return (
+ <>
+
+ {listFooter.map((e) => (
+
+ {
+ router.replace(e.path, { scroll: false });
+ setHotMenu(e.id);
+ }}
+ >
+ {e.icon}
+
+
+ {e.name}
+
+
+ ))}
+
+ >
+ );
+}
diff --git a/src/app_modules/colab/component/detail/detail_data.tsx b/src/app_modules/colab/component/detail/detail_data.tsx
index 30158c00..e8d9f678 100644
--- a/src/app_modules/colab/component/detail/detail_data.tsx
+++ b/src/app_modules/colab/component/detail/detail_data.tsx
@@ -3,31 +3,60 @@
import { Stack, Box, Center, Title, Grid, Text } from "@mantine/core";
import ComponentColab_AuthorNameOnHeader from "../header_author_name";
import { MODEL_COLLABORATION } from "../../model/interface";
+import { Comp_V3_SetInnerHTMLWithStiker } from "@/app_modules/_global/component/new/comp_V3_set_html_with_stiker";
+import { Component_V3_GridDetailData } from "@/app_modules/_global/component/new/comp_V3_grid_detail_data";
export default function ComponentColab_DetailData({
data,
}: {
data?: MODEL_COLLABORATION;
}) {
+
+ const listData = [
+ {
+ title: "Industri",
+ value: data?.ProjectCollaborationMaster_Industri.name
+ ? data.ProjectCollaborationMaster_Industri.name
+ : "Industri",
+ },
+ {
+ title: "Lokasi",
+ value: data?.lokasi ? data.lokasi : "-",
+ },
+ {
+ title: "Tujuan Proyek",
+ value: ,
+ },
+ {
+ title: "Keuntungan Proyek",
+ value: ,
+ },
+ ];
+
+
return (
<>
-
-
-
- {data?.title ? data.title : "Judul Proyek"}
-
-
+
+
+ {data?.title ? data.title : "Judul Proyek"}
+
+
+
+ {listData.map((e, i) => (
+
+ ))}
+
+
+ {/*
-
- Industri
-
+ Industri
- :
+ :
-
+
{data?.ProjectCollaborationMaster_Industri.name
? data.ProjectCollaborationMaster_Industri.name
: "Industri"}
@@ -37,35 +66,32 @@ export default function ComponentColab_DetailData({
-
- Lokasi
-
+ Lokasi
- :
+ :
-
+
{data?.lokasi ? data.lokasi : " Lokasi dari proyek"}
-
- Tujuan proyek
-
- {data?.purpose ? data?.purpose : "-"}
+ Tujuan proyek
+
-
- Keuntungan
-
- {data?.benefit ? data?.benefit : "-"}
+ Keuntungan
+
-
-
-
+ */}
+
>
);
}
diff --git a/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx b/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx
index d1aed031..451990b3 100644
--- a/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx
+++ b/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_AvatarAndUsername } from "@/app_modules/_global/component";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
diff --git a/src/app_modules/colab/component/detail/list_partisipasi_user.tsx b/src/app_modules/colab/component/detail/list_partisipasi_user.tsx
index 94a65e62..f313f41a 100644
--- a/src/app_modules/colab/component/detail/list_partisipasi_user.tsx
+++ b/src/app_modules/colab/component/detail/list_partisipasi_user.tsx
@@ -4,9 +4,14 @@ import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import notifikasiToUser_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_user";
+import { clientLogger } from "@/util/clientLogger";
+import mqtt_client from "@/util/mqtt_client";
import {
ActionIcon,
Box,
@@ -14,83 +19,226 @@ import {
Center,
Drawer,
Group,
- Paper,
- ScrollArea,
+ Loader,
Stack,
Text,
Textarea,
Title,
} from "@mantine/core";
-import { useDisclosure } from "@mantine/hooks";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
import { IconX } from "@tabler/icons-react";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useParams } from "next/navigation";
import { useState } from "react";
+import { apiGetOneCollaborationById } from "../../_lib/api_collaboration";
import colab_funCreatePartisipan from "../../fun/create/fun_create_partisipan_by_user_id";
-import colab_getListPartisipanByColabId from "../../fun/get/get_list_partisipan_by_id";
import { MODEL_COLLABORATION_PARTISIPASI } from "../../model/interface";
+import { Collaboration_SkeletonListPrtisipanIsUser } from "../skeleton_view";
import ComponentColab_AuthorNameOnListPartisipan from "./header_author_list_partisipan";
-import notifikasiToUser_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_user";
-import mqtt_client from "@/util/mqtt_client";
+import { WibuRealtime } from "wibu-pkg";
+import { IRealtimeData } from "@/lib/global_state";
export default function ComponentColab_DetailListPartisipasiUser({
- listPartisipan,
userLoginId,
authorId,
- colabId,
- cekPartisipan,
}: {
- listPartisipan?: MODEL_COLLABORATION_PARTISIPASI[];
userLoginId?: string;
authorId?: string;
- colabId?: string;
- cekPartisipan?: boolean;
}) {
- const [apply, setApply] = useState(false);
- const [data, setData] = useState(listPartisipan);
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(
+ null
+ );
+ const [isPartisipan, setCekPartisipan] = useState(null);
+
+ const [activePage, setActivePage] = useState(1);
const [opened, { open, close }] = useDisclosure(false);
const [deskripsi, setDeskripsi] = useState("");
+ const [isLoading, setIsLoading] = useState(false);
- async function onJoin() {
- const res = await colab_funCreatePartisipan(
- colabId as any,
- userLoginId as any,
- deskripsi
- );
- if (res.status === 201) {
- const dataNotif = {
- appId: res?.data?.ProjectCollaboration?.id,
- userId: res?.data?.ProjectCollaboration?.userId,
- pesan: res?.data?.ProjectCollaboration?.title,
- status: "Partisipan Project",
- kategoriApp: "COLLABORATION",
- title: "Partisipan baru telah bergabung !",
- };
+ useShallowEffect(() => {
+ onLoadDataPartisipan();
+ }, []);
- const createNotifikasi = await notifikasiToUser_funCreate({
- data: dataNotif as any,
+ async function onLoadDataPartisipan() {
+ try {
+ const respone = await apiGetOneCollaborationById({
+ id: params.id,
+ kategori: "list_partisipan",
+ page: `${activePage}`,
});
- if (createNotifikasi.status === 201) {
- mqtt_client.publish(
- "USER",
- JSON.stringify({
- userId: dataNotif.userId,
- count: 1,
- })
- );
+ if (respone) {
+ setData(respone.data);
}
-
- const resList = await colab_getListPartisipanByColabId(colabId as any);
- setApply(true);
- close();
- setData(resList as any);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ } catch (error) {
+ clientLogger.error("Error get list partisipan", error);
}
}
+ useShallowEffect(() => {
+ onCheckPartisipasi();
+ }, []);
+
+ async function onCheckPartisipasi() {
+ try {
+ const respone = await apiGetOneCollaborationById({
+ id: params.id,
+ kategori: "cek_partisipasi",
+ });
+
+ if (respone) {
+ setCekPartisipan(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error cek partisipasi", error);
+ }
+ }
+
+ async function onJoin() {
+ try {
+ setIsLoading(true);
+ const res = await colab_funCreatePartisipan({
+ id: params.id,
+ deskripsi: deskripsi,
+ });
+
+ if (res.status === 201) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res?.data?.ProjectCollaboration?.id,
+ userId: res?.data?.ProjectCollaboration?.userId as any,
+ pesan: res?.data?.ProjectCollaboration?.title,
+ status: "Partisipan Project" as any,
+ kategoriApp: "COLLABORATION",
+ title: "Partisipan baru telah bergabung !",
+ };
+
+ const createNotifikasi = await notifikasiToUser_funCreate({
+ data: dataNotifikasi as any,
+ });
+
+ if (createNotifikasi.status === 201) {
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+ // mqtt_client.publish(
+ // "USER",
+ // JSON.stringify({
+ // userId: dataNotif.userId,
+ // count: 1,
+ // })
+ // );
+ }
+
+ const response = await apiGetOneCollaborationById({
+ id: params.id,
+ kategori: "list_partisipan",
+ page: `${activePage}`,
+ });
+
+ if (response) {
+ setData(response.data);
+ }
+
+ const cekPartisipan = await apiGetOneCollaborationById({
+ id: params.id,
+ kategori: "cek_partisipasi",
+ });
+
+ if (cekPartisipan) {
+ setCekPartisipan(cekPartisipan);
+ }
+
+ close();
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ clientLogger.error("Error create partisipan", error);
+ } finally {
+ setIsLoading(false);
+ }
+ }
+
+ if (_.isNull(data) || _.isNull(isPartisipan)) {
+ return ;
+ }
+
return (
<>
+
+ {userLoginId !== authorId && (
+
+
+ {isPartisipan ? "Telah Berpartisipasi" : "Partisipasi"}
+
+
+ )}
+
+ {_.isEmpty(data) ? (
+
+
+
+ Partispasi User ({data?.length})
+
+
+
+
+ ) : (
+
+
+
+ Partispasi User ({data?.length})
+ {" "}
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={async () => {
+ const respone = await apiGetOneCollaborationById({
+ id: params.id,
+ kategori: "list_partisipan",
+ page: `${activePage + 1}`,
+ });
+
+ setActivePage((val) => val + 1);
+
+ return respone.data;
+ }}
+ >
+ {(item) => (
+
+ )}
+
+
+
+
+ )}
+
+
-
-
+
Deskripsi Diri}
+ label={
+
+ Deskripsi Diri
+
+ }
+ styles={{
+ input: {
+ backgroundColor: MainColor.white,
+ },
+ }}
placeholder="Deskripsikan diri anda yang sesuai dengan proyek ini.."
minRows={4}
onChange={(val) => {
@@ -143,6 +299,8 @@ export default function ComponentColab_DetailListPartisipasiUser({
maxInput={300}
/>
-
-
- {userLoginId !== authorId ? (
-
-
- {cekPartisipan ? "Telah Berpartisipasi" : "Partisipasi"}
-
-
- ) : (
- ""
- )}
-
-
-
-
- Partispasi User ({data?.length})
- {" "}
-
-
-
- {data?.length === 0 ? (
-
-
- Tidak ada partisipan
-
-
- ) : (
- data?.map((e, i) => (
-
-
-
- ))
- )}
-
-
-
-
-
-
>
);
}
diff --git a/src/app_modules/colab/component/header_author_name.tsx b/src/app_modules/colab/component/header_author_name.tsx
index 958bbeb3..315b34e4 100644
--- a/src/app_modules/colab/component/header_author_name.tsx
+++ b/src/app_modules/colab/component/header_author_name.tsx
@@ -3,6 +3,8 @@
import { ComponentGlobal_AvatarAndUsername } from "@/app_modules/_global/component";
import { Group, Stack, Text } from "@mantine/core";
import { useRouter } from "next/navigation";
+import moment from "moment";
+import "moment/locale/id";
export default function ComponentColab_AuthorNameOnHeader({
tglPublish,
@@ -19,10 +21,8 @@ export default function ComponentColab_AuthorNameOnHeader({
component={
{tglPublish ? (
-
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "medium",
- }).format(tglPublish)}
+
+ {moment(tglPublish).locale("id").format("ll")}
) : (
""
@@ -65,7 +65,7 @@ export default function ComponentColab_AuthorNameOnHeader({
{tglPublish ? (
-
+
{new Intl.DateTimeFormat("id-ID", {
dateStyle: "medium"
diff --git a/src/app_modules/colab/component/index.ts b/src/app_modules/colab/component/index.ts
new file mode 100644
index 00000000..e17745cf
--- /dev/null
+++ b/src/app_modules/colab/component/index.ts
@@ -0,0 +1,3 @@
+import { Collaboration_SkeletonCreate } from "./skeleton_view";
+
+export { Collaboration_SkeletonCreate };
diff --git a/src/app_modules/colab/component/skeleton_view.tsx b/src/app_modules/colab/component/skeleton_view.tsx
new file mode 100644
index 00000000..027a227d
--- /dev/null
+++ b/src/app_modules/colab/component/skeleton_view.tsx
@@ -0,0 +1,278 @@
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Center, Grid, Group, Skeleton, Stack } from "@mantine/core";
+
+export {
+ Collaboration_SkeletonBeranda,
+ Collaboration_SkeletonCreate,
+ Collaboration_SkeletonDetail,
+ Collaboration_SkeletonDetailInfoGroup,
+ Collaboration_SkeletonGrup,
+ Collaboration_SkeletonListPartisipan,
+ Collaboration_SkeletonListPrtisipanIsUser,
+};
+
+function Collaboration_SkeletonCreate() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+function Collaboration_SkeletonBeranda() {
+ return (
+ <>
+ {Array.from(new Array(2)).map((e, i) => (
+
+
+
+
+
+
+
+
+
+ {/*
+
+ */}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ))}
+ >
+ );
+}
+
+function Collaboration_SkeletonGrup() {
+ return (
+ <>
+ {Array.from(new Array(2)).map((e, i) => (
+
+
+
+
+
+
+
+
+
+
+ ))}
+ >
+ );
+}
+
+function Collaboration_SkeletonDetail() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+function Collaboration_SkeletonListPrtisipanIsUser() {
+ return (
+ <>
+
+
+
+
+
+
+
+ {Array.from(new Array(2)).map((e, i) => (
+
+
+
+
+
+
+
+
+ ))}
+
+
+
+ >
+ );
+}
+
+function Collaboration_SkeletonListPartisipan() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+ {Array.from(new Array(2)).map((e, i) => (
+
+
+
+
+
+
+
+
+ ))}
+
+
+
+ >
+ );
+}
+
+function Collaboration_SkeletonDetailInfoGroup() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {Array.from(new Array(2)).map((e, i) => (
+
+
+
+
+
+
+
+
+ ))}
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/colab/create/index.tsx b/src/app_modules/colab/create/index.tsx
index 32c32541..682633ca 100644
--- a/src/app_modules/colab/create/index.tsx
+++ b/src/app_modules/colab/create/index.tsx
@@ -2,40 +2,78 @@
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import Component_V3_Label_TextInput from "@/app_modules/_global/component/new/comp_V3_label_text_input";
+import { Component_V3_TextEditor } from "@/app_modules/_global/component/new/comp_V3_text_editor";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
-import { Button, Select, Stack, TextInput, Textarea } from "@mantine/core";
+import { clientLogger } from "@/util/clientLogger";
+import mqtt_client from "@/util/mqtt_client";
+import { Button, Select, Stack, TextInput } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { Collaboration_SkeletonCreate } from "../component";
import colab_funCreateProyek from "../fun/create/fun_create_proyek";
import { MODEL_COLLABORATION_MASTER } from "../model/interface";
-import mqtt_client from "@/util/mqtt_client";
-import { useHookstate } from "@hookstate/core";
-import { useGsCollabCreate } from "../global_state/state";
+import { apiGetMasterIndustri } from "../_lib/api_collaboration";
-export default function Colab_Create({
- listIndustri,
-}: {
- listIndustri: MODEL_COLLABORATION_MASTER[];
-}) {
- const [value, setValue] = useState({
+interface IValue {
+ title: string;
+ lokasi: string;
+ purpose: string;
+ benefit: string;
+ projectCollaborationMaster_IndustriId: number;
+}
+
+export default function Colab_Create() {
+ const [value, setValue] = useState({
title: "",
lokasi: "",
purpose: "",
benefit: "",
projectCollaborationMaster_IndustriId: 0,
- // jumlah_partisipan: 0,
});
+
+ const [listIndustri, setListIndustri] = useState<
+ MODEL_COLLABORATION_MASTER[] | null
+ >(null);
+
+ useShallowEffect(() => {
+ onLoadIndustri();
+ }, []);
+
+ async function onLoadIndustri() {
+ try {
+ const response = await apiGetMasterIndustri();
+
+ if (response.success) {
+ setListIndustri(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get master industri", error);
+ }
+ }
+
+ if (listIndustri == null) {
+ return (
+ <>
+
+ >
+ );
+ }
+
return (
<>
-
+
- {/*
- minimal partisipan yang akan di pilih untuk mendiskusikan proyek
-
- }
- type="number"
- withAsterisk
- label="Jumlah Partisipan"
- placeholder={"2"}
- onChange={(val) => {
- setValue({
- ...value,
- jumlah_partisipan: val.currentTarget.value as any,
- });
- }}
- /> */}
+
+
+
+ {
+ setValue({
+ ...value,
+ purpose: val,
+ });
+ }}
+ />
+
+
+
+
+
+ {
+ setValue({
+ ...value,
+ benefit: val,
+ });
+ }}
+ />
+
+
+
+
+ {/*
-
+ */}
-
+ {/*
-
+ */}
@@ -160,7 +218,7 @@ export default function Colab_Create({
);
}
-function ButtonAction({ value }: { value: any }) {
+function ButtonAction({ value }: { value: IValue }) {
const router = useRouter();
const [loading, setLoading] = useState(false);
@@ -170,7 +228,6 @@ function ButtonAction({ value }: { value: any }) {
JSON.stringify({ isNewPost: true, count: 1 })
);
- console.log(value.jumlah_partisipan);
if (value.title === "")
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
if (value.lokasi === "")
@@ -180,29 +237,36 @@ function ButtonAction({ value }: { value: any }) {
if (value.projectCollaborationMaster_IndustriId === 0)
return ComponentGlobal_NotifikasiPeringatan("Pilih Industri");
- const res = await colab_funCreateProyek(value);
- if (res.status === 201) {
+ try {
setLoading(true);
- router.back();
- ComponentGlobal_NotifikasiBerhasil(res.message);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+
+ const res = await colab_funCreateProyek(value as any);
+ if (res.status === 201) {
+ router.back();
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error create proyek", error);
}
}
- // console.log(value);
-
return (
<>
maxInputLength ||
+ funReplaceHtml({ html: value.purpose }).length === 0 ||
+ funReplaceHtml({ html: value.benefit }).length > maxInputLength ||
+ funReplaceHtml({ html: value.benefit }).length === 0
}
loaderPosition="center"
loading={loading ? true : false}
diff --git a/src/app_modules/colab/create/layout.tsx b/src/app_modules/colab/create/layout.tsx
index 81b9c61b..5b348c6b 100644
--- a/src/app_modules/colab/create/layout.tsx
+++ b/src/app_modules/colab/create/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutColab_Create({
@@ -11,11 +14,18 @@ export default function LayoutColab_Create({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/colab/detail/group/index.tsx b/src/app_modules/colab/detail/group/index.tsx
index 79bda42b..d1f18207 100644
--- a/src/app_modules/colab/detail/group/index.tsx
+++ b/src/app_modules/colab/detail/group/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { MODEL_USER } from "@/app_modules/home/model/interface";
import mqtt_client from "@/util/mqtt_client";
@@ -26,7 +26,7 @@ import {
IconSend,
} from "@tabler/icons-react";
import _ from "lodash";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import useInfiniteScroll, {
ScrollDirection,
@@ -43,6 +43,8 @@ import {
MainColor,
} from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { apiGetDataGroupById } from "../../_lib/api_collaboration";
+import { clientLogger } from "@/util/clientLogger";
export default function Colab_GroupChatView({
userLoginId,
@@ -55,6 +57,7 @@ export default function Colab_GroupChatView({
selectRoom: MODEL_COLLABORATION_ROOM_CHAT;
dataUserLogin: MODEL_USER;
}) {
+ const params = useParams<{ id: string }>();
const router = useRouter();
const [loadingBack, setLoadingBack] = useState(false);
const [loadingInfo, setLoadingInfo] = useState(false);
@@ -66,6 +69,30 @@ export default function Colab_GroupChatView({
const [isGet, setIsGet] = useState(true);
const [newMessageId, setIdMessage] = useState("");
+ // NEW
+
+ const [dataGroup, setDataGroup] =
+ useState(null);
+
+ useShallowEffect(() => {
+ onLoadDataGroup();
+ }, []);
+
+ async function onLoadDataGroup() {
+ try {
+ const respone = await apiGetDataGroupById({
+ id: params.id,
+ kategori: "detail",
+ });
+
+ if (respone) {
+ setDataGroup(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data group", error);
+ }
+ }
+
const next = async (direction: ScrollDirection) => {
try {
setIsLoading(true);
@@ -202,13 +229,13 @@ export default function Colab_GroupChatView({
{loadingBack ? (
) : (
-
+
)}
-
+
{selectRoom?.name}
@@ -220,13 +247,15 @@ export default function Colab_GroupChatView({
radius={"xl"}
onClick={() => {
setLoadingInfo(true);
- router.push(RouterColab.info_grup + selectRoom.id, {scroll: false});
+ router.push(RouterColab.info_grup + selectRoom.id, {
+ scroll: false,
+ });
}}
>
{loadingInfo ? (
) : (
-
+
)}
@@ -351,10 +380,11 @@ export default function Colab_GroupChatView({
>
KIzRIM PESAN
*/}
-
+
{
diff --git a/src/app_modules/colab/detail/group/new_detail_group.tsx b/src/app_modules/colab/detail/group/new_detail_group.tsx
new file mode 100644
index 00000000..7f3797f2
--- /dev/null
+++ b/src/app_modules/colab/detail/group/new_detail_group.tsx
@@ -0,0 +1,442 @@
+"use client";
+
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import { MODEL_USER } from "@/app_modules/home/model/interface";
+import mqtt_client from "@/util/mqtt_client";
+import {
+ ActionIcon,
+ Box,
+ Center,
+ Container,
+ Grid,
+ Group,
+ Loader,
+ Paper,
+ rem,
+ Stack,
+ Text,
+ Textarea,
+ Title,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import {
+ IconChevronLeft,
+ IconCircle,
+ IconInfoSquareRounded,
+ IconSend,
+} from "@tabler/icons-react";
+import _ from "lodash";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import useInfiniteScroll, {
+ ScrollDirection,
+} from "react-easy-infinite-scroll-hook";
+import ComponentColab_IsEmptyData from "../../component/is_empty_data";
+import colab_funCreateMessageByUserId from "../../fun/create/room/fun_create_message_by_user_id";
+import colab_getMessageByRoomId from "../../fun/get/room_chat/get_message_by_room_id";
+import {
+ MODEL_COLLABORATION_MESSAGE,
+ MODEL_COLLABORATION_ROOM_CHAT,
+} from "../../model/interface";
+import {
+ AccentColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { apiGetDataGroupById } from "../../_lib/api_collaboration";
+import { clientLogger } from "@/util/clientLogger";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+import { apiGetUserById } from "@/app_modules/_global/lib/api_user";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import moment from "moment";
+import "moment/locale/id";
+
+export default function Colab_NewGroupChatView({
+ listMsg,
+ selectRoom,
+}: {
+ listMsg: any;
+ selectRoom: MODEL_COLLABORATION_ROOM_CHAT;
+}) {
+ const params = useParams<{ id: string }>();
+ const router = useRouter();
+ const [loadingBack, setLoadingBack] = useState(false);
+ const [loadingInfo, setLoadingInfo] = useState(false);
+ const [msg, setMsg] = useState("");
+ const [newMessage, setNewMessage] = useState();
+ const [data, setData] = useState(listMsg);
+ const [totalPage, setTotalPage] = useState(1);
+ const [isLoading, setIsLoading] = useState(false);
+ const [isGet, setIsGet] = useState(true);
+ const [newMessageId, setIdMessage] = useState("");
+ const [dataGroup, setDataGroup] =
+ useState(null);
+ const [userLoginId, setUserLoginId] = useState();
+ const [dataUserLogin, setDataUserLogin] = useState(null);
+
+ async function handleDataUserLogin() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+
+ if (response.success) {
+ setUserLoginId(response.userId);
+ const respone = await apiGetUserById({ id: response.userId });
+ if (respone) {
+ setDataUserLogin(respone.data);
+ }
+ } else {
+ setUserLoginId(null);
+ setDataUserLogin(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data user login", error);
+ }
+ }
+
+ useShallowEffect(() => {
+ onLoadDataGroup();
+ handleDataUserLogin();
+ }, []);
+
+ async function onLoadDataGroup() {
+ try {
+ const respone = await apiGetDataGroupById({
+ id: params.id,
+ kategori: "detail",
+ });
+
+ if (respone) {
+ setDataGroup(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data group", error);
+ }
+ }
+
+ const next = async (direction: ScrollDirection) => {
+ try {
+ setIsLoading(true);
+ await new Promise((a) => setTimeout(a, 500));
+
+ const newData = await colab_getMessageByRoomId({
+ roomId: selectRoom?.id,
+ page: totalPage + 1,
+ });
+ setTotalPage(totalPage + 1);
+
+ // console.log(newData, "loading baru");
+
+ if (_.isEmpty(newData)) {
+ setIsGet(false);
+ } else {
+ const d =
+ direction === "down" ? [...data, ...newData] : [...newData, ...data];
+ setData(d);
+ }
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ const ref = useInfiniteScroll({
+ next,
+ rowCount: data.length,
+ hasMore: { up: isGet },
+ scrollThreshold: 0.5,
+ });
+
+ async function onSend() {
+ await colab_funCreateMessageByUserId(msg, selectRoom.id).then(
+ async (res) => {
+ if (res.status === 200) {
+ setIdMessage(res.data?.id as any);
+ setMsg("");
+ const kiriman: MODEL_COLLABORATION_MESSAGE = {
+ createdAt: new Date(),
+ id: newMessageId,
+ isActive: true,
+ message: msg,
+ isFile: false,
+ updatedAt: new Date(),
+ userId: dataUserLogin?.id as string,
+ User: {
+ id: dataUserLogin?.id as string,
+ Profile: {
+ id: dataUserLogin?.Profile?.id as any,
+ name: dataUserLogin?.Profile?.name as any,
+ },
+ },
+ };
+ mqtt_client.publish(selectRoom.id, JSON.stringify(kiriman));
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ }
+ );
+ }
+
+ useShallowEffect(() => {
+ mqtt_client.subscribe(selectRoom.id);
+ // mqtt_client.on("message", (topic: any, message: any) => {
+ // onList(message.toString());
+ // });
+
+ mqtt_client.on("message", (topic: any, message: any) => {
+ let dd = _.clone(data);
+ const a = [...dd, JSON.parse(message)];
+ // console.log(dd.length);
+ setData(a);
+ });
+ }, [data]);
+
+ async function onList(message: any) {
+ const kiriman: MODEL_COLLABORATION_MESSAGE = {
+ createdAt: new Date(),
+ id: newMessageId,
+ isActive: true,
+ message: message,
+ isFile: false,
+ updatedAt: new Date(),
+ userId: dataUserLogin?.id as string,
+ User: {
+ id: dataUserLogin?.id as string,
+ Profile: {
+ id: dataUserLogin?.Profile?.id as any,
+ name: dataUserLogin?.Profile?.name as any,
+ },
+ },
+ };
+
+ const dataLama = _.clone(data);
+ setData([...dataLama, { ...kiriman }]);
+ }
+
+ return (
+ <>
+
+
+ {/* Header */}
+
+
+
+
+ {
+ setLoadingBack(true);
+ router.back();
+ }}
+ >
+ {loadingBack ? (
+
+ ) : (
+
+ )}
+
+
+
+
+
+ {selectRoom?.name}
+
+
+
+
+
+ {
+ setLoadingInfo(true);
+ router.push(RouterColab.info_grup + selectRoom.id, {
+ scroll: false,
+ });
+ }}
+ >
+ {loadingInfo ? (
+
+ ) : (
+
+ )}
+
+
+
+
+
+
+
+ {/* Main View */}
+
+ {/* Chat View */}
+
+
+
+ {_.isEmpty(data) ? (
+
+ ) : isLoading || !dataUserLogin ? (
+
+
+
+ ) : (
+ data.map((e, i) => (
+
+ {userLoginId === e?.User?.id ? (
+
+
+
+
+ {e?.User?.Profile?.name}
+
+
+
+
+
+
+
+ {moment(e.createdAt).format("ll")}
+
+
+
+ {moment(e.createdAt).format("LT")}
+
+
+
+
+
+ ) : (
+
+
+
+
+ {e?.User?.Profile?.name}
+
+
+
+
+
+
+ {moment(e.createdAt).format("ll")}
+
+
+
+ {moment(e.createdAt).format("LT")}
+
+
+
+
+
+ )}
+
+ ))
+ )}
+
+
+
+
+
+ {/* Footer */}
+
+ {/* {
+ const d: { [key: string]: any } = _.clone(data[0]);
+ setData([...data, d]);
+ }}
+ >
+ KIzRIM PESAN
+ */}
+
+
+
+ setMsg(val.currentTarget.value)}
+ />
+
+
+ {
+ onSend();
+ }}
+ style={{
+ transition: "0.5s",
+ }}
+ >
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/colab/detail/grup/index.tsx b/src/app_modules/colab/detail/grup/index.tsx
index 8eb7f65b..87ce9eb1 100644
--- a/src/app_modules/colab/detail/grup/index.tsx
+++ b/src/app_modules/colab/detail/grup/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { MODEL_USER } from "@/app_modules/home/model/interface";
import mqtt_client from "@/util/mqtt_client";
diff --git a/src/app_modules/colab/detail/info_grup/index.tsx b/src/app_modules/colab/detail/info_grup/index.tsx
index e0aeade4..51061b1a 100644
--- a/src/app_modules/colab/detail/info_grup/index.tsx
+++ b/src/app_modules/colab/detail/info_grup/index.tsx
@@ -1,56 +1,101 @@
"use client";
-import { AccentColor } from "@/app_modules/_global/color/color_pallet";
-import { ComponentGlobal_AvatarAndUsername, ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import {
+ ComponentGlobal_AvatarAndUsername,
+ ComponentGlobal_CardStyles,
+} from "@/app_modules/_global/component";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import { Box, Paper, Stack, Title } from "@mantine/core";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Stack, Title } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import {
+ apiGetDataGroupById
+} from "../../_lib/api_collaboration";
import ComponentColab_DetailData from "../../component/detail/detail_data";
-import { MODEL_COLLABORATION_ROOM_CHAT } from "../../model/interface";
+import {
+ Collaboration_SkeletonDetailInfoGroup
+} from "../../component/skeleton_view";
+import {
+ MODEL_COLLABORATION_ROOM_CHAT
+} from "../../model/interface";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, { UI_NewHeader, UI_NewChildren } from "@/app_modules/_global/ui/V2_layout_tamplate";
-export default function Colab_DetailInfoGrup({
- dataRoom,
-}: {
- dataRoom: MODEL_COLLABORATION_ROOM_CHAT;
-}) {
+export default function Colab_DetailInfoGrup() {
return (
<>
- }
>
-
-
+
+ */}
+
+
+
+
+
+
+
+
+
>
);
}
-function InfoGroup({ dataRoom }: { dataRoom: MODEL_COLLABORATION_ROOM_CHAT }) {
+function InfoGroup() {
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetDataGroupById({
+ id: params.id,
+ kategori: "info_group",
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data info group", error);
+ }
+ }
+
+ if (_.isNull(data)) {
+ return (
+ <>
+
+ >
+ );
+ }
+
return (
<>
-
-
-
-
-
- Anggota Grup
- {dataRoom.ProjectCollaboration_AnggotaRoomChat.map((e, i) => (
-
-
-
-
- ))}
-
-
-
-
+
+
+
+
+
+
+ Anggota Grup
+ {data?.ProjectCollaboration_AnggotaRoomChat.map((e, i) => (
+
+
+
+ ))}
+
+
+
>
);
}
diff --git a/src/app_modules/colab/detail/main_detail/index.tsx b/src/app_modules/colab/detail/main_detail/index.tsx
index 34f272ca..97ea5399 100644
--- a/src/app_modules/colab/detail/main_detail/index.tsx
+++ b/src/app_modules/colab/detail/main_detail/index.tsx
@@ -1,42 +1,80 @@
"use client";
-import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import {
+ ComponentGlobal_BoxInformation,
+ ComponentGlobal_CardStyles,
+} from "@/app_modules/_global/component";
+import { clientLogger } from "@/util/clientLogger";
import { Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { apiGetOneCollaborationById } from "../../_lib/api_collaboration";
import ComponentColab_DetailData from "../../component/detail/detail_data";
import ComponentColab_DetailListPartisipasiUser from "../../component/detail/list_partisipasi_user";
import ComponentColab_AuthorNameOnHeader from "../../component/header_author_name";
+import { Collaboration_SkeletonDetail } from "../../component/skeleton_view";
import { MODEL_COLLABORATION } from "../../model/interface";
-import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+
+export default function Colab_MainDetail() {
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [userLoginId, setUserLoginId] = useState();
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+
+ if (response.success) {
+ setUserLoginId(response.userId);
+ const respone = await apiGetOneCollaborationById({
+ id: params.id,
+ kategori: "detail",
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } else {
+ setUserLoginId(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get all collaboration", error);
+ }
+ }
+
+ if (userLoginId === undefined || data === null)
+ return ;
-export default function Colab_MainDetail({
- dataColab,
- userLoginId,
- listPartisipan,
- cekPartisipan,
-}: {
- dataColab?: MODEL_COLLABORATION;
- userLoginId?: string;
- listPartisipan?: any[];
- cekPartisipan: boolean;
-}) {
return (
<>
-
+ {userLoginId === null ? (
+
+ ) : (
-
-
+
+
+
+
+
+
+
-
+ )}
>
);
}
diff --git a/src/app_modules/colab/detail/main_detail/layout.tsx b/src/app_modules/colab/detail/main_detail/layout.tsx
index ba21b78d..7ecaa27c 100644
--- a/src/app_modules/colab/detail/main_detail/layout.tsx
+++ b/src/app_modules/colab/detail/main_detail/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutColab_MainDetail({
@@ -15,7 +18,7 @@ export default function LayoutColab_MainDetail({
}) {
return (
<>
-
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/colab/detail/proyek/partisipasi/index.tsx b/src/app_modules/colab/detail/proyek/partisipasi/index.tsx
index 96991c5c..725ae404 100644
--- a/src/app_modules/colab/detail/proyek/partisipasi/index.tsx
+++ b/src/app_modules/colab/detail/proyek/partisipasi/index.tsx
@@ -1,36 +1,60 @@
"use client";
-import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import { apiGetOneCollaborationById } from "@/app_modules/colab/_lib/api_collaboration";
import ComponentColab_DetailData from "@/app_modules/colab/component/detail/detail_data";
import ComponentColab_DetailListPartisipasiUser from "@/app_modules/colab/component/detail/list_partisipasi_user";
import ComponentColab_AuthorNameOnHeader from "@/app_modules/colab/component/header_author_name";
-import {
- MODEL_COLLABORATION,
- MODEL_COLLABORATION_PARTISIPASI,
-} from "@/app_modules/colab/model/interface";
-import { Stack, Text } from "@mantine/core";
+import { Collaboration_SkeletonDetail } from "@/app_modules/colab/component/skeleton_view";
+import { MODEL_COLLABORATION } from "@/app_modules/colab/model/interface";
+import { clientLogger } from "@/util/clientLogger";
+import { Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+
+export default function Colab_DetailPartisipasiProyek() {
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetOneCollaborationById({
+ id: params.id,
+ kategori: "detail",
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get all collaboration", error);
+ }
+ }
-export default function Colab_DetailPartisipasiProyek({
- dataColab,
- listPartisipan,
-}: {
- dataColab: MODEL_COLLABORATION;
- listPartisipan: MODEL_COLLABORATION_PARTISIPASI[];
-}) {
return (
<>
-
+ {_.isNull(data) ? (
+
+ ) : (
-
-
-
+
+
+
+
+
+
+
+
-
+ )}
>
);
}
diff --git a/src/app_modules/colab/detail/proyek/partisipasi/layout.tsx b/src/app_modules/colab/detail/proyek/partisipasi/layout.tsx
index 2a530e7a..03feed3b 100644
--- a/src/app_modules/colab/detail/proyek/partisipasi/layout.tsx
+++ b/src/app_modules/colab/detail/proyek/partisipasi/layout.tsx
@@ -1,7 +1,12 @@
"use client";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import UI_NewLayoutTamplate, {
+ UI_NewHeader,
+ UI_NewChildren,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
export default function LayoutColab_DetailPartisipasiProyek({
children,
@@ -10,11 +15,18 @@ export default function LayoutColab_DetailPartisipasiProyek({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/colab/detail/proyek/saya/index.tsx b/src/app_modules/colab/detail/proyek/saya/index.tsx
index 173f6ff5..36cb0f8f 100644
--- a/src/app_modules/colab/detail/proyek/saya/index.tsx
+++ b/src/app_modules/colab/detail/proyek/saya/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
import {
AccentColor,
MainColor,
@@ -9,137 +9,185 @@ import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
+import { apiGetOneCollaborationById } from "@/app_modules/colab/_lib/api_collaboration";
import ComponentColab_DetailData from "@/app_modules/colab/component/detail/detail_data";
import ComponentColab_AuthorNameOnListPartisipan from "@/app_modules/colab/component/detail/header_author_list_partisipan";
import ComponentColab_IsEmptyData from "@/app_modules/colab/component/is_empty_data";
+import {
+ Collaboration_SkeletonDetail,
+ Collaboration_SkeletonListPrtisipanIsUser,
+} from "@/app_modules/colab/component/skeleton_view";
import colab_funCreateRoomChat from "@/app_modules/colab/fun/create/fun_create_room_chat";
import { gs_colab_hot_menu } from "@/app_modules/colab/global_state";
import {
MODEL_COLLABORATION,
MODEL_COLLABORATION_PARTISIPASI,
} from "@/app_modules/colab/model/interface";
-import mqtt_client from "@/util/mqtt_client";
+import { clientLogger } from "@/util/clientLogger";
import {
ActionIcon,
+ Box,
Button,
+ Center,
Checkbox,
Drawer,
Grid,
Group,
- Paper,
- ScrollArea,
+ Loader,
Stack,
Text,
TextInput,
Title,
} from "@mantine/core";
-import { useDisclosure } from "@mantine/hooks";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
import { IconX } from "@tabler/icons-react";
import { useAtom } from "jotai";
import _ from "lodash";
-import { useRouter } from "next/navigation";
+import { ScrollOnly } from "next-scroll-loader";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
-export default function Colab_DetailProyekSaya({
- dataColab,
- listPartisipan,
-}: {
- dataColab: MODEL_COLLABORATION;
- listPartisipan: MODEL_COLLABORATION_PARTISIPASI[];
-}) {
- return (
- <>
-
-
-
-
-
-
- >
- );
-}
+export default function Colab_DetailProyekSaya() {
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
-function CheckBoxPartisipan({
- listPartisipan,
- colabId,
-}: {
- listPartisipan: MODEL_COLLABORATION_PARTISIPASI[];
- colabId: string;
-}) {
- const [value, setValue] = useState([]);
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetOneCollaborationById({
+ id: params.id,
+ kategori: "detail",
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get all collaboration", error);
+ }
+ }
return (
<>
- {/* {JSON.stringify(listPartisipan,null,2)} */}
-
- {/* {JSON.stringify(value, null, 2)} */}
-
-
-
- *
-
- Pilih user yang akan menjadi tim proyek anda
-
-
- {/*
- *
-
- Room chat dapat dibentuk jika ada 2 user yang dipilih
-
- */}
-
-
-
-
- {_.isEmpty(listPartisipan) ? (
-
- ) : (
- listPartisipan.map((e, i) => (
-
-
-
-
-
-
-
-
- ))
- )}
-
-
-
-
-
-
+ {_.isNull(data) ? (
+
+ ) : (
+
+
+
+ )}
+
+
>
);
}
-function ButtonAction({
- value,
- colabId,
-}: {
- value: string[];
- colabId: string;
-}) {
+function CheckBoxPartisipan() {
+ const params = useParams<{ id: string }>();
+ const [value, setValue] = useState([]);
+ const [data, setData] = useState(
+ null
+ );
+ const [activePage, setActivePage] = useState(1);
+
+ useShallowEffect(() => {
+ onLoadDataPartisipan();
+ }, []);
+
+ async function onLoadDataPartisipan() {
+ try {
+ const respone = await apiGetOneCollaborationById({
+ id: params.id,
+ kategori: "list_partisipan",
+ page: `${activePage}`,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get list partisipan", error);
+ }
+ }
+
+ if (_.isNull(data)) {
+ return ;
+ }
+
+ return (
+ <>
+
+
+
+
+
+ *
+
+ Pilih user yang akan menjadi tim proyek anda
+
+
+
+
+ {_.isEmpty(data) ? (
+
+ ) : (
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={async () => {
+ const respone = await apiGetOneCollaborationById({
+ id: params.id,
+ kategori: "list_partisipan",
+ page: `${activePage + 1}`,
+ });
+
+ setActivePage((val) => val + 1);
+
+ return respone.data;
+ }}
+ >
+ {(item) => (
+
+
+
+
+
+
+
+
+
+
+ )}
+
+
+ )}
+
+
+
+
+
+ >
+ );
+}
+
+function ButtonAction({ value }: { value: string[] }) {
+ const params = useParams<{ id: string }>();
const router = useRouter();
const [opened, { open, close }] = useDisclosure(false);
const [hotMenu, setHotMenu] = useAtom(gs_colab_hot_menu);
@@ -147,29 +195,35 @@ function ButtonAction({
const [loading, setLoading] = useState(false);
async function onSave() {
- if (nameRoom === "")
- return ComponentGlobal_NotifikasiPeringatan("Lengkapi Nama Grup");
+ try {
+ setLoading(true);
+ if (nameRoom === "")
+ return ComponentGlobal_NotifikasiPeringatan("Lengkapi Nama Grup");
- // await notifikasiToUser_CreateGroupCollaboration({ colabId: colabId });
+ // await notifikasiToUser_CreateGroupCollaboration({ colabId: colabId });
- const res = await colab_funCreateRoomChat(nameRoom, value, colabId);
- if (res.status === 201) {
- for (let a of value) {
- mqtt_client.publish(
- "USER",
- JSON.stringify({
- userId: a,
- count: 1,
- })
- );
+ const res = await colab_funCreateRoomChat(nameRoom, value, params.id);
+ if (res.status === 201) {
+ // for (let a of value) {
+ // mqtt_client.publish(
+ // "USER",
+ // JSON.stringify({
+ // userId: a,
+ // count: 1,
+ // })
+ // );
+ // }
+
+ ComponentGlobal_NotifikasiBerhasil("Berhasil Membuat Grup");
+ setHotMenu(4);
+ router.replace(RouterColab.grup_diskusi);
+ } else {
+ ComponentGlobal_NotifikasiGagal("Gagal Membuat Grup");
}
-
- setLoading(true);
- ComponentGlobal_NotifikasiBerhasil("Berhasil Membuat Grup");
- setHotMenu(4);
- router.push(RouterColab.grup_diskusi);
- } else {
- ComponentGlobal_NotifikasiGagal("Gagal Membuat Grup");
+ } catch (error) {
+ clientLogger.error("Error create room chat", error);
+ } finally {
+ setLoading(false);
}
}
@@ -188,7 +242,7 @@ function ButtonAction({
transition: "0.5s",
}}
>
- Buat Ruang Diskusi{" "}
+ Buat Ruang Diskusi
- Nama Grup Diskusi
+ Nama Grup Diskusi
-
+
{
diff --git a/src/app_modules/colab/detail/proyek/saya/layout.tsx b/src/app_modules/colab/detail/proyek/saya/layout.tsx
index 8c184be5..428f5a3f 100644
--- a/src/app_modules/colab/detail/proyek/saya/layout.tsx
+++ b/src/app_modules/colab/detail/proyek/saya/layout.tsx
@@ -1,33 +1,35 @@
"use client";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import { ActionIcon } from "@mantine/core";
import { IconDotsVertical, IconEdit } from "@tabler/icons-react";
+import { useParams } from "next/navigation";
import React, { useState } from "react";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, { UI_NewHeader, UI_NewChildren } from "@/app_modules/_global/ui/V2_layout_tamplate";
export default function LayoutColab_DetailProyekSaya({
children,
- colabId,
}: {
children: React.ReactNode;
- colabId: string;
}) {
+ const params = useParams<{id: string}>()
const [openDrawer, setOpenDrawer] = useState(false);
const listPage = [
{
id: "1",
name: "Edit Proyek",
icon: ,
- path: RouterColab.edit + colabId,
+ path: RouterColab.edit + params.id,
},
];
return (
<>
-
{children}
-
+ */}
+
+
+
+ setOpenDrawer(true)}
+ >
+
+
+ }
+ />
+
+ {children}
+
();
+ const [listIndustri, setListIndustri] = useState<
+ MODEL_COLLABORATION_MASTER[] | null
+ >(null);
+
+ useShallowEffect(() => {
+ onLoadIndustri();
+ }, []);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetOneCollaborationById({
+ id: id as string,
+ kategori: "detail",
+ });
+ if (response.success) {
+ const fixData = _.omit(response.data, [
+ "ProjectCollaboration_Partisipasi",
+ "Author",
+ ]);
+ setData(fixData as MODEL_COLLABORATION);
+ }
+ } catch (error) {
+ clientLogger.error("Error get one collaboration by id", error);
+ }
+ }
+
+ async function onLoadIndustri() {
+ try {
+ const response = await apiGetMasterIndustri();
+
+ if (response.success) {
+ setListIndustri(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get master industri", error);
+ }
+ }
+
+ if (data === undefined || listIndustri === null)
+ return ;
-export default function Colab_Edit({
- selectedData,
- listIndustri,
-}: {
- selectedData: MODEL_COLLABORATION;
- listIndustri: MODEL_COLLABORATION_MASTER[];
-}) {
- const [value, setValue] = useState(selectedData);
return (
<>
-
- {/* {JSON.stringify(value, null, 2)} */}
+
- setValue({
- ...value,
+ setData({
+ ...data,
title: val.currentTarget.value,
})
}
@@ -49,16 +106,22 @@ export default function Colab_Edit({
maxLength={100}
styles={{
label: {
- color: "white",
+ color: MainColor.white,
+ },
+ input: {
+ backgroundColor: MainColor.white,
+ },
+ required: {
+ color: MainColor.red,
},
}}
label="Lokasi"
withAsterisk
placeholder="Masukan lokasi proyek"
- value={value.lokasi}
+ value={data?.lokasi}
onChange={(val) =>
- setValue({
- ...value,
+ setData({
+ ...data,
lokasi: val.currentTarget.value,
})
}
@@ -67,21 +130,34 @@ export default function Colab_Edit({
({
- value: e.id,
- label: e.name,
- }))}
+ value={data?.ProjectCollaborationMaster_Industri.id}
+ data={
+ _.isEmpty(listIndustri)
+ ? []
+ : listIndustri.map((e) => ({
+ value: e.id,
+ label: e.name,
+ }))
+ }
onChange={
(val) =>
- setValue({
- ...(value as any),
+ setData({
+ ...(data as any),
ProjectCollaborationMaster_Industri: {
id: val as any,
},
@@ -90,75 +166,45 @@ export default function Colab_Edit({
}
/>
- {/*
- minimal partisipan yang akan di pilih untuk mendiskusikan proyek
-
- }
- type="number"
- withAsterisk
- label="Jumlah Partisipan"
- placeholder={"2"}
- value={value.jumlah_partisipan ? value.jumlah_partisipan : ""}
- onChange={(val) => {
- setValue({
- ...value,
- jumlah_partisipan: + val.currentTarget.value
- });
- }}
- /> */}
-
-
+
+ {
+ setData({
+ ...data,
+ purpose: val,
+ });
}}
- label="Tujuan Proyek"
- placeholder="Masukan tujuan proyek"
- withAsterisk
- minRows={5}
- value={value.purpose}
- onChange={(val) =>
- setValue({
- ...value,
- purpose: val.currentTarget.value,
- })
- }
/>
+
-
+
+ {
+ setData({
+ ...data,
+ benefit: val,
+ });
}}
- label="Keuntungan "
- placeholder="Masukan keuntungan dalam proyek"
- minRows={5}
- value={value.benefit}
- onChange={(val) =>
- setValue({
- ...value,
- benefit: val.currentTarget.value,
- })
- }
/>
+
-
+
>
);
@@ -180,13 +226,19 @@ function ButtonAction({ value }: { value: any }) {
// if (value.jumlah_partisipan < 2)
// return ComponentGlobal_NotifikasiPeringatan("Minimal Ada 2 Partisipan");
+ setLoading(true);
await colab_funEditById(value as any).then((res) => {
- if (res.status === 200) {
- setLoading(true);
- router.back();
- ComponentGlobal_NotifikasiBerhasil(res.message);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ try {
+ if (res.status === 200) {
+ router.back();
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error update proyek", error);
}
});
}
@@ -197,11 +249,11 @@ function ButtonAction({ value }: { value: any }) {
disabled={
!value.title ||
!value.lokasi ||
- !value.purpose ||
- !value.benefit ||
- value.projectCollaborationMaster_IndustriId === 0
- ? true
- : false
+ value.projectCollaborationMaster_IndustriId === 0 ||
+ funReplaceHtml({ html: value.purpose }).length > maxInputLength ||
+ funReplaceHtml({ html: value.purpose }).length === 0 ||
+ funReplaceHtml({ html: value.benefit }).length > maxInputLength ||
+ funReplaceHtml({ html: value.benefit }).length === 0
}
loaderPosition="center"
loading={loading ? true : false}
diff --git a/src/app_modules/colab/edit/layout.tsx b/src/app_modules/colab/edit/layout.tsx
index 07d45715..5d1fe0e5 100644
--- a/src/app_modules/colab/edit/layout.tsx
+++ b/src/app_modules/colab/edit/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutColab_Edit({
@@ -11,9 +14,16 @@ export default function LayoutColab_Edit({
}) {
return (
<>
- }>
+ {/* }>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/colab/fun/chat/get_message_by_room_id.ts b/src/app_modules/colab/fun/chat/get_message_by_room_id.ts
index e0423879..afa12f34 100644
--- a/src/app_modules/colab/fun/chat/get_message_by_room_id.ts
+++ b/src/app_modules/colab/fun/chat/get_message_by_room_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _, { ceil } from "lodash";
export default async function colab_V2getListMessageByRoomId({
diff --git a/src/app_modules/colab/fun/create/fun_create_partisipan_by_user_id.ts b/src/app_modules/colab/fun/create/fun_create_partisipan_by_user_id.ts
index e8c3c460..d0b5e4af 100644
--- a/src/app_modules/colab/fun/create/fun_create_partisipan_by_user_id.ts
+++ b/src/app_modules/colab/fun/create/fun_create_partisipan_by_user_id.ts
@@ -1,36 +1,57 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import prisma from "@/lib/prisma";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { revalidatePath } from "next/cache";
-export default async function colab_funCreatePartisipan(
- colabId: string,
- userId: string,
- deskripsi: string
-) {
- const create = await prisma.projectCollaboration_Partisipasi.create({
- data: {
- projectCollaborationId: colabId,
- userId: userId,
- deskripsi_diri: deskripsi,
- },
- select: {
- ProjectCollaboration: {
- select: {
- id: true,
- title: true,
- userId: true,
+export default async function colab_funCreatePartisipan({
+ id,
+ deskripsi,
+}: {
+ id: string;
+ deskripsi: string;
+}) {
+ try {
+ const userLoginId = await funGetUserIdByToken();
+
+ if (!userLoginId) {
+ return {
+ status: 404,
+ message: "Gagal mendapatkan data, user id tidak ada",
+ };
+ }
+
+ const create = await prisma.projectCollaboration_Partisipasi.create({
+ data: {
+ projectCollaborationId: id,
+ userId: userLoginId,
+ deskripsi_diri: deskripsi,
+ },
+ select: {
+ ProjectCollaboration: {
+ select: {
+ id: true,
+ title: true,
+ userId: true,
+ },
},
},
- },
- });
+ });
- if (!create) return { status: 400, message: "Gagal menambahkan partisipan" };
- revalidatePath(RouterColab.main_detail + colabId);
- return {
- data: create,
- status: 201,
- message: "Berhasil menambahkan partisipan",
- };
+ if (!create)
+ return { status: 400, message: "Gagal menambahkan partisipan" };
+ revalidatePath(RouterColab.main_detail + id);
+ return {
+ data: create,
+ status: 201,
+ message: "Berhasil menambahkan partisipan",
+ };
+ } catch (error) {
+ return {
+ status: 500,
+ message: "Error menambahkan partisipan",
+ error: (error as Error).message,
+ };
+ }
}
diff --git a/src/app_modules/colab/fun/create/fun_create_proyek.ts b/src/app_modules/colab/fun/create/fun_create_proyek.ts
index 22e689ea..a0d4cff9 100644
--- a/src/app_modules/colab/fun/create/fun_create_proyek.ts
+++ b/src/app_modules/colab/fun/create/fun_create_proyek.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import prisma from "@/lib/prisma";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { revalidatePath } from "next/cache";
import { MODEL_COLLABORATION } from "../../model/interface";
@@ -9,22 +9,27 @@ import { MODEL_COLLABORATION } from "../../model/interface";
export default async function colab_funCreateProyek(
value: MODEL_COLLABORATION
) {
- const userLoginId = await funGetUserIdByToken();
+ try {
+ const userLoginId = await funGetUserIdByToken();
+ if (!userLoginId) return { status: 400, message: "Gagal Membuat Proyek" };
- const data = await prisma.projectCollaboration.create({
- data: {
- title: value.title,
- lokasi: value.lokasi,
- purpose: value.purpose,
- benefit: value.benefit,
- projectCollaborationMaster_IndustriId:
- value.projectCollaborationMaster_IndustriId,
- userId: userLoginId,
- // jumlah_partisipan: + value.jumlah_partisipan,
- },
- });
+ const data = await prisma.projectCollaboration.create({
+ data: {
+ title: value.title,
+ lokasi: value.lokasi,
+ purpose: value.purpose,
+ benefit: value.benefit,
+ projectCollaborationMaster_IndustriId:
+ value.projectCollaborationMaster_IndustriId,
+ userId: userLoginId,
+ // jumlah_partisipan: + value.jumlah_partisipan,
+ },
+ });
- if (!data) return { status: 400, message: "Gagal Membuat Proyek" };
- revalidatePath(RouterColab.beranda);
- return { data, status: 201, message: "Berhasil Membuar Proyek" };
+ if (!data) return { status: 400, message: "Gagal Membuat Proyek" };
+ revalidatePath(RouterColab.beranda);
+ return { data, status: 201, message: "Berhasil Membuat Proyek" };
+ } catch (error) {
+ return { status: 500, message: "Gagal Membuat Proyek" };
+ }
}
diff --git a/src/app_modules/colab/fun/create/fun_create_room_chat.ts b/src/app_modules/colab/fun/create/fun_create_room_chat.ts
index 8e7231d2..b326e49a 100644
--- a/src/app_modules/colab/fun/create/fun_create_room_chat.ts
+++ b/src/app_modules/colab/fun/create/fun_create_room_chat.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export default async function colab_funCreateRoomChat(
diff --git a/src/app_modules/colab/fun/create/room/fun_create_message_by_user_id.ts b/src/app_modules/colab/fun/create/room/fun_create_message_by_user_id.ts
index f10a3e9b..f9ec16cf 100644
--- a/src/app_modules/colab/fun/create/room/fun_create_message_by_user_id.ts
+++ b/src/app_modules/colab/fun/create/room/fun_create_message_by_user_id.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import prisma from "@/lib/prisma";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { revalidatePath } from "next/cache";
diff --git a/src/app_modules/colab/fun/edit/fun_edit_by_id.ts b/src/app_modules/colab/fun/edit/fun_edit_by_id.ts
index 69af1a53..ce9cf81f 100644
--- a/src/app_modules/colab/fun/edit/fun_edit_by_id.ts
+++ b/src/app_modules/colab/fun/edit/fun_edit_by_id.ts
@@ -1,12 +1,11 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_COLLABORATION } from "../../model/interface";
import { revalidatePath } from "next/cache";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
export default async function colab_funEditById(value: MODEL_COLLABORATION) {
- console.log(value);
const updt = await prisma.projectCollaboration.update({
where: {
id: value.id,
diff --git a/src/app_modules/colab/fun/edit/fun_is_read_by_id.ts b/src/app_modules/colab/fun/edit/fun_is_read_by_id.ts
index 8d76731c..b1f71330 100644
--- a/src/app_modules/colab/fun/edit/fun_is_read_by_id.ts
+++ b/src/app_modules/colab/fun/edit/fun_is_read_by_id.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import prisma from "@/lib/prisma";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
import { revalidatePath } from "next/cache";
export default async function colab_funUpdateIsReadByNotifId(notifId: string) {
diff --git a/src/app_modules/colab/fun/get/cek_notifikasi.ts b/src/app_modules/colab/fun/get/cek_notifikasi.ts
index c520582d..590ae11b 100644
--- a/src/app_modules/colab/fun/get/cek_notifikasi.ts
+++ b/src/app_modules/colab/fun/get/cek_notifikasi.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export default async function colab_CekNotifikasi() {
diff --git a/src/app_modules/colab/fun/get/cek_partisipasi_by_user_id.ts b/src/app_modules/colab/fun/get/cek_partisipasi_by_user_id.ts
index 4afacf5c..e298759a 100644
--- a/src/app_modules/colab/fun/get/cek_partisipasi_by_user_id.ts
+++ b/src/app_modules/colab/fun/get/cek_partisipasi_by_user_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export default async function colab_funCekPartisipasiById(colabId: string) {
diff --git a/src/app_modules/colab/fun/get/get_list_all_proyek.ts b/src/app_modules/colab/fun/get/get_list_all_proyek.ts
index c3f557d3..93efebe8 100644
--- a/src/app_modules/colab/fun/get/get_list_all_proyek.ts
+++ b/src/app_modules/colab/fun/get/get_list_all_proyek.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function colab_getListAllProyek({
page,
diff --git a/src/app_modules/colab/fun/get/get_list_by_status_id.ts b/src/app_modules/colab/fun/get/get_list_by_status_id.ts
index 80800b55..9c241bfc 100644
--- a/src/app_modules/colab/fun/get/get_list_by_status_id.ts
+++ b/src/app_modules/colab/fun/get/get_list_by_status_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export default async function colab_getListByStatusId(statusId: number) {
diff --git a/src/app_modules/colab/fun/get/get_list_notifikasi_by_user_id.ts b/src/app_modules/colab/fun/get/get_list_notifikasi_by_user_id.ts
index 3b98a2df..29d7e5df 100644
--- a/src/app_modules/colab/fun/get/get_list_notifikasi_by_user_id.ts
+++ b/src/app_modules/colab/fun/get/get_list_notifikasi_by_user_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export default async function colab_getListNotifikasiByUserId() {
diff --git a/src/app_modules/colab/fun/get/get_list_partisipan_by_id.ts b/src/app_modules/colab/fun/get/get_list_partisipan_by_id.ts
index 53bffef2..ed661328 100644
--- a/src/app_modules/colab/fun/get/get_list_partisipan_by_id.ts
+++ b/src/app_modules/colab/fun/get/get_list_partisipan_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function colab_getListPartisipanByColabId(colabId: string) {
const data = await prisma.projectCollaboration_Partisipasi.findMany({
diff --git a/src/app_modules/colab/fun/get/get_one_by_id.ts b/src/app_modules/colab/fun/get/get_one_by_id.ts
index 0da4806b..ef920ef5 100644
--- a/src/app_modules/colab/fun/get/get_one_by_id.ts
+++ b/src/app_modules/colab/fun/get/get_one_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function colab_getOneCollaborationById(colabId: string) {
const data = await prisma.projectCollaboration.findFirst({
diff --git a/src/app_modules/colab/fun/get/get_one_notifikasi_by_id.ts b/src/app_modules/colab/fun/get/get_one_notifikasi_by_id.ts
index c41e8a61..bd245ebe 100644
--- a/src/app_modules/colab/fun/get/get_one_notifikasi_by_id.ts
+++ b/src/app_modules/colab/fun/get/get_one_notifikasi_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function colab_getOneNotifikasiById({
notifId,
diff --git a/src/app_modules/colab/fun/get/pasrtisipan/get_list_partisipasi_proyek_by_author_id.ts b/src/app_modules/colab/fun/get/pasrtisipan/get_list_partisipasi_proyek_by_author_id.ts
index f65e3d82..d5ec9f9b 100644
--- a/src/app_modules/colab/fun/get/pasrtisipan/get_list_partisipasi_proyek_by_author_id.ts
+++ b/src/app_modules/colab/fun/get/pasrtisipan/get_list_partisipasi_proyek_by_author_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export default async function colab_getListPartisipasiProyekByAuthorId({
diff --git a/src/app_modules/colab/fun/get/pasrtisipan/get_list_proyek_saya_by_author_id.ts b/src/app_modules/colab/fun/get/pasrtisipan/get_list_proyek_saya_by_author_id.ts
index 7b149e7e..a7fb14d8 100644
--- a/src/app_modules/colab/fun/get/pasrtisipan/get_list_proyek_saya_by_author_id.ts
+++ b/src/app_modules/colab/fun/get/pasrtisipan/get_list_proyek_saya_by_author_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export default async function colab_getListAllProyekSayaByAuthorId({
diff --git a/src/app_modules/colab/fun/get/room_chat/get_list_anggota_by_room_id.ts b/src/app_modules/colab/fun/get/room_chat/get_list_anggota_by_room_id.ts
index b9c54bf6..aedecbb6 100644
--- a/src/app_modules/colab/fun/get/room_chat/get_list_anggota_by_room_id.ts
+++ b/src/app_modules/colab/fun/get/room_chat/get_list_anggota_by_room_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function colab_getListAnggotaByRoomId(roomId: string) {
const get = await prisma.projectCollaboration_RoomChat.findFirst({
diff --git a/src/app_modules/colab/fun/get/room_chat/get_list_room_by_author_id.ts b/src/app_modules/colab/fun/get/room_chat/get_list_room_by_author_id.ts
index 56c8f6d6..c114827f 100644
--- a/src/app_modules/colab/fun/get/room_chat/get_list_room_by_author_id.ts
+++ b/src/app_modules/colab/fun/get/room_chat/get_list_room_by_author_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export default async function colab_getListRoomChatByAuthorId({
diff --git a/src/app_modules/colab/fun/get/room_chat/get_message_by_room_id.ts b/src/app_modules/colab/fun/get/room_chat/get_message_by_room_id.ts
index 4e27d8cd..f0bf7ed7 100644
--- a/src/app_modules/colab/fun/get/room_chat/get_message_by_room_id.ts
+++ b/src/app_modules/colab/fun/get/room_chat/get_message_by_room_id.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import prisma from "@/lib/prisma";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
import _ from "lodash";
import { revalidatePath } from "next/cache";
@@ -12,8 +12,8 @@ export default async function colab_getMessageByRoomId({
roomId: string;
page: number;
}) {
- const lewat = page * 6 - 6;
- const ambil = 6;
+ const ambil = 10;
+ const lewat = page * ambil - ambil;
const getList = await prisma.projectCollaboration_Message.findMany({
orderBy: {
diff --git a/src/app_modules/colab/fun/get/room_chat/get_one_message_by_id.ts b/src/app_modules/colab/fun/get/room_chat/get_one_message_by_id.ts
index 3b7d51fa..760f443b 100644
--- a/src/app_modules/colab/fun/get/room_chat/get_one_message_by_id.ts
+++ b/src/app_modules/colab/fun/get/room_chat/get_one_message_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function colab_getOneMessageById({
messageId,
diff --git a/src/app_modules/colab/fun/master/fun_get_master_industri.ts b/src/app_modules/colab/fun/master/fun_get_master_industri.ts
index fd3ab3db..5ee98a9f 100644
--- a/src/app_modules/colab/fun/master/fun_get_master_industri.ts
+++ b/src/app_modules/colab/fun/master/fun_get_master_industri.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function colab_funGetMasterIndustri() {
const data = await prisma.projectCollaborationMaster_Industri.findMany({});
diff --git a/src/app_modules/colab/fun/master/fun_get_master_status.ts b/src/app_modules/colab/fun/master/fun_get_master_status.ts
index 77f11720..a374242d 100644
--- a/src/app_modules/colab/fun/master/fun_get_master_status.ts
+++ b/src/app_modules/colab/fun/master/fun_get_master_status.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function colab_funGetMasterStatus() {
const data = await prisma.projectCollaborationMaster_Status.findMany({});
diff --git a/src/app_modules/colab/main/beranda.tsx b/src/app_modules/colab/main/beranda.tsx
index 9b6a7c3f..f64d74c2 100644
--- a/src/app_modules/colab/main/beranda.tsx
+++ b/src/app_modules/colab/main/beranda.tsx
@@ -1,30 +1,63 @@
"use client";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
+import { clientLogger } from "@/util/clientLogger";
import mqtt_client from "@/util/mqtt_client";
import { Box, Center, Loader } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
+import { apiGetAllCollaboration } from "../_lib/api_collaboration";
import { ComponentColab_ButtonUpdateBeranda } from "../component/button/button_update_beranda";
import { ComponentColab_CardBeranda } from "../component/card_view/card_beranda";
-import colab_getListAllProyek from "../fun/get/get_list_all_proyek";
+import { Collaboration_SkeletonBeranda } from "../component/skeleton_view";
import { MODEL_COLLABORATION } from "../model/interface";
-export default function Colab_Beranda({
- listData,
- userLoginId,
-}: {
- listData: MODEL_COLLABORATION[];
- userLoginId: string;
-}) {
- const [data, setData] = useState(listData);
+export default function Colab_Beranda() {
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
-
const [isNewPost, setIsNewPost] = useState(false);
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetAllCollaboration({
+ kategori: "beranda",
+ page: "1",
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get all collaboration", error);
+ }
+ }
+
+ useShallowEffect(() => {
+ handleGetUserLoginId();
+ }, []);
+
+ async function handleGetUserLoginId() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ } else {
+ setUserLoginId(null);
+ }
+ } catch (error) {
+ setUserLoginId(null);
+ }
+ }
useShallowEffect(() => {
mqtt_client.subscribe("Colab_create");
@@ -36,6 +69,10 @@ export default function Colab_Beranda({
});
}, []);
+ if (_.isNull(data)) {
+ return ;
+ }
+
return (
<>
@@ -55,28 +92,29 @@ export default function Colab_Beranda({
) : (
(
)}
data={data}
- setData={setData}
+ setData={setData as any}
moreData={async () => {
- const loadData = await colab_getListAllProyek({
- page: activePage + 1,
+ const respone = await apiGetAllCollaboration({
+ kategori: "beranda",
+ page: `${activePage + 1}`,
});
setActivePage((val) => val + 1);
- return loadData;
+ return respone.data;
}}
>
{(item) => (
)}
diff --git a/src/app_modules/colab/main/grup/index.tsx b/src/app_modules/colab/main/grup/index.tsx
index f7ccf26b..8efc722f 100644
--- a/src/app_modules/colab/main/grup/index.tsx
+++ b/src/app_modules/colab/main/grup/index.tsx
@@ -1,28 +1,51 @@
"use client";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import {
- Box,
- Center,
- Loader
-} from "@mantine/core";
+import { Box, Center, Loader, Skeleton, Stack } from "@mantine/core";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
import { ComponentColab_CardGrup } from "../../component/card_view/crad_grup";
import colab_getListRoomChatByAuthorId from "../../fun/get/room_chat/get_list_room_by_author_id";
+import { MODEL_COLLABORATION_ANGGOTA_ROOM_CHAT } from "../../model/interface";
+import { clientLogger } from "@/util/clientLogger";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetAllCollaboration } from "../../_lib/api_collaboration";
import {
- MODEL_COLLABORATION_ANGGOTA_ROOM_CHAT
-} from "../../model/interface";
+ Collaboration_SkeletonBeranda,
+ Collaboration_SkeletonGrup,
+} from "../../component/skeleton_view";
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
-export default function Colab_GrupDiskus({
- listRoom,
-}: {
- listRoom: MODEL_COLLABORATION_ANGGOTA_ROOM_CHAT[];
-}) {
- const [data, setData] = useState(listRoom);
+export default function Colab_GrupDiskus() {
+ const [data, setData] = useState<
+ MODEL_COLLABORATION_ANGGOTA_ROOM_CHAT[] | null
+ >(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetAllCollaboration({
+ kategori: "grup",
+ page: `${activePage}`,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get grup", error);
+ }
+ }
+
+ if (_.isNull(data)) {
+ return ;
+ }
+
return (
<>
@@ -31,22 +54,23 @@ export default function Colab_GrupDiskus({
) : (
(
)}
data={data}
- setData={setData}
+ setData={setData as any}
moreData={async () => {
- const loadData = await colab_getListRoomChatByAuthorId({
- page: activePage + 1,
+ const respone = await apiGetAllCollaboration({
+ kategori: "grup",
+ page: `${activePage + 1}`,
});
setActivePage((val) => val + 1);
- return loadData;
+ return respone.data;
}}
>
{(item) => }
diff --git a/src/app_modules/colab/main/layout.tsx b/src/app_modules/colab/main/layout.tsx
index 03b3cd7b..79fd8966 100644
--- a/src/app_modules/colab/main/layout.tsx
+++ b/src/app_modules/colab/main/layout.tsx
@@ -1,7 +1,7 @@
"use client";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
-import { RouterHome } from "@/app/lib/router_hipmi/router_home";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
+import { RouterHome } from "@/lib/router_hipmi/router_home";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
@@ -11,13 +11,14 @@ import { useAtom } from "jotai";
import { useRouter } from "next/navigation";
import React, { useState } from "react";
import { gs_colab_hot_menu } from "../global_state";
+import { Collaboration_ComponentNewFooter } from "../component/comp_new_footer_collaboration";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, { UI_NewHeader, UI_NewChildren, UI_NewFooter } from "@/app_modules/_global/ui/V2_layout_tamplate";
export default function LayoutColab_Main({
children,
- cekNotif,
}: {
children: React.ReactNode;
- cekNotif: boolean;
}) {
const router = useRouter();
const [hotMenu, setHotMenu] = useAtom(gs_colab_hot_menu);
@@ -46,7 +47,20 @@ export default function LayoutColab_Main({
return (
<>
-
+
+
+
+ {children}
+
+
+
+
+
+ {/* {
router.replace(e.path, { scroll: false });
setHotMenu(e.id);
@@ -69,7 +83,7 @@ export default function LayoutColab_Main({
{e.icon}
@@ -79,41 +93,10 @@ export default function LayoutColab_Main({
))}
- //
}
>
{children}
-
+ */}
>
);
}
diff --git a/src/app_modules/colab/main/proyek/index.tsx b/src/app_modules/colab/main/proyek/index.tsx
index 90babe4e..0e139a06 100644
--- a/src/app_modules/colab/main/proyek/index.tsx
+++ b/src/app_modules/colab/main/proyek/index.tsx
@@ -1,25 +1,17 @@
"use client";
+import {
+ AccentColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
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 { IconUser, IconUsersGroup } from "@tabler/icons-react";
import { useAtom } from "jotai";
import { gs_colab_proyek } from "../../global_state";
-import {
- MODEL_COLLABORATION,
- MODEL_COLLABORATION_PARTISIPASI,
-} from "../../model/interface";
-import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
+import Colab_PartisipasiProyek from "./partisipasi";
+import Colab_ProyekSaya from "./saya";
-export default function Colab_Proyek({
- listPartisipasiUser,
- listProyekSaya,
-}: {
- listPartisipasiUser: MODEL_COLLABORATION_PARTISIPASI[];
- listProyekSaya: MODEL_COLLABORATION[];
-}) {
+export default function Colab_Proyek() {
const [activeTab, setActiveTab] = useAtom(gs_colab_proyek);
const listTabs = [
@@ -28,18 +20,14 @@ export default function Colab_Proyek({
icon: ,
label: "Partisipasi Proyek",
value: "Partisipasi",
- path: (
-
- ),
+ path: ,
},
{
id: 2,
icon: ,
label: "Proyek Saya",
value: "Saya",
- path: ,
+ path: ,
},
];
@@ -64,15 +52,15 @@ export default function Colab_Proyek({
key={e.id}
value={e.value}
fw={"bold"}
- c={"black"}
style={{
transition: "0.5s",
+ color: activeTab === e.value ? MainColor.darkblue : MainColor.black,
backgroundColor:
- activeTab === e.value ? MainColor.yellow : "white",
+ activeTab === e.value ? MainColor.yellow : MainColor.white,
border:
activeTab === e.value
? `1px solid ${AccentColor.yellow}`
- : `1px solid white`,
+ : `1px solid ${MainColor.white}`,
}}
>
diff --git a/src/app_modules/colab/main/proyek/partisipasi.tsx b/src/app_modules/colab/main/proyek/partisipasi.tsx
index 0071cd2a..75a8a39f 100644
--- a/src/app_modules/colab/main/proyek/partisipasi.tsx
+++ b/src/app_modules/colab/main/proyek/partisipasi.tsx
@@ -1,46 +1,70 @@
"use client";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { clientLogger } from "@/util/clientLogger";
import { Box, Center, Loader } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
+import { apiGetAllCollaboration } from "../../_lib/api_collaboration";
import { ComponentColab_CardSemuaPartisipan } from "../../component/card_view/card_semua_partisipan";
-import colab_getListPartisipasiProyekByAuthorId from "../../fun/get/pasrtisipan/get_list_partisipasi_proyek_by_author_id";
+import { Collaboration_SkeletonBeranda } from "../../component/skeleton_view";
import { MODEL_COLLABORATION_PARTISIPASI } from "../../model/interface";
-export default function Colab_PartisipasiProyek({
- listPartisipasiUser,
-}: {
- listPartisipasiUser: MODEL_COLLABORATION_PARTISIPASI[];
-}) {
- const [data, setData] = useState(listPartisipasiUser);
+export default function Colab_PartisipasiProyek() {
+ const [data, setData] = useState(
+ null
+ );
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetAllCollaboration({
+ kategori: "partisipasi",
+ page: `${activePage}`,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get partisipasi", error);
+ }
+ }
+
+ if (_.isNull(data)) {
+ return ;
+ }
+
return (
<>
{_.isEmpty(data) ? (
) : (
- // --- Main component --- //
(
)}
data={data}
- setData={setData}
+ setData={setData as any}
moreData={async () => {
- const loadData = await colab_getListPartisipasiProyekByAuthorId({
- page: activePage + 1,
+ const respone = await apiGetAllCollaboration({
+ kategori: "partisipasi",
+ page: `${activePage + 1}`,
});
setActivePage((val) => val + 1);
- return loadData;
+ return respone.data;
}}
>
{(item) => (
diff --git a/src/app_modules/colab/main/proyek/saya.tsx b/src/app_modules/colab/main/proyek/saya.tsx
index 419e5f3a..4d5d2f69 100644
--- a/src/app_modules/colab/main/proyek/saya.tsx
+++ b/src/app_modules/colab/main/proyek/saya.tsx
@@ -1,46 +1,70 @@
"use client";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { clientLogger } from "@/util/clientLogger";
import { Box, Center, Loader } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
+import { apiGetAllCollaboration } from "../../_lib/api_collaboration";
import { ComponentColab_CardProyekSaya } from "../../component/card_view/card_proyek_saya";
-import colab_getListAllProyekSayaByAuthorId from "../../fun/get/pasrtisipan/get_list_proyek_saya_by_author_id";
+import { Collaboration_SkeletonBeranda } from "../../component/skeleton_view";
import { MODEL_COLLABORATION } from "../../model/interface";
-export default function Colab_ProyekSaya({
- listProyekSaya,
-}: {
- listProyekSaya: MODEL_COLLABORATION[];
-}) {
- const [data, setData] = useState(listProyekSaya);
+export default function Colab_ProyekSaya() {
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetAllCollaboration({
+ kategori: "proyeksaya",
+ page: `${activePage}`,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get proyeksaya", error);
+ }
+ }
+
+ if (_.isNull(data)) {
+ return ;
+ }
+
return (
<>
{_.isEmpty(data) ? (
) : (
// --- Main component --- //
-
+
(
)}
data={data}
- setData={setData}
+ setData={setData as any}
moreData={async () => {
- const loadData = await colab_getListAllProyekSayaByAuthorId({
- page: activePage + 1,
+ const respone = await apiGetAllCollaboration({
+ kategori: "proyeksaya",
+ page: `${activePage + 1}`,
});
+
setActivePage((val) => val + 1);
- return loadData;
+ return respone.data;
}}
>
{(item) => (
diff --git a/src/app_modules/colab/splash/index.tsx b/src/app_modules/colab/splash/index.tsx
index 48839abb..0d8ece33 100644
--- a/src/app_modules/colab/splash/index.tsx
+++ b/src/app_modules/colab/splash/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
import UIGlobal_SplashScreen from "@/app_modules/_global/ui/ui_splash";
import { useShallowEffect } from "@mantine/hooks";
import { IconAffiliate } from "@tabler/icons-react";
@@ -17,7 +17,7 @@ export default function Colab_Splash() {
setHotMenu(1);
// setStatus("Publish");
router.replace(RouterColab.beranda, {scroll: false});
- }, 1000);
+ }, 500);
}, []);
return (
diff --git a/src/app_modules/components/CustomSkeleton.tsx b/src/app_modules/components/CustomSkeleton.tsx
new file mode 100644
index 00000000..7d094445
--- /dev/null
+++ b/src/app_modules/components/CustomSkeleton.tsx
@@ -0,0 +1,34 @@
+import { Skeleton, SkeletonProps, createStyles } from '@mantine/core';
+
+interface CustomSkeletonProps extends SkeletonProps {
+ isLoading?: boolean;
+ className?: string;
+}
+
+const useStyles = createStyles((theme) => ({
+ skeleton: {
+ '&::before': {
+ backgroundColor: "#1F5B9E",
+ },
+ '&::after': {
+ backgroundColor: "#0F3055",
+ },
+ },
+}));
+
+const CustomSkeleton: React.FC = ({
+ isLoading = true,
+ className,
+ ...props
+}) => {
+ const { classes, cx } = useStyles();
+ return (
+
+ );
+};
+
+export default CustomSkeleton;
\ No newline at end of file
diff --git a/src/app_modules/crowd/main/layout.tsx b/src/app_modules/crowd/main/layout.tsx
index 3484fa77..84847bf3 100644
--- a/src/app_modules/crowd/main/layout.tsx
+++ b/src/app_modules/crowd/main/layout.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterHome } from "@/app/lib/router_hipmi/router_home";
+import { RouterHome } from "@/lib/router_hipmi/router_home";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import React from "react";
@@ -15,7 +15,7 @@ export default function LayoutMainCrowd({
}
diff --git a/src/app_modules/crowd/main/view.tsx b/src/app_modules/crowd/main/view.tsx
index dc93ff28..bc38a95a 100644
--- a/src/app_modules/crowd/main/view.tsx
+++ b/src/app_modules/crowd/main/view.tsx
@@ -1,12 +1,10 @@
"use client";
-import { RouterCrowd } from "@/app/lib/router_hipmi/router_crowd";
+import { RouterCrowd } from "@/lib/router_hipmi/router_crowd";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
-import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import { gs_donasi_hot_menu } from "@/app_modules/donasi/global_state";
import { gs_investas_menu } from "@/app_modules/investasi/g_state";
import { Grid, Image, Paper, Stack, Text, Title } from "@mantine/core";
@@ -21,26 +19,27 @@ export default function MainCrowd() {
const [donasiHotMenu, setDonasiHotMenu] = useAtom(gs_donasi_hot_menu);
const [loadingInv, setLoadingInv] = useState(false);
const [loadingDon, setLoadingDon] = useState(false);
+ const [isLoading, setLoading] = useState(true);
return (
<>
-
- {/*
-
-
- */}
-
-
+ setLoading(false)}
+ styles={{
+ imageWrapper: {
+ border: `2px solid ${AccentColor.blue}`,
+ borderRadius: "10px 10px 10px 10px",
+ },
+ image: {
+ borderRadius: "8px 8px 8px 8px",
+ },
+ }}
+ />
{/* INVESTASI */}
@@ -51,17 +50,11 @@ export default function MainCrowd() {
border: `2px solid ${AccentColor.blue}`,
borderRadius: "10px",
backgroundColor: MainColor.darkblue,
- color: "white",
- // color: "gray",
+ color: MainColor.white,
}}
onClick={() => {
- setLoadingInv(true);
- router.push(RouterCrowd.investasi);
+ router.push(RouterCrowd.investasi, { scroll: false });
setChangeColor(0);
- // ComponentGlobal_NotifikasiPeringatan(
- // "Sedang Perbaikan",
- // 3000
- // );
}}
>
@@ -74,11 +67,15 @@ export default function MainCrowd() {
- {loadingInv ? (
+ {/* PAKE LOADING */}
+ {/* {loadingInv ? (
) : (
- )}
+ )} */}
+
+ {/* GA PAKE LOADING */}
+
@@ -92,16 +89,11 @@ export default function MainCrowd() {
border: `2px solid ${AccentColor.blue}`,
borderRadius: "10px",
backgroundColor: MainColor.darkblue,
- color: "white",
+ color: MainColor.white,
}}
onClick={() => {
- setLoadingDon(true);
- router.push(RouterCrowd.donasi);
+ router.push(RouterCrowd.donasi, { scroll: false });
setDonasiHotMenu(0);
- // ComponentGlobal_NotifikasiPeringatan(
- // "Sementara ini sedang maintenance",
- // 3000
- // );
}}
>
@@ -114,11 +106,15 @@ export default function MainCrowd() {
- {loadingDon ? (
+ {/* PAKE LOADING */}
+ {/* {loadingDon ? (
) : (
- )}
+ )} */}
+
+ {/* GA PAKE LOADINGF */}
+
diff --git a/src/app_modules/crowd/splash/view.tsx b/src/app_modules/crowd/splash/view.tsx
index 65e4e84f..701368b1 100644
--- a/src/app_modules/crowd/splash/view.tsx
+++ b/src/app_modules/crowd/splash/view.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterCrowd } from "@/app/lib/router_hipmi/router_crowd";
+import { RouterCrowd } from "@/lib/router_hipmi/router_crowd";
import UIGlobal_SplashScreen from "@/app_modules/_global/ui/ui_splash";
import { useShallowEffect } from "@mantine/hooks";
import { IconHeartHandshake } from "@tabler/icons-react";
@@ -10,7 +10,7 @@ export default function SplashCrowd() {
const router = useRouter();
useShallowEffect(() => {
- setTimeout(() => router.push(RouterCrowd.main), 1000);
+ setTimeout(() => router.push(RouterCrowd.main), 500);
}, []);
return (
<>
diff --git a/src/app_modules/donasi/_ui/edit/ui_edit_kabar.tsx b/src/app_modules/donasi/_ui/edit/ui_edit_kabar.tsx
index 69428e7b..1f9fed0b 100644
--- a/src/app_modules/donasi/_ui/edit/ui_edit_kabar.tsx
+++ b/src/app_modules/donasi/_ui/edit/ui_edit_kabar.tsx
@@ -1,19 +1,23 @@
"use client";
-import {
- UIGlobal_LayoutHeaderTamplate,
- UIGlobal_LayoutTamplate,
-} from "@/app_modules/_global/ui";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { Donasi_ViewEditKabar } from "../../_view";
-export function Donasi_UiEditKabar({ dataKabar }: { dataKabar: any }) {
+export function Donasi_UiEditKabar() {
return (
<>
- }
- >
-
-
+
+
+
+
+
+
+
+
>
);
}
diff --git a/src/app_modules/donasi/_ui/kabar/ui_daftar_kabar.tsx b/src/app_modules/donasi/_ui/kabar/ui_daftar_kabar.tsx
index a7f053db..490e8420 100644
--- a/src/app_modules/donasi/_ui/kabar/ui_daftar_kabar.tsx
+++ b/src/app_modules/donasi/_ui/kabar/ui_daftar_kabar.tsx
@@ -4,25 +4,15 @@ import {
UIGlobal_LayoutHeaderTamplate,
UIGlobal_LayoutTamplate,
} from "@/app_modules/_global/ui";
-import React from "react";
import { Donasi_ViewDaftarKabar } from "../../_view";
-export function Donasi_UiDaftarKabar({
- dataDonasi,
- donasiId,
-}: {
- dataDonasi: string;
- donasiId: string;
-}) {
+export function Donasi_UiDaftarKabar() {
return (
<>
}
>
-
+
>
);
diff --git a/src/app_modules/donasi/_ui/kabar/ui_rekap_kabar.tsx b/src/app_modules/donasi/_ui/kabar/ui_rekap_kabar.tsx
index ba0bb542..790f7c32 100644
--- a/src/app_modules/donasi/_ui/kabar/ui_rekap_kabar.tsx
+++ b/src/app_modules/donasi/_ui/kabar/ui_rekap_kabar.tsx
@@ -1,37 +1,36 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import { UIGlobal_Drawer } from "@/app_modules/_global/ui";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { ActionIcon } from "@mantine/core";
import { IconCirclePlus, IconDotsVertical } from "@tabler/icons-react";
-import React, { useState } from "react";
+import { useState } from "react";
import { Donasi_ViewRekapKabar } from "../../_view";
+import { useParams } from "next/navigation";
-export function Donasi_UiRekapKabar({
- listKabar,
- donasiId,
-}: {
- listKabar: any[];
- donasiId: string;
-}) {
+export function Donasi_UiRekapKabar() {
+ const { id } = useParams();
const [openDrawer, setOpenDrawer] = useState(false);
const listPage = [
{
id: "1",
name: "Tambah Kabar",
icon: ,
- path: RouterDonasi.create_kabar + donasiId,
+ path: RouterDonasi.create_kabar + id,
},
];
return (
<>
-
+
+
}
/>
- }
- >
-
-
+
+
+
+
+
(null);
const [file, setFile] = useState(null);
const [img, setImg] = useState();
const [isLoading, setLoading] = useState(false);
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetDonasiKabarById({ id: id as string });
+ // console.log("res >", response)
+ if (response && response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data kabar", error);
+ }
+ }
+
async function onUpdate() {
- if (data.title === "" || data.deskripsi === "") {
+ if (data?.title === "" || data?.deskripsi === "") {
return ComponentGlobal_NotifikasiPeringatan("Lengkapi data");
}
@@ -59,25 +77,27 @@ export function Donasi_ViewEditKabar({
if (!uploadImage.success) {
setLoading(false);
- return ComponentGlobal_NotifikasiPeringatan(
- "Gagal upload file gambar"
- );
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload file gambar");
+ return;
}
const res = await donasi_funUpdateKabar({
- data: data,
+ data: data as MODEL_DONASI_KABAR,
fileId: uploadImage.data.id,
});
if (res.status === 200) {
setLoading(false);
- const deleteImage = await funGlobal_DeleteFileById({
- fileId: data.imageId,
- });
- if (!deleteImage.success) {
- setLoading(false);
- ComponentGlobal_NotifikasiPeringatan("Gagal hapus gambar lama");
+ if (data?.imageId !== null) {
+ const deleteImage = await funGlobal_DeleteFileById({
+ fileId: data?.imageId as string,
+ });
+
+ if (!deleteImage.success) {
+ setLoading(false);
+ clientLogger.error("Gagal hapus gambar lama");
+ }
}
ComponentGlobal_NotifikasiBerhasil(res.message);
@@ -88,11 +108,10 @@ export function Donasi_ViewEditKabar({
}
} else {
const res = await donasi_funUpdateKabar({
- data: data,
+ data: data as MODEL_DONASI_KABAR,
});
if (res.status === 200) {
- setLoading(false);
ComponentGlobal_NotifikasiBerhasil(res.message);
router.back();
} else {
@@ -101,135 +120,120 @@ export function Donasi_ViewEditKabar({
}
}
} catch (error) {
- console.log(error);
+ setLoading(false);
+ clientLogger.error("Error update donasi", error);
+ } finally {
+ setLoading(false);
}
}
+ if (!data) return ;
+
return (
<>
-
+ {isLoading ? (
+
+ ) : (
+ <>
+
- {
- setData({
- ...data,
- title: _.startCase(val.target.value),
- });
- }}
- />
- {
- setData({
- ...data,
- deskripsi: val.target.value,
- });
- }}
- />
-
-
-
-
- {img ? (
-
-
-
- ) : data.imageId === null ? (
-
-
-
- Upload Gambar
-
-
- ) : (
-
-
-
- )}
-
-
- {/* Upload Foto */}
-
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
- setImg(buffer);
- setFile(files);
- } catch (error) {
- console.log(error);
- }
+
- {(props) => (
- }
- radius={50}
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload Gambar
-
- )}
-
-
-
+ label="Judul"
+ withAsterisk
+ placeholder="Masukan judul kabar"
+ value={data.title}
+ onChange={(val) => {
+ setData({
+ ...data,
+ title: val.target.value,
+ });
+ }}
+ />
+ {
+ setData({
+ ...data,
+ deskripsi: val.target.value,
+ });
+ }}
+ />
+
- onUpdate()}
- >
- Simpan
-
+
+
+ {img ? (
+
+
+
+ ) : data.imageId === null ? (
+
+
+
+ ) : (
+
+
+
+ )}
+
+
+ {/* Upload Foto */}
+
+
+
+
+
+ onUpdate()}
+ >
+ Simpan
+
+ >
+ )}
>
);
diff --git a/src/app_modules/donasi/_view/kabar/view_daftar_kabar.tsx b/src/app_modules/donasi/_view/kabar/view_daftar_kabar.tsx
index dc0785ff..afe56c9a 100644
--- a/src/app_modules/donasi/_view/kabar/view_daftar_kabar.tsx
+++ b/src/app_modules/donasi/_view/kabar/view_daftar_kabar.tsx
@@ -1,17 +1,59 @@
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { Box, Center } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
+import { useParams } from "next/navigation";
import { useState } from "react";
import ComponentDonasi_ListKabar from "../../component/card_view/ui_card_kabar";
-import { donasi_funGetListKabarById } from "../../fun/get/get_list_kabar";
+import { apiGetDonasiListKabarById } from "../../lib/api_donasi";
-export function Donasi_ViewDaftarKabar({ dataDonasi ,donasiId}: { dataDonasi: any[], donasiId: string }) {
- const [data, setData] = useState(dataDonasi);
+export function Donasi_ViewDaftarKabar() {
+ const { id } = useParams();
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetDonasiListKabarById({
+ id: id as string,
+ page: activePage,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+
+ async function onMoreData() {
+ try {
+ const nextPage = activePage + 1;
+ setActivePage(nextPage);
+ const response = await apiGetDonasiListKabarById({
+ id: id as string,
+ page: nextPage,
+ });
+
+ if (response.success) {
+ return response.data;
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+
+ if (!data) return ;
+
return (
<>
{_.isEmpty(data) ? (
@@ -19,24 +61,15 @@ export function Donasi_ViewDaftarKabar({ dataDonasi ,donasiId}: { dataDonasi: an
) : (
(
)}
data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await donasi_funGetListKabarById({
- page: activePage + 1,
- donasiId: donasiId,
- });
-
- setActivePage((val) => val + 1);
-
- return loadData;
- }}
+ setData={setData as any}
+ moreData={onMoreData}
>
{(item) => (
(null);
const [activePage, setActivePage] = useState(1);
- const [isLoading, setIsLoading] = useState(false);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetDonasiListKabarById({
+ id: id as string,
+ page: activePage,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+
+ async function onMoreData() {
+ try {
+ const nextPage = activePage + 1;
+ setActivePage(nextPage);
+ const response = await apiGetDonasiListKabarById({
+ id: id as string,
+ page: nextPage,
+ });
+
+ if (response.success) {
+ return response.data;
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+
+ if (!data) return ;
return (
<>
@@ -39,17 +72,8 @@ export function Donasi_ViewRekapKabar({
)}
data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await donasi_funGetListKabarById({
- page: activePage + 1,
- donasiId: donasiId,
- });
-
- setActivePage((val) => val + 1);
-
- return loadData;
- }}
+ setData={setData as any}
+ moreData={onMoreData}
>
{(item) => (
{
setOpenModal(true);
}}
@@ -73,12 +84,13 @@ export function Donasi_ComponentButtonDeleteDonasiById({
opened={openModal}
close={() => setOpenModal(false)}
buttonKiri={
- setOpenModal(false)}>
+ setOpenModal(false)}>
Batal
}
buttonKanan={
- onDelete()}>
+ onDelete()}>
Hapus
}
diff --git a/src/app_modules/donasi/component/card_view/box_informasi_pencarian_dana.tsx b/src/app_modules/donasi/component/card_view/box_informasi_pencarian_dana.tsx
index 55ef5371..39384152 100644
--- a/src/app_modules/donasi/component/card_view/box_informasi_pencarian_dana.tsx
+++ b/src/app_modules/donasi/component/card_view/box_informasi_pencarian_dana.tsx
@@ -4,27 +4,59 @@ import _ from "lodash";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { ScrollOnly } from "next-scroll-loader";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import { donasi_funGetListPencairanDanaById } from "../../fun/get/get_list_pencairan_dana_by_id";
import { MODEL_DONASI_PENCAIRAN_DANA } from "../../model/interface";
-import { ComponentDonasi_CardDonatur } from "./ui_card_donatur";
import { ComponentDonasi_CardPencairanDana } from "./card_pencairan_dana";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetDonasiPencairanDanaById } from "../../lib/api_donasi";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export function ComponentDonasi_InformasiPencairanDana({
- donasiId,
- listPD,
-}: {
- donasiId: string;
- listPD: MODEL_DONASI_PENCAIRAN_DANA[];
-}) {
- const router = useRouter();
- const [data, setData] = useState(listPD);
+export function ComponentDonasi_InformasiPencairanDana() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoadData();
+ }, [param.id]);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetDonasiPencairanDanaById({
+ id: param.id,
+ page: activePage,
+ });
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+
+ const onLoadMoreData = async () => {
+ try {
+ const nextPage = activePage + 1;
+ setActivePage(nextPage);
+ const response = await apiGetDonasiPencairanDanaById({
+ id: param.id,
+ page: nextPage,
+ });
+ if (response.success) {
+ return response.data;
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ };
+
+ if (!data) return ;
+
return (
<>
- {_.isEmpty(listPD) ? (
+ {_.isEmpty(data) ? (
) : (
@@ -36,17 +68,8 @@ export function ComponentDonasi_InformasiPencairanDana({
)}
data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await donasi_funGetListPencairanDanaById({
- page: activePage + 1,
- donasiId: donasiId,
- });
-
- setActivePage((val) => val + 1);
-
- return loadData;
- }}
+ setData={setData as any}
+ moreData={onLoadMoreData}
>
{(item) => }
diff --git a/src/app_modules/donasi/component/card_view/box_pencairan_dana.tsx b/src/app_modules/donasi/component/card_view/box_pencairan_dana.tsx
index 5705e1c7..4e857987 100644
--- a/src/app_modules/donasi/component/card_view/box_pencairan_dana.tsx
+++ b/src/app_modules/donasi/component/card_view/box_pencairan_dana.tsx
@@ -3,8 +3,40 @@ import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_
import { Paper, Stack, Grid, Title, Text } from "@mantine/core";
import { MODEL_DONASI } from "../../model/interface";
import TampilanRupiahDonasi from "../tampilan_rupiah";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { apiGetOneDonasiById } from "../../lib/api_donasi";
-export function ComponentDonasi_BoxPencariranDana({ akumulasi }: { akumulasi: MODEL_DONASI }) {
+export function ComponentDonasi_BoxPencariranDana() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [loading, setLoading] = useState(true);
+
+ useShallowEffect(() => {
+ getData();
+ }, []);
+
+ async function getData() {
+ try {
+ setLoading(true);
+ const response = await apiGetOneDonasiById(param.id, "semua");
+
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ if (loading || !data) {
+ return ;
+ }
+
return (
<>
-
+
Dana sudah dicairkan
- {akumulasi.akumulasiPencairan} kali
+ {data.akumulasiPencairan} kali
Pencairan dana
diff --git a/src/app_modules/donasi/component/card_view/card_invoice.tsx b/src/app_modules/donasi/component/card_view/card_invoice.tsx
index 8aa249e2..06333010 100644
--- a/src/app_modules/donasi/component/card_view/card_invoice.tsx
+++ b/src/app_modules/donasi/component/card_view/card_invoice.tsx
@@ -1,4 +1,4 @@
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import {
ComponentGlobal_CardLoadingOverlay,
diff --git a/src/app_modules/donasi/component/card_view/card_invoice_new.tsx b/src/app_modules/donasi/component/card_view/card_invoice_new.tsx
new file mode 100644
index 00000000..c1b888d9
--- /dev/null
+++ b/src/app_modules/donasi/component/card_view/card_invoice_new.tsx
@@ -0,0 +1,83 @@
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_LoadImageCustom } from "@/app_modules/_global/component";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import { Badge, Card, Grid, Group, Progress, Stack, Text } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { IDataAllDonasiSaya } from "../../lib/type_donasi";
+import ComponentDonasi_TampilanHitungMundur from "../tampilan_hitung_mundur";
+import TampilanRupiahDonasi from "../tampilan_rupiah";
+
+export function ComponentDonasi_CardInvoiceNew({ data, }: { data: IDataAllDonasiSaya; }) {
+ const router = useRouter();
+
+ async function onCekInvoice() {
+ if (data.donasiMaster_StatusInvoiceId === "1") {
+ return router.push(RouterDonasi.detail_donasi_saya + `${data?.id}`);
+ } else {
+ if (data.donasiMaster_StatusInvoiceId === "2") {
+ return router.push(RouterDonasi.proses_transaksi + `${data?.id}`);
+ } else {
+ if (data.donasiMaster_StatusInvoiceId === "3") {
+ return router.push(RouterDonasi.invoice + `${data?.id}`);
+ } else {
+ ComponentGlobal_NotifikasiGagal("Gagal Melihat Invoice");
+ }
+ }
+ }
+ }
+
+ return (
+ <>
+ onCekInvoice()}
+ >
+
+
+
+
+
+
+ {data.title}
+
+
+
+
+
+
+ Donasi Saya
+
+
+
+
+
+
+ {data.nameStatusInvoice}
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/donasi/component/card_view/card_pencairan_dana.tsx b/src/app_modules/donasi/component/card_view/card_pencairan_dana.tsx
index f6d7ae97..2bcc7104 100644
--- a/src/app_modules/donasi/component/card_view/card_pencairan_dana.tsx
+++ b/src/app_modules/donasi/component/card_view/card_pencairan_dana.tsx
@@ -1,20 +1,10 @@
-import {
- AccentColor,
- MainColor,
-} from "@/app_modules/_global/color/color_pallet";
-import {
- Button,
- Center,
- Paper,
- Spoiler,
- Stack,
- Text,
- Title,
-} from "@mantine/core";
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import { Button, Center, Spoiler, Stack, Text, Title } from "@mantine/core";
import { IconImageInPicture } from "@tabler/icons-react";
import moment from "moment";
-import { RouterImagePreview } from "@/app/lib";
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import { RouterImagePreview } from "@/lib";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { MODEL_DONASI_PENCAIRAN_DANA } from "../../model/interface";
@@ -29,15 +19,7 @@ export function ComponentDonasi_CardPencairanDana({
return (
<>
-
+
{moment(data.createdAt).format("ll")}
{data.title}
@@ -68,7 +50,7 @@ export function ComponentDonasi_CardPencairanDana({
-
+
>
);
}
diff --git a/src/app_modules/donasi/component/card_view/card_publish_new.tsx b/src/app_modules/donasi/component/card_view/card_publish_new.tsx
new file mode 100644
index 00000000..275d0080
--- /dev/null
+++ b/src/app_modules/donasi/component/card_view/card_publish_new.tsx
@@ -0,0 +1,54 @@
+"use client";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import { ComponentGlobal_CardStyles, ComponentGlobal_LoadImageCustom } from "@/app_modules/_global/component";
+import { Grid, Progress, Stack, Text } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import ComponentDonasi_TampilanHitungMundur from "../tampilan_hitung_mundur";
+import TampilanRupiahDonasi from "../tampilan_rupiah";
+import { MainColor } from "@/app_modules/_global/color";
+
+export default function ComponentDonasi_CardPublishNew({ data }: { data: any; }) {
+ const router = useRouter();
+
+ return (
+ <>
+ {
+ router.push(RouterDonasi.detail_main + `${data.id}`)
+ }}
+ >
+
+
+
+
+
+
+
+
+
+ {data.title}
+
+
+
+
+
+ Terkumpul
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/donasi/component/card_view/card_status.tsx b/src/app_modules/donasi/component/card_view/card_status.tsx
index f19b165f..99a5d007 100644
--- a/src/app_modules/donasi/component/card_view/card_status.tsx
+++ b/src/app_modules/donasi/component/card_view/card_status.tsx
@@ -1,4 +1,4 @@
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import {
ComponentGlobal_CardLoadingOverlay,
diff --git a/src/app_modules/donasi/component/card_view/card_status_new.tsx b/src/app_modules/donasi/component/card_view/card_status_new.tsx
new file mode 100644
index 00000000..821ca4a3
--- /dev/null
+++ b/src/app_modules/donasi/component/card_view/card_status_new.tsx
@@ -0,0 +1,53 @@
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import { ComponentGlobal_CardStyles, ComponentGlobal_LoadImageCustom } from "@/app_modules/_global/component";
+import { Grid, Stack, Text } from "@mantine/core";
+import { useParams, useRouter } from "next/navigation";
+import { IDataAllDonasi } from "../../lib/type_donasi";
+
+export function ComponentDonasi_CardStatusNew({ data }: { data: IDataAllDonasi; }) {
+ const router = useRouter();
+ const param = useParams<{ id: string }>();
+
+ function goToDetail() {
+ if (param.id == "2") {
+ router.push(RouterDonasi.detail_review + `${data.id}`);
+ } else if (param.id == "3") {
+ router.push(RouterDonasi.detail_draft + `${data.id}`);
+ } else if (param.id == "4") {
+ router.push(RouterDonasi.detail_reject + `${data.id}`);
+ }
+ }
+
+ return (
+ <>
+ { goToDetail() }} >
+
+
+
+
+
+
+
+
+ {data.title}
+
+
+ Target Dana
+
+ Rp.{" "}
+ {new Intl.NumberFormat("id-ID", {
+ maximumFractionDigits: 10,
+ }).format(+data.target)}
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/donasi/component/card_view/ui_card_donatur.tsx b/src/app_modules/donasi/component/card_view/ui_card_donatur.tsx
index 173d0f87..df3271ff 100644
--- a/src/app_modules/donasi/component/card_view/ui_card_donatur.tsx
+++ b/src/app_modules/donasi/component/card_view/ui_card_donatur.tsx
@@ -3,6 +3,8 @@ import { Paper, Grid, Center, Stack, Title, Group, Text } from "@mantine/core";
import { IconMoodSmileBeam } from "@tabler/icons-react";
import { MODEL_DONASI_INVOICE } from "../../model/interface";
import TampilanRupiahDonasi from "../tampilan_rupiah";
+import moment from "moment";
+import "moment/locale/id";
export function ComponentDonasi_CardDonatur({ data }: { data: MODEL_DONASI_INVOICE }){
return (
@@ -35,9 +37,7 @@ export function ComponentDonasi_CardDonatur({ data }: { data: MODEL_DONASI_INVOI
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "full",
- }).format(data?.createdAt)}
+ {moment(data.createdAt).format("DD MMM YYYY")}
diff --git a/src/app_modules/donasi/component/card_view/ui_card_kabar.tsx b/src/app_modules/donasi/component/card_view/ui_card_kabar.tsx
index 35813e46..ec8f98b4 100644
--- a/src/app_modules/donasi/component/card_view/ui_card_kabar.tsx
+++ b/src/app_modules/donasi/component/card_view/ui_card_kabar.tsx
@@ -1,15 +1,15 @@
"use client";
import { Stack, Text, Title } from "@mantine/core";
-
import {
ComponentGlobal_CardLoadingOverlay,
ComponentGlobal_CardStyles,
} from "@/app_modules/_global/component";
+import moment from "moment";
+import "moment/locale/id";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { MODEL_DONASI_KABAR } from "../../model/interface";
-
export default function ComponentDonasi_ListKabar({
kabar,
route,
@@ -28,11 +28,7 @@ export default function ComponentDonasi_ListKabar({
}}
>
-
- {new Intl.DateTimeFormat("id-ID", { dateStyle: "medium" }).format(
- kabar.createdAt
- )}
-
+ {moment(kabar.createdAt).format("DD-MM-YYYY")}
{kabar.title}
{visible && }
diff --git a/src/app_modules/donasi/component/detail_main/cerita_penggalang.tsx b/src/app_modules/donasi/component/detail_main/cerita_penggalang.tsx
index 9aeadcc9..ecd25637 100644
--- a/src/app_modules/donasi/component/detail_main/cerita_penggalang.tsx
+++ b/src/app_modules/donasi/component/detail_main/cerita_penggalang.tsx
@@ -2,16 +2,27 @@
import { useRouter } from "next/navigation";
import { MODEL_DONASI } from "../../model/interface";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
-import { Stack, Title, Paper, Group, ActionIcon, Text } from "@mantine/core";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import {
+ Stack,
+ Title,
+ Paper,
+ Group,
+ ActionIcon,
+ Text,
+ Box,
+} from "@mantine/core";
import { IconCircleChevronRight } from "@tabler/icons-react";
-import moment from "moment";
import { useState } from "react";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { Comp_V3_SetInnerHTMLWithStiker } from "@/app_modules/_global/component/new/comp_V3_set_html_with_stiker";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+import moment from "moment";
+import "moment/locale/id";
export default function ComponentDonasi_CeritaPenggalangMain({
donasi,
@@ -25,7 +36,7 @@ export default function ComponentDonasi_CeritaPenggalangMain({
Cerita Penggalang Dana
@@ -35,15 +46,13 @@ export default function ComponentDonasi_CeritaPenggalangMain({
backgroundColor: AccentColor.darkblue,
border: `2px solid ${AccentColor.blue}`,
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
}}
>
- {new Intl.DateTimeFormat("id-ID", { dateStyle: "full" }).format(
- donasi?.createdAt
- )}
+ {moment(donasi?.createdAt).format("DD MMM YYYY")}
- {donasi?.CeritaDonasi.cerita}
+
+ {funReplaceHtml({ html: donasi?.CeritaDonasi.cerita })}
+
{/* Baca selengkapnya */}
diff --git a/src/app_modules/donasi/component/detail_main/cerita_penggalang_new.tsx b/src/app_modules/donasi/component/detail_main/cerita_penggalang_new.tsx
new file mode 100644
index 00000000..dced3d2e
--- /dev/null
+++ b/src/app_modules/donasi/component/detail_main/cerita_penggalang_new.tsx
@@ -0,0 +1,94 @@
+"use client";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import { AccentColor, MainColor, } from "@/app_modules/_global/color/color_pallet";
+import { ActionIcon, Group, Paper, Stack, Text, Title } from "@mantine/core";
+import { IconCircleChevronRight } from "@tabler/icons-react";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import { apiGetOneDonasiById } from "../../lib/api_donasi";
+import { useShallowEffect } from "@mantine/hooks";
+import SkeletonCeritaPenggalangDonasi from "./skeleton_cerita_penggalang";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+
+export default function ComponentDonasi_CeritaPenggalangMainNew() {
+ const router = useRouter();
+ const param = useParams<{ id: string }>();
+ const [loading, setLoading] = useState(true)
+ const [donasi, setDonasi] = useState({})
+
+
+ async function getCeritaDonasi() {
+ try {
+ setLoading(true)
+ const response = await apiGetOneDonasiById(param.id, "cerita")
+ if (response.success) {
+ setDonasi(response.data)
+ }else{
+
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false)
+ }
+ }
+
+
+ useShallowEffect(() => {
+ getCeritaDonasi()
+ }, [])
+
+
+ return (
+ <>
+
+ Cerita Penggalang Dana
+
+ {loading ? (
+
+ ) : (
+
+
+
+ {new Intl.DateTimeFormat("id-ID", {
+ dateStyle: "full",
+ }).format(new Date(donasi?.createdAt))}
+
+ {
+ router.push(
+ RouterDonasi.cerita_penggalang + `${donasi?.id}`
+ );
+ }}
+ >
+
+
+
+
+ {funReplaceHtml({ html: donasi?.CeritaDonasi.cerita })}
+
+
+ )}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/donasi/component/detail_main/detail_dana_donasi_new.tsx b/src/app_modules/donasi/component/detail_main/detail_dana_donasi_new.tsx
new file mode 100644
index 00000000..7c9c3431
--- /dev/null
+++ b/src/app_modules/donasi/component/detail_main/detail_dana_donasi_new.tsx
@@ -0,0 +1,175 @@
+"use client";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_CardStyles, ComponentGlobal_LoadImageLandscape, } from "@/app_modules/_global/component";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { Divider, Grid, Group, Progress, Stack, Text, Title, } from "@mantine/core";
+import { IconClover, IconMessageChatbot, IconMoneybag, } from "@tabler/icons-react";
+import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
+import { useParams, useRouter } from "next/navigation";
+import { Donasi_findDonaturByTokenId } from "../../fun/get/get_donatur_by_token_id";
+import { MODEL_DONASI } from "../../model/interface";
+import ComponentDonasi_TampilanHitungMundur from "../tampilan_hitung_mundur";
+import TampilanRupiahDonasi from "../tampilan_rupiah";
+import { useState } from "react";
+import { apiGetOneDonasiById } from "../../lib/api_donasi";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import { useShallowEffect } from "@mantine/hooks";
+import SkeletonDetailDanaDonasi from "./skeleton_detail_dana_donasi";
+
+export function ComponentDonasi_DetailDataMainNew() {
+ const router = useRouter();
+ const param = useParams<{ id: string }>();
+ const [loading, setLoading] = useState(true);
+ const [donasi, setDonasi] = useState();
+ const [countDonatur, setcountDonatur] = useState(0);
+ const [userLoginId, setuserLoginId] = useState("");
+
+ async function getData() {
+ try {
+ setLoading(true)
+ const response = await apiGetOneDonasiById(param.id, "semua")
+ const response1 = await apiGetOneDonasiById(param.id, "count")
+ const response2 = await funGetUserIdByToken()
+ if (response.success) {
+ setDonasi(response.data)
+ setcountDonatur(response1.data)
+ setuserLoginId(response2)
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false)
+ }
+ }
+
+ useShallowEffect(() => {
+ getData()
+ }, [])
+
+ return (
+ <>
+
+ {
+ loading ?
+ :
+
+
+
+ {donasi?.title}
+
+
+
+
+
+ Dana terkumpul
+
+
+
+
+ Dari target{" "}
+
+
+
+
+ Kategori
+
+ {donasi?.DonasiMaster_Ketegori.name}
+
+
+
+
+
+
+
+ {
+ router.push(RouterDonasi.donatur + `${donasi.id}`);
+ }}
+ >
+
+
+
+ {countDonatur}
+
+
+ Donatur
+
+
+
+
+ {
+ router.push(RouterDonasi.daftar_kabar({ id: donasi.id }), {
+ scroll: false,
+ });
+ }}
+ >
+
+
+ Kabar Terbaru
+
+
+
+ {
+ onPencairanDana(
+ router,
+ donasi,
+ userLoginId,
+ );
+ }}
+ >
+
+
+ Pencairan Dana
+
+
+
+
+ }
+
+ >
+ );
+}
+
+async function onPencairanDana(router: AppRouterInstance, donasi: MODEL_DONASI, userLoginId: string,) {
+ const cek = await Donasi_findDonaturByTokenId(donasi.id, userLoginId);
+ if (userLoginId == donasi.authorId) {
+ return router.push(RouterDonasi.pencairan_dana + `${donasi.id}`);
+ }
+
+ if (!cek) {
+ return ComponentGlobal_NotifikasiPeringatan("Halaman khusus donatur");
+ } else {
+ router.push(RouterDonasi.pencairan_dana + `${donasi.id}`);
+ }
+}
diff --git a/src/app_modules/donasi/component/detail_main/detail_data_donasi.tsx b/src/app_modules/donasi/component/detail_main/detail_data_donasi.tsx
index 76fb5824..7f53bd45 100644
--- a/src/app_modules/donasi/component/detail_main/detail_data_donasi.tsx
+++ b/src/app_modules/donasi/component/detail_main/detail_data_donasi.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import {
ComponentGlobal_CardStyles,
diff --git a/src/app_modules/donasi/component/detail_main/informasi_penggalang.tsx b/src/app_modules/donasi/component/detail_main/informasi_penggalang.tsx
index a88706aa..c0f92507 100644
--- a/src/app_modules/donasi/component/detail_main/informasi_penggalang.tsx
+++ b/src/app_modules/donasi/component/detail_main/informasi_penggalang.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { MODEL_USER } from "@/app_modules/home/model/interface";
import {
Stack,
diff --git a/src/app_modules/donasi/component/detail_main/informasi_penggalang_new.tsx b/src/app_modules/donasi/component/detail_main/informasi_penggalang_new.tsx
new file mode 100644
index 00000000..6fc07ccc
--- /dev/null
+++ b/src/app_modules/donasi/component/detail_main/informasi_penggalang_new.tsx
@@ -0,0 +1,98 @@
+"use client";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import { AccentColor, MainColor, } from "@/app_modules/_global/color/color_pallet";
+import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { ActionIcon, Avatar, Group, Paper, Stack, Text, Title } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconCircleChevronRight } from "@tabler/icons-react";
+import _ from "lodash";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import { apiGetOneDonasiById } from "../../lib/api_donasi";
+
+export default function ComponentDonasi_InformasiPenggalangMainNew() {
+ const router = useRouter();
+ const param = useParams<{ id: string }>();
+ const [loading, setLoading] = useState(true);
+ const [data, setData] = useState({})
+
+
+ async function getDataAuthor() {
+ try {
+ setLoading(true)
+ const response = await apiGetOneDonasiById(param.id, "author")
+ if (response.success) {
+ setData(response.data)
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false)
+ }
+ }
+
+ useShallowEffect(() => {
+ getDataAuthor()
+ }, [])
+
+ return (
+ <>
+
+ Informasi Penggalang Dana
+
+ {
+ loading ?
+ :
+
+
+ Penggalang Dana
+ {
+ router.push(RouterDonasi.penggalang_dana + `${data.authorId}`);
+ }}
+ >
+
+
+
+
+
+ {(() => {
+ const usr = data?.Author?.username;
+ const splt = usr?.split("");
+ const Up = _.upperCase(splt[0])
+
+ return Up;
+ })()}
+
+ {data?.Author?.username}
+
+
+
+ }
+
+
+ >
+ );
+}
diff --git a/src/app_modules/donasi/component/detail_main/skeleton_cerita_penggalang.tsx b/src/app_modules/donasi/component/detail_main/skeleton_cerita_penggalang.tsx
new file mode 100644
index 00000000..ffb25e4a
--- /dev/null
+++ b/src/app_modules/donasi/component/detail_main/skeleton_cerita_penggalang.tsx
@@ -0,0 +1,15 @@
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Box } from "@mantine/core";
+
+export default function SkeletonCeritaPenggalangDonasi() {
+ return (
+ <>
+
+
+
+
+
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/donasi/component/detail_main/skeleton_detail_dana_donasi.tsx b/src/app_modules/donasi/component/detail_main/skeleton_detail_dana_donasi.tsx
new file mode 100644
index 00000000..ea512c2a
--- /dev/null
+++ b/src/app_modules/donasi/component/detail_main/skeleton_detail_dana_donasi.tsx
@@ -0,0 +1,22 @@
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Box } from "@mantine/core";
+
+export default function SkeletonDetailDanaDonasi() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/donasi/component/footer_button_donasi.tsx b/src/app_modules/donasi/component/footer_button_donasi.tsx
index 597d278f..52b43006 100644
--- a/src/app_modules/donasi/component/footer_button_donasi.tsx
+++ b/src/app_modules/donasi/component/footer_button_donasi.tsx
@@ -1,5 +1,5 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { Footer, Center, Button } from "@mantine/core";
import { useAtom } from "jotai";
import { useRouter } from "next/navigation";
@@ -28,13 +28,19 @@ export default function ButtonDonasi({ donasiId }: { donasiId: string }) {
-
+
{
@@ -287,7 +365,14 @@ export default function CreateCeritaPenggalangDonasi({
style={{
transition: "0.5s",
}}
- disabled={_.values(data).includes("") || file === null ? true : false}
+ disabled={
+ _.values(data).includes("") ||
+ file === null ||
+ funReplaceHtml({ html: data.pembukaan }).length > maxInputLength ||
+ funReplaceHtml({ html: data.pembukaan }).length === 0 ||
+ funReplaceHtml({ html: data.cerita }).length > maxInputLength ||
+ funReplaceHtml({ html: data.cerita }).length === 0
+ }
loaderPosition="center"
loading={isLoading ? true : false}
w={"100%"}
diff --git a/src/app_modules/donasi/create/create_donasi.tsx b/src/app_modules/donasi/create/create_donasi.tsx
index cdfb7acd..cf640a17 100644
--- a/src/app_modules/donasi/create/create_donasi.tsx
+++ b/src/app_modules/donasi/create/create_donasi.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import {
AspectRatio,
Button,
@@ -16,7 +16,7 @@ import { IconCamera, IconUpload } from "@tabler/icons-react";
import { useAtom } from "jotai";
import { useRouter } from "next/navigation";
-import { DIRECTORY_ID } from "@/app/lib";
+import { DIRECTORY_ID } from "@/lib";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_BoxUploadImage } from "@/app_modules/_global/component";
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
diff --git a/src/app_modules/donasi/create/create_donasi_new.tsx b/src/app_modules/donasi/create/create_donasi_new.tsx
new file mode 100644
index 00000000..e0495585
--- /dev/null
+++ b/src/app_modules/donasi/create/create_donasi_new.tsx
@@ -0,0 +1,318 @@
+"use client";
+import { DIRECTORY_ID } from "@/lib";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import {
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
+} from "@/app_modules/_global/component";
+import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
+import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import {
+ AspectRatio,
+ Button,
+ Center,
+ Image,
+ Select,
+ Stack,
+ Text,
+ TextInput,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconPhoto } from "@tabler/icons-react";
+import { useAtom } from "jotai";
+import _ from "lodash";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import Donasi_funCreateTemporary from "../fun/create/fun_create_donasi_temporary";
+import { gs_donasi_tabs_posting } from "../global_state";
+import { apiGetMasterDonasi } from "../lib/api_donasi";
+import { clientLogger } from "@/util/clientLogger";
+
+export default function CreateDonasiNew() {
+ const router = useRouter();
+ const [loadingMaster, setLoadingMaster] = useState(true);
+ const [isLoading, setLoading] = useState(false);
+ const [kategori, setKategori] = useState([]);
+ const [durasi, setDurasi] = useState([]);
+ const [data, setData] = useState({
+ kategoriId: "",
+ title: "",
+ target: "",
+ durasiId: "",
+ });
+ const [targetDana, setTargetDana] = useState("");
+ const [file, setFile] = useState(null);
+ const [img, setImg] = useState();
+ const [tabsPostingDonasi, setTabsPostingDonasi] = useAtom(
+ gs_donasi_tabs_posting
+ );
+
+ async function onGetMaster() {
+ try {
+ setLoadingMaster(true);
+ const responseKategori = await apiGetMasterDonasi("?cat=kategori");
+ const responseDurasi = await apiGetMasterDonasi("?cat=durasi");
+ if (responseKategori.success) {
+ setKategori(responseKategori.data);
+ }
+ if (responseDurasi.success) {
+ setDurasi(responseDurasi.data);
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setLoadingMaster(false);
+ }
+ }
+
+ useShallowEffect(() => {
+ onGetMaster();
+ }, []);
+
+ async function onCreate() {
+ const body = {
+ donasiMaster_KategoriId: data.kategoriId,
+ donasiMaster_DurasiId: data.durasiId,
+ title: data.title,
+ target: targetDana,
+ };
+
+ if (_.values(body).includes(""))
+ return ComponentGlobal_NotifikasiPeringatan("Lengkapin Data");
+
+ try {
+ setLoading(true);
+ const uploadImage = await funGlobal_UploadToStorage({
+ file: file as File,
+ dirId: DIRECTORY_ID.donasi_image,
+ });
+
+ if (!uploadImage.success) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload file gambar");
+ return;
+ }
+
+ const res = await Donasi_funCreateTemporary({
+ data: body as any,
+ fileId: uploadImage.data.id,
+ });
+
+ if (res.status === 201) {
+ setTabsPostingDonasi("Review");
+ router.push(RouterDonasi.create_cerita_penggalang + `${res.donasiId}`);
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error create donasi", error);
+ }
+ }
+
+ return (
+ <>
+
+
+ ({
+ value: e.id,
+ label: e.name,
+ }))}
+ onChange={(val: string) =>
+ setData({
+ ...data,
+ kategoriId: val,
+ })
+ }
+ />
+
+
+ {
+ setData({ ...data, title: val.target.value });
+ }}
+ />
+ Rp.}
+ min={0}
+ withAsterisk
+ label="Target Dana"
+ placeholder="0"
+ value={data.target}
+ onChange={(val) => {
+ const match = val.currentTarget.value
+ .replace(/\./g, "")
+ .match(/^[0-9]+$/);
+
+ if (val.currentTarget.value === "")
+ return setData({
+ ...data,
+ target: 0 + "",
+ });
+ if (!match?.[0]) return null;
+
+ const nilai = val.currentTarget.value.replace(/\./g, "");
+ const target = Intl.NumberFormat("id-ID").format(+nilai);
+
+ setTargetDana(nilai);
+ setData({
+ ...data,
+ target,
+ });
+ }}
+ />
+ ({
+ value: e.id,
+ label: e.name + " " + `hari`,
+ }))}
+ onChange={(val: string) => setData({ ...data, durasiId: val })}
+ />
+
+
+
+
+ {img ? (
+
+
+
+ ) : (
+
+
+
+ )}
+
+
+
+
+
+
+ {/* Upload Foto */}
+ {/*
+ {
+ try {
+ const buffer = URL.createObjectURL(
+ new Blob([new Uint8Array(await files.arrayBuffer())])
+ );
+ setImg(buffer);
+ setFile(files);
+ } catch (error) {
+ console.log(error);
+ }
+ }}
+ accept="image/png,image/jpeg"
+ >
+ {(props) => (
+ }
+ radius={50}
+ bg={MainColor.yellow}
+ color="yellow"
+ c={"black"}
+ >
+ Upload Gambar
+
+ )}
+
+ */}
+
+
+ onCreate()}
+ bg={MainColor.yellow}
+ color="yellow"
+ c={"black"}
+ >
+ Selanjutnya
+
+
+ >
+ );
+}
diff --git a/src/app_modules/donasi/create/create_kabar/index.tsx b/src/app_modules/donasi/create/create_kabar/index.tsx
index 6a2bc43f..94bb5de4 100644
--- a/src/app_modules/donasi/create/create_kabar/index.tsx
+++ b/src/app_modules/donasi/create/create_kabar/index.tsx
@@ -1,33 +1,38 @@
"use client";
+import { DIRECTORY_ID } from "@/lib";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
-import { ComponentGlobal_BoxUploadImage } from "@/app_modules/_global/component";
+import {
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
+} from "@/app_modules/_global/component";
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import { notifikasiToUser_CreateKabarDonasi } from "@/app_modules/notifikasi/fun/create/create_notif_to_user_kabar_donasi";
+import { clientLogger } from "@/util/clientLogger";
import {
AspectRatio,
Button,
- FileButton,
- Group,
+ Center,
Image,
Stack,
- Text,
TextInput,
- Textarea,
+ Textarea
} from "@mantine/core";
-import { IconCamera, IconUpload } from "@tabler/icons-react";
+import { IconPhoto } from "@tabler/icons-react";
import _ from "lodash";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import { Donasi_funCreateKabar } from "../../fun/create/fun_create_kabar";
-import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
-import { DIRECTORY_ID } from "@/app/lib";
-export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
+export default function Donasi_CreateKabar() {
+ const params = useParams<{ id: string }>();
+ const donasiId = params.id;
+
const router = useRouter();
const [file, setFile] = useState(null);
const [img, setImg] = useState();
@@ -58,9 +63,8 @@ export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
if (!uploadImage.success) {
setLoading(false);
- return ComponentGlobal_NotifikasiPeringatan(
- "Gagal upload file gambar"
- );
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload file gambar");
+ return;
}
const res = await Donasi_funCreateKabar({
@@ -76,7 +80,6 @@ export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
ComponentGlobal_NotifikasiBerhasil(res.message);
router.back();
- setLoading(false);
} else {
ComponentGlobal_NotifikasiGagal(res.message);
setLoading(false);
@@ -94,21 +97,21 @@ export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
ComponentGlobal_NotifikasiBerhasil(res.message);
router.back();
- setLoading(false);
} else {
ComponentGlobal_NotifikasiGagal(res.message);
setLoading(false);
}
}
} catch (error) {
- console.log(error);
+ setLoading(false);
+ clientLogger.error("Error upload berita", error);
}
}
return (
<>
-
+
{
setKabar({
@@ -149,10 +152,10 @@ export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
/>
-
+
{img ? (
@@ -165,44 +168,18 @@ export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
) : (
-
-
- Upload Gambar
-
+
)}
{/* Upload Foto */}
-
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
- setImg(buffer);
- setFile(files);
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
- }
- radius={50}
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload Gambar
-
- )}
-
-
+
+
+
- }>
+ {/* }
+ >
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/donasi/create/layout.tsx b/src/app_modules/donasi/create/layout.tsx
index 3bf3d5eb..a780aa60 100644
--- a/src/app_modules/donasi/create/layout.tsx
+++ b/src/app_modules/donasi/create/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutCreateDonasi({
@@ -11,11 +14,17 @@ export default function LayoutCreateDonasi({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/donasi/create/layout_cerita_penggalang.tsx b/src/app_modules/donasi/create/layout_cerita_penggalang.tsx
index 14d2efe2..defa8b59 100644
--- a/src/app_modules/donasi/create/layout_cerita_penggalang.tsx
+++ b/src/app_modules/donasi/create/layout_cerita_penggalang.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutCreateCeritaDonasi({
@@ -11,13 +14,20 @@ export default function LayoutCreateCeritaDonasi({
}) {
return (
<>
-
}
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/donasi/detail/detail_donasi_saya/index.tsx b/src/app_modules/donasi/detail/detail_donasi_saya/index.tsx
index f029fcaa..ffc07d8a 100644
--- a/src/app_modules/donasi/detail/detail_donasi_saya/index.tsx
+++ b/src/app_modules/donasi/detail/detail_donasi_saya/index.tsx
@@ -8,15 +8,48 @@ import ComponentDonasi_InformasiPenggalangMain from "../../component/detail_main
import TampilanRupiahDonasi from "../../component/tampilan_rupiah";
import { MODEL_DONASI_INVOICE } from "../../model/interface";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import { apiGetCountDonatur, apiGetDonasiInvoiceById } from "../../lib/api_donasi";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+
+export default function DetailDonasiSaya() {
+ const params = useParams<{ id: string }>();
+ const invoiceId = params.id;
+ const [invoice, setInvoice] = useState(null);
+ const [countDonatur, setCountDonatur] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ getCountDonatur();
+ }, [invoiceId]);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetDonasiInvoiceById({ id: invoiceId });
+ if (response.success) {
+ setInvoice(response.data);
+ }
+ } catch (error) {
+ console.error("Error fetching invoice data:", error);
+ }
+ }
+
+ async function getCountDonatur() {
+ try {
+ const response = await apiGetCountDonatur({ id: invoiceId });
+ if (response.success) {
+ setCountDonatur(response.data);
+ }
+ } catch (error) {
+ console.error("Error fetching count donatur data:", error);
+ }
+ }
+
+ if (!invoice || countDonatur === null) {
+ return ;
+ }
-export default function DetailDonasiSaya({
- dataDonasi,
- countDonatur,
-}: {
- dataDonasi: MODEL_DONASI_INVOICE;
- countDonatur: number;
-}) {
- const [invoice, setInvoice] = useState(dataDonasi);
return (
<>
diff --git a/src/app_modules/donasi/detail/detail_donasi_saya/layout.tsx b/src/app_modules/donasi/detail/detail_donasi_saya/layout.tsx
index 304eb7e4..c9ce241c 100644
--- a/src/app_modules/donasi/detail/detail_donasi_saya/layout.tsx
+++ b/src/app_modules/donasi/detail/detail_donasi_saya/layout.tsx
@@ -1,16 +1,40 @@
-"use client"
+"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi"
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate"
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate"
-import React from "react"
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import React from "react";
-export default function LayoutDetailDonasiSaya({children}: {children: React.ReactNode}){
- return<>
- }
- >
- {children}
-
+export default function LayoutDetailDonasiSaya({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+ {/*
+ }
+ >
+ {children}
+ */}
+
+
+
+
+
+ {children}
+
>
-}
\ No newline at end of file
+ );
+}
diff --git a/src/app_modules/donasi/detail/detail_draft/index.tsx b/src/app_modules/donasi/detail/detail_draft/index.tsx
index 79cf13b0..d1bd3f8b 100644
--- a/src/app_modules/donasi/detail/detail_draft/index.tsx
+++ b/src/app_modules/donasi/detail/detail_draft/index.tsx
@@ -1,28 +1,54 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import { UIGlobal_Modal } from "@/app_modules/_global/ui";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
-import mqtt_client from "@/util/mqtt_client";
+import { IRealtimeData } from "@/lib/global_state";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import { clientLogger } from "@/util/clientLogger";
import { Button, Group, Stack } from "@mantine/core";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { WibuRealtime } from "wibu-pkg";
import { Donasi_ComponentButtonDeleteDonasiById } from "../../component";
import ComponentDonasi_DetailDataGalangDana from "../../component/detail_galang_dana/detail_data_donasi";
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
import { Donasi_funGantiStatus } from "../../fun/update/fun_ganti_status";
import { MODEL_DONASI } from "../../model/interface";
-import { IRealtimeData } from "@/app/lib/global_state";
-import { WibuRealtime } from "wibu-pkg";
+import { apiGetOneDonasiById } from "../../lib/api_donasi";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export default function DetailDraftDonasi({
- dataDonasi,
-}: {
- dataDonasi: MODEL_DONASI;
-}) {
- const [data, setData] = useState(dataDonasi);
+export default function DetailDraftDonasi() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState({} as MODEL_DONASI);
+ const [loading, setLoading] = useState(true);
+
+ useShallowEffect(() => {
+ getData();
+ }, []);
+
+ async function getData() {
+ try {
+ setLoading(true);
+ const response = await apiGetOneDonasiById(param.id, "semua");
+
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ if (loading) {
+ return ;
+ }
return (
<>
@@ -48,52 +74,59 @@ function ButtonAjukanPenggalangan({
dataDonasi: MODEL_DONASI;
}) {
const router = useRouter();
- const [isLoading, setLoading] = useState(false);
+ const [isLoadingAjukan, setLoadingAjukan] = useState(false);
const [openModal, setOpenModal] = useState(false);
async function onChangeStatus() {
+ setLoadingAjukan(true);
const res = await Donasi_funGantiStatus(dataDonasi.id, "2");
- if (res.status === 200) {
+ try {
+ if (res.status === 200) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res.data?.id as any,
+ status: res.data?.DonasiMaster_Status?.name as any,
+ userId: res.data?.authorId as any,
+ pesan: res.data?.title as any,
+ kategoriApp: "DONASI",
+ title: "Mengajukan review",
+ };
- const dataNotifikasi: IRealtimeData = {
- appId: res.data?.id as any,
- status: res.data?.DonasiMaster_Status?.name as any,
- userId: res.data?.authorId as any,
- pesan: res.data?.title as any,
- kategoriApp: "DONASI",
- title: "Mengajukan review",
- };
-
- const notif = await notifikasiToAdmin_funCreate({
- data: dataNotifikasi as any,
- });
-
- if (notif.status === 201) {
- WibuRealtime.setData({
- type: "notification",
- pushNotificationTo: "ADMIN",
+ const notif = await notifikasiToAdmin_funCreate({
+ data: dataNotifikasi as any,
});
- WibuRealtime.setData({
- type: "trigger",
- pushNotificationTo: "ADMIN",
- dataMessage: dataNotifikasi,
- });
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "ADMIN",
+ });
- setLoading(true);
- ComponentGlobal_NotifikasiBerhasil("Berhasil Diajukan");
- router.push(RouterDonasi.status_galang_dana({ id: "2" }));
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "ADMIN",
+ dataMessage: dataNotifikasi,
+ });
+
+ ComponentGlobal_NotifikasiBerhasil("Berhasil Diajukan");
+ router.replace(RouterDonasi.status_galang_dana({ id: "2" }));
+ }
+ } else {
+ setLoadingAjukan(false);
+ ComponentGlobal_NotifikasiPeringatan(res.message);
}
- } else {
- ComponentGlobal_NotifikasiPeringatan(res.message);
+ } catch (error) {
+ setLoadingAjukan(false);
+ clientLogger.error("Error ajukan donasi", error);
}
}
return (
<>
setOpenModal(true)}
>
Ajukan Kembali
@@ -104,17 +137,24 @@ function ButtonAjukanPenggalangan({
opened={openModal}
close={() => setOpenModal(false)}
buttonKiri={
- setOpenModal(false)}>
+ setOpenModal(false)}
+ >
Batal
}
buttonKanan={
onChangeStatus()}
>
Ajukan
diff --git a/src/app_modules/donasi/detail/detail_draft/layout.tsx b/src/app_modules/donasi/detail/detail_draft/layout.tsx
index 0dc18cab..49bce7da 100644
--- a/src/app_modules/donasi/detail/detail_draft/layout.tsx
+++ b/src/app_modules/donasi/detail/detail_draft/layout.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
@@ -13,6 +13,8 @@ import {
} from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import React, { useState } from "react";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, { UI_NewHeader, UI_NewChildren } from "@/app_modules/_global/ui/V2_layout_tamplate";
export default function LayoutDetailDraftDonasi({
children,
@@ -50,7 +52,7 @@ export default function LayoutDetailDraftDonasi({
return (
<>
-
{children}
-
+ */}
+
+
+
+ setOpenDrawer(true)}
+ >
+
+
+ }
+ />
+
+ {children}
+
();
+ const [kabar, setKabar] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetDonasiKabarById({ id: param.id });
+ if (response.success) {
+ setKabar(response.data);
+ }
+ } catch (error) {
+ console.error("Error fetching kabar data:", error);
+ }
+ }
+
+ if (!kabar) {
+ return ;
+ }
-export default function DetailKabarDonasi({
- dataDonasi,
-}: {
- dataDonasi: MODEL_DONASI_KABAR;
-}) {
- const [kabar, setKabar] = useState(dataDonasi);
return (
<>
- {new Intl.DateTimeFormat("id-ID", { dateStyle: "medium" }).format(
- kabar.createdAt
- )}
+ {moment(kabar.createdAt).format("DD MMM YYYY")}
diff --git a/src/app_modules/donasi/detail/detail_main/bukti_transfer.tsx b/src/app_modules/donasi/detail/detail_main/bukti_transfer.tsx
index eff362bf..f25bac2e 100644
--- a/src/app_modules/donasi/detail/detail_main/bukti_transfer.tsx
+++ b/src/app_modules/donasi/detail/detail_main/bukti_transfer.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import {
AccentColor,
MainColor,
diff --git a/src/app_modules/donasi/detail/detail_main/cerita_penggalang/index.tsx b/src/app_modules/donasi/detail/detail_main/cerita_penggalang/index.tsx
index a7fc4807..9cc9aeaf 100644
--- a/src/app_modules/donasi/detail/detail_main/cerita_penggalang/index.tsx
+++ b/src/app_modules/donasi/detail/detail_main/cerita_penggalang/index.tsx
@@ -2,40 +2,71 @@
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_LoadImageLandscape } from "@/app_modules/_global/component";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { Comp_SetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { apiGetDonasiCeritaPenggalang } from "@/app_modules/donasi/lib/api_donasi";
import { MODEL_CERITA_DONASI } from "@/app_modules/donasi/model/interface";
import { Stack, Text } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
import { useState } from "react";
+import moment from "moment";
+import "moment/locale/id";
+import { ComponentGlobal_NotifikasiGagal, ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+
+export default function CeritaPenggalangDonasi() {
+ const param = useParams<{ id: string }>();
+
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ const getData = async () => {
+ try {
+ const response = await apiGetDonasiCeritaPenggalang({ id: param.id });
+ if (response.success) {
+ setData(response.data);
+ } else {
+ ComponentGlobal_NotifikasiPeringatan(response.message);
+ }
+ } catch (error) {
+ ComponentGlobal_NotifikasiGagal("Terjadi error saat mengambil data");
+ }
+ };
+ getData();
+ }, []);
+
+
+
+ if (!data) return ;
-export default function CeritaPenggalangDonasi({
- dataCerita,
-}: {
- dataCerita: MODEL_CERITA_DONASI;
-}) {
- const [data, setData] = useState(dataCerita);
return (
<>
- {/* {JSON.stringify(data.imageCeritaDonasi, null, 2)} */}
-
-
- {new Intl.DateTimeFormat("id-ID", { dateStyle: "full" }).format(
- data.createdAt
- )}
-
- #HaloOrangBaik
- {data.pembukaan}
+ {data === null ? (
+
+ ) : (
+
+
+ {moment(data?.createdAt).format("DD MMMM YYYY")}
+
+ #HaloOrangBaik
-
- {data.cerita}
-
+
+
+
+
+
+
+ )}
>
);
}
diff --git a/src/app_modules/donasi/detail/detail_main/cerita_penggalang/layout.tsx b/src/app_modules/donasi/detail/detail_main/cerita_penggalang/layout.tsx
index e3f6c898..1fe8d033 100644
--- a/src/app_modules/donasi/detail/detail_main/cerita_penggalang/layout.tsx
+++ b/src/app_modules/donasi/detail/detail_main/cerita_penggalang/layout.tsx
@@ -1,38 +1,81 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewFooter,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import ButtonDonasi from "@/app_modules/donasi/component/footer_button_donasi";
-import React from "react";
+import { apiGetOneDonasiById } from "@/app_modules/donasi/lib/api_donasi";
+import { MODEL_DONASI } from "@/app_modules/donasi/model/interface";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import React, { useState } from "react";
export default function LayoutCeritaPenggalangDonasi({
children,
- statusDonasiId,
- donasiId,
}: {
children: React.ReactNode;
- statusDonasiId: string;
- donasiId: string;
}) {
- if (statusDonasiId !== "1") {
- return (
- <>
-
- }
- >
- {children}
-
- >
- );
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState({} as MODEL_DONASI);
+ const [loading, setLoading] = useState(true);
+
+ useShallowEffect(() => {
+ getData();
+ }, []);
+
+ async function getData() {
+ try {
+ setLoading(true);
+ const response = await apiGetOneDonasiById(param.id, "semua");
+
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
+ }
}
+
+ // if (data?.donasiMaster_StatusDonasiId !== "1") {
+ // return (
+ // <>
+ //
+ //
+ //
+ //
+ // {children}
+ //
+ // >
+ // );
+ // }
+
return (
- }
- footer={}
- >
- {children}
-
+
+
+
+
+
+ {loading ? (
+
+ ) : (
+ data?.donasiMaster_StatusDonasiId === "1" ? (
+ children
+ ) : (
+
+ )
+ )}
+
+ {data?.donasiMaster_StatusDonasiId === "1" && (
+
+
+
+ )}
+
);
}
diff --git a/src/app_modules/donasi/detail/detail_main/donatur/index.tsx b/src/app_modules/donasi/detail/detail_main/donatur/index.tsx
index 391841c3..b88277c9 100644
--- a/src/app_modules/donasi/detail/detail_main/donatur/index.tsx
+++ b/src/app_modules/donasi/detail/detail_main/donatur/index.tsx
@@ -2,24 +2,60 @@
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { ComponentDonasi_CardDonatur } from "@/app_modules/donasi/component/card_view/ui_card_donatur";
-import { donasi_funGetListDonaturById } from "@/app_modules/donasi/fun/get/get_list_donatur";
+import { apiGetDonasiListDonaturById } from "@/app_modules/donasi/lib/api_donasi";
import { MODEL_DONASI_INVOICE } from "@/app_modules/donasi/model/interface";
import { Box, Center } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
+import { useParams } from "next/navigation";
import { useState } from "react";
-export default function DonaturDonasi({
- listDonatur,
- donasiId,
-}: {
- listDonatur: MODEL_DONASI_INVOICE[];
- donasiId: string;
-}) {
- const [data, setData] = useState(listDonatur);
+export default function DonaturDonasi() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetDonasiListDonaturById({
+ id: param.id,
+ page: activePage,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+
+ async function onMoreData() {
+ try {
+ const nextPage = activePage + 1;
+ setActivePage(nextPage);
+ const response = await apiGetDonasiListDonaturById({
+ id: param.id,
+ page: nextPage,
+ });
+
+ if (response.success) {
+ return response.data;
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+
+ if (!data) return ;
+
return (
<>
{_.isEmpty(data) ? (
@@ -34,17 +70,8 @@ export default function DonaturDonasi({
)}
data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await donasi_funGetListDonaturById({
- page: activePage + 1,
- donasiId: donasiId,
- });
-
- setActivePage((val) => val + 1);
-
- return loadData;
- }}
+ setData={setData as any}
+ moreData={onMoreData}
>
{(item) => }
diff --git a/src/app_modules/donasi/detail/detail_main/donatur/layout.tsx b/src/app_modules/donasi/detail/detail_main/donatur/layout.tsx
index dd5d93c6..bf13569d 100644
--- a/src/app_modules/donasi/detail/detail_main/donatur/layout.tsx
+++ b/src/app_modules/donasi/detail/detail_main/donatur/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutDonaturDonasi({
@@ -11,11 +14,18 @@ export default function LayoutDonaturDonasi({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/donasi/detail/detail_main/index_new.tsx b/src/app_modules/donasi/detail/detail_main/index_new.tsx
new file mode 100644
index 00000000..e2583f4e
--- /dev/null
+++ b/src/app_modules/donasi/detail/detail_main/index_new.tsx
@@ -0,0 +1,17 @@
+"use client";
+import { Stack } from "@mantine/core";
+import ComponentDonasi_CeritaPenggalangMainNew from "../../component/detail_main/cerita_penggalang_new";
+import { ComponentDonasi_DetailDataMainNew } from "../../component/detail_main/detail_dana_donasi_new";
+import ComponentDonasi_InformasiPenggalangMainNew from "../../component/detail_main/informasi_penggalang_new";
+
+export default function DetailMainDonasiNew() {
+ return (
+ <>
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/donasi/detail/detail_main/kabar/index.tsx b/src/app_modules/donasi/detail/detail_main/kabar/index.tsx
index 4afd302c..0254f1db 100644
--- a/src/app_modules/donasi/detail/detail_main/kabar/index.tsx
+++ b/src/app_modules/donasi/detail/detail_main/kabar/index.tsx
@@ -4,37 +4,56 @@ import {
ComponentGlobal_CardStyles,
ComponentGlobal_LoadImageLandscape,
} from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { apiGetDonasiKabarById } from "@/app_modules/donasi/lib/api_donasi";
import { MODEL_DONASI_KABAR } from "@/app_modules/donasi/model/interface";
+import { clientLogger } from "@/util/clientLogger";
import { Group, Stack, Text, Title } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import moment from "moment";
+import "moment/locale/id";
+import { useParams } from "next/navigation";
import { useState } from "react";
-export default function KabarDonasi({
- dataDonasi,
-}: {
- dataDonasi: MODEL_DONASI_KABAR;
-}) {
- const [kabar, setKabar] = useState(dataDonasi);
+export default function KabarDonasi() {
+ const { id } = useParams();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetDonasiKabarById({ id: id as string });
+ console.log("res >", response)
+ if (response && response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data kabar", error);
+ }
+ }
+
+ if (!data) return ;
+
return (
<>
-
- {new Intl.DateTimeFormat("id-ID", { dateStyle: "medium" }).format(
- kabar.createdAt
- )}
-
+ {moment(data.createdAt).format("DD MMM YYYY")}
- {kabar.imageId === null ? (
+ {data.imageId === null ? (
""
) : (
-
+
)}
- {kabar.title}
+ {data.title}
- {kabar.deskripsi}
+ {data.deskripsi}
>
diff --git a/src/app_modules/donasi/detail/detail_main/kabar/layout.tsx b/src/app_modules/donasi/detail/detail_main/kabar/layout.tsx
index 586e5cce..d5a7a923 100644
--- a/src/app_modules/donasi/detail/detail_main/kabar/layout.tsx
+++ b/src/app_modules/donasi/detail/detail_main/kabar/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutKabarDonasi({
@@ -11,11 +14,18 @@ export default function LayoutKabarDonasi({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/donasi/detail/detail_main/layout.tsx b/src/app_modules/donasi/detail/detail_main/layout.tsx
index 3a8f4056..8be2659b 100644
--- a/src/app_modules/donasi/detail/detail_main/layout.tsx
+++ b/src/app_modules/donasi/detail/detail_main/layout.tsx
@@ -4,7 +4,7 @@ import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_ta
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import React, { useState } from "react";
import ButtonDonasi from "../../component/footer_button_donasi";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { IconDotsVertical, IconMessageShare } from "@tabler/icons-react";
import { UIGlobal_Drawer } from "@/app_modules/_global/ui";
import { ActionIcon } from "@mantine/core";
diff --git a/src/app_modules/donasi/detail/detail_main/layout_new.tsx b/src/app_modules/donasi/detail/detail_main/layout_new.tsx
new file mode 100644
index 00000000..6d81ab8a
--- /dev/null
+++ b/src/app_modules/donasi/detail/detail_main/layout_new.tsx
@@ -0,0 +1,113 @@
+"use client";
+import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
+import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import React, { useState } from "react";
+import ButtonDonasi from "../../component/footer_button_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import { IconDotsVertical, IconMessageShare } from "@tabler/icons-react";
+import { UIGlobal_Drawer } from "@/app_modules/_global/ui";
+import { ActionIcon } from "@mantine/core";
+import { useParams } from "next/navigation";
+import { apiGetOneDonasiById } from "../../lib/api_donasi";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import { useShallowEffect } from "@mantine/hooks";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, { UI_NewHeader, UI_NewChildren, UI_NewFooter } from "@/app_modules/_global/ui/V2_layout_tamplate";
+
+export default function LayoutDetailMainDonasiNew({ children, }: { children: React.ReactNode; }) {
+ const [openDrawer, setOpenDrawer] = useState(false);
+ const param = useParams<{ id: string }>();
+ const [loading, setLoading] = useState(true);
+ const [authorId, setAuthorId] = useState("");
+ const [userLogin, setUserLogin] = useState("");
+
+ const listPage = [
+ {
+ id: "1",
+ name: "Rekap Kabar",
+ icon: ,
+ path: RouterDonasi.rekap_kabar({ id: param.id }),
+ },
+ ];
+
+ async function getDataDonasi() {
+ try {
+ setLoading(true)
+ const response = await apiGetOneDonasiById(param.id, "author")
+ const response2 = await funGetUserIdByToken()
+ if (response.success) {
+ setAuthorId(response.data.authorId)
+ setUserLogin(response2)
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false)
+ }
+ }
+
+ useShallowEffect(() => {
+ getDataDonasi()
+ }, [])
+
+ return (
+ <>
+ {/* setOpenDrawer(true)}
+ >
+
+
+ )
+ }
+ />
+ }
+ footer={}
+ >
+ {children}
+ */}
+
+
+
+ setOpenDrawer(true)}
+ >
+
+
+ )
+ }
+ />
+
+ {children}
+
+
+
+
+
+ setOpenDrawer(false)}
+ component={listPage}
+ />
+ >
+ );
+}
diff --git a/src/app_modules/donasi/detail/detail_main/pencairan_dana/index.tsx b/src/app_modules/donasi/detail/detail_main/pencairan_dana/index.tsx
index 7abd386c..2a56ba4f 100644
--- a/src/app_modules/donasi/detail/detail_main/pencairan_dana/index.tsx
+++ b/src/app_modules/donasi/detail/detail_main/pencairan_dana/index.tsx
@@ -6,30 +6,27 @@ import {
MODEL_DONASI,
MODEL_DONASI_PENCAIRAN_DANA,
} from "@/app_modules/donasi/model/interface";
-import {
- Stack
-} from "@mantine/core";
+import { Stack } from "@mantine/core";
import { useState } from "react";
-export default function PencairanDanaDonasi({
- donasiId,
- totalAkumulasi,
- listPencairan,
-}: {
- donasiId: string;
- totalAkumulasi: MODEL_DONASI;
- listPencairan: MODEL_DONASI_PENCAIRAN_DANA[];
-}) {
- const [akumulasi, setAkumulasi] = useState(totalAkumulasi);
- const [listPD, setListPD] = useState(listPencairan);
+export default function PencairanDanaDonasi(
+ {
+ // donasiId,
+ // totalAkumulasi,
+ // listPencairan,
+ }: {
+ // donasiId: string;
+ // totalAkumulasi: MODEL_DONASI;
+ // listPencairan: MODEL_DONASI_PENCAIRAN_DANA[];
+ }
+) {
+ // const [akumulasi, setAkumulasi] = useState(totalAkumulasi);
+ // const [listPD, setListPD] = useState(listPencairan);
return (
<>
-
-
+
+
>
);
diff --git a/src/app_modules/donasi/detail/detail_main/pencairan_dana/layout.tsx b/src/app_modules/donasi/detail/detail_main/pencairan_dana/layout.tsx
index aef7f911..95c16505 100644
--- a/src/app_modules/donasi/detail/detail_main/pencairan_dana/layout.tsx
+++ b/src/app_modules/donasi/detail/detail_main/pencairan_dana/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutPencairanDanaDonasi({
@@ -11,11 +14,18 @@ export default function LayoutPencairanDanaDonasi({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/donasi/detail/detail_main/penggalang_dana/index.tsx b/src/app_modules/donasi/detail/detail_main/penggalang_dana/index.tsx
index 35bb52e5..85d33143 100644
--- a/src/app_modules/donasi/detail/detail_main/penggalang_dana/index.tsx
+++ b/src/app_modules/donasi/detail/detail_main/penggalang_dana/index.tsx
@@ -1,16 +1,16 @@
"use client";
-import { pathAssetImage, RouterImagePreview } from "@/app/lib";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
import {
ComponentGlobal_CardStyles,
ComponentGlobal_LoaderAvatar,
} from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import ComponentDonasi_CardPublish from "@/app_modules/donasi/component/card_view/card_publish";
-import {
- MODEL_DONASI_INFO_PENGGALANG
-} from "@/app_modules/donasi/model/interface";
+import { apiGetDonasiPenggalangDanaByUserId } from "@/app_modules/donasi/lib/api_donasi";
+import { MODEL_DONASI_INFO_PENGGALANG } from "@/app_modules/donasi/model/interface";
import { MODEL_USER } from "@/app_modules/home/model/interface";
+import { pathAssetImage, RouterImagePreview } from "@/lib";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import {
ActionIcon,
Box,
@@ -18,18 +18,36 @@ import {
Image,
Stack,
Text,
- Title
+ Title,
} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import { IconBrandGmail, IconMoodSmile, IconPhone } from "@tabler/icons-react";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
-export default function PenggalangDanaDonasi({
- dataPenggalang,
-}: {
- dataPenggalang: MODEL_DONASI_INFO_PENGGALANG;
-}) {
- const [data, setData] = useState(dataPenggalang);
+export default function PenggalangDanaDonasi() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetDonasiPenggalangDanaByUserId({
+ id: param.id,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+
+ if (!data) return ;
return (
<>
diff --git a/src/app_modules/donasi/detail/detail_main/penggalang_dana/layout.tsx b/src/app_modules/donasi/detail/detail_main/penggalang_dana/layout.tsx
index 5fb9f851..557011bb 100644
--- a/src/app_modules/donasi/detail/detail_main/penggalang_dana/layout.tsx
+++ b/src/app_modules/donasi/detail/detail_main/penggalang_dana/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutPenggalangDanaDonasi({
@@ -11,14 +14,21 @@ export default function LayoutPenggalangDanaDonasi({
}) {
return (
<>
-
}
// footer={}
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/donasi/detail/detail_publish/index.tsx b/src/app_modules/donasi/detail/detail_publish/index.tsx
index 74cb9561..4038cc18 100644
--- a/src/app_modules/donasi/detail/detail_publish/index.tsx
+++ b/src/app_modules/donasi/detail/detail_publish/index.tsx
@@ -1,34 +1,74 @@
"use client";
-import {
- Stack
-} from "@mantine/core";
+import { Stack } from "@mantine/core";
import { useState } from "react";
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
import { ComponentDonasi_DetailDataMain } from "../../component/detail_main/detail_data_donasi";
import ComponentDonasi_InformasiPenggalangMain from "../../component/detail_main/informasi_penggalang";
import { MODEL_DONASI } from "../../model/interface";
+import { apiGetOneDonasiById } from "../../lib/api_donasi";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
-export default function DetailPublishDonasi({
- dataPublish,
- countDonatur,
- userLoginId
-}: {
- dataPublish: MODEL_DONASI;
- countDonatur: number,
- userLoginId: string
-}) {
- const [donasi, setDonasi] = useState(dataPublish);
+export default function DetailPublishDonasi() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [countDonatur, setCountDonatur] = useState(null);
+ const [userLoginId, setUserLoginId] = useState(null);
+ const [loading, setLoading] = useState(false);
+
+ useShallowEffect(() => {
+ handleGetUserId();
+ onLoadData();
+ }, []);
+
+ async function handleGetUserId() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response) {
+ setUserLoginId(response.userId);
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+
+ async function onLoadData() {
+ try {
+ setLoading(true);
+ const response = await apiGetOneDonasiById(param.id, "semua");
+ const responseCountDonatur = await apiGetOneDonasiById(param.id, "count");
+
+ if (response.success) {
+ setData(response.data);
+ }
+ if (responseCountDonatur.success) {
+ setCountDonatur(responseCountDonatur.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ if (loading || !userLoginId || !data || countDonatur === null) {
+ return ;
+ }
return (
<>
{/* {JSON.stringify(donasi,null,2)} */}
-
-
-
+
+
+
>
);
}
-
-
diff --git a/src/app_modules/donasi/detail/detail_publish/layout.tsx b/src/app_modules/donasi/detail/detail_publish/layout.tsx
index e9c71220..9fe68b32 100644
--- a/src/app_modules/donasi/detail/detail_publish/layout.tsx
+++ b/src/app_modules/donasi/detail/detail_publish/layout.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
diff --git a/src/app_modules/donasi/detail/detail_reject/index.tsx b/src/app_modules/donasi/detail/detail_reject/index.tsx
index 88df30d8..8cbb4b77 100644
--- a/src/app_modules/donasi/detail/detail_reject/index.tsx
+++ b/src/app_modules/donasi/detail/detail_reject/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
import { funGlobal_DeleteFileById } from "@/app_modules/_global/fun";
import {
@@ -10,22 +10,46 @@ import {
} from "@/app_modules/_global/notif_global";
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
import { Button, Group, Stack } from "@mantine/core";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import ComponentDonasi_DetailDataGalangDana from "../../component/detail_galang_dana/detail_data_donasi";
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
import { Donasi_funDeleteDonasiById } from "../../fun/delete/fin_delete_donasi_by_id";
import { Donasi_funGantiStatus } from "../../fun/update/fun_ganti_status";
import { MODEL_DONASI } from "../../model/interface";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetOneDonasiById } from "../../lib/api_donasi";
+
+export default function DetailRejectDonasi() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState({} as MODEL_DONASI);
+ const [loading, setLoading] = useState(true);
+
+ useShallowEffect(() => {
+ getData();
+ }, []);
+
+ async function getData() {
+ try {
+ setLoading(true);
+ const response = await apiGetOneDonasiById(param.id, "semua");
+
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ if (loading) {
+ return ;
+ }
-export default function DetailRejectDonasi({
- dataReject,
- fileIdImageCerita,
-}: {
- dataReject: MODEL_DONASI;
- fileIdImageCerita: string;
-}) {
- const [data, setData] = useState(dataReject);
return (
<>
@@ -34,7 +58,7 @@ export default function DetailRejectDonasi({
@@ -58,44 +82,54 @@ function ButtonAction({
const [isLoadingDelete, setLoadingDelete] = useState(false);
async function onChangeStatus() {
- await Donasi_funGantiStatus(donasiId, "3").then((res) => {
- if (res.status === 200) {
- setLoadingEdit(true);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- router.replace(RouterDonasi.status_galang_dana({ id: "3" }));
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- setLoadingEdit(true);
- }
- });
+ try {
+ setLoadingEdit(true);
+ await Donasi_funGantiStatus(donasiId, "3").then((res) => {
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ router.replace(RouterDonasi.status_galang_dana({ id: "3" }));
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ setLoadingEdit(true);
+ }
+ });
+ } catch (error) {
+ console.error(error);
+ setLoadingEdit(false);
+ }
}
async function onDelete() {
- const del = await Donasi_funDeleteDonasiById(donasiId);
- if (del.status === 200) {
+ try {
setLoadingDelete(true);
- const deleteImageDonasi = await funGlobal_DeleteFileById({
- fileId: imageId as any,
- });
+ const del = await Donasi_funDeleteDonasiById(donasiId);
+ if (del.status === 200) {
+ const deleteImageDonasi = await funGlobal_DeleteFileById({
+ fileId: imageId as any,
+ });
- if (!deleteImageDonasi.success) {
- ComponentGlobal_NotifikasiPeringatan("Gagal hapus gambar ");
+ if (!deleteImageDonasi.success) {
+ ComponentGlobal_NotifikasiPeringatan("Gagal hapus gambar ");
+ setLoadingDelete(false);
+ }
+
+ const deleteImageCerita = await funGlobal_DeleteFileById({
+ fileId: fileIdImageCerita as any,
+ });
+
+ if (!deleteImageCerita.success) {
+ ComponentGlobal_NotifikasiPeringatan("Gagal hapus gambar ");
+ setLoadingDelete(false);
+ }
+
+ router.replace(RouterDonasi.status_galang_dana({ id: "4" }));
+ ComponentGlobal_NotifikasiBerhasil(del.message);
+ setLoadingDelete(false);
+ } else {
+ ComponentGlobal_NotifikasiGagal(del.message);
setLoadingDelete(false);
}
-
- const deleteImageCerita = await funGlobal_DeleteFileById({
- fileId: fileIdImageCerita as any,
- });
-
- if (!deleteImageCerita.success) {
- ComponentGlobal_NotifikasiPeringatan("Gagal hapus gambar ");
- setLoadingDelete(false);
- }
-
- router.replace(RouterDonasi.status_galang_dana({ id: "4" }));
- ComponentGlobal_NotifikasiBerhasil(del.message);
- setLoadingDelete(false);
- } else {
- ComponentGlobal_NotifikasiGagal(del.message);
+ } catch (error) {
+ console.error(error);
setLoadingDelete(false);
}
}
@@ -104,16 +138,16 @@ function ButtonAction({
setOpenModalEdit(true)}
>
Edit Kembali
setOpenModalDelete(true)}
>
Hapus Donasi
@@ -126,7 +160,12 @@ function ButtonAction({
opened={openModaEdit}
close={() => setOpenModalEdit(false)}
buttonKiri={
- setOpenModalEdit(false)}>
+ setOpenModalEdit(false)}
+ >
Batal
}
@@ -134,8 +173,9 @@ function ButtonAction({
onChangeStatus()}
>
Edit
@@ -149,7 +189,12 @@ function ButtonAction({
opened={openModalDelete}
close={() => setOpenModalDelete(false)}
buttonKiri={
- setOpenModalDelete(false)}>
+ setOpenModalDelete(false)}
+ >
Batal
}
@@ -158,7 +203,8 @@ function ButtonAction({
loaderPosition="center"
loading={isLoadingDelete}
radius={"xl"}
- color="red"
+ style={{ backgroundColor: MainColor.red }}
+ c={AccentColor.white}
onClick={() => onDelete()}
>
Hapus
diff --git a/src/app_modules/donasi/detail/detail_reject/layout.tsx b/src/app_modules/donasi/detail/detail_reject/layout.tsx
index cb5dc695..25560032 100644
--- a/src/app_modules/donasi/detail/detail_reject/layout.tsx
+++ b/src/app_modules/donasi/detail/detail_reject/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutDetailRejectDonasi({
@@ -11,11 +14,18 @@ export default function LayoutDetailRejectDonasi({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/donasi/detail/detail_review/index.tsx b/src/app_modules/donasi/detail/detail_review/index.tsx
index 4cd3e1f5..7ac019fc 100644
--- a/src/app_modules/donasi/detail/detail_review/index.tsx
+++ b/src/app_modules/donasi/detail/detail_review/index.tsx
@@ -1,35 +1,60 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import { UIGlobal_Modal } from "@/app_modules/_global/ui";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
-import mqtt_client from "@/util/mqtt_client";
+import { IRealtimeData } from "@/lib/global_state";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { Button, Stack } from "@mantine/core";
-import { useRouter } from "next/navigation";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import { WibuRealtime } from "wibu-pkg";
import ComponentDonasi_DetailDataGalangDana from "../../component/detail_galang_dana/detail_data_donasi";
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
-import { Donasi_funGantiStatus } from "../../fun/update/fun_ganti_status";
-import { MODEL_DONASI } from "../../model/interface";
import { donasi_checkStatus } from "../../fun";
-import { WibuRealtime } from "wibu-pkg";
-import { IRealtimeData } from "@/app/lib/global_state";
+import { Donasi_funGantiStatus } from "../../fun/update/fun_ganti_status";
+import { apiGetOneDonasiById } from "../../lib/api_donasi";
+import { MODEL_DONASI } from "../../model/interface";
-export default function DetailReviewDonasi({
- dataDonasi,
-}: {
- dataDonasi: MODEL_DONASI;
-}) {
- const [donasi, setDonasi] = useState(dataDonasi);
+export default function DetailReviewDonasi() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState({} as MODEL_DONASI);
+ const [loading, setLoading] = useState(true);
+
+ useShallowEffect(() => {
+ getData();
+ }, []);
+
+ async function getData() {
+ try {
+ setLoading(true);
+ const response = await apiGetOneDonasiById(param.id, "semua");
+
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ if (loading) {
+ return ;
+ }
return (
<>
-
-
-
+
+
+
>
);
@@ -40,19 +65,11 @@ function ButtonBatalReview({ donasi }: { donasi: MODEL_DONASI }) {
const [openModal, setOpenModal] = useState(false);
async function onChangeStatus() {
+ setLoading(true);
const check = await donasi_checkStatus({ id: donasi.id });
if (check) {
const res = await Donasi_funGantiStatus(donasi.id, "3");
if (res.status === 200) {
- // const dataNotif = {
- // appId: res.data?.id as any,
- // status: res.data?.DonasiMaster_Status?.name as any,
- // userId: res.data?.authorId as any,
- // pesan: res.data?.title as any,
- // kategoriApp: "DONASI",
- // title: "Membatalkan review",
- // };
-
const dataNotifikasi: IRealtimeData = {
appId: res.data?.id as any,
status: res.data?.DonasiMaster_Status?.name as any,
@@ -77,15 +94,15 @@ function ButtonBatalReview({ donasi }: { donasi: MODEL_DONASI }) {
pushNotificationTo: "ADMIN",
dataMessage: dataNotifikasi,
});
-
- ComponentGlobal_NotifikasiBerhasil("Berhasil Dibatalkan");
- setLoading(true);
- router.push(RouterDonasi.status_galang_dana({ id: "3" }));
}
+ ComponentGlobal_NotifikasiBerhasil("Berhasil Dibatalkan");
+ router.replace(RouterDonasi.status_galang_dana({ id: "3" }));
} else {
+ setLoading(false);
ComponentGlobal_NotifikasiPeringatan(res.message);
}
} else {
+ setLoading(false);
ComponentGlobal_NotifikasiPeringatan("Donasi telah direview admin");
}
}
@@ -95,10 +112,10 @@ function ButtonBatalReview({ donasi }: { donasi: MODEL_DONASI }) {
mt={"lg"}
style={{
transition: "0.5s",
+ backgroundColor: MainColor.orange,
}}
radius={"xl"}
- bg={"orange"}
- color="orange"
+ c={MainColor.darkblue}
onClick={() => setOpenModal(true)}
>
Batalkan Review
@@ -109,16 +126,22 @@ function ButtonBatalReview({ donasi }: { donasi: MODEL_DONASI }) {
opened={openModal}
close={() => setOpenModal(false)}
buttonKiri={
- setOpenModal(false)}>
+ setOpenModal(false)}
+ >
Batal
}
buttonKanan={
{
onChangeStatus();
}}
diff --git a/src/app_modules/donasi/detail/detail_review/layout.tsx b/src/app_modules/donasi/detail/detail_review/layout.tsx
index 0b9caa13..52954732 100644
--- a/src/app_modules/donasi/detail/detail_review/layout.tsx
+++ b/src/app_modules/donasi/detail/detail_review/layout.tsx
@@ -1,20 +1,31 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
-export default function LayoutDetailReviewDonasi({
+export default function LayoutDetailReviewDonasi({
children,
}: {
children: React.ReactNode;
}) {
-
return (
<>
- }>
+ {/* }
+ >
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/donasi/edit/edit_cerita_penggalang/index.tsx b/src/app_modules/donasi/edit/edit_cerita_penggalang/index.tsx
index 055fd056..8a864cc5 100644
--- a/src/app_modules/donasi/edit/edit_cerita_penggalang/index.tsx
+++ b/src/app_modules/donasi/edit/edit_cerita_penggalang/index.tsx
@@ -1,9 +1,10 @@
"use client";
-import { DIRECTORY_ID } from "@/app/lib";
+import { DIRECTORY_ID } from "@/lib";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import {
ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
ComponentGlobal_LoadImageCustom,
} from "@/app_modules/_global/component";
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
@@ -15,40 +16,62 @@ import {
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import { clientLogger } from "@/util/clientLogger";
import {
AspectRatio,
Button,
Center,
- FileButton,
Image,
Stack,
Textarea,
} from "@mantine/core";
-import { IconCamera } from "@tabler/icons-react";
import _ from "lodash";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { Donasi_funUpdateCerita } from "../../fun/update/fun_update_cerita_donasi";
import { MODEL_CERITA_DONASI } from "../../model/interface";
+import Component_V3_Label_TextInput from "@/app_modules/_global/component/new/comp_V3_label_text_input";
+import { Component_V3_TextEditor } from "@/app_modules/_global/component/new/comp_V3_text_editor";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetDonasiCeritaPenggalang } from "../../lib/api_donasi";
+import { useParams } from "next/navigation";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export default function EditCeritaPenggalangDonasi({
- dataCerita,
-}: {
- dataCerita: MODEL_CERITA_DONASI;
-}) {
+export default function EditCeritaPenggalangDonasi() {
+ const { id } = useParams();
const router = useRouter();
const [isLoading, setLoading] = useState(false);
- const [data, setData] = useState(dataCerita);
+ const [data, setData] = useState(null);
const [file, setFile] = useState(null);
const [updateImage, setUpdateImage] = useState();
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetDonasiCeritaPenggalang({
+ id: id as string,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error("Error get data donasi cerita penggalang", error);
+ }
+ }
+
async function onUpdate() {
setLoading(true);
const body = {
- id: data.id,
- pembukaan: data.pembukaan,
- cerita: data.cerita,
+ id: data?.id,
+ pembukaan: data?.pembukaan,
+ cerita: data?.cerita,
};
if (_.values(body).includes(""))
@@ -60,17 +83,19 @@ export default function EditCeritaPenggalangDonasi({
file: file as File,
dirId: DIRECTORY_ID.donasi_cerita_image,
});
+
if (!uploadImage.success) {
setLoading(false);
ComponentGlobal_NotifikasiPeringatan("Gagal upload file gambar");
+ return;
}
const deleteImage = await funGlobal_DeleteFileById({
- fileId: data.imageId,
+ fileId: data?.imageId as string,
});
if (!deleteImage.success) {
setLoading(false);
- ComponentGlobal_NotifikasiPeringatan("Gagal hapus gambar lama");
+ clientLogger.error("Gagal hapus gambar lama");
}
const res = await Donasi_funUpdateCerita({
@@ -80,7 +105,6 @@ export default function EditCeritaPenggalangDonasi({
if (res.status === 200) {
ComponentGlobal_NotifikasiBerhasil(res.message);
router.back();
- setLoading(false);
} else {
ComponentGlobal_NotifikasiGagal(res.message);
setLoading(false);
@@ -93,27 +117,49 @@ export default function EditCeritaPenggalangDonasi({
if (res.status === 200) {
ComponentGlobal_NotifikasiBerhasil(res.message);
router.back();
- setLoading(false);
} else {
ComponentGlobal_NotifikasiGagal(res.message);
setLoading(false);
}
}
} catch (error) {
- console.log(error);
+ setLoading(false);
+ clientLogger.error("Error update cerita penggalangan", error);
}
}
+ if (!data) return ;
+
return (
<>
+
+
+ {
+ setData({
+ ...data,
+ pembukaan: val,
+ });
+ }}
+ />
+
+
+
+
+ {/*
-
+ */}
-
+
{updateImage ? (
@@ -163,44 +209,40 @@ export default function EditCeritaPenggalangDonasi({
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
-
- setUpdateImage(buffer);
- setFile(files);
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
- }
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload
-
- )}
-
+
+
+
+ {
+ setData({
+ ...data,
+ cerita: val,
+ });
+ }}
+ />
+
+
+
+
+ {/*
-
+ */}
maxInputLength ||
+ funReplaceHtml({ html: data.pembukaan }).length === 0 ||
+ funReplaceHtml({ html: data.cerita }).length > maxInputLength ||
+ funReplaceHtml({ html: data.cerita }).length === 0
+ }
w={"100%"}
radius={"xl"}
onClick={() => {
@@ -247,7 +297,6 @@ export default function EditCeritaPenggalangDonasi({
Update
- {/* {JSON.stringify(value.pembukaan, null, 2)} */}
>
);
}
diff --git a/src/app_modules/donasi/edit/edit_cerita_penggalang/layout.tsx b/src/app_modules/donasi/edit/edit_cerita_penggalang/layout.tsx
index bee2d3fd..3e5cb34b 100644
--- a/src/app_modules/donasi/edit/edit_cerita_penggalang/layout.tsx
+++ b/src/app_modules/donasi/edit/edit_cerita_penggalang/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutEditCeritaPenggalangDonasi({
@@ -11,9 +14,12 @@ export default function LayoutEditCeritaPenggalangDonasi({
}) {
return (
<>
- }>
- {children}
-
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/donasi/edit/edit_donasi/edit_donasi_new.tsx b/src/app_modules/donasi/edit/edit_donasi/edit_donasi_new.tsx
new file mode 100644
index 00000000..bd0e333f
--- /dev/null
+++ b/src/app_modules/donasi/edit/edit_donasi/edit_donasi_new.tsx
@@ -0,0 +1,367 @@
+"use client";
+import { DIRECTORY_ID } from "@/lib";
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import {
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
+ ComponentGlobal_LoadImageCustom,
+} from "@/app_modules/_global/component";
+import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
+import {
+ funGlobal_DeleteFileById,
+ funGlobal_UploadToStorage,
+} from "@/app_modules/_global/fun";
+import {
+ ComponentGlobal_NotifikasiBerhasil,
+ ComponentGlobal_NotifikasiPeringatan,
+} from "@/app_modules/_global/notif_global";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ AspectRatio,
+ Button,
+ Center,
+ Image,
+ Select,
+ Stack,
+ Text,
+ TextInput,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import { Donasi_funUpdateDonasi } from "../../fun/update/fun_update_donasi";
+import { apiGetMasterDonasi, apiGetOneDonasiById } from "../../lib/api_donasi";
+import { MODEL_DONASI } from "../../model/interface";
+import SkeletonEditDonasi from "./skeleton_edit_donasi";
+
+export default function EditDonasiNew() {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ const [data, setData] = useState();
+ const [kategori, setKategori] = useState([]);
+ const [durasi, setDurasi] = useState([]);
+ const [file, setFile] = useState(null);
+ const [updateImage, setUpdateImage] = useState();
+ const [newTarget, setNewTarget] = useState("");
+ const [loadingMaster, setLoadingMaster] = useState(true);
+ const param = useParams<{ id: string }>();
+ const [loadingData, setLoadingData] = useState(true);
+
+ async function onGetMaster() {
+ try {
+ setLoadingMaster(true);
+ const responseKategori = await apiGetMasterDonasi("?cat=kategori");
+ const responseDurasi = await apiGetMasterDonasi("?cat=durasi");
+ if (responseKategori.success) {
+ setKategori(responseKategori.data);
+ }
+ if (responseDurasi.success) {
+ setDurasi(responseDurasi.data);
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setLoadingMaster(false);
+ }
+ }
+
+ async function onGetData() {
+ try {
+ setLoadingData(true);
+ const response = await apiGetOneDonasiById(param.id, "semua");
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoadingData(false);
+ }
+ }
+
+ useShallowEffect(() => {
+ onGetMaster();
+ onGetData();
+ }, []);
+
+ async function onUpdate() {
+ setLoading(true);
+ const body = {
+ id: data?.id,
+ donasiMaster_KategoriId: data?.DonasiMaster_Ketegori.id,
+ donasiMaster_DurasiId: data?.DonasiMaster_Durasi.id,
+ title: data?.title,
+ target: data?.target,
+ };
+
+ if (_.values(body).includes(""))
+ return ComponentGlobal_NotifikasiPeringatan("Lengkapin Data");
+
+ try {
+ if (file != null) {
+ const uploadImage = await funGlobal_UploadToStorage({
+ file: file as File,
+ dirId: DIRECTORY_ID.donasi_image,
+ });
+
+ if (!uploadImage.success) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload file gambar");
+ return;
+ }
+
+ const deleteImage = await funGlobal_DeleteFileById({
+ fileId: String(data?.imageId),
+ dirId: DIRECTORY_ID.donasi_image,
+ });
+
+ if (!deleteImage.success) {
+ setLoading(false);
+ clientLogger.error("Gagal hapus gambar lama");
+ }
+
+ const res = await Donasi_funUpdateDonasi({
+ data: body as any,
+ fileId: uploadImage.data.id,
+ });
+
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ router.back();
+ } else {
+ ComponentGlobal_NotifikasiPeringatan(res.message);
+ setLoading(false);
+ }
+ } else {
+ const res = await Donasi_funUpdateDonasi({
+ data: body as any,
+ });
+
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ router.back();
+ } else {
+ ComponentGlobal_NotifikasiPeringatan(res.message);
+ setLoading(false);
+ }
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error update data donasi", error);
+ }
+ }
+
+ return (
+ <>
+ {loadingData ? (
+
+ ) : (
+
+ ({
+ value: e.id,
+ label: e.name,
+ }))}
+ onChange={(val) =>
+ setData({
+ ...(data as any),
+ DonasiMaster_Ketegori: {
+ id: val,
+ },
+ })
+ }
+ />
+
+
+
+ {updateImage ? (
+
+
+
+ ) : (
+
+
+
+ )}
+
+
+
+
+
+
+ {/*
+ {
+ try {
+ const buffer = URL.createObjectURL(
+ new Blob([new Uint8Array(await files.arrayBuffer())])
+ );
+
+ setUpdateImage(buffer);
+ setFile(files);
+ } catch (error) {
+ console.log(error);
+ }
+ }}
+ accept="image/png,image/jpeg"
+ >
+ {(props) => (
+ }
+ bg={MainColor.yellow}
+ color="yellow"
+ c={"black"}
+ >
+ Upload
+
+ )}
+
+ */}
+
+
+
+
+ ) : (
+ ""
+ )
+ }
+ onChange={(val) =>
+ setData({
+ ...(data as any),
+ title: val.target.value,
+ })
+ }
+ />
+
+ Rp.}
+ min={0}
+ withAsterisk
+ label="Target Dana"
+ placeholder="0"
+ value={newTarget ? newTarget : data?.target}
+ error={
+ data?.target === "" || data?.target === "0" ? (
+
+ ) : (
+ ""
+ )
+ }
+ onChange={(val) => {
+ const match = val.currentTarget.value
+ .replace(/\./g, "")
+ .match(/^[0-9]+$/);
+
+ if (val.currentTarget.value === "") {
+ setData({
+ ...(data as any),
+ target: 0 + "",
+ });
+ setNewTarget("0");
+ }
+
+ if (!match?.[0]) return null;
+
+ const nilai = val.currentTarget.value.replace(/\./g, "");
+ const target = Intl.NumberFormat("id-ID").format(+nilai);
+
+ setNewTarget(target);
+
+ setData({
+ ...(data as any),
+ target: nilai,
+ });
+ }}
+ />
+ ({
+ value: e.id,
+ label: e.name + " " + `hari`,
+ }))}
+ onChange={(val) =>
+ setData({
+ ...(data as any),
+ DonasiMaster_Durasi: {
+ id: val,
+ },
+ })
+ }
+ />
+
+ {
+ onUpdate();
+ }}
+ bg={MainColor.yellow}
+ color="yellow"
+ c={"black"}
+ >
+ Update
+
+
+ )}
+ >
+ );
+}
diff --git a/src/app_modules/donasi/edit/edit_donasi/index.tsx b/src/app_modules/donasi/edit/edit_donasi/index.tsx
index 42398608..7a84db95 100644
--- a/src/app_modules/donasi/edit/edit_donasi/index.tsx
+++ b/src/app_modules/donasi/edit/edit_donasi/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { DIRECTORY_ID } from "@/app/lib";
+import { DIRECTORY_ID } from "@/lib";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import {
ComponentGlobal_BoxUploadImage,
diff --git a/src/app_modules/donasi/edit/edit_donasi/layout.tsx b/src/app_modules/donasi/edit/edit_donasi/layout.tsx
index 788dc93c..fe973c72 100644
--- a/src/app_modules/donasi/edit/edit_donasi/layout.tsx
+++ b/src/app_modules/donasi/edit/edit_donasi/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutEditDonasi({
@@ -11,9 +14,18 @@ export default function LayoutEditDonasi({
}) {
return (
<>
- }>
+ {/* }
+ >
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/donasi/edit/edit_donasi/skeleton_edit_donasi.tsx b/src/app_modules/donasi/edit/edit_donasi/skeleton_edit_donasi.tsx
new file mode 100644
index 00000000..aad5aace
--- /dev/null
+++ b/src/app_modules/donasi/edit/edit_donasi/skeleton_edit_donasi.tsx
@@ -0,0 +1,24 @@
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Box, Stack } from "@mantine/core";
+
+export default function SkeletonEditDonasi() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+ {[...Array(3)].map((_, index) => (
+
+ ))}
+
+
+
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/donasi/edit/edit_rekening/index.tsx b/src/app_modules/donasi/edit/edit_rekening/index.tsx
index c46a182f..7d445b04 100644
--- a/src/app_modules/donasi/edit/edit_rekening/index.tsx
+++ b/src/app_modules/donasi/edit/edit_rekening/index.tsx
@@ -1,28 +1,46 @@
"use client";
-import { Button, Stack, TextInput } from "@mantine/core";
-import { MODEL_DONASI } from "../../model/interface";
-import { useState } from "react";
-import _ from "lodash";
-import { useRouter } from "next/navigation";
-import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
-import { Donasi_funUpdateRekening } from "../../fun/update/fun_update_rekening";
-import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
import {
ComponentGlobal_NotifikasiBerhasil,
ComponentGlobal_NotifikasiGagal,
} from "@/app_modules/_global/notif_global";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Button, Stack, TextInput } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import { Donasi_funUpdateRekening } from "../../fun/update/fun_update_rekening";
+import { apiGetOneDonasiById } from "../../lib/api_donasi";
+import { MODEL_DONASI } from "../../model/interface";
-export default function Donasi_EditRekening({
- dataDonasi,
-}: {
- dataDonasi: MODEL_DONASI;
-}) {
+export default function Donasi_EditRekening() {
+ const { id } = useParams();
const router = useRouter();
- const [donasi, setDonasi] = useState(dataDonasi);
+ const [data, setData] = useState(null);
const [isLoading, setLoading] = useState(false);
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetOneDonasiById(id as string, "semua");
+
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error("Error get data donasi", error);
+ }
+ }
+
+ if (!data) return ;
+
return (
<>
@@ -36,17 +54,17 @@ export default function Donasi_EditRekening({
withAsterisk
label="Nama Bank"
placeholder="Masukan Nama Bank"
- value={donasi.namaBank}
+ value={data.namaBank}
error={
- donasi.namaBank === "" ? (
+ data.namaBank === "" ? (
) : (
""
)
}
onChange={(val) =>
- setDonasi({
- ...donasi,
+ setData({
+ ...data,
namaBank: _.upperCase(val.target.value),
})
}
@@ -61,17 +79,17 @@ export default function Donasi_EditRekening({
type="number"
label="Nomor Rekening"
placeholder="Masukkan Nomor Rekening"
- value={donasi.rekening}
+ value={data.rekening}
error={
- donasi.rekening === "" ? (
+ data.rekening === "" ? (
) : (
""
)
}
onChange={(val) =>
- setDonasi({
- ...donasi,
+ setData({
+ ...data,
rekening: val.currentTarget.value,
})
}
@@ -83,11 +101,9 @@ export default function Donasi_EditRekening({
}}
loaderPosition="center"
loading={isLoading ? true : false}
- disabled={
- donasi.namaBank === "" || donasi.rekening === "" ? true : false
- }
+ disabled={data.namaBank === "" || data.rekening === "" ? true : false}
radius={"xl"}
- onClick={() => onUpdate(router, donasi, setLoading)}
+ onClick={() => onUpdate(router, data, setLoading)}
bg={MainColor.yellow}
color="yellow"
c={"black"}
diff --git a/src/app_modules/donasi/edit/update_kabar/index.tsx b/src/app_modules/donasi/edit/update_kabar/index.tsx
index 60098371..76c81e7d 100644
--- a/src/app_modules/donasi/edit/update_kabar/index.tsx
+++ b/src/app_modules/donasi/edit/update_kabar/index.tsx
@@ -4,37 +4,58 @@ import {
ComponentGlobal_CardStyles,
ComponentGlobal_LoadImageLandscape,
} from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
import { Group, Stack, Text, Title } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import moment from "moment";
+import "moment/locale/id";
+import { useParams } from "next/navigation";
import { useState } from "react";
+import { apiGetDonasiKabarById } from "../../lib/api_donasi";
import { MODEL_DONASI_KABAR } from "../../model/interface";
-export default function UpdateKabarDonasi({
- dataKabar,
-}: {
- dataKabar: MODEL_DONASI_KABAR;
-}) {
- const [kabar, setKabar] = useState(dataKabar);
+export default function UpdateKabarDonasi() {
+ const { id } = useParams();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetDonasiKabarById({ id: id as string });
+ // console.log("res >", response)
+ if (response && response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data kabar", error);
+ }
+ }
+
+ if (!data) return ;
+
return (
<>
- {new Intl.DateTimeFormat("id-ID", { dateStyle: "medium" }).format(
- kabar.createdAt
- )}
+ {moment(data.createdAt).format("DD MMM YYYY")}
- {kabar.imageId === null ? (
+ {data.imageId === null ? (
""
) : (
-
+
)}
- {kabar.title}
+ {data.title}
- {kabar.deskripsi}
+ {data.deskripsi}
>
diff --git a/src/app_modules/donasi/edit/update_kabar/layout.tsx b/src/app_modules/donasi/edit/update_kabar/layout.tsx
index 278d77bc..e2c67094 100644
--- a/src/app_modules/donasi/edit/update_kabar/layout.tsx
+++ b/src/app_modules/donasi/edit/update_kabar/layout.tsx
@@ -9,45 +9,67 @@ import {
import { UIGlobal_DrawerCustom } from "@/app_modules/_global/ui";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import { ActionIcon, Center, SimpleGrid, Stack, Text } from "@mantine/core";
+import {
+ ActionIcon,
+ Center,
+ SimpleGrid,
+ Stack,
+ Text,
+ Loader,
+} from "@mantine/core";
import { IconDotsVertical, IconEdit, IconTrash } from "@tabler/icons-react";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import React from "react";
import { Donasi_funDeleteKabar } from "../../fun/delete/fun_delete.kabar";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewHeader,
+ UI_NewChildren,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
export default function LayoutUpdateKabarDonasi({
children,
- kabarId,
}: {
children: React.ReactNode;
- kabarId: string;
}) {
+ const { id } = useParams<{ id: string }>();
const router = useRouter();
const [openDrawer, setOpenDrawer] = React.useState(false);
+ const [loadingDelete, setLoadingDelete] = React.useState(false);
async function onDelete() {
- const res = await Donasi_funDeleteKabar(kabarId);
- if (res.status === 200) {
- const deleteImage = await funGlobal_DeleteFileById({
- fileId: res.imageId as any,
- });
+ try {
+ setLoadingDelete(true);
+ const res = await Donasi_funDeleteKabar(id);
+ if (res.status === 200) {
+ let deleteImage = null;
+ if (res.imageId) {
+ const deleteImage = await funGlobal_DeleteFileById({
+ fileId: res.imageId as any,
+ });
- if (!deleteImage.success) {
- ComponentGlobal_NotifikasiPeringatan("Gagal hapus gambar ");
+ if (!deleteImage.success) {
+ console.log("Gagal hapus gambar ");
+ }
+ }
+
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ router.back();
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
}
-
- ComponentGlobal_NotifikasiBerhasil(res.message);
- router.back();
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ } catch (error) {
+ console.log("Error delete kabar", error);
+ } finally {
+ setLoadingDelete(false);
}
}
return (
<>
-
+
+
}
/>
- }
- >
- {children}
-
+
+ {children}
+
{
- router.push(RouterDonasi.edit_kabar({ id: kabarId }), {
+ router.push(RouterDonasi.edit_kabar({ id: id }), {
scroll: false,
});
}}
@@ -87,7 +108,11 @@ export default function LayoutUpdateKabarDonasi({
onDelete()}>
-
+ {loadingDelete ? (
+
+ ) : (
+
+ )}
Hapus kabar
diff --git a/src/app_modules/donasi/fun/count/get_count_donatur.ts b/src/app_modules/donasi/fun/count/get_count_donatur.ts
index 00091b7b..4b2bc19e 100644
--- a/src/app_modules/donasi/fun/count/get_count_donatur.ts
+++ b/src/app_modules/donasi/fun/count/get_count_donatur.ts
@@ -1,6 +1,6 @@
"use server"
-import prisma from "@/app/lib/prisma"
+import prisma from "@/lib/prisma"
export async function Donasi_getCountDonatur(donasiId: string) {
const donatur = await prisma.donasi_Invoice.count({
diff --git a/src/app_modules/donasi/fun/create/fun_create_donasi.ts b/src/app_modules/donasi/fun/create/fun_create_donasi.ts
index 2aab80e5..c94d4130 100644
--- a/src/app_modules/donasi/fun/create/fun_create_donasi.ts
+++ b/src/app_modules/donasi/fun/create/fun_create_donasi.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import prisma from "@/lib/prisma";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { revalidatePath } from "next/cache";
import { MODEL_DONASI } from "../../model/interface";
import { Donasi_funDeleteTemporaryCreate } from "../delete/fun_delete_temporary_create";
diff --git a/src/app_modules/donasi/fun/create/fun_create_donasi_temporary.ts b/src/app_modules/donasi/fun/create/fun_create_donasi_temporary.ts
index 2af38cdd..f7edacd9 100644
--- a/src/app_modules/donasi/fun/create/fun_create_donasi_temporary.ts
+++ b/src/app_modules/donasi/fun/create/fun_create_donasi_temporary.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_DONASI } from "../../model/interface";
interface Model_Temporary {
diff --git a/src/app_modules/donasi/fun/create/fun_create_invoice.tsx b/src/app_modules/donasi/fun/create/fun_create_invoice.tsx
index 5cbf38d2..9499a707 100644
--- a/src/app_modules/donasi/fun/create/fun_create_invoice.tsx
+++ b/src/app_modules/donasi/fun/create/fun_create_invoice.tsx
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function Donasi_funCreateInvoice(data: any) {
diff --git a/src/app_modules/donasi/fun/create/fun_create_kabar.ts b/src/app_modules/donasi/fun/create/fun_create_kabar.ts
index 67853a3a..bc10d281 100644
--- a/src/app_modules/donasi/fun/create/fun_create_kabar.ts
+++ b/src/app_modules/donasi/fun/create/fun_create_kabar.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import prisma from "@/lib/prisma";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { revalidatePath } from "next/cache";
import { MODEL_DONASI_KABAR } from "../../model/interface";
diff --git a/src/app_modules/donasi/fun/create/fun_create_notif.ts b/src/app_modules/donasi/fun/create/fun_create_notif.ts
index 25af50ed..15807911 100644
--- a/src/app_modules/donasi/fun/create/fun_create_notif.ts
+++ b/src/app_modules/donasi/fun/create/fun_create_notif.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import prisma from "@/lib/prisma";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import _ from "lodash";
import { revalidatePath } from "next/cache";
diff --git a/src/app_modules/donasi/fun/delete/fin_delete_donasi_by_id.ts b/src/app_modules/donasi/fun/delete/fin_delete_donasi_by_id.ts
index 3ba4dd04..2b9ca67a 100644
--- a/src/app_modules/donasi/fun/delete/fin_delete_donasi_by_id.ts
+++ b/src/app_modules/donasi/fun/delete/fin_delete_donasi_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_funDeleteDonasiById(donasiId: string) {
const delCerita = await prisma.donasi_Cerita.delete({
diff --git a/src/app_modules/donasi/fun/delete/fun_delete.kabar.ts b/src/app_modules/donasi/fun/delete/fun_delete.kabar.ts
index 61f58d17..92de71ec 100644
--- a/src/app_modules/donasi/fun/delete/fun_delete.kabar.ts
+++ b/src/app_modules/donasi/fun/delete/fun_delete.kabar.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import prisma from "@/lib/prisma";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { revalidatePath } from "next/cache";
export async function Donasi_funDeleteKabar(kabarId: string) {
diff --git a/src/app_modules/donasi/fun/delete/fun_delete_temporary_create.ts b/src/app_modules/donasi/fun/delete/fun_delete_temporary_create.ts
index 35352166..1818aca5 100644
--- a/src/app_modules/donasi/fun/delete/fun_delete_temporary_create.ts
+++ b/src/app_modules/donasi/fun/delete/fun_delete_temporary_create.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_funDeleteTemporaryCreate(id: string) {
const del = await prisma.donasi_TemporaryCreate.delete({
diff --git a/src/app_modules/donasi/fun/get/fun_check_status.tsx b/src/app_modules/donasi/fun/get/fun_check_status.tsx
index 1b751153..e824768b 100644
--- a/src/app_modules/donasi/fun/get/fun_check_status.tsx
+++ b/src/app_modules/donasi/fun/get/fun_check_status.tsx
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
export async function donasi_checkStatus({ id }: { id: string }) {
const checkStatus = await prisma.donasi.findFirst({
@@ -9,7 +9,8 @@ export async function donasi_checkStatus({ id }: { id: string }) {
},
});
- console.log(checkStatus?.donasiMaster_StatusDonasiId, "ini status nya")
+ await prisma.$disconnect();
+
if (checkStatus?.donasiMaster_StatusDonasiId == "2") return true;
return false;
diff --git a/src/app_modules/donasi/fun/get/get_all_invoice_by_author_id.tsx b/src/app_modules/donasi/fun/get/get_all_invoice_by_author_id.tsx
index dac445e3..c1bb2d05 100644
--- a/src/app_modules/donasi/fun/get/get_all_invoice_by_author_id.tsx
+++ b/src/app_modules/donasi/fun/get/get_all_invoice_by_author_id.tsx
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function donasi_funGetAllInvoiceByAuthorId({
diff --git a/src/app_modules/donasi/fun/get/get_author_by_id.ts b/src/app_modules/donasi/fun/get/get_author_by_id.ts
index 03015b14..e9d4d088 100644
--- a/src/app_modules/donasi/fun/get/get_author_by_id.ts
+++ b/src/app_modules/donasi/fun/get/get_author_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_getAuthorById(authorId: string) {
// console.log(authorId);
diff --git a/src/app_modules/donasi/fun/get/get_cerita_penggalang.ts b/src/app_modules/donasi/fun/get/get_cerita_penggalang.ts
index ae6b4265..469b92b6 100644
--- a/src/app_modules/donasi/fun/get/get_cerita_penggalang.ts
+++ b/src/app_modules/donasi/fun/get/get_cerita_penggalang.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function Donasi_getCeritaByDonasiId(donasiId: string) {
const data = await prisma.donasi_Cerita.findFirst({
diff --git a/src/app_modules/donasi/fun/get/get_donasi_by_status.ts b/src/app_modules/donasi/fun/get/get_donasi_by_status.ts
index 7ba0682c..44b210ea 100644
--- a/src/app_modules/donasi/fun/get/get_donasi_by_status.ts
+++ b/src/app_modules/donasi/fun/get/get_donasi_by_status.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
/**
*
diff --git a/src/app_modules/donasi/fun/get/get_donatur_by_token_id.ts b/src/app_modules/donasi/fun/get/get_donatur_by_token_id.ts
index 0d2839b8..2ff8ecff 100644
--- a/src/app_modules/donasi/fun/get/get_donatur_by_token_id.ts
+++ b/src/app_modules/donasi/fun/get/get_donatur_by_token_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_findDonaturByTokenId(
donasiId: string,
diff --git a/src/app_modules/donasi/fun/get/get_list_beranda.tsx b/src/app_modules/donasi/fun/get/get_list_beranda.tsx
index 2dc57bc6..51daabd1 100644
--- a/src/app_modules/donasi/fun/get/get_list_beranda.tsx
+++ b/src/app_modules/donasi/fun/get/get_list_beranda.tsx
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { tree } from "next/dist/build/templates/app-page";
export async function donasi_funGetAllPublish({ page }: { page: number }) {
diff --git a/src/app_modules/donasi/fun/get/get_list_donatur.ts b/src/app_modules/donasi/fun/get/get_list_donatur.ts
index f45821c0..2c35aad0 100644
--- a/src/app_modules/donasi/fun/get/get_list_donatur.ts
+++ b/src/app_modules/donasi/fun/get/get_list_donatur.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function donasi_funGetListDonaturById({
page,
diff --git a/src/app_modules/donasi/fun/get/get_list_kabar.ts b/src/app_modules/donasi/fun/get/get_list_kabar.ts
index bd954294..d76490a1 100644
--- a/src/app_modules/donasi/fun/get/get_list_kabar.ts
+++ b/src/app_modules/donasi/fun/get/get_list_kabar.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function donasi_funGetListKabarById({
page,
diff --git a/src/app_modules/donasi/fun/get/get_list_pencairan_dana_by_id.ts b/src/app_modules/donasi/fun/get/get_list_pencairan_dana_by_id.ts
index cb2b7cdb..5733b441 100644
--- a/src/app_modules/donasi/fun/get/get_list_pencairan_dana_by_id.ts
+++ b/src/app_modules/donasi/fun/get/get_list_pencairan_dana_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function donasi_funGetListPencairanDanaById({
page,
diff --git a/src/app_modules/donasi/fun/get/get_nama_bank.ts b/src/app_modules/donasi/fun/get/get_nama_bank.ts
index 2afbe0d7..3c1c8ab6 100644
--- a/src/app_modules/donasi/fun/get/get_nama_bank.ts
+++ b/src/app_modules/donasi/fun/get/get_nama_bank.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_getNamaBank(bankId: string) {
const data = await prisma.donasiMaster_Bank.findFirst({
diff --git a/src/app_modules/donasi/fun/get/get_notif_by_user_id.ts b/src/app_modules/donasi/fun/get/get_notif_by_user_id.ts
index f7c05c8e..d232f331 100644
--- a/src/app_modules/donasi/fun/get/get_notif_by_user_id.ts
+++ b/src/app_modules/donasi/fun/get/get_notif_by_user_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_getNotifByUserId(userId: string) {
// console.log(dataInvoice)
diff --git a/src/app_modules/donasi/fun/get/get_one_donasi_by_id.ts b/src/app_modules/donasi/fun/get/get_one_donasi_by_id.ts
index 7c45eff7..c72774e7 100644
--- a/src/app_modules/donasi/fun/get/get_one_donasi_by_id.ts
+++ b/src/app_modules/donasi/fun/get/get_one_donasi_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_getOneById(donasiId: string) {
const data = await prisma.donasi.findFirst({
diff --git a/src/app_modules/donasi/fun/get/get_one_invoice_by_id.tsx b/src/app_modules/donasi/fun/get/get_one_invoice_by_id.tsx
index 3cb5f34c..b097f47a 100644
--- a/src/app_modules/donasi/fun/get/get_one_invoice_by_id.tsx
+++ b/src/app_modules/donasi/fun/get/get_one_invoice_by_id.tsx
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_getOneInvoiceById(invoiceId: string) {
const res = await prisma.donasi_Invoice.findFirst({
diff --git a/src/app_modules/donasi/fun/get/get_one_kabar.ts b/src/app_modules/donasi/fun/get/get_one_kabar.ts
index ee92b094..bbb7f5a3 100644
--- a/src/app_modules/donasi/fun/get/get_one_kabar.ts
+++ b/src/app_modules/donasi/fun/get/get_one_kabar.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_getOneKabar(kabarId: string) {
const data = await prisma.donasi_Kabar.findFirst({
diff --git a/src/app_modules/donasi/fun/get/get_one_status_invoice_by_id.ts b/src/app_modules/donasi/fun/get/get_one_status_invoice_by_id.ts
index 1290fed4..334002ae 100644
--- a/src/app_modules/donasi/fun/get/get_one_status_invoice_by_id.ts
+++ b/src/app_modules/donasi/fun/get/get_one_status_invoice_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function donasi_getOneStatusInvoiceById({
invoiceId,
diff --git a/src/app_modules/donasi/fun/get/get_pencairan_dana_by_id.ts b/src/app_modules/donasi/fun/get/get_pencairan_dana_by_id.ts
index 988a465d..57f6b984 100644
--- a/src/app_modules/donasi/fun/get/get_pencairan_dana_by_id.ts
+++ b/src/app_modules/donasi/fun/get/get_pencairan_dana_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_getTotalPencairanDanaById(donasiId: string) {
const data = await prisma.donasi.findFirst({
diff --git a/src/app_modules/donasi/fun/get/get_temporary_create.ts b/src/app_modules/donasi/fun/get/get_temporary_create.ts
index 3f014e68..6eacb1d7 100644
--- a/src/app_modules/donasi/fun/get/get_temporary_create.ts
+++ b/src/app_modules/donasi/fun/get/get_temporary_create.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_getTemporaryCreate(id: string) {
const data = await prisma.donasi_TemporaryCreate.findFirst({
diff --git a/src/app_modules/donasi/fun/get/status/get_all_by_status_id.ts b/src/app_modules/donasi/fun/get/status/get_all_by_status_id.ts
index 17d26311..544502c1 100644
--- a/src/app_modules/donasi/fun/get/status/get_all_by_status_id.ts
+++ b/src/app_modules/donasi/fun/get/status/get_all_by_status_id.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function donasi_funGetAllStatusById({
diff --git a/src/app_modules/donasi/fun/get/status/get_all_status_draft.ts b/src/app_modules/donasi/fun/get/status/get_all_status_draft.ts
index ba740354..a736098c 100644
--- a/src/app_modules/donasi/fun/get/status/get_all_status_draft.ts
+++ b/src/app_modules/donasi/fun/get/status/get_all_status_draft.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function donasi_funGetAllStatusDraft({ page }: { page: number }) {
diff --git a/src/app_modules/donasi/fun/get/status/get_all_status_publish.ts b/src/app_modules/donasi/fun/get/status/get_all_status_publish.ts
index e4018211..fb5446be 100644
--- a/src/app_modules/donasi/fun/get/status/get_all_status_publish.ts
+++ b/src/app_modules/donasi/fun/get/status/get_all_status_publish.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function donasi_funGetAllStatusPublish({
diff --git a/src/app_modules/donasi/fun/get/status/get_all_status_reject.ts b/src/app_modules/donasi/fun/get/status/get_all_status_reject.ts
index b4781315..beec8b43 100644
--- a/src/app_modules/donasi/fun/get/status/get_all_status_reject.ts
+++ b/src/app_modules/donasi/fun/get/status/get_all_status_reject.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function donasi_funGetAllStatusReject({ page }: { page: number }) {
diff --git a/src/app_modules/donasi/fun/get/status/get_all_status_review.ts b/src/app_modules/donasi/fun/get/status/get_all_status_review.ts
index 272cf89f..53dd188f 100644
--- a/src/app_modules/donasi/fun/get/status/get_all_status_review.ts
+++ b/src/app_modules/donasi/fun/get/status/get_all_status_review.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function donasi_funGetAllStatusReview({ page }: { page: number }) {
diff --git a/src/app_modules/donasi/fun/master/get_bank.ts b/src/app_modules/donasi/fun/master/get_bank.ts
index 32cb2136..a196c8dc 100644
--- a/src/app_modules/donasi/fun/master/get_bank.ts
+++ b/src/app_modules/donasi/fun/master/get_bank.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_getMasterBank() {
const data = await prisma.masterBank.findMany({
diff --git a/src/app_modules/donasi/fun/master/get_durasi.ts b/src/app_modules/donasi/fun/master/get_durasi.ts
index 87d39965..37c7d152 100644
--- a/src/app_modules/donasi/fun/master/get_durasi.ts
+++ b/src/app_modules/donasi/fun/master/get_durasi.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_getMasterDurasi() {
const data = await prisma.donasiMaster_Durasi.findMany({});
diff --git a/src/app_modules/donasi/fun/master/get_ketegori.ts b/src/app_modules/donasi/fun/master/get_ketegori.ts
index f1a4215d..ffbfe56f 100644
--- a/src/app_modules/donasi/fun/master/get_ketegori.ts
+++ b/src/app_modules/donasi/fun/master/get_ketegori.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_getMasterKategori() {
const data = await prisma.donasiMaster_Kategori.findMany({
diff --git a/src/app_modules/donasi/fun/master/get_nomor_admin.ts b/src/app_modules/donasi/fun/master/get_nomor_admin.ts
index c94cea9d..4c52d494 100644
--- a/src/app_modules/donasi/fun/master/get_nomor_admin.ts
+++ b/src/app_modules/donasi/fun/master/get_nomor_admin.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function donasi_getMasterNomorAdmin() {
const get = await prisma.nomorAdmin.findFirst({
diff --git a/src/app_modules/donasi/fun/master/get_status_donasi.ts b/src/app_modules/donasi/fun/master/get_status_donasi.ts
index 57f85486..1e2d1dfd 100644
--- a/src/app_modules/donasi/fun/master/get_status_donasi.ts
+++ b/src/app_modules/donasi/fun/master/get_status_donasi.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
export async function donasi_funMasterStatusDonasi() {
const data = await prisma.donasiMaster_StatusDonasi.findMany({});
diff --git a/src/app_modules/donasi/fun/update/fun_ganti_status.ts b/src/app_modules/donasi/fun/update/fun_ganti_status.ts
index 5e63414b..251c6618 100644
--- a/src/app_modules/donasi/fun/update/fun_ganti_status.ts
+++ b/src/app_modules/donasi/fun/update/fun_ganti_status.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import prisma from "@/lib/prisma";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { revalidatePath } from "next/cache";
/**
diff --git a/src/app_modules/donasi/fun/update/fun_update_cerita_donasi.ts b/src/app_modules/donasi/fun/update/fun_update_cerita_donasi.ts
index 0c9199c4..6838c363 100644
--- a/src/app_modules/donasi/fun/update/fun_update_cerita_donasi.ts
+++ b/src/app_modules/donasi/fun/update/fun_update_cerita_donasi.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import prisma from "@/lib/prisma";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { revalidatePath } from "next/cache";
import { MODEL_CERITA_DONASI } from "../../model/interface";
diff --git a/src/app_modules/donasi/fun/update/fun_update_donasi.ts b/src/app_modules/donasi/fun/update/fun_update_donasi.ts
index a9d3ac58..5c2fab20 100644
--- a/src/app_modules/donasi/fun/update/fun_update_donasi.ts
+++ b/src/app_modules/donasi/fun/update/fun_update_donasi.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import prisma from "@/lib/prisma";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { revalidatePath } from "next/cache";
import { MODEL_DONASI } from "../../model/interface";
diff --git a/src/app_modules/donasi/fun/update/fun_update_invoice.ts b/src/app_modules/donasi/fun/update/fun_update_invoice.ts
index dbf98d64..83352cfe 100644
--- a/src/app_modules/donasi/fun/update/fun_update_invoice.ts
+++ b/src/app_modules/donasi/fun/update/fun_update_invoice.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Donasi_funUploadBuktiTransferById({
invoiceId,
diff --git a/src/app_modules/donasi/fun/update/fun_update_kabar.tsx b/src/app_modules/donasi/fun/update/fun_update_kabar.tsx
index d78e4af1..2db29d86 100644
--- a/src/app_modules/donasi/fun/update/fun_update_kabar.tsx
+++ b/src/app_modules/donasi/fun/update/fun_update_kabar.tsx
@@ -1,9 +1,9 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import { MODEL_DONASI_KABAR } from "../../model/interface";
import { revalidatePath } from "next/cache";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
export async function donasi_funUpdateKabar({
data,
diff --git a/src/app_modules/donasi/fun/update/fun_update_notif_by_user_id.ts b/src/app_modules/donasi/fun/update/fun_update_notif_by_user_id.ts
index a2913790..0541b0cd 100644
--- a/src/app_modules/donasi/fun/update/fun_update_notif_by_user_id.ts
+++ b/src/app_modules/donasi/fun/update/fun_update_notif_by_user_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function Donasi_funUpdateNotifById(notifId: string) {
diff --git a/src/app_modules/donasi/fun/update/fun_update_rekening.ts b/src/app_modules/donasi/fun/update/fun_update_rekening.ts
index bcb3a358..3809fa1d 100644
--- a/src/app_modules/donasi/fun/update/fun_update_rekening.ts
+++ b/src/app_modules/donasi/fun/update/fun_update_rekening.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_DONASI } from "../../model/interface";
export async function Donasi_funUpdateRekening(data: MODEL_DONASI) {
diff --git a/src/app_modules/donasi/fun/update/fun_update_status_invoice.ts b/src/app_modules/donasi/fun/update/fun_update_status_invoice.ts
index 2d84264b..96158f09 100644
--- a/src/app_modules/donasi/fun/update/fun_update_status_invoice.ts
+++ b/src/app_modules/donasi/fun/update/fun_update_status_invoice.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function Donasi_funUpdateStatusInvoice({
diff --git a/src/app_modules/donasi/index.ts b/src/app_modules/donasi/index.ts
index e0c0ec64..5751445d 100644
--- a/src/app_modules/donasi/index.ts
+++ b/src/app_modules/donasi/index.ts
@@ -1,8 +1,12 @@
+import LayoutDetailMainDonasiNew from '@/app_modules/donasi/detail/detail_main/layout_new';
import MainDonasi from "./main/beranda";
+import MainDonasiNew from "./main/beranda_new";
import LayoutDonasi from "./main/layout";
import GalangDanaDonasi from "./main/galang_dana/ui_galang_dana";
+import GalangDanaDonasiNew from "./main/galang_dana/ui_galang_dana_new";
import DonasiSayaDonasi from "./main/donasi_saya";
import CreateDonasi from "./create/create_donasi";
+import CreateDonasiNew from "./create/create_donasi_new";
import LayoutCreateDonasi from "./create/layout";
import DetailMainDonasi from "./detail/detail_main";
import LayoutDetailMainDonasi from "./detail/detail_main/layout";
@@ -47,6 +51,7 @@ import Donasi_CreateKabar from "./create/create_kabar";
import LayoutDonasi_CreateKabar from "./create/create_kabar/layout";
import Donasi_EditRekening from "./edit/edit_rekening";
import LayoutDonasi_EditRekening from "./edit/edit_rekening/layout";
+import EditDonasiNew from "./edit/edit_donasi/edit_donasi_new";
export { LayoutDonasi_BuktiTransfer } from "./detail/detail_main/bukti_transfer";
export {
@@ -99,4 +104,9 @@ export {
LayoutDonasi_CreateKabar,
Donasi_EditRekening,
LayoutDonasi_EditRekening,
+ MainDonasiNew,
+ GalangDanaDonasiNew,
+ CreateDonasiNew,
+ EditDonasiNew,
+ LayoutDetailMainDonasiNew
};
diff --git a/src/app_modules/donasi/lib/api_donasi.ts b/src/app_modules/donasi/lib/api_donasi.ts
new file mode 100644
index 00000000..ee35a937
--- /dev/null
+++ b/src/app_modules/donasi/lib/api_donasi.ts
@@ -0,0 +1,407 @@
+export const apiGetAllDonasi = async (path?: string) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/new/donasi${path ? path : ""}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ return await response.json().catch(() => null);
+};
+
+export const apiGetMasterDonasi = async (path?: string) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/new/donasi/master${path ? path : ""}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ return await response.json().catch(() => null);
+};
+
+export const apiGetAllDonasiSaya = async (path?: string) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/new/donasi/invoice${path ? path : ""}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ return await response.json().catch(() => null);
+};
+
+export const apiGetOneDonasiById = async (path: string, kategori: string) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ // const response = await fetch(`/api/new/donasi/${path}?cat=${kategori}`, {
+ const response = await fetch(`/api/donasi/${path}?cat=${kategori}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ return await response.json().catch(() => null);
+};
+
+export const apiGetDonasiCeritaPenggalang = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/donasi/${id}/cerita-penggalang`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get donasi cerita penggalang",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to get donasi cerita penggalang"
+ );
+ }
+
+ // Return the JSON response
+ const data = await response.json();
+ return data;
+ } catch (error) {
+ console.error("Error get donasi cerita penggalang", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+export const apiGetTemporaryCreate = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/donasi/${id}/temporary-create`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get donasi temporary create",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to get donasi temporary create"
+ );
+ }
+
+ // Return the JSON response
+ const data = await response.json();
+ return data;
+ } catch (error) {
+ console.error("Error get donasi temporary create", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+export const apiGetDonasiInvoiceById = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/donasi/${id}/invoice`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get donasi invoice",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get donasi invoice");
+ }
+
+ // Return the JSON response
+ const data = await response.json();
+ return data;
+ } catch (error) {
+ console.error("Error get donasi invoice", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+export const apiGetCountDonatur = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/donasi/${id}/invoice/count`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get donasi invoice count",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to get donasi invoice count"
+ );
+ }
+
+ // Return the JSON response
+ const data = await response.json();
+ return data;
+ } catch (error) {
+ console.error("Error get donasi invoice count", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+export const apiGetDonasiKabarById = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/donasi/kabar/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get donasi kabar",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get donasi kabar");
+ }
+
+ // Return the JSON response
+ const data = await response.json();
+ return data;
+ } catch (error) {
+ console.error("Error get donasi kabar", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+export const apiGetDonasiPenggalangDanaByUserId = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/donasi/${id}/penggalang-dana`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get donasi penggalang dana",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to get donasi penggalang dana"
+ );
+ }
+
+ // Return the JSON response
+ const data = await response.json();
+ return data;
+ } catch (error) {
+ console.error("Error get donasi penggalang dana", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+}
+
+export const apiGetDonasiPencairanDanaById = async ({ id, page }: { id: string, page: number }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/donasi/${id}/pencairan-dana?page=${page}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get donasi pencairan dana",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to get donasi pencairan dana"
+ );
+ }
+
+ // Return the JSON response
+ const data = await response.json();
+ return data;
+ } catch (error) {
+ console.error("Error get donasi pencairan dana", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+}
+
+export const apiGetDonasiListDonaturById = async ({ id, page }: { id: string, page: number }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/donasi/${id}/donatur?page=${page}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get donasi list donatur",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to get donasi list donatur"
+ );
+ }
+
+ // Return the JSON response
+ const data = await response.json();
+ return data;
+ } catch (error) {
+ console.error("Error get donasi list donatur", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+}
+
+export const apiGetDonasiListKabarById = async ({ id, page }: { id: string, page: number }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/donasi/kabar/${id}/list?page=${page}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get donasi list kabar",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to get donasi list kabar"
+ );
+ }
+
+ // Return the JSON response
+ const data = await response.json();
+ return data;
+ } catch (error) {
+ console.error("Error get donasi list kabar", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+}
\ No newline at end of file
diff --git a/src/app_modules/donasi/lib/type_donasi.ts b/src/app_modules/donasi/lib/type_donasi.ts
new file mode 100644
index 00000000..912d067f
--- /dev/null
+++ b/src/app_modules/donasi/lib/type_donasi.ts
@@ -0,0 +1,23 @@
+export interface IDataAllDonasi {
+ id: string
+ imageId: string
+ title: string
+ publishTime: Date
+ progres: string
+ terkumpul: string
+ target: string
+ nameDonasiDurasi: string
+}
+
+export interface IDataAllDonasiSaya {
+ id: string
+ nominal: string
+ donasiMaster_StatusInvoiceId: string
+ nameStatusInvoice: string
+ donasiId: string
+ title: string
+ publishTime: Date
+ progres: string
+ imageId: string
+ durasiDonasi: string
+}
\ No newline at end of file
diff --git a/src/app_modules/donasi/main/beranda.tsx b/src/app_modules/donasi/main/beranda.tsx
index f8bcf57e..3d2db3c4 100644
--- a/src/app_modules/donasi/main/beranda.tsx
+++ b/src/app_modules/donasi/main/beranda.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
@@ -11,7 +11,7 @@ import { useState } from "react";
import ComponentDonasi_CardPublish from "../component/card_view/card_publish";
import { donasi_funGetAllPublish } from "../fun/get/get_list_beranda";
import { MODEL_DONASI } from "../model/interface";
-import { gs_donasiTriggerBeranda } from "@/app/lib/global_state";
+import { gs_donasiTriggerBeranda } from "@/lib/global_state";
import { useAtom } from "jotai";
import { useShallowEffect } from "@mantine/hooks";
import { AccentColor } from "@/app_modules/_global/color";
diff --git a/src/app_modules/donasi/main/beranda_new.tsx b/src/app_modules/donasi/main/beranda_new.tsx
new file mode 100644
index 00000000..721680d9
--- /dev/null
+++ b/src/app_modules/donasi/main/beranda_new.tsx
@@ -0,0 +1,132 @@
+"use client";
+import { gs_donasiTriggerBeranda } from "@/lib/global_state";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import { AccentColor } from "@/app_modules/_global/color";
+import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { Affix, Box, Button, Center, rem } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useAtom } from "jotai";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useState } from "react";
+import ComponentDonasi_CardPublishNew from "../component/card_view/card_publish_new";
+import SkeletonDonasi from "../component/skeleton_donasi";
+import { apiGetAllDonasi } from "../lib/api_donasi";
+import { IDataAllDonasi } from "../lib/type_donasi";
+
+export default function MainDonasiNew() {
+ const [data, setData] = useState([]);
+ const [activePage, setActivePage] = useState(1);
+ const [loading, setLoading] = useState(true)
+
+ // Realtime
+ const [isTriggerDonasiBeranda, setIsTriggerDonasiBeranda] = useAtom(
+ gs_donasiTriggerBeranda
+ );
+ const [isShowUpdate, setIsShowUpdate] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
+
+ useShallowEffect(() => {
+ if (isTriggerDonasiBeranda) {
+ setIsShowUpdate(true);
+ }
+ }, [isTriggerDonasiBeranda, setIsShowUpdate]);
+
+ async function onLoadData({ onPublish }: { onPublish: (val: any) => void }) {
+ setIsLoading(true);
+ const loadData = await apiGetAllDonasi(`?cat=beranda&page=1`)
+ onPublish(loadData.data)
+
+ setIsShowUpdate(false);
+ setIsTriggerDonasiBeranda(false);
+ setIsLoading(false);
+ }
+
+
+ async function getDataDonasi() {
+ try {
+ setLoading(true)
+ const response = await apiGetAllDonasi(`?cat=beranda&page=1`)
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false)
+ }
+ }
+
+
+ useShallowEffect(() => {
+ getDataDonasi()
+ }, []);
+
+ return (
+ <>
+
+ {isShowUpdate && (
+
+
+ {
+ onLoadData({
+ onPublish(val) {
+ setData(val);
+ },
+ });
+ }}
+ >
+ Update beranda
+
+
+
+ )}
+
+
+ {
+ loading
+ ?
+ :
+ _.isEmpty(data) ? (
+
+ ) : (
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData}
+ moreData={async () => {
+ const pageNew = activePage + 1
+ const loadData = await apiGetAllDonasi(`?cat=beranda&page=${pageNew}`)
+
+ setActivePage((val) => val + 1);
+
+ return loadData.data;
+ }}
+ >
+ {(item) => (
+
+ )}
+
+ )
+ }
+
+ >
+ );
+}
diff --git a/src/app_modules/donasi/main/donasi_saya.tsx b/src/app_modules/donasi/main/donasi_saya.tsx
index b0a50e39..318e0ec3 100644
--- a/src/app_modules/donasi/main/donasi_saya.tsx
+++ b/src/app_modules/donasi/main/donasi_saya.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
diff --git a/src/app_modules/donasi/main/donasi_saya_new.tsx b/src/app_modules/donasi/main/donasi_saya_new.tsx
new file mode 100644
index 00000000..0ecf12b1
--- /dev/null
+++ b/src/app_modules/donasi/main/donasi_saya_new.tsx
@@ -0,0 +1,72 @@
+"use client";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { Box, Center } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useState } from "react";
+import { ComponentDonasi_CardInvoiceNew } from "../component/card_view/card_invoice_new";
+import SkeletonDonasiSaya from "../component/skeleton_donasi_saya";
+import { apiGetAllDonasiSaya } from "../lib/api_donasi";
+import { IDataAllDonasiSaya } from "../lib/type_donasi";
+
+export default function DonasiSayaNew() {
+ const [data, setData] = useState([]);
+ const [activePage, setActivePage] = useState(1);
+ const [loading, setLoading] = useState(true)
+
+ async function getDataDonasiSaya() {
+ try {
+ setLoading(true)
+ const response = await apiGetAllDonasiSaya(`?page=1`)
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false)
+ }
+ }
+
+
+ useShallowEffect(() => {
+ getDataDonasiSaya()
+ }, []);
+
+ return (
+ <>
+
+ {
+ loading ?
+
+ :
+ _.isEmpty(data) ? (
+
+ ) : (
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData}
+ moreData={async () => {
+ const pageNew = activePage + 1
+ const loadData = await apiGetAllDonasiSaya(`?page=${pageNew}`)
+ setActivePage((val) => val + 1);
+
+ return loadData.data;
+ }}
+ >
+ {(item) => }
+
+ )
+ }
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/donasi/main/galang_dana/donasi_galang_dana_new.tsx b/src/app_modules/donasi/main/galang_dana/donasi_galang_dana_new.tsx
new file mode 100644
index 00000000..d4d81c42
--- /dev/null
+++ b/src/app_modules/donasi/main/galang_dana/donasi_galang_dana_new.tsx
@@ -0,0 +1,80 @@
+"use client";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { Box, Center } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import ComponentDonasi_CardPublishNew from "../../component/card_view/card_publish_new";
+import SkeletonDonasi from "../../component/skeleton_donasi";
+import { apiGetAllDonasi } from "../../lib/api_donasi";
+import { IDataAllDonasi } from "../../lib/type_donasi";
+import { ComponentDonasi_CardStatusNew } from "../../component/card_view/card_status_new";
+
+export default function Donasi_ViewGalangDanaNew() {
+ const param = useParams<{ id: string }>();;
+ const [data, setData] = useState([]);
+ const [activePage, setActivePage] = useState(1);
+ const [loading, setLoading] = useState(true)
+
+ async function getDataGalangDana() {
+ try {
+ setLoading(true)
+ const response = await apiGetAllDonasi(`?cat=galang-dana&status=${param.id}&page=1`)
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false)
+ }
+ }
+
+
+ useShallowEffect(() => {
+ getDataGalangDana()
+ }, []);
+
+ return (
+ <>
+ {
+ loading ?
+ :
+ _.isEmpty(data) ? (
+
+ ) : (
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData}
+ moreData={async () => {
+ const pageNew = activePage + 1
+ const loadData = await apiGetAllDonasi(`?cat=galang-dana&status=${param.id}&page=${pageNew}`)
+ setActivePage((val) => val + 1);
+
+ return loadData.data;
+ }}
+ >
+ {
+ param.id == "1" ?
+ (item) => ()
+ :
+ (item) => ()
+
+ }
+
+
+ )
+ }
+ >
+ );
+}
diff --git a/src/app_modules/donasi/main/galang_dana/draft.tsx b/src/app_modules/donasi/main/galang_dana/draft.tsx
index a6b2f3cc..dcdef3e2 100644
--- a/src/app_modules/donasi/main/galang_dana/draft.tsx
+++ b/src/app_modules/donasi/main/galang_dana/draft.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { Box, Center } from "@mantine/core";
diff --git a/src/app_modules/donasi/main/galang_dana/publish.tsx b/src/app_modules/donasi/main/galang_dana/publish.tsx
index ab06b1c1..1280e6a5 100644
--- a/src/app_modules/donasi/main/galang_dana/publish.tsx
+++ b/src/app_modules/donasi/main/galang_dana/publish.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { Box, Center } from "@mantine/core";
diff --git a/src/app_modules/donasi/main/galang_dana/reject.tsx b/src/app_modules/donasi/main/galang_dana/reject.tsx
index d47eb5d2..a2a74f87 100644
--- a/src/app_modules/donasi/main/galang_dana/reject.tsx
+++ b/src/app_modules/donasi/main/galang_dana/reject.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { Box, Center } from "@mantine/core";
diff --git a/src/app_modules/donasi/main/galang_dana/review.tsx b/src/app_modules/donasi/main/galang_dana/review.tsx
index d3cde647..079471db 100644
--- a/src/app_modules/donasi/main/galang_dana/review.tsx
+++ b/src/app_modules/donasi/main/galang_dana/review.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { Box, Center } from "@mantine/core";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import _ from "lodash";
diff --git a/src/app_modules/donasi/main/galang_dana/ui_galang_dana.tsx b/src/app_modules/donasi/main/galang_dana/ui_galang_dana.tsx
index 60b68322..2fcfdc0a 100644
--- a/src/app_modules/donasi/main/galang_dana/ui_galang_dana.tsx
+++ b/src/app_modules/donasi/main/galang_dana/ui_galang_dana.tsx
@@ -14,7 +14,7 @@ import {
} from "@/app_modules/_global/color/color_pallet";
import { useState } from "react";
import { MODEL_NEW_DEFAULT_MASTER } from "@/app_modules/model_global/interface";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
export default function GalangDanaDonasi({
statusId,
diff --git a/src/app_modules/donasi/main/galang_dana/ui_galang_dana_new.tsx b/src/app_modules/donasi/main/galang_dana/ui_galang_dana_new.tsx
new file mode 100644
index 00000000..af2dc091
--- /dev/null
+++ b/src/app_modules/donasi/main/galang_dana/ui_galang_dana_new.tsx
@@ -0,0 +1,81 @@
+"use client";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import { AccentColor, MainColor, } from "@/app_modules/_global/color/color_pallet";
+import { Stack, Tabs } from "@mantine/core";
+import { useParams, useRouter } from "next/navigation";
+import Donasi_ViewGalangDanaNew from "./donasi_galang_dana_new";
+
+export default function GalangDanaDonasiNew() {
+ const router = useRouter();
+ const param = useParams<{ id: string }>();
+ const status = [
+ {
+ id: "1",
+ name: "Publish"
+ },
+ {
+ id: "2",
+ name: "Review"
+ },
+ {
+ id: "3",
+ name: "Draft"
+ },
+ {
+ id: "4",
+ name: "Reject"
+ }
+ ]
+
+ async function onChangeStatus({ statusId }: { statusId: string }) {
+ router.replace(RouterDonasi.status_galang_dana({ id: statusId }));
+ }
+
+ return (
+ <>
+ {
+ onChangeStatus({ statusId: val });
+ }}
+ styles={{
+ tabsList: {
+ backgroundColor: MainColor.darkblue,
+ position: "sticky",
+ top: 0,
+ zIndex: 99,
+ },
+ }}
+ >
+
+
+ {status.map((e, i) => (
+
+ {e.name}
+
+ ))}
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/donasi/main/layout.tsx b/src/app_modules/donasi/main/layout.tsx
index f8c9cfb2..5421a39a 100644
--- a/src/app_modules/donasi/main/layout.tsx
+++ b/src/app_modules/donasi/main/layout.tsx
@@ -1,11 +1,15 @@
"use client";
-import { RouterCrowd } from "@/app/lib/router_hipmi/router_crowd";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewFooter,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { RouterCrowd } from "@/lib/router_hipmi/router_crowd";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { ActionIcon, SimpleGrid, Stack, Text } from "@mantine/core";
import {
IconGiftCardFilled,
@@ -48,7 +52,7 @@ export default function LayoutDonasi({
return (
<>
-
e.path === ""
? ComponentGlobal_NotifikasiPeringatan("Cooming Soon")
@@ -72,7 +76,7 @@ export default function LayoutDonasi({
{e.icon}
@@ -84,7 +88,41 @@ export default function LayoutDonasi({
}
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
+
+ {listFooter.map((e, i) => (
+
+
+ e.path === ""
+ ? ComponentGlobal_NotifikasiPeringatan("Cooming Soon")
+ : (router.replace(e.path), setActive(i))
+ }
+ >
+ {e.icon}
+
+
+ {e.name}
+
+
+ ))}
+
+
+
>
);
}
diff --git a/src/app_modules/donasi/proses_donasi/invoice/index.tsx b/src/app_modules/donasi/proses_donasi/invoice/index.tsx
index 9ae48559..ad464940 100644
--- a/src/app_modules/donasi/proses_donasi/invoice/index.tsx
+++ b/src/app_modules/donasi/proses_donasi/invoice/index.tsx
@@ -1,50 +1,65 @@
"use client";
-import { DIRECTORY_ID } from "@/app/lib";
-import { IRealtimeData } from "@/app/lib/global_state";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_ButtonUploadFileImage } from "@/app_modules/_global/component";
import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
+import { DIRECTORY_ID } from "@/lib";
+import { IRealtimeData } from "@/lib/global_state";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import {
Button,
Center,
CopyButton,
- FileButton,
Grid,
Group,
Paper,
Stack,
Text,
- Title,
+ Title
} from "@mantine/core";
-import { IconCamera, IconCircleCheck } from "@tabler/icons-react";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconCircleCheck } from "@tabler/icons-react";
import { useAtom } from "jotai";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import { WibuRealtime } from "wibu-pkg";
import TampilanRupiahDonasi from "../../component/tampilan_rupiah";
import { Donasi_funUpdateStatusInvoice } from "../../fun/update/fun_update_status_invoice";
import { gs_donasi_hot_menu } from "../../global_state";
+import { apiGetDonasiInvoiceById } from "../../lib/api_donasi";
import { MODEL_DONASI_INVOICE } from "../../model/interface";
-export default function Donasi_InvoiceProses({
- dataInvoice,
-}: {
- dataInvoice: MODEL_DONASI_INVOICE;
-}) {
- const [invoice, setDataInvoice] = useState(dataInvoice);
+export default function Donasi_InvoiceProses() {
+ const param = useParams<{ id: string }>();
+ const [invoice, setDataInvoice] = useState(null);
const router = useRouter();
const [file, setFile] = useState(null);
const [active, setActive] = useAtom(gs_donasi_hot_menu);
const [isLoading, setLoading] = useState(false);
+ useShallowEffect(() => {
+ onLoadInvoice();
+ }, []);
+
+ async function onLoadInvoice() {
+ try {
+ const response = await apiGetDonasiInvoiceById({ id: param.id });
+ if (response.success) {
+ setDataInvoice(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+
async function onClick() {
try {
setLoading(true);
@@ -55,24 +70,16 @@ export default function Donasi_InvoiceProses({
if (!uploadImage.success) {
setLoading(false);
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload file gambar");
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload file gambar");
+ return;
}
const res = await Donasi_funUpdateStatusInvoice({
- invoiceId: invoice.id,
+ invoiceId: invoice?.id as any,
statusId: "2",
fileId: uploadImage.data.id,
});
if (res.status === 200) {
- // const dataNotif: any = {
- // appId: res.data?.Donasi?.id as any,
- // userId: res.data?.Donasi?.authorId as any,
- // pesan: res.data?.Donasi?.title as any,
- // status: res.data?.DonasiMaster_StatusInvoice?.name,
- // kategoriApp: "DONASI",
- // title: "Donatur melakukan transfer",
- // };
-
const dataNotifikasi: IRealtimeData = {
appId: res.data?.Donasi?.id as any,
status: res.data?.DonasiMaster_StatusInvoice?.name as any,
@@ -87,25 +94,29 @@ export default function Donasi_InvoiceProses({
});
if (notif.status === 201) {
- WibuRealtime.setData({
- type: "notification",
- pushNotificationTo: "ADMIN",
- });
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "ADMIN",
+ });
ComponentGlobal_NotifikasiBerhasil(res.message);
setActive(2);
- router.push(RouterDonasi.proses_transaksi + `${invoice.id}`);
- setLoading(false);
+ router.push(RouterDonasi.proses_transaksi + `${invoice?.id}`);
}
} else {
ComponentGlobal_NotifikasiGagal(res.message);
setLoading(false);
}
} catch (error) {
- console.log(error);
+ setLoading(false);
+ console.error("Error upload data invoice", error);
}
}
+ if (!invoice) {
+ return ;
+ }
+
return (
<>
@@ -259,35 +270,9 @@ export default function Donasi_InvoiceProses({
>
- {
- try {
- // const buffer = URL.createObjectURL(
- // new Blob([new Uint8Array(await files.arrayBuffer())])
- // );
- // console.log(buffer, "ini buffer");
-
- setFile(files);
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
- }
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload
-
- )}
-
+
+
{file ? (
diff --git a/src/app_modules/donasi/proses_donasi/invoice/layout.tsx b/src/app_modules/donasi/proses_donasi/invoice/layout.tsx
index b8080cde..51bbe32d 100644
--- a/src/app_modules/donasi/proses_donasi/invoice/layout.tsx
+++ b/src/app_modules/donasi/proses_donasi/invoice/layout.tsx
@@ -1,14 +1,17 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { ActionIcon } from "@mantine/core";
import { IconX } from "@tabler/icons-react";
import { useAtom } from "jotai";
import React from "react";
import { gs_donasi_hot_menu } from "../../global_state";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { useRouter } from "next/navigation";
export default function LayoutDonasi_InvoiceProses({
@@ -24,20 +27,34 @@ export default function LayoutDonasi_InvoiceProses({
}
return (
<>
- onClick()}>
-
+
}
/>
}
>
{children}
-
+ */}
+
+
+
+ onClick()}>
+
+
+ }
+ />
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/donasi/proses_donasi/masukan_donasi/index.tsx b/src/app_modules/donasi/proses_donasi/masukan_donasi/index.tsx
index b40861d1..eff4417e 100644
--- a/src/app_modules/donasi/proses_donasi/masukan_donasi/index.tsx
+++ b/src/app_modules/donasi/proses_donasi/masukan_donasi/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import {
AccentColor,
MainColor,
diff --git a/src/app_modules/donasi/proses_donasi/metode_pembayaran/index.tsx b/src/app_modules/donasi/proses_donasi/metode_pembayaran/index.tsx
index 710dae87..cdd1ff3c 100644
--- a/src/app_modules/donasi/proses_donasi/metode_pembayaran/index.tsx
+++ b/src/app_modules/donasi/proses_donasi/metode_pembayaran/index.tsx
@@ -1,89 +1,121 @@
"use client";
-import { IRealtimeData } from "@/app/lib/global_state";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+import { apiGetMasterBank } from "@/app_modules/_global/lib/api_fetch_master";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { MODEL_MASTER_BANK } from "@/app_modules/investasi/_lib/interface";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
+import { IRealtimeData } from "@/lib/global_state";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import { clientLogger } from "@/util/clientLogger";
import { Button, Paper, Radio, Stack, Title } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import { useAtom } from "jotai";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import { WibuRealtime } from "wibu-pkg";
import { Donasi_funCreateInvoice } from "../../fun/create/fun_create_invoice";
import { gs_donasi_hot_menu, gs_proses_donasi } from "../../global_state";
-import { WibuRealtime } from "wibu-pkg";
-export default function Donasi_MetodePembayaran({
- listBank,
- donasiId,
- authorId,
-}: {
- listBank: MODEL_MASTER_BANK[];
- donasiId: string;
- authorId: string;
-}) {
+export default function Donasi_MetodePembayaran() {
+ const param = useParams<{ id: string }>();
const router = useRouter();
const [isLoading, setLoading] = useState(false);
const [prosesDonasi, setProsesDonasi] = useAtom(gs_proses_donasi);
const [pilihBank, setPilihBank] = useState("");
- const [bank, setBank] = useState(listBank);
+ const [bank, setBank] = useState(null);
const [activeHotMenu, setActiveHotMenu] = useAtom(gs_donasi_hot_menu);
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ handleListData();
+ handleGetUserId();
+ }, []);
+
+ async function handleListData() {
+ try {
+ const response = await apiGetMasterBank();
+ if (response.success) {
+ setBank(response.data);
+ }
+ } catch (error) {
+ console.error("Error fetching bank data:", error);
+ }
+ }
+
+ async function handleGetUserId() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ }
+ } catch (error) {
+ console.error("Error fetching user ID:", error);
+ }
+ }
async function onProses() {
- const body = {
- donasiId: donasiId,
- donasiMaster_BankId: pilihBank,
- nominal: prosesDonasi.nominal,
- authorId: authorId,
- };
-
-
- const res = await Donasi_funCreateInvoice(body);
- if (res.status === 200) {
-
- const dataNotifikasi: IRealtimeData = {
- appId: res.data?.Donasi?.id as any,
- status: res.data?.DonasiMaster_StatusInvoice?.name as any,
- userId: res.data?.Donasi?.authorId as any,
- pesan: res.data?.Donasi?.title as any,
- kategoriApp: "DONASI",
- title: "Donatur membuat invoice donasi",
+ try {
+ setLoading(true);
+ const body = {
+ donasiId: param.id,
+ donasiMaster_BankId: pilihBank,
+ nominal: prosesDonasi.nominal,
+ authorId: userLoginId,
};
- const notif = await notifikasiToAdmin_funCreate({
- data: dataNotifikasi as any,
- });
+ const res = await Donasi_funCreateInvoice(body);
+ if (res.status === 200) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res.data?.Donasi?.id as any,
+ status: res.data?.DonasiMaster_StatusInvoice?.name as any,
+ userId: res.data?.Donasi?.authorId as any,
+ pesan: res.data?.Donasi?.title as any,
+ kategoriApp: "DONASI",
+ title: "Donatur membuat invoice donasi",
+ };
- if (notif.status === 201) {
- WibuRealtime.setData({
- type: "notification",
- pushNotificationTo: "ADMIN",
+ const notif = await notifikasiToAdmin_funCreate({
+ data: dataNotifikasi as any,
});
- setLoading(true);
- setActiveHotMenu(2);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- setProsesDonasi({
- ...prosesDonasi,
- nominal: "",
- });
- router.push(RouterDonasi.invoice + `${res.data?.id}`);
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "ADMIN",
+ });
+
+ setActiveHotMenu(2);
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ setProsesDonasi({
+ ...prosesDonasi,
+ nominal: "",
+ });
+ router.push(RouterDonasi.invoice + `${res.data?.id}`);
+ }
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
}
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error proses donasi:", error);
}
}
+ if (!bank || !userLoginId) {
+ return ;
+ }
+
return (
<>
- {/* {JSON.stringify(prosesDonasi, null, 2)} */}
-
();
const router = useRouter();
- const [data, setData] = useState(statusInvoice);
+ const [dataInvoice, setDataInvoice] = useState(
+ null
+ );
+ const [dataNomorAdmin, setDataNomorAdmin] = useState(null);
const [hotMenu, setHotMenu] = useAtom(gs_donasi_hot_menu);
+ useShallowEffect(() => {
+ onLoadDataInvoice();
+ onLoadDataNomorAdmin();
+ }, []);
+
+ async function onLoadDataInvoice() {
+ try {
+ const response = await apiGetDonasiInvoiceById({ id: param.id });
+ if (response.success) {
+ setDataInvoice(response.data);
+ }
+ } catch (error) {
+ console.log(error);
+ }
+ }
+
+ async function onLoadDataNomorAdmin() {
+ try {
+ const response = await apiGetAdminContact();
+ if (response.success) {
+ setDataNomorAdmin(response.data);
+ }
+ } catch (error) {
+ console.log(error);
+ }
+ }
+
interface MODAL_DONASI_INVOICE {
invoiceId: string;
statusInvoiceId: string;
@@ -47,33 +75,35 @@ export default function Donasi_ProsesTransaksi({
mqtt_client.on("message", (topic, message) => {
const dataClient: MODAL_DONASI_INVOICE = JSON.parse(message.toString());
- if (topic === "donasi_invoice" && dataClient.invoiceId === data.id) {
- // setData({
- // ...data,
- // donasiMaster_StatusInvoiceId: dataClient.statusInvoiceId,
- // });
+ if (topic === "donasi_invoice" && dataClient.invoiceId === param.id) {
onLoad();
}
});
}, []);
async function onLoad() {
- const loadData = await donasi_getOneStatusInvoiceById({
- invoiceId: data.id,
- });
- setData(loadData as any);
+ try {
+ const response = await apiGetDonasiInvoiceById({ id: param.id });
+ if (response.success) {
+ setDataInvoice(response.data);
+ }
+ } catch (error) {
+ console.log(error);
+ }
}
- if (data.DonasiMaster_StatusInvoice.id === "1") {
+ if (dataInvoice?.DonasiMaster_StatusInvoice.id === "1") {
setHotMenu(2);
- router.replace(RouterDonasi.detail_donasi_saya + `${data.id}`, {
+ router.replace(RouterDonasi.detail_donasi_saya + `${dataInvoice?.id}`, {
scroll: false,
});
}
+ if(!dataInvoice || !dataNomorAdmin) return
+
return (
<>
- {data.DonasiMaster_StatusInvoice.id === "1" ? (
+ {dataInvoice.DonasiMaster_StatusInvoice.id === "1" ? (
<>
@@ -88,7 +118,7 @@ export default function Donasi_ProsesTransaksi({
padding: "15px",
cursor: "pointer",
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
}}
>
@@ -99,7 +129,7 @@ export default function Donasi_ProsesTransaksi({
padding: "15px",
cursor: "pointer",
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
}}
>
@@ -121,7 +151,7 @@ export default function Donasi_ProsesTransaksi({
padding: "15px",
cursor: "pointer",
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
}}
>
@@ -150,9 +180,9 @@ export default function Donasi_ProsesTransaksi({
textDecoration: "none",
}}
target="_blank"
- href={`https://wa.me/+${nomorAdmin.nomor}?text=Hallo Admin , Saya ada kendala dalam proses transfer donasi!`}
+ href={`https://wa.me/+${dataNomorAdmin}?text=Hallo Admin , Saya ada kendala dalam proses transfer donasi!`}
>
-
+
diff --git a/src/app_modules/donasi/proses_donasi/proses_transaksi/layout.tsx b/src/app_modules/donasi/proses_donasi/proses_transaksi/layout.tsx
index 10b3f2c0..ddb73853 100644
--- a/src/app_modules/donasi/proses_donasi/proses_transaksi/layout.tsx
+++ b/src/app_modules/donasi/proses_donasi/proses_transaksi/layout.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
diff --git a/src/app_modules/event/_lib/api_event.ts b/src/app_modules/event/_lib/api_event.ts
new file mode 100644
index 00000000..7fa0b20d
--- /dev/null
+++ b/src/app_modules/event/_lib/api_event.ts
@@ -0,0 +1,233 @@
+import { IEventSponsor } from "./interface";
+
+export const apiGetEventDetailById = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/event/${id}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get event detail",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get event detail");
+ }
+
+ // Return the JSON response
+ const data = await response.json();
+ return data;
+ } catch (error) {
+ console.error("Error get event detail", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+export const apiGetEventCekPeserta = async ({
+ userId,
+ eventId,
+}: {
+ userId: string;
+ eventId: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(
+ `/api/event/check-peserta?userId=${userId}&eventId=${eventId}`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ return await response.json().catch(() => null);
+};
+
+export const apiGetEventPesertaById = async ({
+ id,
+ page,
+}: {
+ id: string;
+ page: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/event/peserta/${id}?page=${page}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+// =============== SPONSOR =============== //
+
+export const apiGetEventCreateSponsor = async ({
+ id,
+ data,
+}: {
+ id: string;
+ data: IEventSponsor;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/event/sponsor/${id}`, {
+ method: "POST",
+ body: JSON.stringify(data),
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+export const apiGetEventSponsorListById = async ({
+ id,
+ page,
+}: {
+ id: string;
+ page: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isPage = page ? `?page=${page}` : "";
+
+ const response = await fetch(`/api/event/sponsor/list/${id}${isPage}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+export const apiGetOneSponsorEventById = async ({ id }: { id: string }) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/event/sponsor/${id}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+export const apiGetEventKonfirmasiById = async ({
+ id,
+ userId,
+}: {
+ id: string;
+ userId: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(
+ `/api/event/${id}/konfirmasi?userId=${userId}`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get event konfirmasi",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get event konfirmasi");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get event konfirmasi", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+export const apiGetMasterTipeAcara = async () => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/master/tipe-acara`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get master tipe acara",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get master tipe acara");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get master tipe acara", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
diff --git a/src/app_modules/event/model/interface.ts b/src/app_modules/event/_lib/interface.ts
similarity index 71%
rename from src/app_modules/event/model/interface.ts
rename to src/app_modules/event/_lib/interface.ts
index 24b5ac96..6392a6bf 100644
--- a/src/app_modules/event/model/interface.ts
+++ b/src/app_modules/event/_lib/interface.ts
@@ -30,5 +30,22 @@ export interface MODEL_EVENT_PESERTA {
userId: string;
User: MODEL_USER;
eventId: string;
+ isPresent: boolean;
Event: MODEL_EVENT;
}
+
+export interface IEventSponsor {
+ id?: string;
+ isActive?: boolean;
+ createdAt?: Date;
+ updatedAt?: Date;
+ name?: string;
+ isTransfer?: boolean;
+ fileName?: string;
+ fileExt?: string;
+ fileId?: string;
+ eventId?: string;
+ Event?: MODEL_EVENT;
+ authorId?: string;
+ Author?: MODEL_USER;
+}
diff --git a/src/app_modules/event/_ui/V2_konfirmasi.tsx b/src/app_modules/event/_ui/V2_konfirmasi.tsx
new file mode 100644
index 00000000..8657213c
--- /dev/null
+++ b/src/app_modules/event/_ui/V2_konfirmasi.tsx
@@ -0,0 +1,666 @@
+"use client";
+
+import { MainColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import {
+ ComponentGlobal_NotifikasiBerhasil,
+ ComponentGlobal_NotifikasiGagal,
+} from "@/app_modules/_global/notif_global";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { API_RouteEvent } from "@/lib/api_user_router/route_api_event";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import { clientLogger } from "@/util/clientLogger";
+import { Button, Center, Group, Skeleton, Stack, Text } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useAtom } from "jotai";
+import moment from "moment";
+import "moment/locale/id";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import {
+ apiGetEventDetailById,
+ apiGetEventKonfirmasiById,
+} from "../_lib/api_event";
+import { MODEL_EVENT } from "../_lib/interface";
+import { event_funUpdateKehadiran } from "../fun";
+import { Event_funJoinAndConfirmEvent } from "../fun/create/fun_join_and_confirm";
+import { Event_funJoinEvent } from "../fun/create/fun_join_event";
+import { gs_event_hotMenu } from "../global_state";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+
+interface IKonfirmasiProps {
+ dataEvent: {
+ id: string;
+ title: string;
+ tanggal: Date;
+ tanggalSelesai: Date;
+ lokasi: string;
+ Author: {
+ id: string;
+ username: string;
+ Profile: {
+ id: string;
+ name: string;
+ };
+ };
+ };
+ peserta: boolean | null;
+ kehadiran: boolean | null;
+}
+
+export default function UiEvent_V2_Konfirmasi() {
+ const params = useParams<{ id: string }>();
+ const eventId = params.id;
+
+ const [data, setData] = useState();
+
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ // Load Data
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const responseUser = await apiNewGetUserIdByToken();
+ if (responseUser.success) {
+ setUserLoginId(responseUser.userId);
+ const response = await apiGetEventKonfirmasiById({
+ id: eventId,
+ userId: responseUser.userId,
+ });
+
+ if (response.res) {
+ setData(response.res);
+ } else {
+ setData(null);
+ }
+ }
+ } catch (error) {
+ setData(null);
+ console.error("Error get data detail event", error);
+ }
+ }
+
+
+
+ // Jika data kosong
+ if (data === undefined || !userLoginId) {
+ return ;
+ }
+
+ // Jika data tidak ada
+ if (data?.dataEvent === null) {
+ return (
+ <>
+
+ >
+ );
+ }
+
+ // Jika tanggal acara sudah lewat
+ if (moment(data?.dataEvent?.tanggalSelesai).diff(moment(), "minute") < 0) {
+ return (
+ <>
+
+ >
+ );
+ }
+
+ // Jika join true
+ if (
+ data?.peserta == true &&
+ moment(data?.dataEvent?.tanggal).diff(moment(), "minute") > 0
+ ) {
+ return (
+ <>
+
+ >
+ );
+ }
+
+ // Jika belum join dan tanggal mulai acara belum lewat
+ if (
+ data?.peserta === false &&
+ moment(data?.dataEvent?.tanggal).diff(moment(), "minute") > 0
+ ) {
+ return (
+ <>
+
+ >
+ );
+ }
+
+ // Jika belum join dan tanggal mulai acara sudah lewat ✅
+ if (
+ data?.peserta === false &&
+ moment(data?.dataEvent?.tanggal).diff(moment(), "minute") < 0
+ ) {
+ return (
+ <>
+
+ >
+ );
+ }
+
+ if (data?.kehadiran === false) {
+ return (
+
+ );
+ }
+
+ // Jika sudah join, sudah konfirmasi dan tanggal mulai acara sudah lewat
+ // if (isPresent && moment(data?.tanggal).diff(moment(), "minute") < 0)
+ if (
+ data?.kehadiran &&
+ data?.peserta &&
+ moment(data?.dataEvent?.tanggal).diff(moment(), "minute") < 0
+ ) {
+ return ;
+ }
+
+ return (
+ <>
+
+
+
+
+
+
+ Data Event Tidak Ditemukan
+
+
+ {
+ setHotMenu(0);
+ setLoading(true);
+ router.push(RouterEvent.beranda, { scroll: false });
+ }}
+ >
+ Kembali Ke Beranda
+
+
+
+
+
+
+ >
+ );
+}
+
+function DataNotFound() {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
+
+ return (
+ <>
+
+
+
+
+
+ {
+ setHotMenu(0);
+ setLoading(true);
+ router.push(RouterEvent.beranda, { scroll: false });
+ }}
+ >
+ Kembali Ke Beranda
+
+
+
+
+
+
+ >
+ );
+}
+
+function SkeletonIsDataNull() {
+ return (
+ <>
+
+
+
+
+
+
+
+ >
+ );
+}
+
+function UserJoinTrue({ title, tanggal }: { title: string; tanggal: Date }) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
+
+ return (
+ <>
+
+
+
+
+
+
+ Terima kasih, Bapak/Ibu, Anda telah berhasil bergabung dalam
+ acara{" "}
+
+ {title}
+ {" "}
+ . Mohon ditunggu hingga tanggal{" "}
+
+ {moment(tanggal).format("DD-MM-YYYY")}
+ {" "}
+ untuk melakukan konfirmasi kehadiran melalui aplikasi HIPMI
+ APP.
+
+
+ {
+ setHotMenu(0);
+ setLoading(true);
+ router.push(RouterEvent.beranda, { scroll: false });
+ }}
+ >
+ Beranda
+
+
+
+
+
+
+ >
+ );
+}
+
+function UserAllowToJoin({
+ title,
+ tanggal,
+ lokasi,
+ eventId,
+ userLoginId,
+}: {
+ title: string;
+ tanggal: Date;
+ lokasi: string;
+ eventId: string;
+ userLoginId: string;
+}) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+
+ async function onJoinEvent() {
+ setLoading(true);
+
+ const data = {
+ userId: userLoginId,
+ eventId: eventId,
+ };
+
+ const res = await Event_funJoinEvent(data as any);
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ router.push(RouterEvent.detail_main + eventId);
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ }
+
+ return (
+ <>
+
+
+
+
+
+
+ Halo, Bapak/Ibu. Kami dengan senang hati mengundang Anda untuk
+ bergabung dalam acara{" "}
+
+ {title}
+ {" "}
+ yang akan diselenggarakan pada{" "}
+
+ {moment(tanggal).format("LL")}
+ {" "}
+ pukul{" "}
+
+ {moment(tanggal).format("LT")}
+ {" "}
+ di{" "}
+
+ {lokasi}
+ {" "}
+ . Pastikan Anda sudah melakukan registrasi melalui aplikasi{" "}
+
+ HIPMI APP
+ {" "}
+ agar dapat berpartisipasi. Kami sangat
+ menantikan kehadiran Anda. Sampai jumpa dalam acara ini.
+
+
+ {
+ onJoinEvent();
+ }}
+ >
+ Join Event
+
+
+
+
+
+
+ >
+ );
+}
+
+function UserNotJoinAndEventReady({
+ title,
+ eventId,
+ userLoginId,
+}: {
+ title: string;
+ eventId: string;
+ userLoginId: string;
+}) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ async function onJoinAndKonfirmasi() {
+ setLoading(true);
+
+ const body = {
+ eventId: eventId,
+ userId: userLoginId,
+ };
+
+ const res = await Event_funJoinAndConfirmEvent(body as any);
+
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ router.push(RouterEvent.detail_main + eventId);
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ }
+ return (
+ <>
+
+
+
+
+
+
+ Halo, Bapak/Ibu. Kami mencatat bahwa Anda belum melakukan
+ registrasi melalui aplikasi untuk mengikuti acara,{" "}
+
+ {title}.
+ {" "}
+ Mohon segera lakukan registrasi melalui Event App agar dapat
+ mengikuti acara ini. Jika membutuhkan bantuan, jangan ragu
+ untuk menghubungi tim kami. Terima kasih Terima kasih atas
+ kehadiran Anda di acara pada hari ini. Mohon untuk
+ mengonfirmasi kehadiran Anda dengan menekan tombol{" "}
+ {"Join & Konfirmasi"}
+ atau fitur konfirmasi yang tersedia di bawah. Terima kasih dan
+ selamat menikmati acara.
+
+
+ {
+ onJoinAndKonfirmasi();
+ }}
+ >
+ Join & Konfirmasi
+
+
+
+
+
+
+ >
+ );
+}
+
+function EventAlreadyDone({
+ title,
+ eventId,
+}: {
+ title: string;
+ eventId: string;
+}) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ const [isLoadingDetail, setLoadingDetail] = useState(false);
+ const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
+
+ return (
+ <>
+
+
+
+
+
+
+ Kami mohon maaf, Bapak/Ibu, acara{" "}
+
+ {title}
+ {" "}
+ telah selesai, sehingga konfirmasi kehadiran sudah tidak dapat
+ dilakukan. Terima kasih atas perhatian dan minat Anda. Kami
+ berharap dapat bertemu di acara kami berikutnya. Terima kasih,
+ Bapak/Ibu, kehadiran Anda di acara.
+
+
+
+ {
+ setHotMenu(0);
+ setLoading(true);
+ router.push(RouterEvent.beranda, { scroll: false });
+ }}
+ >
+ Beranda
+
+
+ {
+ setHotMenu(3);
+ setLoadingDetail(true);
+ router.push(RouterEvent.detail_riwayat + eventId, {
+ scroll: false,
+ });
+ }}
+ >
+ Riwayat Event
+
+
+
+
+
+
+ >
+ );
+}
+
+function UserNotConfirm({
+ title,
+ eventId,
+ userLoginId,
+}: {
+ title: string;
+ eventId: string;
+ userLoginId: string;
+}) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ async function onUpdateKonfirmasi() {
+ setLoading(true);
+ const res = await event_funUpdateKehadiran({
+ eventId: eventId,
+ userId: userLoginId,
+ });
+
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ router.push(RouterEvent.detail_main + eventId);
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ }
+ return (
+ <>
+
+
+
+
+
+
+ Terima kasih atas kehadiran Anda di acara{" "}
+
+ {title}
+ {" "}
+ pada hari ini. Mohon untuk mengonfirmasi kehadiran Anda dengan
+ menekan tombol{" "}
+
+ Konfirmasi Kehadiran
+ {" "}
+ atau fitur konfirmasi yang tersedia di bawah. Terima kasih dan
+ selamat menikmati acara.
+
+
+ {
+ onUpdateKonfirmasi();
+ }}
+ >
+ Konfirmasi Kehadiran
+
+
+
+
+
+
+ >
+ );
+}
+
+function UserAlreadyConfirm({ title }: { title: string }) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
+
+ return (
+ <>
+
+
+
+
+
+
+ Terima kasih, Bapak/Ibu, kehadiran Anda di acara{" "}
+
+ {title}
+ {" "}
+ telah berhasil dikonfirmasi. Kami senang menyambut Anda dan
+ semoga acara ini memberikan manfaat yang maksimal. Selamat
+ mengikuti kegiatan.
+
+
+ {
+ setHotMenu(0);
+ setLoading(true);
+ router.push(RouterEvent.beranda, { scroll: false });
+ }}
+ >
+ Beranda
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/event/_ui/konfirmasi.tsx b/src/app_modules/event/_ui/konfirmasi.tsx
new file mode 100644
index 00000000..3e42f2b6
--- /dev/null
+++ b/src/app_modules/event/_ui/konfirmasi.tsx
@@ -0,0 +1,626 @@
+"use client";
+
+import { MainColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import {
+ ComponentGlobal_NotifikasiBerhasil,
+ ComponentGlobal_NotifikasiGagal,
+} from "@/app_modules/_global/notif_global";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { API_RouteEvent } from "@/lib/api_user_router/route_api_event";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import { clientLogger } from "@/util/clientLogger";
+import { Button, Center, Group, Skeleton, Stack, Text } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useAtom } from "jotai";
+import moment from "moment";
+import "moment/locale/id";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import { apiGetEventDetailById } from "../_lib/api_event";
+import { MODEL_EVENT } from "../_lib/interface";
+import { event_funUpdateKehadiran } from "../fun";
+import { Event_funJoinAndConfirmEvent } from "../fun/create/fun_join_and_confirm";
+import { Event_funJoinEvent } from "../fun/create/fun_join_event";
+import { gs_event_hotMenu } from "../global_state";
+
+export default function Ui_Konfirmasi({
+ userLoginId,
+}: {
+ userLoginId: string;
+}) {
+ // console.log(dataEvent);
+
+ const params = useParams<{ id: string }>();
+ const eventId = params.id;
+
+ const router = useRouter();
+ const [data, setData] = useState(null);
+ const [isJoin, setIsJoin] = useState(null);
+ const [isPresent, setIsPresent] = useState(null);
+
+ // Load Data
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetEventDetailById({
+ id: eventId,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data detail event", error);
+ }
+ }
+
+ // CEK PESERTA
+ useShallowEffect(() => {
+ onCheckPeserta();
+ }, []);
+
+ async function onCheckPeserta() {
+ const res = await fetch(
+ API_RouteEvent.check_peserta({ eventId: eventId, userId: userLoginId })
+ );
+ const data = await res.json();
+ setIsJoin(data);
+ }
+
+ // =========== CEK KEHADIRAN ===========//
+ useShallowEffect(() => {
+ onLoadKehadiran();
+ }, []);
+
+ async function onLoadKehadiran() {
+ const res = await fetch(
+ API_RouteEvent.check_kehadiran({ eventId: eventId, userId: userLoginId })
+ );
+ const data = await res.json();
+ setIsPresent(data);
+ }
+
+ console.log("Peserta >", isPresent)
+ // =========== CEK KEHADIRAN ===========//
+
+ // Jika data kosong
+ if (!data && !isPresent) {
+ return ;
+ }
+
+ // Jika data tidak ada
+ if (!data) {
+ return (
+ <>
+
+ >
+ );
+ }
+
+ // Jika tanggal acara sudah lewat
+ if (moment(data?.tanggalSelesai).diff(moment(), "minute") < 0) {
+ return (
+ <>
+
+ >
+ );
+ }
+
+ // Jika join true
+ if (isJoin == true && moment(data?.tanggal).diff(moment(), "minute") > 0) {
+ return (
+ <>
+
+ >
+ );
+ }
+
+ // Jika belum join dan tanggal mulai acara belum lewat
+ if (isJoin == false && moment(data?.tanggal).diff(moment(), "minute") > 0) {
+ return (
+ <>
+
+ >
+ );
+ }
+
+ // Jika belum join dan tanggal mulai acara sudah lewat
+ if (isJoin == false && moment(data?.tanggal).diff(moment(), "minute") < 0) {
+ return (
+ <>
+
+ >
+ );
+ }
+
+ if (isPresent == false && data) {
+ return (
+
+ );
+ }
+
+ // Jika sudah join, sudah konfirmasi dan tanggal mulai acara sudah lewat
+ // if (isPresent && moment(data?.tanggal).diff(moment(), "minute") < 0)
+ if (
+ isPresent &&
+ isJoin &&
+ moment(data?.tanggal).diff(moment(), "minute") < 0
+ ) {
+ return ;
+ }
+}
+
+function DataNotFound() {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
+
+ return (
+ <>
+
+
+
+
+
+
+ Data Event Tidak Ditemukan
+
+
+ {
+ setHotMenu(0);
+ setLoading(true);
+ router.push(RouterEvent.beranda, { scroll: false });
+ }}
+ >
+ Kembali Ke Beranda
+
+
+
+
+
+
+ >
+ );
+}
+
+function SkeletonIsDataNull() {
+ return (
+ <>
+
+
+
+
+
+ {" "}
+ {" "}
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+function UserJoinTrue({ title, tanggal }: { title: string; tanggal: Date }) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
+
+ return (
+ <>
+
+
+
+
+
+
+ Terima kasih, Bapak/Ibu, Anda telah berhasil bergabung dalam
+ acara{" "}
+
+ {title}
+ {" "}
+ . Mohon ditunggu hingga tanggal{" "}
+
+ {moment(tanggal).format("DD-MM-YYYY")}
+ {" "}
+ untuk melakukan konfirmasi kehadiran melalui aplikasi HIPMI
+ APP.
+
+
+ {
+ setHotMenu(0);
+ setLoading(true);
+ router.push(RouterEvent.beranda, { scroll: false });
+ }}
+ >
+ Beranda
+
+
+
+
+
+
+ >
+ );
+}
+
+function UserAllowToJoin({
+ title,
+ tanggal,
+ lokasi,
+ eventId,
+ userLoginId,
+}: {
+ title: string;
+ tanggal: Date;
+ lokasi: string;
+ eventId: string;
+ userLoginId: string;
+}) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+
+ async function onJoinEvent() {
+ setLoading(true);
+
+ const data = {
+ userId: userLoginId,
+ eventId: eventId,
+ };
+
+ const res = await Event_funJoinEvent(data as any);
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ router.push(RouterEvent.detail_main + eventId);
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ }
+
+ return (
+ <>
+
+
+
+
+
+
+ Halo, Bapak/Ibu. Kami dengan senang hati mengundang Anda untuk
+ bergabung dalam acara
+
+ {title}
+ {" "}
+ yang akan diselenggarakan pada{" "}
+
+ {moment(tanggal).format("LL")}
+ {" "}
+ pukul
+
+ {moment(tanggal).format("LT")}
+ {" "}
+ di
+
+ {lokasi}
+ {" "}
+ . Pastikan Anda sudah melakukan registrasi melalui aplikasi
+ [Nama Aplikasi] agar dapat berpartisipasi. Kami sangat
+ menantikan kehadiran Anda. Sampai jumpa di acara ini.
+
+
+ {
+ onJoinEvent();
+ }}
+ >
+ Join Event
+
+
+
+
+
+
+ >
+ );
+}
+
+function UserNotJoinAndEventReady({
+ title,
+ eventId,
+ userLoginId,
+}: {
+ title: string;
+ eventId: string;
+ userLoginId: string;
+}) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ async function onJoinAndKonfirmasi() {
+ setLoading(true);
+
+ const body = {
+ eventId: eventId,
+ userId: userLoginId,
+ };
+
+ const res = await Event_funJoinAndConfirmEvent(body as any);
+
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ router.push(RouterEvent.detail_main + eventId);
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ }
+ return (
+ <>
+
+
+
+
+
+
+ Halo, Bapak/Ibu. Kami mencatat bahwa Anda belum melakukan
+ registrasi melalui aplikasi untuk mengikuti acara{" "}
+
+ {title}.
+ {" "}
+ Mohon segera lakukan registrasi melalui Event App agar dapat
+ mengikuti acara ini. Jika membutuhkan bantuan, jangan ragu
+ untuk menghubungi tim kami. Terima kasih Terima kasih atas
+ kehadiran Anda di acara pada hari ini. Mohon untuk
+ mengonfirmasi kehadiran Anda dengan menekan tombol{" "}
+ {"Join & Konfirmasi"}
+ atau fitur konfirmasi yang tersedia di bawah. Terima kasih dan
+ selamat menikmati acara.
+
+
+ {
+ onJoinAndKonfirmasi();
+ }}
+ >
+ Join & Konfirmasi
+
+
+
+
+
+
+ >
+ );
+}
+
+function EventAlreadyDone({
+ title,
+ eventId,
+}: {
+ title: string;
+ eventId: string;
+}) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ const [isLoadingDetail, setLoadingDetail] = useState(false);
+ const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
+
+ return (
+ <>
+
+
+
+
+
+
+ Kami mohon maaf, Bapak/Ibu, acara{" "}
+
+ {title}
+ {" "}
+ telah selesai, sehingga konfirmasi kehadiran sudah tidak dapat
+ dilakukan. Terima kasih atas perhatian dan minat Anda. Kami
+ berharap dapat bertemu di acara kami berikutnya. Terima kasih,
+ Bapak/Ibu, kehadiran Anda di acara.
+
+
+
+ {
+ setHotMenu(0);
+ setLoading(true);
+ router.push(RouterEvent.beranda, { scroll: false });
+ }}
+ >
+ Beranda
+
+
+ {
+ setHotMenu(3);
+ setLoadingDetail(true);
+ router.push(RouterEvent.detail_riwayat + eventId, {
+ scroll: false,
+ });
+ }}
+ >
+ Riwayat Event
+
+
+
+
+
+
+ >
+ );
+}
+
+function UserNotConfirm({
+ title,
+ eventId,
+ userLoginId,
+}: {
+ title: string;
+ eventId: string;
+ userLoginId: string;
+}) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ async function onUpdateKonfirmasi() {
+ setLoading(true);
+ const res = await event_funUpdateKehadiran({
+ eventId: eventId,
+ userId: userLoginId,
+ });
+
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ router.push(RouterEvent.detail_main + eventId);
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ }
+ return (
+ <>
+
+
+
+
+
+
+ Terima kasih atas kehadiran Anda di acara{" "}
+
+ {title}
+ {" "}
+ pada hari ini. Mohon untuk mengonfirmasi kehadiran Anda dengan
+ menekan tombol{" "}
+
+ Konfirmasi Kehadiran
+ {" "}
+ atau fitur konfirmasi yang tersedia di bawah. Terima kasih dan
+ selamat menikmati acara.
+
+
+ {
+ onUpdateKonfirmasi();
+ }}
+ >
+ Konfirmasi Kehadiran
+
+
+
+
+
+
+ >
+ );
+}
+
+function UserAlreadyConfirm({ title }: { title: string }) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
+
+ return (
+ <>
+
+
+
+
+
+
+ Terima kasih, Bapak/Ibu, kehadiran Anda di acara{" "}
+
+ {title}
+ {" "}
+ telah berhasil dikonfirmasi. Kami senang menyambut Anda dan
+ semoga acara ini memberikan manfaat yang maksimal. Selamat
+ mengikuti kegiatan.
+
+
+ {
+ setHotMenu(0);
+ setLoading(true);
+ router.push(RouterEvent.beranda, { scroll: false });
+ }}
+ >
+ Beranda
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/event/component/box_list_status.tsx b/src/app_modules/event/component/box_list_status.tsx
index 418701dd..88bca15e 100644
--- a/src/app_modules/event/component/box_list_status.tsx
+++ b/src/app_modules/event/component/box_list_status.tsx
@@ -1,14 +1,15 @@
"use client";
-import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
import {
ComponentGlobal_CardLoadingOverlay,
ComponentGlobal_CardStyles,
} from "@/app_modules/_global/component";
-import { Card, Group, Stack, Text, Title } from "@mantine/core";
+import { Box, Group, Stack, Text, Title } from "@mantine/core";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import { MODEL_EVENT } from "../model/interface";
+import { MODEL_EVENT } from "../_lib/interface";
+import { Comp_SetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
export default function ComponentEvent_BoxListStatus({
data,
@@ -30,29 +31,69 @@ export default function ComponentEvent_BoxListStatus({
setVisible(true);
router.push(path + data.id);
}}
+ // style={{
+ // maxHeight: 200,
+ // overflow: "hidden",
+ // position: "relative",
+ // }}
>
-
+
{data.title}
-
+
{new Intl.DateTimeFormat("id-ID", {
dateStyle: "medium",
- }).format(data.tanggal)}
+ }).format(new Date(data.tanggal))}
-
- {data.deskripsi}
+
- {visible && eventId !== "" ? (
-
- ) : (
- ""
- )}
+ {visible && eventId !== "" && }
+
+ {/*
+
+
+
+
+ */}
>
);
}
diff --git a/src/app_modules/event/component/button/api_fetch_event.ts b/src/app_modules/event/component/button/api_fetch_event.ts
new file mode 100644
index 00000000..1ff30b97
--- /dev/null
+++ b/src/app_modules/event/component/button/api_fetch_event.ts
@@ -0,0 +1,127 @@
+export { apiGetEventByStatus, apiGetKontribusiEvent, apiGetRiwayatEvent };
+
+const apiGetEventByStatus = async ({
+ status,
+ page,
+}: {
+ status: string;
+ page: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ // Send PUT request to update portfolio logo
+ const isPage = `?page=${page}`;
+ const response = await fetch(`/api/event/status/${status}${isPage}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error updating portfolio logo:",
+ errorData?.message || "Unknown error"
+ );
+
+ return null;
+ }
+
+ return await response.json();
+ } catch (error) {
+ console.error("Error updating portfolio medsos:", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiGetKontribusiEvent = async ({ page }: { page: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ // Send PUT request to update portfolio logo
+ const isPage = `?page=${page}`;
+ const response = await fetch(`/api/event/kontribusi${isPage}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error updating portfolio logo:",
+ errorData?.message || "Unknown error"
+ );
+
+ return null;
+ }
+
+ return await response.json();
+ } catch (error) {
+ console.error("Error updating portfolio medsos:", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiGetRiwayatEvent = async ({
+ name,
+ page,
+}: {
+ name: string;
+ page: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ // Send PUT request to update portfolio logo
+ const isPage = `?page=${page}`;
+ const response = await fetch(`/api/event/riwayat/${name}${isPage}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error updating portfolio logo:",
+ errorData?.message || "Unknown error"
+ );
+
+ return null;
+ }
+
+ return await response.json();
+ } catch (error) {
+ console.error("Error updating portfolio medsos:", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
diff --git a/src/app_modules/event/component/button/button_create_event.tsx b/src/app_modules/event/component/button/button_create_event.tsx
index 74d53096..32a0c234 100644
--- a/src/app_modules/event/component/button/button_create_event.tsx
+++ b/src/app_modules/event/component/button/button_create_event.tsx
@@ -1,21 +1,21 @@
-import { IRealtimeData } from "@/app/lib/global_state";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
import { MainColor } from "@/app_modules/_global/color";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
import {
ComponentGlobal_NotifikasiBerhasil,
ComponentGlobal_NotifikasiGagal,
- ComponentGlobal_NotifikasiPeringatan,
} from "@/app_modules/_global/notif_global";
import { notifikasiToAdmin_funCreate } from "@/app_modules/notifikasi/fun";
+import { IRealtimeData } from "@/lib/global_state";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import { clientLogger } from "@/util/clientLogger";
import { Button } from "@mantine/core";
import { useAtom } from "jotai";
-import moment from "moment";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { WibuRealtime } from "wibu-pkg";
import { Event_funCreate } from "../../fun/create/fun_create";
import { gs_event_hotMenu } from "../../global_state";
-import { event_checkStatus } from "../../fun/get/fun_check_status_by_id";
export default function Event_ComponentCreateButton({
value,
@@ -31,42 +31,47 @@ export default function Event_ComponentCreateButton({
const [isLoading, setLoading] = useState(false);
async function onSave() {
-
- const res = await Event_funCreate(value);
+ try {
+ setLoading(true);
+ const res = await Event_funCreate(value);
- if (res.status === 201) {
- const dataNotifikasi: IRealtimeData = {
- appId: res.data?.id as any,
- status: res.data?.EventMaster_Status?.name as any,
- userId: res.data?.authorId as any,
- pesan: res.data?.title as any,
- kategoriApp: "EVENT",
- title: "Event baru",
- };
+ if (res.status === 201) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res.data?.id as any,
+ status: res.data?.EventMaster_Status?.name as any,
+ userId: res.data?.authorId as any,
+ pesan: res.data?.title as any,
+ kategoriApp: "EVENT",
+ title: "Event baru",
+ };
- const notif = await notifikasiToAdmin_funCreate({
- data: dataNotifikasi as any,
- });
-
- if (notif.status === 201) {
- WibuRealtime.setData({
- type: "notification",
- pushNotificationTo: "ADMIN",
+ const notif = await notifikasiToAdmin_funCreate({
+ data: dataNotifikasi as any,
});
- WibuRealtime.setData({
- type: "trigger",
- pushNotificationTo: "ADMIN",
- dataMessage: dataNotifikasi,
- });
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "ADMIN",
+ });
- ComponentGlobal_NotifikasiBerhasil(res.message);
- setHotMenu(1);
- setLoading(true);
- router.push(RouterEvent.status({ id: "2" }), { scroll: false });
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "ADMIN",
+ dataMessage: dataNotifikasi,
+ });
+
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ setHotMenu(1);
+ router.push(RouterEvent.status({ id: "2" }), { scroll: false });
+ }
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
}
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error create event", error);
}
}
@@ -79,14 +84,16 @@ export default function Event_ComponentCreateButton({
disabled={
value.title === "" ||
value.lokasi === "" ||
- value.deskripsi === "" ||
value.eventMaster_TipeAcaraId === 0 ||
value.tanggal === "function Date() { [native code] }" ||
// moment(value.tanggal).diff(moment(), "minutes") < 0
- diffTimeEnd - 1 < diffTimeStart
+ diffTimeEnd - 1 < diffTimeStart ||
+ // value.deskripsi === "" ||
+ funReplaceHtml({ html: value.deskripsi }).length > maxInputLength ||
+ funReplaceHtml({ html: value.deskripsi }).length === 0
}
loaderPosition="center"
- loading={isLoading ? true : false}
+ loading={isLoading}
radius={"xl"}
mt={"xl"}
onClick={() => {
@@ -94,7 +101,7 @@ export default function Event_ComponentCreateButton({
}}
bg={MainColor.yellow}
color="yellow"
- c={"black"}
+ c={MainColor.darkblue}
>
Simpan
diff --git a/src/app_modules/event/component/button/comp_daftar_peserta_dan_sponsor.tsx b/src/app_modules/event/component/button/comp_daftar_peserta_dan_sponsor.tsx
new file mode 100644
index 00000000..2422a2a4
--- /dev/null
+++ b/src/app_modules/event/component/button/comp_daftar_peserta_dan_sponsor.tsx
@@ -0,0 +1,14 @@
+import { Admin_V3_ComponentBreakpoint } from "@/app_modules/admin/_components_v3/comp_simple_grid_breakpoint";
+import Event_ComponentBoxDaftarPeserta from "../detail/comp_box_daftar_peserta";
+import Event_ComponentBoxDaftarSponsor from "../detail/comp_box_sponsor";
+
+export const Event_ComponentDaftarPesertaDanSponsor = () => {
+ return (
+ <>
+
+
+ {/* */}
+
+ >
+ );
+};
diff --git a/src/app_modules/event/component/card_view/card_beranda.tsx b/src/app_modules/event/component/card_view/card_beranda.tsx
index d751c207..1f3159df 100644
--- a/src/app_modules/event/component/card_view/card_beranda.tsx
+++ b/src/app_modules/event/component/card_view/card_beranda.tsx
@@ -1,4 +1,5 @@
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import { MainColor } from "@/app_modules/_global/color";
import {
ComponentGlobal_AvatarAndUsername,
ComponentGlobal_CardLoadingOverlay,
@@ -7,6 +8,7 @@ import {
import { Box, Group, Stack, Text, Title } from "@mantine/core";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { Comp_SetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
export function ComponentEvent_CardBeranda({ data }: { data: any }) {
const router = useRouter();
@@ -15,7 +17,9 @@ export function ComponentEvent_CardBeranda({ data }: { data: any }) {
return (
<>
-
+
-
+
{data.title}
-
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "medium",
- }).format(data.tanggal)}
-
-
- {data.deskripsi}
+
+
diff --git a/src/app_modules/event/component/card_view/card_kontributor.tsx b/src/app_modules/event/component/card_view/card_kontributor.tsx
index 87616f3d..c99cd531 100644
--- a/src/app_modules/event/component/card_view/card_kontributor.tsx
+++ b/src/app_modules/event/component/card_view/card_kontributor.tsx
@@ -1,4 +1,4 @@
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
import {
ComponentGlobal_AvatarAndUsername,
ComponentGlobal_CardLoadingOverlay,
@@ -14,7 +14,7 @@ import {
} from "@mantine/core";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import { MODEL_EVENT_PESERTA } from "../../model/interface";
+import { MODEL_EVENT_PESERTA } from "../../_lib/interface";
export function ComponentEvent_CardKontributor({
data,
diff --git a/src/app_modules/event/component/card_view/card_riwayat.tsx b/src/app_modules/event/component/card_view/card_riwayat.tsx
index ed29b4f1..30660348 100644
--- a/src/app_modules/event/component/card_view/card_riwayat.tsx
+++ b/src/app_modules/event/component/card_view/card_riwayat.tsx
@@ -1,4 +1,4 @@
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
import { Group, Stack, Text, Title } from "@mantine/core";
import {
@@ -8,7 +8,8 @@ import {
} from "@/app_modules/_global/component";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import { MODEL_EVENT } from "../../model/interface";
+import { MODEL_EVENT } from "../../_lib/interface";
+import { Comp_SetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
export function ComponentEvent_CardRiwayat({ data }: { data: MODEL_EVENT }) {
const router = useRouter();
@@ -19,13 +20,6 @@ export function ComponentEvent_CardRiwayat({ data }: { data: MODEL_EVENT }) {
<>
- {/* */}
-
@@ -45,12 +39,15 @@ export function ComponentEvent_CardRiwayat({ data }: { data: MODEL_EVENT }) {
{new Intl.DateTimeFormat("id-ID", {
dateStyle: "medium",
- }).format(data.tanggal)}
+ }).format(new Date(data.tanggal))}
-
- {data.deskripsi}
+
+
diff --git a/src/app_modules/event/component/detail/comp_avatar_and_username_event.tsx b/src/app_modules/event/component/detail/comp_avatar_and_username_event.tsx
new file mode 100644
index 00000000..163cb590
--- /dev/null
+++ b/src/app_modules/event/component/detail/comp_avatar_and_username_event.tsx
@@ -0,0 +1,56 @@
+import {
+ ComponentGlobal_AvatarAndUsername,
+ ComponentGlobal_CardStyles,
+} from "@/app_modules/_global/component";
+import { Badge, Group, Stack, Text } from "@mantine/core";
+import { Prisma } from "@prisma/client";
+import moment from "moment";
+
+type IFontSize = "xs" | "sm" | "md" | "lg" | "xl";
+
+function ComponentEvent_AvatarAndUsername({
+ profile,
+ component,
+ sizeAvatar,
+ fontSize,
+ tanggalMulai,
+ tanggalSelesai,
+ isPresent,
+}: {
+ profile: Prisma.ProfileSelect;
+ component?: React.ReactNode;
+ sizeAvatar?: number;
+ fontSize?: IFontSize | {};
+ tanggalMulai?: Date;
+ tanggalSelesai?: Date;
+ isPresent?: boolean;
+}) {
+ const tglMulai = moment(tanggalMulai).diff(moment(), "minutes") < 0;
+
+ return (
+ <>
+
+
+
+
+ {isPresent ? (
+ Hadir
+ ) : (
+ -
+ )}
+
+
+
+ )
+ }
+ />
+
+ >
+ );
+}
+
+export default ComponentEvent_AvatarAndUsername;
diff --git a/src/app_modules/event/component/detail/comp_box_daftar_peserta.tsx b/src/app_modules/event/component/detail/comp_box_daftar_peserta.tsx
new file mode 100644
index 00000000..bfe0705d
--- /dev/null
+++ b/src/app_modules/event/component/detail/comp_box_daftar_peserta.tsx
@@ -0,0 +1,46 @@
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { ActionIcon, Flex, Loader, Paper, Text } from "@mantine/core";
+import { IconUsersGroup } from "@tabler/icons-react";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+
+function Event_ComponentBoxDaftarPeserta({ eventId }: { eventId?: string }) {
+ const params = useParams<{ id: string }>();
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ return (
+ <>
+ {
+ setLoading(true);
+ router.push(RouterEvent.daftar_peserta({ id: params.id }), {
+ scroll: false,
+ });
+ // router.push(RouterInvestasi_OLD.detail_dokumen + investasiId, { scroll: false });
+ }}
+ >
+
+
+ Daftar Peserta
+
+
+ {isLoading ? (
+
+ ) : (
+
+ )}
+
+
+
+ >
+ );
+}
+export default Event_ComponentBoxDaftarPeserta;
diff --git a/src/app_modules/event/component/detail/comp_box_sponsor.tsx b/src/app_modules/event/component/detail/comp_box_sponsor.tsx
new file mode 100644
index 00000000..7f476c28
--- /dev/null
+++ b/src/app_modules/event/component/detail/comp_box_sponsor.tsx
@@ -0,0 +1,46 @@
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { ActionIcon, Flex, Loader, Paper, Text } from "@mantine/core";
+import { IconStar } from "@tabler/icons-react";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+
+function Event_ComponentBoxDaftarSponsor() {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+ const params = useParams<{ id: string }>();
+ return (
+ <>
+ {
+ // setLoading(true);
+ // router.push(RouterEvent.daftar_sponsor({ id: params.id }), {
+ // scroll: false,
+ // });
+ ComponentGlobal_NotifikasiPeringatan("Fitur belum tersedia");
+ }}
+ >
+
+
+ Daftar Sponsor
+
+
+ {isLoading ? (
+
+ ) : (
+
+ )}
+
+
+
+ >
+ );
+}
+export default Event_ComponentBoxDaftarSponsor;
diff --git a/src/app_modules/event/component/detail/create_sponsor.tsx b/src/app_modules/event/component/detail/create_sponsor.tsx
new file mode 100644
index 00000000..d075f137
--- /dev/null
+++ b/src/app_modules/event/component/detail/create_sponsor.tsx
@@ -0,0 +1,110 @@
+'use client';
+import { MainColor } from '@/app_modules/_global/color';
+import { ComponentGlobal_BoxInformation, ComponentGlobal_BoxUploadImage } from '@/app_modules/_global/component';
+import { Investasi_ComponentButtonCreateNewInvestasi } from '@/app_modules/investasi/_component';
+import { Box, Stack, Loader, AspectRatio, Image, Button, TextInput, Group, Title } from '@mantine/core';
+import { IconCamera, IconPhoto } from '@tabler/icons-react';
+import { useRouter } from 'next/navigation';
+import React, { useState } from 'react';
+
+function Event_CreateSponsor() {
+ const router = useRouter();
+ const [img, setImg] = useState(null);
+ const [isLoadingImg, setIsLoadingImg] = useState(false);
+ return (
+ <>
+
+
+
+
+
+
+ {isLoadingImg ? (
+
+
+
+ ) : img ? (
+
+
+
+
+ ) : (
+
+
+
+ )}
+
+
+ } color='yellow' c={"black"} bg={MainColor.yellow}>Upload Gambar
+
+
+
+ Sosial Media
+
+
+ router.push("/dev/event/detail/sponsor/nominal_sponsor")}>
+ Simpan
+
+
+
+
+ >
+ );
+}
+
+export default Event_CreateSponsor;
diff --git a/src/app_modules/event/component/detail/detail_data.tsx b/src/app_modules/event/component/detail/detail_data.tsx
index 3e72b9b9..28eaa34e 100644
--- a/src/app_modules/event/component/detail/detail_data.tsx
+++ b/src/app_modules/event/component/detail/detail_data.tsx
@@ -1,89 +1,101 @@
"use client";
-import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
-import { Grid, Stack, Text, Title } from "@mantine/core";
-import { MODEL_EVENT } from "../../model/interface";
-
+import { MainColor } from "@/app_modules/_global/color";
+import {
+ ComponentGlobal_BoxInformation,
+ ComponentGlobal_CardStyles,
+} from "@/app_modules/_global/component";
+import { Comp_SetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
+import { Component_V3_GridDetailData } from "@/app_modules/_global/component/new/comp_V3_grid_detail_data";
+import { Component_V3_MomentDateAndTime } from "@/app_modules/_global/component/new/comp_V3_moment_date_and_time";
+import { SimpleGrid, Stack, Title } from "@mantine/core";
+import "moment/locale/id";
+import { MODEL_EVENT } from "../../_lib/interface";
+import { Event_ComponentSkeletonDetail } from "../skeleton/comp_skeleton_detail";
+import Event_ComponentBoxDaftarPeserta from "./comp_box_daftar_peserta";
export default function ComponentEvent_DetailData({
+ isDaftarPeserta,
+ isReport,
data,
}: {
- data: MODEL_EVENT;
+ isDaftarPeserta?: boolean;
+ isReport?: boolean;
+ data: MODEL_EVENT | null;
}) {
+ const listData = [
+ {
+ title: "Lokasi",
+ value: data?.lokasi ?? "-",
+ },
+ {
+ title: "Tipe Acara",
+ value: `${data?.EventMaster_TipeAcara?.name}`,
+ },
+ {
+ title: "Tanggal Mulai ",
+ value: ,
+ },
+ {
+ title: "Tanggal Selesai ",
+ value: ,
+ },
+ {
+ title: "Deskripsi",
+ value: ,
+ },
+ ];
+
return (
<>
-
-
-
- {data ? data?.title : null}
-
-
-
- Lokasi
-
- :
-
- {data ? data?.lokasi : null}
-
-
-
-
- Tipe Acara
-
- :
-
- {data ? data.EventMaster_TipeAcara?.name : null}
-
-
-
- Tanggal & Waktu
-
-
- Mulai
-
- :
-
-
- {" "}
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "full",
- }).format(data?.tanggal)}
- ,{" "}
-
- {new Intl.DateTimeFormat("id-ID", {
- timeStyle: "short",
- }).format(data?.tanggal)}
-
-
-
-
-
-
- Selesai
-
- :
-
-
- {" "}
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "full",
- }).format(data?.tanggalSelesai)}
- ,{" "}
-
- {new Intl.DateTimeFormat("id-ID", {
- timeStyle: "short",
- }).format(data?.tanggalSelesai)}
-
-
-
-
-
+ {!data ? (
+
+ ) : (
+
+ {isReport && data.catatan ? (
+
+ ) : (
+ ""
+ )}
-
- Deskripsi
- {data ? data?.deskripsi : null}
-
+
+
+
+
+ {data ? data?.title : null}
+
+
+
+ {listData.map((e, i) => (
+
+ ))}
+
+
+
+ {isDaftarPeserta && (
+
+
+ {/* */}
+
+ )}
+
+
-
+ )}
>
);
}
diff --git a/src/app_modules/event/component/detail/detail_main.tsx b/src/app_modules/event/component/detail/detail_main.tsx
index bfcdefea..a21b3fce 100644
--- a/src/app_modules/event/component/detail/detail_main.tsx
+++ b/src/app_modules/event/component/detail/detail_main.tsx
@@ -1,107 +1,95 @@
"use client";
+import { MainColor } from "@/app_modules/_global/color";
import {
ComponentGlobal_AvatarAndUsername,
ComponentGlobal_CardStyles,
} from "@/app_modules/_global/component";
-import { Grid, Stack, Text, Title } from "@mantine/core";
-import { MODEL_EVENT } from "../../model/interface";
+import { Comp_SetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
+import { Component_V3_GridDetailData } from "@/app_modules/_global/component/new/comp_V3_grid_detail_data";
+import { Component_V3_MomentDateAndTime } from "@/app_modules/_global/component/new/comp_V3_moment_date_and_time";
+import { clientLogger } from "@/util/clientLogger";
+import { Stack, Title } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import "moment/locale/id";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { apiGetEventDetailById } from "../../_lib/api_event";
+import { MODEL_EVENT } from "../../_lib/interface";
+import { Event_ComponentDaftarPesertaDanSponsor } from "../button/comp_daftar_peserta_dan_sponsor";
+import { Event_ComponentSkeletonDetail } from "../skeleton/comp_skeleton_detail";
-export default function ComponentEvent_DetailMainData({
- data,
-}: {
- data: MODEL_EVENT;
-}) {
- const tgl = data.tanggal;
- const hari = tgl.toLocaleString("id-ID", { dateStyle: "full" });
+export default function ComponentEvent_DetailMainData() {
+ const params = useParams<{ id: string }>();
+ const eventId = params.id as string;
+ const [data, setData] = useState(null);
- const jam = tgl.toLocaleTimeString([], {
- timeStyle: "short",
- hourCycle: "h24",
- });
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetEventDetailById({
+ id: eventId,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data detail event", error);
+ }
+ }
+
+ const listData = [
+ {
+ title: "Lokasi",
+ value: data?.lokasi ?? "-",
+ },
+ {
+ title: "Tipe Acara",
+ value: `${data?.EventMaster_TipeAcara?.name}`,
+ },
+ {
+ title: "Tanggal Mulai ",
+ value: ,
+ },
+ {
+ title: "Tanggal Selesai ",
+ value: ,
+ },
+ {
+ title: "Deskripsi",
+ value: ,
+ },
+ ];
return (
<>
-
-
-
+ {data == null ? (
+
+ ) : (
+
+
+
-
-
- {data ? data.title : null}
-
-
-
- Lokasi
-
- :
-
- {data ? data.lokasi : null}
-
-
-
-
- Tipe Acara
-
- :
-
- {data ? data.EventMaster_TipeAcara.name : null}
-
-
-
-
- Tanggal & Waktu
-
-
- Mulai
-
- :
-
-
- {" "}
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "full",
- }).format(data?.tanggal)}
- ,{" "}
-
- {new Intl.DateTimeFormat("id-ID", {
- timeStyle: "short",
- }).format(data?.tanggal)}
-
-
-
-
-
-
- Selesai
-
- :
-
-
- {" "}
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "full",
- }).format(data?.tanggalSelesai)}
- ,{" "}
-
- {new Intl.DateTimeFormat("id-ID", {
- timeStyle: "short",
- }).format(data?.tanggalSelesai)}
-
-
-
-
-
-
-
- Deskripsi
- {data ? data?.deskripsi : null}
+
+
+ {data ? data.title : null}
+
+
+ {listData.map((e, i) => (
+
+ ))}
+
+
-
-
+
+ )}
>
);
}
diff --git a/src/app_modules/event/component/detail/list_peserta.tsx b/src/app_modules/event/component/detail/list_peserta.tsx
index 9ae7274b..98625383 100644
--- a/src/app_modules/event/component/detail/list_peserta.tsx
+++ b/src/app_modules/event/component/detail/list_peserta.tsx
@@ -1,58 +1,235 @@
"use client";
import {
+ ActionIcon,
+ Avatar,
+ Badge,
Center,
+ Grid,
+ Group,
+ Loader,
Stack,
Text,
Title
} from "@mantine/core";
import _ from "lodash";
+import { MainColor } from "@/app_modules/_global/color";
import {
- ComponentGlobal_AvatarAndUsername,
ComponentGlobal_CardStyles,
+ ComponentGlobal_LoaderAvatar
} from "@/app_modules/_global/component";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { apiGetOneProfileById } from "@/app_modules/katalog/profile/lib/api_fetch_profile";
+import { API_RouteEvent } from "@/lib/api_user_router/route_api_event";
+import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
+import { useShallowEffect } from "@mantine/hooks";
+import { Prisma } from "@prisma/client";
+import moment from "moment";
+import { ScrollOnly } from "next-scroll-loader";
import { useRouter } from "next/navigation";
-import { MODEL_EVENT_PESERTA } from "../../model/interface";
+import { useState } from "react";
+import { MODEL_EVENT_PESERTA } from "../../_lib/interface";
+import { event_newGetListPesertaById } from "../../fun";
+import Event_ComponentSkeletonListPeserta from "../skeleton/comp_skeleton_list_peserta";
export default function ComponentEvent_ListPeserta({
- listPeserta,
total,
+ eventId,
+ isNewPeserta,
}: {
- listPeserta: MODEL_EVENT_PESERTA[];
total: number;
+ eventId: string;
+ isNewPeserta?: boolean | null;
}) {
const router = useRouter();
+ const [data, setData] = useState(null);
+ const [activePage, setActivePage] = useState(1);
+
+ useShallowEffect(() => {
+ onLoadPeserta();
+ }, []);
+
+ useShallowEffect(() => {
+ if (isNewPeserta !== null && isNewPeserta === true) {
+ onLoadPeserta();
+ }
+ }, [isNewPeserta]);
+
+ async function onLoadPeserta() {
+ const res = await fetch(
+ API_RouteEvent.list_peserta({ eventId: eventId, page: 1 })
+ );
+ const data = await res.json();
+ setData(data);
+ }
+
return (
<>
-
-
-
- Daftar Peserta ({total})
-
-
- {_.isEmpty(listPeserta) ? (
+ {data === null ? (
+
+ ) : (
+
+
-
- - Tidak ada peserta -
-
+
+ Daftar Peserta ({total})
+
- ) : (
-
- {listPeserta.map((e, i) => (
-
-
+
+ - Tidak ada peserta -
+
+
+ ) : (
+ //
+ // {data.map((e, i) => (
+ //
+ //
+
+ // {/* */}
+ //
+ // ))}
+ //
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={async () => {
+ const loadData = await event_newGetListPesertaById({
+ eventId: eventId as string,
+ page: activePage + 1,
+ });
+
+ setActivePage((val) => val + 1);
+
+ return loadData;
+ }}
+ >
+ {(item) => (
+
- {/* */}
-
- ))}
-
- )}
-
-
+ )}
+
+ )}
+
+
+ )}
+ >
+ );
+}
+
+type IFontSize = "xs" | "sm" | "md" | "lg" | "xl";
+
+function ComponentEvent_AvatarAndUsername({
+ profile,
+ component,
+ sizeAvatar,
+ fontSize,
+ tanggalMulai,
+ tanggalSelesai,
+ isPresent,
+}: {
+ profile: Prisma.ProfileSelect;
+ component?: React.ReactNode;
+ sizeAvatar?: number;
+ fontSize?: IFontSize | {};
+ tanggalMulai?: Date;
+ tanggalSelesai?: Date;
+ isPresent?: boolean;
+}) {
+ const router = useRouter();
+ const [visible, setVisible] = useState(false);
+
+ async function onCheckProfile() {
+ try {
+ const res = await apiGetOneProfileById({ id: profile.id as any });
+
+ if (res && res.success) {
+ setVisible(true);
+ router.push(RouterProfile.katalog({ id: profile.id as any }));
+ } else {
+ ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
+ }
+ } catch (error) {
+ console.log("Error >>r", error);
+ }
+ }
+
+ const tglMulai = moment(tanggalMulai).diff(moment(), "minutes") < 0;
+
+ return (
+ <>
+
+
+ onCheckProfile()}
+ >
+ {visible ? (
+
+
+
+ ) : (
+
+ )}
+
+
+
+
+
+ onCheckProfile()}
+ >
+ {profile?.name}
+
+
+
+
+ {tglMulai && (
+
+
+
+
+ {isPresent ? (
+ Hadir
+ ) : (
+ -
+ )}
+
+
+
+
+ )}
+
>
);
}
diff --git a/src/app_modules/event/component/detail/list_peserta_new.tsx b/src/app_modules/event/component/detail/list_peserta_new.tsx
new file mode 100644
index 00000000..305d358a
--- /dev/null
+++ b/src/app_modules/event/component/detail/list_peserta_new.tsx
@@ -0,0 +1,43 @@
+import { AccentColor, MainColor } from '@/app_modules/_global/color';
+import { Avatar, Badge, Box, Card, Flex, Group, Stack, Text } from '@mantine/core';
+
+function ComponentEvent_ListPesertaNew({ backgroundColor, border, marginBottom, height, color }: {
+ backgroundColor?: string;
+ border?: string;
+ marginBottom?: string | number;
+ height?: string | number;
+ color?: string;
+}) {
+ return (
+ <>
+
+
+
+
+
+
+ Nico Arya Putra Laksana
+
+ HADIR
+
+
+
+ >
+ );
+}
+
+export default ComponentEvent_ListPesertaNew;
diff --git a/src/app_modules/event/component/detail/list_sponsor.tsx b/src/app_modules/event/component/detail/list_sponsor.tsx
new file mode 100644
index 00000000..cd40eddf
--- /dev/null
+++ b/src/app_modules/event/component/detail/list_sponsor.tsx
@@ -0,0 +1,99 @@
+"use client";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import {
+ ComponentGlobal_AvatarAndUsername,
+ ComponentGlobal_CardLoadingOverlay,
+ ComponentGlobal_CardStyles,
+} from "@/app_modules/_global/component";
+import {
+ Box,
+ Divider,
+ Grid,
+ Stack,
+ Title
+} from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+
+function ComponentEvent_ListSponsor({
+ backgroundColor,
+ border,
+ marginBottom,
+ height,
+ color,
+ profile,
+ data,
+}: {
+ backgroundColor?: string;
+ border?: string;
+ marginBottom?: string | number;
+ height?: string | number;
+ color?: string;
+ profile: any;
+ data: any;
+}) {
+ const router = useRouter();
+ const [visible, setVisible] = useState(false);
+
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+ {
+ router.push(RouterEvent.detail_sponsor({ id: data.id }));
+ setVisible(true);
+ }}
+ >
+
+ {data?.name}
+
+
+
+ {visible && }
+
+ {/*
+
+ router.push(RouterEvent.detail_sponsor({ id: params.id }))
+ }
+ >
+
+
+
+
+
+ INACO
+
+ Rp. 100.000
+
+
+ */}
+ >
+ );
+}
+
+export default ComponentEvent_ListSponsor;
diff --git a/src/app_modules/event/component/index.ts b/src/app_modules/event/component/index.ts
index d9cc4eeb..6180e8a6 100644
--- a/src/app_modules/event/component/index.ts
+++ b/src/app_modules/event/component/index.ts
@@ -1,5 +1,11 @@
import Event_ComponentCreateButton from "./button/button_create_event";
+import Event_ComponentSkeletonBeranda from "./skeleton/comp_skeleton_beranda";
+import { Event_ComponentSkeletonDetail } from "./skeleton/comp_skeleton_detail";
import { Event_ComponentSkeletonDetailData } from "./skeleton/comp_skeleton_detail_data";
+import Event_ComponentSkeletonListPeserta from "./skeleton/comp_skeleton_list_peserta";
export { Event_ComponentSkeletonDetailData };
export { Event_ComponentCreateButton };
+export { Event_ComponentSkeletonBeranda };
+export { Event_ComponentSkeletonDetail };
+export { Event_ComponentSkeletonListPeserta };
diff --git a/src/app_modules/event/component/list_tab_riwayat.ts b/src/app_modules/event/component/list_tab_riwayat.ts
new file mode 100644
index 00000000..362d3714
--- /dev/null
+++ b/src/app_modules/event/component/list_tab_riwayat.ts
@@ -0,0 +1,12 @@
+export const listTabsRiwayatEvent = [
+ {
+ id: "1",
+ label: "Semua Riwayat",
+ value: "semua",
+ },
+ {
+ id: "2",
+ label: "Riwayat Saya",
+ value: "saya",
+ },
+];
\ No newline at end of file
diff --git a/src/app_modules/event/component/new_footer.tsx b/src/app_modules/event/component/new_footer.tsx
new file mode 100644
index 00000000..c7c22130
--- /dev/null
+++ b/src/app_modules/event/component/new_footer.tsx
@@ -0,0 +1,75 @@
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import {
+ IconHome,
+ IconReservedLine,
+ IconCalendarEvent,
+ IconHistory,
+} from "@tabler/icons-react";
+import { useAtom } from "jotai";
+import { useRouter } from "next/navigation";
+import { gs_event_hotMenu } from "../global_state";
+import { MainColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { SimpleGrid, Stack, ActionIcon, Text } from "@mantine/core";
+
+export function Event_ComponentNewFooter() {
+ const router = useRouter();
+ const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu);
+
+ const listFooter = [
+ {
+ id: "1",
+ name: "Beranda",
+ path: RouterEvent.beranda,
+ icon: ,
+ },
+
+ {
+ id: "2",
+ name: "Status",
+ path: RouterEvent.status({ id: "1" }),
+ icon: ,
+ },
+ {
+ id: "3",
+ name: "Kontribusi",
+ path: RouterEvent.kontribusi,
+ icon: ,
+ },
+ {
+ id: "4",
+ name: "Riwayat",
+ path: RouterEvent.riwayat({ id: "1" }),
+ icon: ,
+ },
+ ];
+ return (
+ <>
+
+ {listFooter.map((e, i) => (
+
+
+ e.path === ""
+ ? ComponentGlobal_NotifikasiPeringatan("Cooming Soon")
+ : (router.replace(e.path), setHotMenu(i))
+ }
+ >
+ {e.icon}
+
+
+ {e.name}
+
+
+ ))}
+
+ >
+ );
+}
diff --git a/src/app_modules/event/component/skeleton/comp_skeleton_beranda.tsx b/src/app_modules/event/component/skeleton/comp_skeleton_beranda.tsx
new file mode 100644
index 00000000..c5906c2f
--- /dev/null
+++ b/src/app_modules/event/component/skeleton/comp_skeleton_beranda.tsx
@@ -0,0 +1,30 @@
+import { AccentColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Grid, Group, Paper, Skeleton, Stack, Text } from "@mantine/core";
+
+export default function Event_ComponentSkeletonBeranda() {
+ return (
+ <>
+ {Array.from({ length: 10 }).map((_, index) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ))}
+ >
+ );
+}
diff --git a/src/app_modules/event/component/skeleton/comp_skeleton_detail.tsx b/src/app_modules/event/component/skeleton/comp_skeleton_detail.tsx
new file mode 100644
index 00000000..e4fcd758
--- /dev/null
+++ b/src/app_modules/event/component/skeleton/comp_skeleton_detail.tsx
@@ -0,0 +1,47 @@
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Center, Grid, SimpleGrid, Stack } from "@mantine/core";
+
+export function Event_ComponentSkeletonDetail() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/*
+
+
+ */}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/event/component/skeleton/comp_skeleton_detail_data.tsx b/src/app_modules/event/component/skeleton/comp_skeleton_detail_data.tsx
index 7d8cc8aa..67b13b1d 100644
--- a/src/app_modules/event/component/skeleton/comp_skeleton_detail_data.tsx
+++ b/src/app_modules/event/component/skeleton/comp_skeleton_detail_data.tsx
@@ -24,10 +24,10 @@ export function Event_ComponentSkeletonDetailData() {
))}
-
+ {/*
-
+ */}
>
diff --git a/src/app_modules/event/component/skeleton/comp_skeleton_list_peserta.tsx b/src/app_modules/event/component/skeleton/comp_skeleton_list_peserta.tsx
new file mode 100644
index 00000000..4ec8df0f
--- /dev/null
+++ b/src/app_modules/event/component/skeleton/comp_skeleton_list_peserta.tsx
@@ -0,0 +1,33 @@
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Center, Grid, Stack } from "@mantine/core";
+
+export default function Event_ComponentSkeletonListPeserta() {
+ return (
+ <>
+
+
+
+
+
+
+
+ {Array.from(new Array(3)).map((e, i) => (
+
+
+
+
+
+
+
+
+
+
+
+ ))}
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/event/create/create.tsx b/src/app_modules/event/create/create.tsx
index a078cb80..f2d868fd 100644
--- a/src/app_modules/event/create/create.tsx
+++ b/src/app_modules/event/create/create.tsx
@@ -1,35 +1,31 @@
"use client";
+import { MainColor } from "@/app_modules/_global/color";
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import Component_V3_Label_TextInput from "@/app_modules/_global/component/new/comp_V3_label_text_input";
+import { Component_V3_TextEditor } from "@/app_modules/_global/component/new/comp_V3_text_editor";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+import { baseStylesTextInput } from "@/app_modules/_global/lib/base_style_text_input";
+import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { MODEL_DEFAULT_MASTER_OLD } from "@/app_modules/model_global/interface";
-import {
- Button,
- Select,
- Stack,
- Text,
- TextInput,
- Textarea,
-} from "@mantine/core";
+import { Select, Stack, TextInput } from "@mantine/core";
import { DateTimePicker } from "@mantine/dates";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
import moment from "moment";
import { useState } from "react";
+import { apiGetMasterTipeAcara } from "../_lib/api_event";
import { Event_ComponentCreateButton } from "../component";
import ComponentEvent_ErrorMaximalInput from "../component/error_maksimal_input";
-export default function Event_Create({
- listTipeAcara,
- authorId,
-}: {
- listTipeAcara: MODEL_DEFAULT_MASTER_OLD[];
- authorId: string;
-}) {
- const [listTipe, setListTipe] = useState(listTipeAcara);
-
+export default function Event_Create() {
+ const [listTipe, setListTipe] = useState();
const [isTimeStart, setIsTimeStart] = useState(false);
const [diffTimeStart, setDiffTimeStart] = useState(0);
const [isTimeEnd, setIsTimeEnd] = useState(false);
const [diffTimeEnd, setDiffTimeEnd] = useState(0);
-
const [value, setValue] = useState({
title: "",
lokasi: "",
@@ -37,17 +33,60 @@ export default function Event_Create({
tanggal: Date.toString(),
tanggalSelesai: Date.toString(),
eventMaster_TipeAcaraId: 0,
- authorId: authorId,
+ authorId: "",
});
+ useShallowEffect(() => {
+ handleGetUserLoginId();
+ }, []);
+
+ async function handleGetUserLoginId() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setValue({
+ ...value,
+ authorId: response.userId,
+ });
+ }
+ } catch (error) {
+ setValue({
+ ...value,
+ authorId: "",
+ });
+ }
+ }
+
+ useShallowEffect(() => {
+ handleGetMasterTipeAcara();
+ }, []);
+
+ async function handleGetMasterTipeAcara() {
+ try {
+ const response = await apiGetMasterTipeAcara();
+ if (response.success) {
+ setListTipe(response.data);
+ } else {
+ setListTipe([]);
+ }
+ } catch (error) {
+ setListTipe([]);
+ }
+ }
+
+ if (!listTipe || !value.authorId) {
+ return ;
+ }
+
return (
<>
{/* {JSON.stringify(value, null, 2)} */}
-
+
({
- value: e.id,
- label: e.name,
- }))}
+ data={
+ _.isEmpty(listTipe)
+ ? []
+ : listTipe.map((e) => ({
+ value: e.id,
+ label: e.name,
+ }))
+ }
onChange={(val: any) =>
setValue({
...value,
@@ -84,8 +131,9 @@ export default function Event_Create({
-
{
@@ -143,8 +191,9 @@ export default function Event_Create({
{
@@ -184,27 +233,21 @@ export default function Event_Create({
/>
- {
+
+
+ {
setValue({
...value,
- deskripsi: val.target.value,
+ deskripsi: val,
});
}}
/>
+
diff --git a/src/app_modules/event/create/layout.tsx b/src/app_modules/event/create/layout.tsx
index 00e6048b..2f802ee0 100644
--- a/src/app_modules/event/create/layout.tsx
+++ b/src/app_modules/event/create/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutEvent_Create({
@@ -11,9 +14,16 @@ export default function LayoutEvent_Create({
}) {
return (
<>
- }>
+ {/* }>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/event/detail/detail_sponsor/index.tsx b/src/app_modules/event/detail/detail_sponsor/index.tsx
new file mode 100644
index 00000000..73d9928e
--- /dev/null
+++ b/src/app_modules/event/detail/detail_sponsor/index.tsx
@@ -0,0 +1,154 @@
+"use client";
+import {
+ ComponentGlobal_AvatarAndUsername,
+ ComponentGlobal_CardStyles,
+} from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ Button,
+ Divider,
+ Grid,
+ SimpleGrid,
+ Stack
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import { apiGetOneSponsorEventById } from "../../_lib/api_event";
+import { IEventSponsor } from "../../_lib/interface";
+
+function DetailSponsor_Event({ userLoginId }: { userLoginId: string }) {
+ const params = useParams<{ id: string }>();
+ const router = useRouter();
+ const [data, setData] = useState(null);
+ const [isLoadingTransfer, setIsLoadingTransfer] = useState(false);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetOneSponsorEventById({
+ id: params.id,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data sponsor", error);
+ }
+ }
+
+ if (!data) {
+ return (
+ <>
+
+ >
+ );
+ }
+
+ return (
+ <>
+
+ {/*
+ Nominal Sponsor:
+
+ Rp. 100.000
+
+ */}
+
+ {/*
+
+
+
+
+ INACO
+
+
+ Sosial Media:
+
+
+ InacoJellyku
+
+
+
+ +6289647038426
+
+
+
+
+ */}
+
+
+
+
+
+
+
+
+
+ Nama Sponsor
+
+ :
+ {data.name}
+
+
+
+
+ Nominal
+
+ :
+ Rp. {data.isTransfer ? 0 : "-"}
+
+
+ {userLoginId == data.authorId && (
+
+ {
+ try {
+ setIsLoadingTransfer(true);
+ router.push(
+ RouterEvent.nominal_sponsor({ id: params.id })
+ );
+ } catch (error) {
+ console.log(error);
+ }
+ }}
+ >
+ Selesaikan Transaksi
+
+ Tampilkan Logo
+
+ )}
+
+
+
+ >
+ );
+}
+
+export default DetailSponsor_Event;
diff --git a/src/app_modules/event/detail/detail_sponsor/layout.tsx b/src/app_modules/event/detail/detail_sponsor/layout.tsx
new file mode 100644
index 00000000..e2677de7
--- /dev/null
+++ b/src/app_modules/event/detail/detail_sponsor/layout.tsx
@@ -0,0 +1,145 @@
+"use client";
+
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import {
+ UIGlobal_DrawerCustom,
+ UIGlobal_LayoutHeaderTamplate,
+ UIGlobal_LayoutTamplate,
+ UIGlobal_Modal,
+} from "@/app_modules/_global/ui";
+import {
+ ActionIcon,
+ Box,
+ Button,
+ Center,
+ Flex,
+ Stack,
+ Text,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconDotsVertical, IconEdit, IconTrash } from "@tabler/icons-react";
+import React, { useState } from "react";
+import { apiGetOneSponsorEventById } from "../../_lib/api_event";
+import { useParams } from "next/navigation";
+import { clientLogger } from "@/util/clientLogger";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+
+function LayoutEvent_DetailSponsor({
+ children,
+ userLoginId,
+}: {
+ children: React.ReactNode;
+ userLoginId: string;
+}) {
+ const params = useParams<{ id: string }>();
+ const [authorId, setAuthorId] = useState(null);
+ const [openDrawer, setOpenDrawer] = useState(false);
+ const [openModal, setOpenModal] = useState(false);
+ const [isLoading, setLoading] = useState(false);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetOneSponsorEventById({
+ id: params.id,
+ });
+
+ if (respone) {
+ setAuthorId(respone.data.authorId);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data sponsor", error);
+ }
+ }
+
+ return (
+ <>
+
+ ) : authorId == userLoginId ? (
+ setOpenDrawer(true)}
+ >
+
+
+ ) : (
+ ""
+ )
+ }
+ />
+ }
+ >
+ {children}
+
+ setOpenDrawer(false)}
+ component={
+
+
+
+
+
+
+
+ Edit
+
+
+
+
+ setOpenModal(true)}
+ >
+
+
+
+
+ Hapus
+
+
+
+
+ }
+ />
+ setOpenModal(false)}
+ buttonKiri={
+ setOpenModal(false)}
+ >
+ Batal
+
+ }
+ buttonKanan={
+
+ Hapus
+
+ }
+ />
+ >
+ );
+}
+
+export default LayoutEvent_DetailSponsor;
diff --git a/src/app_modules/event/detail/draft/index.tsx b/src/app_modules/event/detail/draft/index.tsx
index 88a97a31..93ecca6a 100644
--- a/src/app_modules/event/detail/draft/index.tsx
+++ b/src/app_modules/event/detail/draft/index.tsx
@@ -1,64 +1,64 @@
"use client";
-import { IRealtimeData } from "@/app/lib/global_state";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
-import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
+import { IRealtimeData } from "@/lib/global_state";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import { clientLogger } from "@/util/clientLogger";
import { Button, Group, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import moment from "moment";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import { WibuRealtime } from "wibu-pkg";
-import { Event_ComponentSkeletonDetailData } from "../../component";
+import { apiGetEventDetailById } from "../../_lib/api_event";
+import { MODEL_EVENT } from "../../_lib/interface";
import ComponentEvent_DetailData from "../../component/detail/detail_data";
import { Event_funDeleteById } from "../../fun/delete/fun_delete";
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
-import { MODEL_EVENT } from "../../model/interface";
-export default function Event_DetailDraft({
- dataEvent,
- eventId,
-}: {
- dataEvent: MODEL_EVENT;
- eventId: string;
-}) {
- const [data, setData] = useState(dataEvent);
+export default function Event_DetailDraft() {
+ const params = useParams<{ id: string }>();
+ const eventId = params.id as string;
+ const [data, setData] = useState(null);
- if (!data) {
- return (
- <>
-
- >
- );
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetEventDetailById({
+ id: eventId,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data detail event", error);
+ }
}
return (
<>
- {/* {JSON.stringify(dataEvent.tanggal)} */}
- {data?.catatan ? (
-
- ) : (
- ""
- )}
-
-
+
+
>
);
}
-function ButtonAction({
- eventId,
- tanggalSelesai,
-}: {
- eventId: string;
- tanggalSelesai?: any;
-}) {
+function ButtonAction({ eventId, endDate }: { eventId: string; endDate: any }) {
const router = useRouter();
const [isLoadingDelete, setLoadingDelete] = useState(false);
const [isLoadingAjukan, setLoadingAjukan] = useState(false);
@@ -66,82 +66,105 @@ function ButtonAction({
const [openModal2, setOpenModal2] = useState(false);
async function onDelete() {
- const res = await Event_funDeleteById(eventId);
- if (res.status === 200) {
- router.back();
- ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
- setLoadingDelete(true);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ try {
+ const res = await Event_funDeleteById(eventId);
+ try {
+ setLoadingDelete(true);
+ if (res.status === 200) {
+ router.back();
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ } else {
+ setLoadingDelete(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ setLoadingDelete(false);
+ clientLogger.error("Error delete event", error);
+ }
+ } catch (error) {
+ console.log("Error delete event", error);
+ setLoadingDelete(false);
}
}
async function onAjukan() {
- if (
- moment(tanggalSelesai.toISOString().toString()).diff(
- moment(),
- "minutes"
- ) < 0
- )
+ // console.log("end Date", endDate)
+
+ if (moment(endDate).diff(moment(), "minutes") < 0)
return ComponentGlobal_NotifikasiPeringatan("Waktu acara telah lewat");
- const res = await Event_funEditStatusById("2", eventId);
- if (res.status === 200) {
- const dataNotifikasi: IRealtimeData = {
- appId: res.data?.id as any,
- status: res.data?.EventMaster_Status?.name as any,
- userId: res.data?.authorId as any,
- pesan: res.data?.title as any,
- kategoriApp: "EVENT",
- title: "Mengajukan review",
- };
-
- const notif = await notifikasiToAdmin_funCreate({
- data: dataNotifikasi as any,
- });
-
- if (notif.status === 201) {
- WibuRealtime.setData({
- type: "notification",
- pushNotificationTo: "ADMIN",
- });
-
- WibuRealtime.setData({
- type: "trigger",
- pushNotificationTo: "ADMIN",
- dataMessage: dataNotifikasi,
- });
- }
- ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ try {
setLoadingAjukan(true);
- router.replace(RouterEvent.status({ id: "2" }));
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ const res = await Event_funEditStatusById("2", eventId);
+ if (res.status === 200) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res.data?.id as any,
+ status: res.data?.EventMaster_Status?.name as any,
+ userId: res.data?.authorId as any,
+ pesan: res.data?.title as any,
+ kategoriApp: "EVENT",
+ title: "Mengajukan review",
+ };
+
+ const notif = await notifikasiToAdmin_funCreate({
+ data: dataNotifikasi as any,
+ });
+
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "ADMIN",
+ });
+
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "ADMIN",
+ dataMessage: dataNotifikasi,
+ });
+ }
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ router.replace(RouterEvent.status({ id: "2" }));
+ } else {
+ setLoadingAjukan(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ setLoadingAjukan(false);
+ clientLogger.error("Error ajukan event", error);
}
}
return (
<>
-
- {
- setOpenModal1(true);
- }}
- >
- Ajukan Review
-
- {
- setOpenModal2(true);
- }}
- >
- Hapus
-
-
+ {!endDate ? (
+
+
+
+
+ ) : (
+
+ {
+ setOpenModal1(true);
+ }}
+ >
+ Ajukan Review
+
+ {
+ setOpenModal2(true);
+ }}
+ >
+ Hapus
+
+
+ )}
{/* MODAL AJUKAN */}
setOpenModal1(false)}
buttonKiri={
- setOpenModal1(false)}>
+ setOpenModal1(false)}
+ >
Batal
}
buttonKanan={
{
onAjukan();
}}
- color="yellow"
+ c={MainColor.darkblue}
>
Ajukan
@@ -174,7 +203,12 @@ function ButtonAction({
opened={openModal2}
close={() => setOpenModal2(false)}
buttonKiri={
- setOpenModal2(false)}>
+ setOpenModal2(false)}
+ >
Batal
}
@@ -186,7 +220,8 @@ function ButtonAction({
onClick={() => {
onDelete();
}}
- color="red"
+ style={{ backgroundColor: MainColor.red }}
+ c={AccentColor.white}
>
Hapus
diff --git a/src/app_modules/event/detail/draft/layout.tsx b/src/app_modules/event/detail/draft/layout.tsx
index 4189db75..4d820e11 100644
--- a/src/app_modules/event/detail/draft/layout.tsx
+++ b/src/app_modules/event/detail/draft/layout.tsx
@@ -1,9 +1,12 @@
"use client";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
import { ActionIcon } from "@mantine/core";
import { IconDotsVertical, IconEdit } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
@@ -30,7 +33,24 @@ export default function LayoutEvent_DetailDraft({
return (
<>
-
+
+ setOpenDrawer(true)}
+ >
+
+
+ }
+ />
+
+ {children}
+
+
+ {/*
{children}
-
+ */}
();
+ const sponsorId = params.id;
+
+ const [nominal, setNominal] = useAtom(gs_nominal_sponsor);
+ const [bankId, setBankId] = useAtom(gs_event_bank_id);
+
+
+ return (
+ <>
+
+
+ Mohon transfer ke rekening dibawah
+
+ untuk diteruskan ke
+ NicoArya
+
+
+
+
+
+
+ Bank BRI
+ PT. Himpunan Pengusaha Badung
+
+
+
+
+
+
+ 9065456754325643
+
+
+
+
+
+
+ Salin
+
+
+
+
+
+
+
+
+
+
+
+ Jumlah Transfer
+
+
+
+
+
+
+ Rp. 100.000
+
+
+
+
+
+
+ Salin
+
+
+
+
+
+
+
+
+
+
+
+ }
+ radius={"xl"}
+ style={{ backgroundColor: MainColor.yellow }}
+ c={MainColor.darkblue}
+ >
+ Upload
+
+
+
+ Upload bukti transfer anda
+
+
+
+
+ Saya Sudah Transfer
+
+
+ >
+ );
+}
+
+export default Event_Invoice;
diff --git a/src/app_modules/event/detail/invoice/layout.tsx b/src/app_modules/event/detail/invoice/layout.tsx
new file mode 100644
index 00000000..59b2f602
--- /dev/null
+++ b/src/app_modules/event/detail/invoice/layout.tsx
@@ -0,0 +1,24 @@
+'use client';
+import { UIGlobal_LayoutHeaderTamplate, UIGlobal_LayoutTamplate } from '@/app_modules/_global/ui';
+import { ActionIcon } from '@mantine/core';
+import { IconX } from '@tabler/icons-react';
+import { useParams, useRouter } from 'next/navigation';
+import React from 'react';
+
+function Event_LayoutInvoice({ children }: { children: React.ReactNode }) {
+ return (
+ <>
+
+
+
+ }
+ />}>
+ {children}
+
+ >
+ );
+}
+
+export default Event_LayoutInvoice;
diff --git a/src/app_modules/event/detail/kontribusi/index.tsx b/src/app_modules/event/detail/kontribusi/index.tsx
index ee709ea4..015c1182 100644
--- a/src/app_modules/event/detail/kontribusi/index.tsx
+++ b/src/app_modules/event/detail/kontribusi/index.tsx
@@ -2,26 +2,13 @@
import { Stack } from "@mantine/core";
import ComponentEvent_DetailMainData from "../../component/detail/detail_main";
-import ComponentEvent_ListPeserta from "../../component/detail/list_peserta";
-import { MODEL_EVENT, MODEL_EVENT_PESERTA } from "../../model/interface";
-export default function Event_DetailKontribusi({
- dataEvent,
- listKontributor,
- totalPeserta,
-}: {
- dataEvent: MODEL_EVENT;
- listKontributor: MODEL_EVENT_PESERTA[];
- totalPeserta: number;
-}) {
+export default function Event_DetailKontribusi() {
return (
<>
-
-
+
+ {/* */}
>
);
diff --git a/src/app_modules/event/detail/kontribusi/layout.tsx b/src/app_modules/event/detail/kontribusi/layout.tsx
index 2143e4da..8c17d311 100644
--- a/src/app_modules/event/detail/kontribusi/layout.tsx
+++ b/src/app_modules/event/detail/kontribusi/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutEvent_DetailKontribusi({
@@ -11,11 +14,18 @@ export default function LayoutEvent_DetailKontribusi({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/event/detail/main_detail/index.tsx b/src/app_modules/event/detail/main_detail/index.tsx
index 71376d11..06148edd 100644
--- a/src/app_modules/event/detail/main_detail/index.tsx
+++ b/src/app_modules/event/detail/main_detail/index.tsx
@@ -1,120 +1,153 @@
"use client";
-import { IRealtimeData } from "@/app/lib/global_state";
+import { IRealtimeData } from "@/lib/global_state";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import notifikasiToUser_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_user";
+import { clientLogger } from "@/util/clientLogger";
import { Button, Stack } from "@mantine/core";
-import { useRouter } from "next/navigation";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
import { useState } from "react";
import { WibuRealtime } from "wibu-pkg";
+import { apiGetEventCekPeserta } from "../../_lib/api_event";
import ComponentEvent_DetailMainData from "../../component/detail/detail_main";
-import ComponentEvent_ListPeserta from "../../component/detail/list_peserta";
-import { Event_countTotalPesertaById } from "../../fun/count/count_total_peserta_by_id";
import { Event_funJoinEvent } from "../../fun/create/fun_join_event";
-import { Event_getListPesertaById } from "../../fun/get/get_list_peserta_by_id";
-import { MODEL_EVENT, MODEL_EVENT_PESERTA } from "../../model/interface";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
-export default function Event_DetailMain({
- dataEvent,
- listPeserta,
- userLoginId,
- isJoin,
- totalPeserta,
-}: {
- dataEvent: MODEL_EVENT;
- listPeserta: MODEL_EVENT_PESERTA[];
- userLoginId: string;
- isJoin: boolean;
- totalPeserta: number;
-}) {
- const router = useRouter();
- const [total, setTotal] = useState(totalPeserta);
- const [peserta, setPeserta] = useState(listPeserta);
+export default function Event_DetailMain() {
+ const params = useParams<{ id: string }>();
+ const eventId = params.id;
const [isLoading, setLoading] = useState(false);
+ const [isJoinSuccess, setIsJoinSuccess] = useState(null);
+ // const [isNewPeserta, setIsNewPeserta] = useState(null);
+
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ handleGetUserLoginId();
+ }, []);
+
+ async function handleGetUserLoginId() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ const responseData = await apiGetEventCekPeserta({
+ userId: response.userId,
+ eventId: eventId,
+ });
+
+ if (responseData) {
+ setIsJoinSuccess(responseData.data);
+ }
+ } else {
+ setUserLoginId(null);
+ }
+ } catch (error) {
+ setUserLoginId(null);
+ }
+ }
+
+ // useShallowEffect(() => {
+ // onCheckPeserta();
+ // }, []);
+
+ // async function onCheckPeserta() {
+ // try {
+ // const respone = await apiGetEventCekPeserta({
+ // userId: userLoginId,
+ // eventId: eventId,
+ // });
+
+ // if (respone) {
+ // setIsJoinSuccess(respone.data);
+ // }
+ // } catch (error) {
+ // clientLogger.error("Error check peserta", error);
+ // }
+ // }
+
+ // [ON JOIN BUTTON]
+ async function onJoin() {
+ const body = {
+ userId: userLoginId,
+ eventId: eventId,
+ };
+
+ try {
+ setLoading(true);
+ const res = await Event_funJoinEvent(body as any);
+ if (res.status === 200) {
+ if (userLoginId !== res.data?.Event?.authorId) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res?.data?.Event?.id as any,
+ status: "Peserta Event" as any,
+ userId: res.data?.Event?.authorId as any,
+ pesan: res.data?.Event?.title as any,
+ kategoriApp: "EVENT",
+ title: "Peserta baru event anda !",
+ };
+
+ const createNotifikasi = await notifikasiToUser_funCreate({
+ data: dataNotifikasi as any,
+ });
+
+ if (createNotifikasi.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+ }
+ }
+ setIsJoinSuccess(true);
+ setLoading(false);
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error join event", error);
+ }
+ }
return (
<>
-
- {isJoin ? (
+
+
+ {isJoinSuccess == null || !userLoginId ? (
+
+ ) : isJoinSuccess ? (
Anda Telah Ikut Serta
) : (
{
- onJoin(
- userLoginId,
- dataEvent.id,
- setPeserta,
- setTotal,
- setLoading
- );
+ onJoin();
}}
>
JOIN
)}
-
+ {/* */}
>
);
}
-
-async function onJoin(
- userId: string,
- eventId: string,
- setPeserta: any,
- setTotal: any,
- setLoading: any
-) {
- const body = {
- userId: userId,
- eventId: eventId,
- };
-
- const userLoginId = userId;
-
- const res = await Event_funJoinEvent(body as any);
- if (res.status === 200) {
- const resPeserta = await Event_getListPesertaById(eventId);
- setPeserta(resPeserta);
-
- const resTotal = await Event_countTotalPesertaById(eventId);
- setTotal(resTotal);
-
- if (userLoginId !== res.data?.Event?.authorId) {
- const dataNotifikasi: IRealtimeData = {
- appId: res?.data?.Event?.id as any,
- status: "Peserta Event" as any,
- userId: res.data?.Event?.authorId as any,
- pesan: res.data?.Event?.title as any,
- kategoriApp: "EVENT",
- title: "Peserta baru event anda !",
- };
-
- const createNotifikasi = await notifikasiToUser_funCreate({
- data: dataNotifikasi as any,
- });
-
- if (createNotifikasi.status === 201) {
- WibuRealtime.setData({
- type: "notification",
- pushNotificationTo: "USER",
- dataMessage: dataNotifikasi,
- });
- }
- }
-
- setLoading(true);
- ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
-}
diff --git a/src/app_modules/event/detail/main_detail/layout.tsx b/src/app_modules/event/detail/main_detail/layout.tsx
index 465b92a1..9a20509f 100644
--- a/src/app_modules/event/detail/main_detail/layout.tsx
+++ b/src/app_modules/event/detail/main_detail/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutEvent_DetailMain({
@@ -11,11 +14,13 @@ export default function LayoutEvent_DetailMain({
}) {
return (
<>
- }
- >
- {children}
-
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/event/detail/peserta/index.tsx b/src/app_modules/event/detail/peserta/index.tsx
new file mode 100644
index 00000000..b0ade72d
--- /dev/null
+++ b/src/app_modules/event/detail/peserta/index.tsx
@@ -0,0 +1,105 @@
+"use client";
+
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
+import { Center, Loader, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { ScrollOnly } from "next-scroll-loader";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { apiGetEventPesertaById } from "../../_lib/api_event";
+import { MODEL_EVENT_PESERTA } from "../../_lib/interface";
+import ComponentEvent_AvatarAndUsername from "../../component/detail/comp_avatar_and_username_event";
+import _ from "lodash";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+
+function Event_DaftarPeserta() {
+ const params = useParams<{ id: string }>();
+
+ const [data, setData] = useState(null);
+ const [activePage, setActivePage] = useState(1);
+
+ useShallowEffect(() => {
+ onLoadDataPeserta();
+ }, []);
+
+ async function onLoadDataPeserta() {
+ try {
+ const respone = await apiGetEventPesertaById({
+ id: params.id,
+ page: `${activePage}`,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data peserta:", error);
+ }
+ }
+
+ const handleMoreData = async () => {
+ try {
+ const nextPage = activePage + 1;
+
+ const response = await apiGetEventPesertaById({
+ id: params.id,
+ page: `${nextPage}`,
+ });
+
+ if (response) {
+ setActivePage(nextPage);
+
+ return response.data;
+ }
+ } catch (error) {
+ clientLogger.error("Error fetching more data:", error);
+ }
+ };
+
+ if (!data) {
+ return (
+ <>
+
+
+
+
+ >
+ );
+ }
+
+ return (
+ <>
+ {_.isEmpty(data) ? (
+
+ ) : (
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={handleMoreData}
+ >
+ {(item) => (
+
+ )}
+
+
+ )}
+ >
+ );
+}
+
+export default Event_DaftarPeserta;
diff --git a/src/app_modules/event/detail/peserta/layout.tsx b/src/app_modules/event/detail/peserta/layout.tsx
new file mode 100644
index 00000000..5d0a80bb
--- /dev/null
+++ b/src/app_modules/event/detail/peserta/layout.tsx
@@ -0,0 +1,25 @@
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import React from "react";
+
+function LayoutEvent_Peserta({ children }: { children: React.ReactNode }) {
+ return (
+ <>
+ {/* }>
+ {children}
+ */}
+
+
+
+
+
+ {children}
+
+ >
+ );
+}
+
+export default LayoutEvent_Peserta;
diff --git a/src/app_modules/event/detail/publish/index.tsx b/src/app_modules/event/detail/publish/index.tsx
index 9afb7e66..65171179 100644
--- a/src/app_modules/event/detail/publish/index.tsx
+++ b/src/app_modules/event/detail/publish/index.tsx
@@ -1,25 +1,39 @@
"use client";
+import { useParams } from "next/navigation";
import ComponentEvent_DetailData from "../../component/detail/detail_data";
-import ComponentEvent_ListPeserta from "../../component/detail/list_peserta";
-import { MODEL_EVENT } from "../../model/interface";
+import { useState } from "react";
+import { clientLogger } from "@/util/clientLogger";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetEventDetailById } from "../../_lib/api_event";
+import { MODEL_EVENT } from "../../_lib/interface";
+
+export default function Event_DetailPublish() {
+ const params = useParams<{ id: string }>();
+ const eventId = params.id as string;
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetEventDetailById({
+ id: eventId,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data detail event", error);
+ }
+ }
-export default function Event_DetailPublish({
- dataEvent,
- listPeserta,
- totalPeserta,
-}: {
- dataEvent: MODEL_EVENT;
- listPeserta: any[];
- totalPeserta: number;
-}) {
return (
<>
-
-
+
>
);
}
diff --git a/src/app_modules/event/detail/publish/layout.tsx b/src/app_modules/event/detail/publish/layout.tsx
index 35c78baa..627bcb05 100644
--- a/src/app_modules/event/detail/publish/layout.tsx
+++ b/src/app_modules/event/detail/publish/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutEvent_DetailPublish({
@@ -11,11 +14,18 @@ export default function LayoutEvent_DetailPublish({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/event/detail/reject/index.tsx b/src/app_modules/event/detail/reject/index.tsx
index 6e25c05b..b67558ef 100644
--- a/src/app_modules/event/detail/reject/index.tsx
+++ b/src/app_modules/event/detail/reject/index.tsx
@@ -1,63 +1,145 @@
"use client";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
-import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
-import { Button, SimpleGrid, Stack } from "@mantine/core";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import { clientLogger } from "@/util/clientLogger";
+import { Button, Group, SimpleGrid, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import { apiGetEventDetailById } from "../../_lib/api_event";
+import { MODEL_EVENT } from "../../_lib/interface";
import ComponentEvent_DetailData from "../../component/detail/detail_data";
import { Event_funDeleteById } from "../../fun/delete/fun_delete";
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
-import { MODEL_EVENT } from "../../model/interface";
-export default function Event_DetailReject({
- dataEvent,
-}: {
- dataEvent: MODEL_EVENT;
-}) {
- const [data, setData] = useState(dataEvent);
+export default function Event_DetailReject() {
+ const params = useParams<{ id: string }>();
+ const eventId = params.id as string;
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetEventDetailById({
+ id: eventId,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data detail event", error);
+ }
+ }
+
return (
<>
-
-
-
+
+
>
);
}
-function ButtonAction({ eventId }: { eventId: string }) {
+function ButtonAction({
+ eventId,
+ data,
+}: {
+ eventId: string;
+ data: MODEL_EVENT | null;
+}) {
const router = useRouter();
const [openModal1, setOpenModal1] = useState(false);
const [openModal2, setOpenModal2] = useState(false);
+ const [isLoading, setLoading] = useState(false);
+ const [isLoading2, setLoading2] = useState(false);
+
+ async function onUpdate(
+ router: AppRouterInstance,
+ eventId: string,
+ setLoading: any
+ ) {
+ try {
+ setLoading(true);
+ await Event_funEditStatusById("3", eventId).then((res) => {
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ router.push(RouterEvent.status({ id: "3" }));
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error update event", error);
+ }
+ }
+
+ async function onDelete(
+ router: AppRouterInstance,
+ eventId: string,
+ setLoading2: any
+ ) {
+ try {
+ setLoading2(true);
+ const res = await Event_funDeleteById(eventId);
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
+ router.back();
+ } else {
+ setLoading2(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ setLoading2(false);
+ clientLogger.error("Error delete event", error);
+ }
+ }
return (
<>
-
- {
- setOpenModal1(true);
- }}
- >
- Edit Kembali
-
- setOpenModal2(true)}
- >
- Hapus
-
-
+ {!data ? (
+
+
+
+
+ ) : (
+
+ {
+ setOpenModal1(true);
+ }}
+ >
+ Edit Kembali
+
+ setOpenModal2(true)}
+ >
+ Hapus
+
+
+ )}
+
+
{/* MODAL EDIT */}
setOpenModal1(false)}
buttonKiri={
- setOpenModal1(false)}>
+ setOpenModal1(false)}
+ >
Batal
}
buttonKanan={
{
- onUpdate(router, eventId);
- setOpenModal1(false);
+ onUpdate(router, eventId, setLoading);
}}
>
Edit
@@ -89,17 +178,24 @@ function ButtonAction({ eventId }: { eventId: string }) {
opened={openModal2}
close={() => setOpenModal2(false)}
buttonKiri={
- setOpenModal2(false)}>
+ setOpenModal2(false)}
+ >
Batal
}
buttonKanan={
{
- onDelete(router, eventId);
- setOpenModal2(false);
+ onDelete(router, eventId, setLoading2);
}}
>
Hapus
@@ -109,24 +205,3 @@ function ButtonAction({ eventId }: { eventId: string }) {
>
);
}
-
-async function onUpdate(router: AppRouterInstance, eventId: string) {
- await Event_funEditStatusById("3", eventId).then((res) => {
- if (res.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(res.message);
- router.push(RouterEvent.status({ id: "3" }));
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
-}
-
-async function onDelete(router: AppRouterInstance, eventId: string) {
- const res = await Event_funDeleteById(eventId);
- if (res.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
- router.back();
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
-}
diff --git a/src/app_modules/event/detail/reject/layout.tsx b/src/app_modules/event/detail/reject/layout.tsx
index efc183aa..b9687b31 100644
--- a/src/app_modules/event/detail/reject/layout.tsx
+++ b/src/app_modules/event/detail/reject/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutEvent_DetailReject({
@@ -11,11 +14,18 @@ export default function LayoutEvent_DetailReject({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/event/detail/review/index.tsx b/src/app_modules/event/detail/review/index.tsx
index 5088dd33..425b6497 100644
--- a/src/app_modules/event/detail/review/index.tsx
+++ b/src/app_modules/event/detail/review/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
@@ -8,26 +8,52 @@ import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/cre
import mqtt_client from "@/util/mqtt_client";
import { Button, Stack } from "@mantine/core";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import ComponentEvent_DetailData from "../../component/detail/detail_data";
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
-import { MODEL_EVENT } from "../../model/interface";
-import { IRealtimeData } from "@/app/lib/global_state";
+import { MODEL_EVENT } from "../../_lib/interface";
+import { IRealtimeData } from "@/lib/global_state";
import { WibuRealtime } from "wibu-pkg";
import { event_checkStatus } from "../../fun/get/fun_check_status_by_id";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { clientLogger } from "@/util/clientLogger";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetEventDetailById } from "../../_lib/api_event";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export default function Event_DetailReview({
- dataEvent,
-}: {
- dataEvent: MODEL_EVENT;
-}) {
+export default function Event_DetailReview() {
+ const params = useParams<{ id: string }>();
+ const eventId = params.id as string;
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetEventDetailById({
+ id: eventId,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data detail event", error);
+ }
+ }
return (
<>
-
-
+
+ {!data ? (
+
+ ) : (
+
+ )}
>
);
@@ -39,7 +65,12 @@ function ButtonAction({ eventId }: { eventId: string }) {
const [openModal, setOpenModal] = useState(false);
return (
<>
- setOpenModal(true)}>
+ setOpenModal(true)}
+ >
Batalkan Review
@@ -48,16 +79,22 @@ function ButtonAction({ eventId }: { eventId: string }) {
opened={openModal}
close={() => setOpenModal(false)}
buttonKiri={
- setOpenModal(false)}>
+ setOpenModal(false)}
+ >
Batal
}
buttonKanan={
onClick(router, eventId, setLoading)}
>
Simpan
@@ -73,6 +110,7 @@ async function onClick(
eventId: string,
setLoading: any
) {
+ setLoading(true);
const checkStatus = await event_checkStatus({ id: eventId });
if (checkStatus) {
@@ -104,13 +142,14 @@ async function onClick(
});
ComponentGlobal_NotifikasiBerhasil(res.message, 1500);
- setLoading(true);
router.replace(RouterEvent.status({ id: "3" }));
}
} else {
+ setLoading(false);
ComponentGlobal_NotifikasiGagal(res.message);
}
} else {
+ router.back();
ComponentGlobal_NotifikasiPeringatan("Event telah direview admin");
}
}
diff --git a/src/app_modules/event/detail/review/layout.tsx b/src/app_modules/event/detail/review/layout.tsx
index 28480947..8109caaa 100644
--- a/src/app_modules/event/detail/review/layout.tsx
+++ b/src/app_modules/event/detail/review/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutEvent_DetailReview({
@@ -11,11 +14,18 @@ export default function LayoutEvent_DetailReview({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/event/detail/riwayat/index.tsx b/src/app_modules/event/detail/riwayat/index.tsx
index 3d9ef6e9..34232b7b 100644
--- a/src/app_modules/event/detail/riwayat/index.tsx
+++ b/src/app_modules/event/detail/riwayat/index.tsx
@@ -1,63 +1,15 @@
"use client";
-import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import {
- Stack
-} from "@mantine/core";
-import { useRouter } from "next/navigation";
-import { useState } from "react";
+import { Stack } from "@mantine/core";
import ComponentEvent_DetailMainData from "../../component/detail/detail_main";
-import ComponentEvent_ListPeserta from "../../component/detail/list_peserta";
-import { Event_countTotalPesertaById } from "../../fun/count/count_total_peserta_by_id";
-import { Event_funJoinEvent } from "../../fun/create/fun_join_event";
-import { Event_getListPesertaById } from "../../fun/get/get_list_peserta_by_id";
-import { MODEL_EVENT, MODEL_EVENT_PESERTA } from "../../model/interface";
-export default function Event_DetailRiwayat({
- dataEvent,
- listPeserta,
- totalPeserta,
-}: {
- dataEvent: MODEL_EVENT;
- listPeserta: MODEL_EVENT_PESERTA[];
- totalPeserta: number;
-}) {
- const router = useRouter();
- const [total, setTotal] = useState(totalPeserta);
- const [peserta, setPeserta] = useState(listPeserta);
+export default function Event_DetailRiwayat() {
return (
<>
-
-
+
+ {/* */}
>
);
}
-
-async function onJoin(
- userId: string,
- eventId: string,
- setPeserta: any,
- setTotal: any
-) {
- const body = {
- userId: userId,
- eventId: eventId,
- };
-
- await Event_funJoinEvent(body as any).then(async (res) => {
- if (res.status === 200) {
- await Event_getListPesertaById(eventId).then(async (val) => {
- await Event_countTotalPesertaById(eventId).then((ttl) => {
- setPeserta(val);
- setTotal(ttl);
- ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
- });
- });
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
-}
diff --git a/src/app_modules/event/detail/riwayat/layout.tsx b/src/app_modules/event/detail/riwayat/layout.tsx
index 33acd340..f17e78a2 100644
--- a/src/app_modules/event/detail/riwayat/layout.tsx
+++ b/src/app_modules/event/detail/riwayat/layout.tsx
@@ -1,9 +1,8 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, { UI_NewChildren, UI_NewHeader } from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
-
export default function LayoutEvent_DetailRiwayat({
children,
}: {
@@ -11,9 +10,16 @@ export default function LayoutEvent_DetailRiwayat({
}) {
return (
<>
- }>
+ {/* }>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/event/detail/sponsor/edit_sponsor/index.tsx b/src/app_modules/event/detail/sponsor/edit_sponsor/index.tsx
new file mode 100644
index 00000000..28dea62c
--- /dev/null
+++ b/src/app_modules/event/detail/sponsor/edit_sponsor/index.tsx
@@ -0,0 +1,109 @@
+'use client'
+import { MainColor } from '@/app_modules/_global/color';
+import { ComponentGlobal_BoxInformation, ComponentGlobal_BoxUploadImage } from '@/app_modules/_global/component';
+import { Box, Stack, Loader, AspectRatio, Image, Group, Button, TextInput, Title } from '@mantine/core';
+import { IconCamera, IconPhoto } from '@tabler/icons-react';
+import { useRouter } from 'next/navigation';
+import React, { useState } from 'react';
+
+function Event_EditSponsor() {
+ const router = useRouter();
+ const [img, setImg] = useState(null);
+ const [isLoadingImg, setIsLoadingImg] = useState(false);
+ return (
+ <>
+
+
+
+
+
+
+ {isLoadingImg ? (
+
+
+
+ ) : img ? (
+
+
+
+
+ ) : (
+
+
+
+ )}
+
+
+ } color='yellow' c={"black"} bg={MainColor.yellow}>Upload Gambar
+
+
+
+ Sosial Media
+
+
+ router.push("/dev/event/detail/sponsor/nominal_sponsor")}>
+ Simpan
+
+
+
+
+ >
+ );
+}
+
+export default Event_EditSponsor;
diff --git a/src/app_modules/event/detail/sponsor/edit_sponsor/layout.tsx b/src/app_modules/event/detail/sponsor/edit_sponsor/layout.tsx
new file mode 100644
index 00000000..02510471
--- /dev/null
+++ b/src/app_modules/event/detail/sponsor/edit_sponsor/layout.tsx
@@ -0,0 +1,14 @@
+import { UIGlobal_LayoutHeaderTamplate, UIGlobal_LayoutTamplate } from '@/app_modules/_global/ui';
+import React from 'react';
+
+function Event_LayoutEditSponsor({children} : {children: React.ReactNode}) {
+ return (
+ <>
+ }>
+ {children}
+
+ >
+ );
+}
+
+export default Event_LayoutEditSponsor;
diff --git a/src/app_modules/event/detail/sponsor/index.tsx b/src/app_modules/event/detail/sponsor/index.tsx
new file mode 100644
index 00000000..e2c6037c
--- /dev/null
+++ b/src/app_modules/event/detail/sponsor/index.tsx
@@ -0,0 +1,99 @@
+"use client";
+import { useParams } from "next/navigation";
+import ComponentEvent_ListSponsor from "../../component/detail/list_sponsor";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetEventSponsorListById } from "../../_lib/api_event";
+import { IEventSponsor, MODEL_EVENT } from "../../_lib/interface";
+import { Component, useState } from "react";
+import { clientLogger } from "@/util/clientLogger";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { ScrollOnly } from "next-scroll-loader";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { ComponentDonasi_CardInvoice } from "@/app_modules/donasi/component/card_view/card_invoice";
+import { donasi_funGetAllInvoiceByAuthorId } from "@/app_modules/donasi/fun/get/get_all_invoice_by_author_id";
+import { Box, Center, Stack } from "@mantine/core";
+import _ from "lodash";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+
+function Event_DaftarSponsor() {
+ const params = useParams<{ id: string }>();
+ const eventId = params.id;
+ const [data, setData] = useState(null);
+ const [activePage, setActivePage] = useState(1);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetEventSponsorListById({
+ id: eventId,
+ page: `${activePage}`,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data sponsor", error);
+ }
+ }
+
+ if (!data) {
+ return (
+ <>
+
+ ;
+ ;
+
+ >
+ );
+ }
+
+ return (
+ <>
+ {/* */}
+
+ {_.isEmpty(data) ? (
+
+ ) : (
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={async () => {
+ try {
+ const respone = await apiGetEventSponsorListById({
+ id: eventId,
+ page: `${activePage + 1}`,
+ });
+
+ if (respone) {
+ setActivePage((val) => val + 1);
+ return respone.data;
+ }
+ } catch (error) {
+ clientLogger.error("Error get data sponsor", error);
+ }
+ }}
+ >
+ {(item) => (
+
+ )}
+
+ )}
+
+ >
+ );
+}
+
+export default Event_DaftarSponsor;
diff --git a/src/app_modules/event/detail/sponsor/layout.tsx b/src/app_modules/event/detail/sponsor/layout.tsx
new file mode 100644
index 00000000..d4fe7e81
--- /dev/null
+++ b/src/app_modules/event/detail/sponsor/layout.tsx
@@ -0,0 +1,86 @@
+"use client";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import {
+ UIGlobal_Drawer,
+ UIGlobal_LayoutHeaderTamplate,
+ UIGlobal_LayoutTamplate,
+} from "@/app_modules/_global/ui";
+import { clientLogger } from "@/util/clientLogger";
+import { ActionIcon } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconCirclePlus, IconDotsVertical } from "@tabler/icons-react";
+import { useParams } from "next/navigation";
+import React, { useState } from "react";
+import { apiGetEventDetailById } from "../../_lib/api_event";
+import { MODEL_EVENT } from "../../_lib/interface";
+import moment from "moment";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+
+function LayoutEvent_Sponsor({ children }: { children: React.ReactNode }) {
+ const params = useParams<{ id: string }>();
+ const eventId = params.id as string;
+ const [data, setData] = useState(null);
+ const [openDrawer, setOpenDrawer] = useState(false);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetEventDetailById({
+ id: eventId,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data detail event", error);
+ }
+ }
+
+ const isExpired = moment(data?.tanggalSelesai).diff(moment(), "minutes") < 0;
+
+ return (
+ <>
+
+ ) : !isExpired ? (
+ setOpenDrawer(true)}
+ >
+
+
+ ) : (
+ ""
+ )
+ }
+ />
+ }
+ >
+ {children}
+
+ setOpenDrawer(false)}
+ component={[
+ {
+ id: 1,
+ name: "Tambah Sponsor",
+ icon: ,
+ path: RouterEvent.tambah_sponsor({ id: params.id }),
+ },
+ ]}
+ />
+ >
+ );
+}
+
+export default LayoutEvent_Sponsor;
diff --git a/src/app_modules/event/detail/sponsor/metode_pembayaran/index.tsx b/src/app_modules/event/detail/sponsor/metode_pembayaran/index.tsx
new file mode 100644
index 00000000..c6a00714
--- /dev/null
+++ b/src/app_modules/event/detail/sponsor/metode_pembayaran/index.tsx
@@ -0,0 +1,129 @@
+"use client";
+
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { apiGetMasterBank } from "@/app_modules/_global/lib/api_fetch_master";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import {
+ gs_event_bank_id,
+ gs_nominal_sponsor,
+} from "@/app_modules/event/global_state";
+import { MODEL_MASTER_BANK } from "@/app_modules/investasi/_lib/interface";
+import { clientLogger } from "@/util/clientLogger";
+import { Button, Paper, Radio, Stack, Title } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useAtom } from "jotai";
+import _ from "lodash";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+
+function Event_MetodePembayaran() {
+ const params = useParams<{ id: string }>();
+ const [pilihBank, setPilihBank] = useState("");
+ const router = useRouter();
+ const [nominal, setNominal] = useAtom(gs_nominal_sponsor);
+ const [bankId, setBankId] = useAtom(gs_event_bank_id);
+ const [isLoading, setIsLoading] = useState(false);
+
+ const [data, setData] = useState(null);
+ useShallowEffect(() => {
+ onLoadBank();
+ }, []);
+
+ async function onLoadBank() {
+ try {
+ const respone = await apiGetMasterBank();
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data bank", error);
+ }
+ }
+
+ if (!data) {
+ return (
+ <>
+
+ {Array.from({ length: 2 }).map((e, i) => (
+
+ ))}
+
+ >
+ );
+ }
+
+ return (
+ <>
+ {_.isEmpty(data) ? (
+
+ ) : (
+
+
+ {data.map((e) => (
+
+
+ {e.namaBank}
+
+ }
+ />
+
+ ))}
+
+
+ {
+ try {
+ setIsLoading(true);
+ setBankId(pilihBank);
+ router.push(RouterEvent.invoice({ id: params.id }), {
+ scroll: false,
+ });
+ } catch (error) {
+ console.log(error);
+ }
+ }}
+ >
+ Pilih
+
+
+ )}
+ >
+ );
+}
+
+export default Event_MetodePembayaran;
diff --git a/src/app_modules/event/detail/sponsor/metode_pembayaran/layout.tsx b/src/app_modules/event/detail/sponsor/metode_pembayaran/layout.tsx
new file mode 100644
index 00000000..b8b86a38
--- /dev/null
+++ b/src/app_modules/event/detail/sponsor/metode_pembayaran/layout.tsx
@@ -0,0 +1,14 @@
+import { UIGlobal_LayoutHeaderTamplate, UIGlobal_LayoutTamplate } from '@/app_modules/_global/ui';
+import React from 'react';
+
+function Event_LayoutMetodePembayaran({ children }: { children: React.ReactNode }) {
+ return (
+ <>
+ }>
+ {children}
+
+ >
+ );
+}
+
+export default Event_LayoutMetodePembayaran;
diff --git a/src/app_modules/event/detail/sponsor/nominal_sponsor/index.tsx b/src/app_modules/event/detail/sponsor/nominal_sponsor/index.tsx
new file mode 100644
index 00000000..3d3d6270
--- /dev/null
+++ b/src/app_modules/event/detail/sponsor/nominal_sponsor/index.tsx
@@ -0,0 +1,165 @@
+"use client";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { gs_nominal_sponsor } from "@/app_modules/event/global_state";
+import {
+ Box,
+ Button,
+ Group,
+ Paper,
+ Stack,
+ Text,
+ TextInput,
+ Title,
+ Loader,
+} from "@mantine/core";
+import {
+ IconChevronRight,
+ IconMoodSmile,
+ IconMoodSmileBeam,
+ IconMoodSmileDizzy,
+ IconMoodXd,
+} from "@tabler/icons-react";
+import { useAtom } from "jotai";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+
+const listNominal = [
+ {
+ id: 1,
+ value: 25000,
+ icon: ,
+ },
+ {
+ id: 2,
+ value: 50000,
+ icon: ,
+ },
+ {
+ id: 3,
+ value: 75000,
+ icon: ,
+ },
+ {
+ id: 4,
+ value: 100000,
+ icon: ,
+ },
+];
+function Event_PilihNominalSponsor() {
+ const params = useParams<{ id: string }>();
+ const router = useRouter();
+ const [inputNominal, setInputNominal] = useState("");
+ const [valueNominal, setValueNominal] = useState(0);
+ const [fixNominal, setFixNominal] = useAtom(gs_nominal_sponsor);
+ const [isLoading, setLoading] = useState(false);
+ const [isLoadingPaper, setLoadingPaper] = useState(false);
+ const [chooseId, setChooseId] = useState(0);
+
+ return (
+ <>
+
+
+ {listNominal.map((e) => (
+ {
+ try {
+ setChooseId(e.id);
+ setLoadingPaper(true);
+ setFixNominal(e.value);
+ router.push(RouterEvent.metode_pembayaran({ id: params.id }));
+ } catch (error) {
+ console.error(error);
+ }
+ }}
+ >
+
+
+ {e.icon}
+
+ Rp.
+ {new Intl.NumberFormat("id-ID", { currency: "IDR" }).format(
+ e.value
+ )}
+
+
+ {isLoadingPaper && e.id === chooseId ? (
+
+ ) : (
+
+ )}
+
+
+ ))}
+
+
+
+ Nominal Lainnya
+ Rp.}
+ placeholder="0"
+ min={0}
+ value={inputNominal}
+ onChange={(val) => {
+ const match = val.currentTarget.value
+ .replace(/\./g, "")
+ .match(/^[0-9]+$/);
+
+ if (val.currentTarget.value === "")
+ return setInputNominal(0 + "");
+
+ if (!match?.[0]) return null;
+
+ const nilai = val.currentTarget.value.replace(/\./g, "");
+ const target = Intl.NumberFormat("id-ID").format(+nilai);
+
+ setValueNominal(+nilai);
+ setInputNominal(target);
+ }}
+ />
+
+
+
+ {
+ setLoading(true);
+ setFixNominal(valueNominal);
+ router.push(RouterEvent.metode_pembayaran({ id: params.id }));
+ }}
+ >
+ Lanjutan Pembayaran
+
+
+ >
+ );
+}
+
+export default Event_PilihNominalSponsor;
diff --git a/src/app_modules/event/detail/sponsor/nominal_sponsor/layout.tsx b/src/app_modules/event/detail/sponsor/nominal_sponsor/layout.tsx
new file mode 100644
index 00000000..5d90999f
--- /dev/null
+++ b/src/app_modules/event/detail/sponsor/nominal_sponsor/layout.tsx
@@ -0,0 +1,17 @@
+import { UIGlobal_LayoutHeaderTamplate, UIGlobal_LayoutTamplate } from '@/app_modules/_global/ui';
+import { ActionIcon } from '@mantine/core';
+import React from 'react';
+
+function Event_LayoutNominalSponsor({ children }: { children: React.ReactNode }) {
+ return (
+ <>
+ }>
+ {children}
+
+ >
+ );
+}
+
+export default Event_LayoutNominalSponsor;
diff --git a/src/app_modules/event/detail/tambah_sponsor/index.tsx b/src/app_modules/event/detail/tambah_sponsor/index.tsx
new file mode 100644
index 00000000..43b97eb9
--- /dev/null
+++ b/src/app_modules/event/detail/tambah_sponsor/index.tsx
@@ -0,0 +1,210 @@
+"use client";
+
+import { MainColor } from "@/app_modules/_global/color";
+import {
+ ComponentGlobal_BoxInformation,
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
+ ComponentGlobal_CardStyles,
+} from "@/app_modules/_global/component";
+import Event_CreateSponsor from "@/app_modules/event/component/detail/create_sponsor";
+import {
+ Stack,
+ Box,
+ AspectRatio,
+ Group,
+ Button,
+ TextInput,
+ Title,
+ Loader,
+ Image,
+ Center,
+ Text,
+} from "@mantine/core";
+import { IconPhoto, IconCamera, IconFileTypePdf } from "@tabler/icons-react";
+import { useParams, useRouter } from "next/navigation";
+import React, { useState } from "react";
+import { apiGetEventCreateSponsor } from "../../_lib/api_event";
+import { clientLogger } from "@/util/clientLogger";
+import { funUploadFileToStorage } from "@/app_modules/_global/fun/upload/fun_upload_to_storage";
+import {
+ ComponentGlobal_NotifikasiBerhasil,
+ ComponentGlobal_NotifikasiPeringatan,
+} from "@/app_modules/_global/notif_global";
+import { DIRECTORY_ID } from "@/lib";
+import { IEventSponsor } from "../../_lib/interface";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+
+function Event_TambahSponsor() {
+ const params = useParams<{ id: string }>();
+ const router = useRouter();
+
+ const [file, setFile] = useState(null);
+ const [isLoading, setIsLoading] = useState(false);
+
+ const [name, setName] = useState("");
+
+ async function onCreated() {
+ if (!file) {
+ setIsLoading(false);
+ return;
+ }
+
+ try {
+ setIsLoading(true);
+
+ const uploadFile = await funUploadFileToStorage({
+ file: file,
+ dirId: DIRECTORY_ID.event_sponsor,
+ });
+
+ if (!uploadFile.success) {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload file");
+ return;
+ }
+
+ const fileType = file.type.split("/").pop();
+ const data: IEventSponsor = {
+ name: name,
+ fileName: file.name,
+ fileExt: fileType,
+ fileId: uploadFile.data.id,
+ };
+
+ const created: any = await apiGetEventCreateSponsor({
+ id: params.id,
+ data: data,
+ });
+
+ if (created) {
+ router.replace(RouterEvent.nominal_sponsor({ id: params.id }));
+ ComponentGlobal_NotifikasiBerhasil(created.message);
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiPeringatan(created.message);
+ }
+ } catch (error) {
+ setIsLoading(false);
+ clientLogger.error("Error create sponsor", error);
+ }
+ }
+
+ return (
+ <>
+
+
+
+
+
+ setName(e.target.value)}
+ />
+
+ {/*
+ {isLoadingImg ? (
+
+
+
+ ) : img ? (
+
+
+
+ ) : (
+
+
+
+ )}
+ */}
+
+
+
+
+ {file ? (
+ {file.name}
+ ) : (
+
+ .
+
+ )}
+
+
+
+
+
+
+
+
+
+ {
+ onCreated();
+ }}
+ bg={MainColor.yellow}
+ color="yellow"
+ c={"black"}
+ >
+ Simpan
+
+
+
+ {/*
+
+ router.replace("/dev/event/detail/sponsor/nominal_sponsor")
+ }
+ >
+ Simpan
+
+ */}
+
+
+ {/* */}
+ >
+ );
+}
+
+export default Event_TambahSponsor;
diff --git a/src/app_modules/event/detail/tambah_sponsor/layout.tsx b/src/app_modules/event/detail/tambah_sponsor/layout.tsx
new file mode 100644
index 00000000..464bae65
--- /dev/null
+++ b/src/app_modules/event/detail/tambah_sponsor/layout.tsx
@@ -0,0 +1,17 @@
+'use client';
+import { UIGlobal_LayoutHeaderTamplate, UIGlobal_LayoutTamplate } from '@/app_modules/_global/ui';
+import React from 'react';
+
+function LayoutEvent_TambahSponsor({ children }: { children: React.ReactNode }) {
+ return (
+ <>
+ }
+ >
+ {children}
+
+ >
+ );
+}
+
+export default LayoutEvent_TambahSponsor;
diff --git a/src/app_modules/event/edit/index.tsx b/src/app_modules/event/edit/index.tsx
index ec0884a4..8b9870b3 100644
--- a/src/app_modules/event/edit/index.tsx
+++ b/src/app_modules/event/edit/index.tsx
@@ -3,46 +3,100 @@
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import Component_V3_Label_TextInput from "@/app_modules/_global/component/new/comp_V3_label_text_input";
+import { Component_V3_TextEditor } from "@/app_modules/_global/component/new/comp_V3_text_editor";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { MODEL_DEFAULT_MASTER_OLD } from "@/app_modules/model_global/interface";
-import {
- Button,
- Select,
- Stack,
- Text,
- TextInput,
- Textarea,
-} from "@mantine/core";
+import { clientLogger } from "@/util/clientLogger";
+import { Button, Select, Stack, TextInput } from "@mantine/core";
import { DateTimePicker } from "@mantine/dates";
+import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import moment from "moment";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import { Event_funEditById } from "../fun/edit/fun_edit_by_id";
-import { MODEL_EVENT } from "../model/interface";
+import {
+ apiGetEventDetailById,
+ apiGetMasterTipeAcara,
+} from "../_lib/api_event";
+import { MODEL_EVENT } from "../_lib/interface";
import ComponentEvent_ErrorMaximalInput from "../component/error_maksimal_input";
+import { Event_funEditById } from "../fun/edit/fun_edit_by_id";
+import { useParams } from "next/navigation";
+import { ComponentGlobal_BoxInformation } from "@/app_modules/_global/component";
+import { baseStylesTextInput } from "@/app_modules/_global/lib/base_style_text_input";
-export default function Event_Edit({
- dataEvent,
- listTipeAcara,
-}: {
- dataEvent: MODEL_EVENT;
- listTipeAcara: MODEL_DEFAULT_MASTER_OLD[];
-}) {
+export default function Event_Edit() {
const router = useRouter();
+ const { id } = useParams();
const [isLoading, setLoading] = useState(false);
- const [value, setValue] = useState(dataEvent);
- const [tipe, setTipe] = useState(listTipeAcara);
+ const [data, setData] = useState();
+ const [listTipeAcara, setListTipeAcara] = useState<
+ MODEL_DEFAULT_MASTER_OLD[]
+ >([]);
const [isTimeStart, setIsTimeStart] = useState(false);
const [diffTimeStart, setDiffTimeStart] = useState(0);
const [isTimeEnd, setIsTimeEnd] = useState(false);
const [diffTimeEnd, setDiffTimeEnd] = useState(0);
+ useShallowEffect(() => {
+ handleGetMasterTipeAcara();
+ }, []);
+
+ async function handleGetMasterTipeAcara() {
+ try {
+ const response = await apiGetMasterTipeAcara();
+ if (response.success) {
+ setListTipeAcara(response.data);
+ } else {
+ setListTipeAcara([]);
+ }
+ } catch (error) {
+ setListTipeAcara([]);
+ }
+ }
+
+ useShallowEffect(() => {
+ handleGetDetailEvent();
+ }, []);
+
+ async function handleGetDetailEvent() {
+ try {
+ const response = await apiGetEventDetailById({ id: id as string });
+ if (response.success) {
+ const fixData = _.omit(response.data, [
+ "Author",
+ "EventMaster_Status",
+ "Event_Peserta",
+ "createdAt",
+ "updatedAt",
+ "active",
+ ]);
+ setData(fixData as any);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ setData(null);
+ }
+ }
+
+ if (!listTipeAcara.length || !data) {
+ return ;
+ }
+
+ if (data === undefined) {
+ return ;
+ }
+
return (
<>
{/* {JSON.stringify(value, null, 2)} */}
@@ -50,24 +104,30 @@ export default function Event_Edit({
) : (
""
)
}
onChange={(val) => {
- setValue({
- ...value,
+ setData({
+ ...(data as any),
title: val.target.value,
});
}}
@@ -76,20 +136,29 @@ export default function Event_Edit({
({
+ data={listTipeAcara.map((e) => ({
value: e.id,
label: e.name,
}))}
- value={value.EventMaster_TipeAcara.id}
+ value={data.EventMaster_TipeAcara.id}
onChange={(val) => {
- setValue({
- ...(value as any),
+ setData({
+ ...(data as any),
EventMaster_TipeAcara: {
id: val,
},
@@ -100,43 +169,40 @@ export default function Event_Edit({
) : (
""
)
}
onChange={(val) => {
- setValue({
- ...value,
+ setData({
+ ...data,
lokasi: val.target.value,
});
}}
/>
- {/* {JSON.stringify(diffTimeStart, null, 2)}
- {JSON.stringify(diffTimeEnd, null, 2)}
-
- {JSON.stringify(
- moment(value.tanggal.toISOString().toString()),
- null,
- 2
- )}
- */}
-
{
@@ -145,7 +211,7 @@ export default function Event_Edit({
withAsterisk
label="Tanggal & Waktu Mulai"
placeholder="Masukan tangal dan waktu"
- value={value.tanggal}
+ value={moment(data.tanggal).toDate()}
error={
isTimeStart ? (
@@ -164,8 +230,8 @@ export default function Event_Edit({
? setIsTimeStart(true)
: setIsTimeStart(false);
- setValue({
- ...(value as any),
+ setData({
+ ...data,
tanggal: val,
});
}}
@@ -173,8 +239,9 @@ export default function Event_Edit({
{
@@ -183,12 +250,11 @@ export default function Event_Edit({
withAsterisk
label="Tanggal & Waktu Berakhir"
placeholder="Masukan tangal dan waktu"
- value={value.tanggalSelesai}
+ value={moment(data.tanggalSelesai).toDate()}
error={
isTimeEnd ? (
- ) : moment(value.tanggalSelesai?.toISOString().toString()) <
- moment(value.tanggal.toISOString().toString()) ? (
+ ) : moment(data.tanggalSelesai) < moment(data.tanggal) ? (
) : (
""
@@ -205,43 +271,33 @@ export default function Event_Edit({
? setIsTimeEnd(true)
: setIsTimeEnd(false);
- setValue({
- ...(value as any),
+ setData({
+ ...data,
tanggalSelesai: val,
});
}}
/>
-
- ) : (
- ""
- )
- }
- onChange={(val) => {
- setValue({
- ...value,
- deskripsi: val.target.value,
+
+
+ {
+ setData({
+ ...data,
+ deskripsi: val.trim(),
});
}}
/>
+
+ {funReplaceHtml({ html: data.deskripsi }).length === 0 && (
+
+ )}
+
@@ -249,22 +305,23 @@ export default function Event_Edit({
style={{
transition: "0.5s",
}}
- disabled={
- value.title === "" ||
- value.lokasi === "" ||
- value.deskripsi === "" ||
- value.eventMaster_TipeAcaraId === 0 ||
- moment(value.tanggalSelesai?.toISOString().toString()) <
- moment(value.tanggal.toISOString().toString())
- }
+ // disabled={
+ // data.title === "" ||
+ // data.lokasi === "" ||
+ // data.eventMaster_TipeAcaraId === 0 ||
+ // moment(data.tanggalSelesai?.toISOString().toString()) <
+ // moment(data.tanggal.toISOString().toString()) ||
+ // funReplaceHtml({ html: data.deskripsi }).length > maxInputLength ||
+ // funReplaceHtml({ html: data.deskripsi }).length === 0
+ // }
loaderPosition="center"
loading={isLoading ? true : false}
radius={"xl"}
mt={"xl"}
- onClick={() => onUpdate(router, value, setLoading)}
+ onClick={() => onUpdate(router, data, setLoading)}
bg={MainColor.yellow}
color="yellow"
- c={"black"}
+ c={MainColor.darkblue}
>
Update
@@ -281,14 +338,19 @@ async function onUpdate(
if (_.values(value).includes(""))
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
- const res = await Event_funEditById(value);
- setLoading(true);
+ try {
+ setLoading(true);
+ const res = await Event_funEditById(value);
- if (res.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(res.message);
- router.back();
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ router.back();
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
setLoading(false);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ clientLogger.error("Error update event", error);
}
}
diff --git a/src/app_modules/event/edit/layout.tsx b/src/app_modules/event/edit/layout.tsx
index fbe4d4f7..82b474eb 100644
--- a/src/app_modules/event/edit/layout.tsx
+++ b/src/app_modules/event/edit/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutEvent_Edit({
@@ -11,9 +14,16 @@ export default function LayoutEvent_Edit({
}) {
return (
<>
- }>
+ {/* }>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/event/fun/count/count_total_peserta_by_id.ts b/src/app_modules/event/fun/count/count_total_peserta_by_id.ts
index 2b806008..6c82c9ab 100644
--- a/src/app_modules/event/fun/count/count_total_peserta_by_id.ts
+++ b/src/app_modules/event/fun/count/count_total_peserta_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Event_countTotalPesertaById(eventId: string) {
const data = await prisma.event_Peserta.count({
diff --git a/src/app_modules/event/fun/create/fun_create.ts b/src/app_modules/event/fun/create/fun_create.ts
index 647624e1..20cc407f 100644
--- a/src/app_modules/event/fun/create/fun_create.ts
+++ b/src/app_modules/event/fun/create/fun_create.ts
@@ -1,38 +1,45 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { MODEL_EVENT } from "../../model/interface";
+import prisma from "@/lib/prisma";
+import { MODEL_EVENT } from "../../_lib/interface";
import { revalidatePath } from "next/cache";
import _ from "lodash";
export async function Event_funCreate(req: MODEL_EVENT) {
- const res = await prisma.event.create({
- data: {
- title: _.startCase(req.title),
- lokasi: req.lokasi,
- deskripsi: req.deskripsi,
- eventMaster_TipeAcaraId: req.eventMaster_TipeAcaraId,
- tanggal: req.tanggal,
- tanggalSelesai: req.tanggalSelesai,
- authorId: req.authorId,
- },
- select: {
- id: true,
- title: true,
- EventMaster_Status: {
- select: {
- name: true,
- },
+ try {
+ const res = await prisma.event.create({
+ data: {
+ title: _.startCase(req.title),
+ lokasi: req.lokasi,
+ deskripsi: req.deskripsi,
+ eventMaster_TipeAcaraId: req.eventMaster_TipeAcaraId,
+ tanggal: req.tanggal,
+ tanggalSelesai: req.tanggalSelesai,
+ authorId: req.authorId,
},
- authorId: true,
- },
- });
+ select: {
+ id: true,
+ title: true,
+ EventMaster_Status: {
+ select: {
+ name: true,
+ },
+ },
+ authorId: true,
+ },
+ });
- if (!res) return { status: 400, message: "Gagal Disimpan" };
- revalidatePath("/dev/event/main/status_page");
- return {
- data: res,
- status: 201,
- message: "Berhasil Disimpan",
- };
+ if (!res) return { status: 400, message: "Gagal disimpan" };
+ revalidatePath("/dev/event/main/status_page");
+ return {
+ data: res,
+ status: 201,
+ message: "Berhasil disimpan",
+ };
+ } catch (error) {
+ return {
+ status: 500,
+ message: "Error create event",
+ };
+ }
}
diff --git a/src/app_modules/event/fun/create/fun_join_and_confirm.ts b/src/app_modules/event/fun/create/fun_join_and_confirm.ts
new file mode 100644
index 00000000..c2b78934
--- /dev/null
+++ b/src/app_modules/event/fun/create/fun_join_and_confirm.ts
@@ -0,0 +1,23 @@
+"use server";
+
+import prisma from "@/lib/prisma";
+import { MODEL_EVENT_PESERTA } from "../../_lib/interface";
+import { revalidatePath } from "next/cache";
+
+export async function Event_funJoinAndConfirmEvent(data: MODEL_EVENT_PESERTA) {
+ const join = await prisma.event_Peserta.create({
+ data: {
+ eventId: data.eventId,
+ userId: data.userId,
+ isPresent: true,
+ },
+ });
+
+ if (!join) return { status: 400, message: "Gagal Join & Konfirmasi" };
+
+ revalidatePath("/dev/event/detail/main");
+ return {
+ status: 200,
+ message: "Berhasil Join & Konfirmasi",
+ };
+}
diff --git a/src/app_modules/event/fun/create/fun_join_event.ts b/src/app_modules/event/fun/create/fun_join_event.ts
index 268d3d67..cae8d02b 100644
--- a/src/app_modules/event/fun/create/fun_join_event.ts
+++ b/src/app_modules/event/fun/create/fun_join_event.ts
@@ -1,32 +1,40 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { MODEL_EVENT_PESERTA } from "../../model/interface";
+import prisma from "@/lib/prisma";
+import { MODEL_EVENT_PESERTA } from "../../_lib/interface";
import { revalidatePath } from "next/cache";
export async function Event_funJoinEvent(data: MODEL_EVENT_PESERTA) {
- const res = await prisma.event_Peserta.create({
- data: {
- eventId: data.eventId,
- userId: data.userId,
- },
+ try {
+ const res = await prisma.event_Peserta.create({
+ data: {
+ eventId: data.eventId,
+ userId: data.userId,
+ },
- select: {
- Event: {
- select: {
- id: true,
- title: true,
- authorId: true,
+ select: {
+ Event: {
+ select: {
+ id: true,
+ title: true,
+ authorId: true,
+ },
},
},
- },
- });
+ });
- if (!res) return { status: 400, message: "Gagal Join" };
- revalidatePath("/dev/event/detail/main");
- return {
- data: res,
- status: 200,
- message: "Berhasil Join",
- };
+ if (!res) return { status: 400, message: "Gagal Join" };
+ revalidatePath("/dev/event/detail/main");
+ return {
+ data: res,
+ status: 200,
+ message: "Berhasil Join",
+ };
+ } catch (error) {
+ return {
+ status: 500,
+ message: "Error Join",
+ error: (error as Error).message,
+ };
+ }
}
diff --git a/src/app_modules/event/fun/delete/fun_delete.ts b/src/app_modules/event/fun/delete/fun_delete.ts
index 7d896b79..ce8c818f 100644
--- a/src/app_modules/event/fun/delete/fun_delete.ts
+++ b/src/app_modules/event/fun/delete/fun_delete.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
+import prisma from "@/lib/prisma";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
import { revalidatePath } from "next/cache";
export async function Event_funDeleteById(eventId: string) {
diff --git a/src/app_modules/event/fun/edit/fun_edit_by_id.ts b/src/app_modules/event/fun/edit/fun_edit_by_id.ts
index 3781173f..86f67d8a 100644
--- a/src/app_modules/event/fun/edit/fun_edit_by_id.ts
+++ b/src/app_modules/event/fun/edit/fun_edit_by_id.ts
@@ -1,9 +1,9 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _ from "lodash";
import { revalidatePath } from "next/cache";
-import { MODEL_EVENT } from "../../model/interface";
+import { MODEL_EVENT } from "../../_lib/interface";
export async function Event_funEditById(data: MODEL_EVENT) {
const updt = await prisma.event.update({
diff --git a/src/app_modules/event/fun/edit/fun_edit_status_by_id.ts b/src/app_modules/event/fun/edit/fun_edit_status_by_id.ts
index a6ecd2e5..2be2a989 100644
--- a/src/app_modules/event/fun/edit/fun_edit_status_by_id.ts
+++ b/src/app_modules/event/fun/edit/fun_edit_status_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
/**
diff --git a/src/app_modules/event/fun/edit/fun_update_konfirmasi_by_user_id.ts b/src/app_modules/event/fun/edit/fun_update_konfirmasi_by_user_id.ts
new file mode 100644
index 00000000..dc86d7da
--- /dev/null
+++ b/src/app_modules/event/fun/edit/fun_update_konfirmasi_by_user_id.ts
@@ -0,0 +1,24 @@
+"use server";
+
+import { prisma } from "@/lib";
+
+export async function event_funUpdateKehadiran({
+ userId,
+ eventId,
+}: {
+ userId: string;
+ eventId: string;
+}) {
+ const updt = await prisma.event_Peserta.updateMany({
+ where: {
+ userId: userId,
+ eventId: eventId,
+ },
+ data: {
+ isPresent: true,
+ },
+ });
+
+ if(!updt) return { status: 400, message: "Gagal Update" };
+ return { status: 200, message: "Anda telah terkonfirmasi" };
+}
diff --git a/src/app_modules/event/fun/get/cek_user_join_by_id.ts b/src/app_modules/event/fun/get/cek_user_join_by_id.ts
index 086eb574..1d0b923e 100644
--- a/src/app_modules/event/fun/get/cek_user_join_by_id.ts
+++ b/src/app_modules/event/fun/get/cek_user_join_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Event_CekUserJoinById(eventId: string, userId: string) {
const cek = await prisma.event_Peserta.count({
diff --git a/src/app_modules/event/fun/get/fun_check_kehadiran.ts b/src/app_modules/event/fun/get/fun_check_kehadiran.ts
new file mode 100644
index 00000000..e7d62009
--- /dev/null
+++ b/src/app_modules/event/fun/get/fun_check_kehadiran.ts
@@ -0,0 +1,27 @@
+"use server";
+
+import { prisma } from "@/lib";
+
+export async function event_funCheckKehadiran({
+ userId,
+ eventId,
+}: {
+ userId: string;
+ eventId: string;
+}) {
+ const checkKehadiran = await prisma.event_Peserta.findFirst({
+ where: {
+ userId: userId,
+ eventId: eventId,
+ },
+ select: {
+ isPresent: true,
+ },
+ });
+
+ if (checkKehadiran?.isPresent) {
+ return true;
+ } else {
+ return false;
+ }
+}
diff --git a/src/app_modules/event/fun/get/fun_check_peserta_by_user_id.ts b/src/app_modules/event/fun/get/fun_check_peserta_by_user_id.ts
new file mode 100644
index 00000000..0509a232
--- /dev/null
+++ b/src/app_modules/event/fun/get/fun_check_peserta_by_user_id.ts
@@ -0,0 +1,24 @@
+"use server";
+
+import { prisma } from "@/lib";
+
+export async function event_funCheckPesertaByUserId({
+ userId,
+ eventId,
+}: {
+ userId: string;
+ eventId: string;
+}) {
+ const check = await prisma.event_Peserta.findFirst({
+ where: {
+ userId: userId,
+ eventId: eventId,
+ },
+ });
+
+ if (check != null) {
+ return true;
+ } else {
+ return false;
+ }
+}
diff --git a/src/app_modules/event/fun/get/fun_check_status_by_id.ts b/src/app_modules/event/fun/get/fun_check_status_by_id.ts
index 27f5388f..5e5208a3 100644
--- a/src/app_modules/event/fun/get/fun_check_status_by_id.ts
+++ b/src/app_modules/event/fun/get/fun_check_status_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
export async function event_checkStatus({ id }: { id: string }) {
const checkStatus = await prisma.event.findFirst({
diff --git a/src/app_modules/event/fun/get/get_list_all_publish.ts b/src/app_modules/event/fun/get/get_list_all_publish.ts
index ab5161f8..b606b867 100644
--- a/src/app_modules/event/fun/get/get_list_all_publish.ts
+++ b/src/app_modules/event/fun/get/get_list_all_publish.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _ from "lodash";
import moment from "moment";
diff --git a/src/app_modules/event/fun/get/get_list_kontribusi_by_user_id.ts b/src/app_modules/event/fun/get/get_list_kontribusi_by_user_id.ts
index e715788b..eb62ed55 100644
--- a/src/app_modules/event/fun/get/get_list_kontribusi_by_user_id.ts
+++ b/src/app_modules/event/fun/get/get_list_kontribusi_by_user_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function event_getListKontibusiByUserId({
diff --git a/src/app_modules/event/fun/get/get_list_peserta_by_id.ts b/src/app_modules/event/fun/get/get_list_peserta_by_id.ts
index 1b490246..56115e45 100644
--- a/src/app_modules/event/fun/get/get_list_peserta_by_id.ts
+++ b/src/app_modules/event/fun/get/get_list_peserta_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Event_getListPesertaById(eventId: string) {
const data = await prisma.event_Peserta.findMany({
@@ -13,12 +13,14 @@ export async function Event_getListPesertaById(eventId: string) {
createdAt: true,
updatedAt: true,
userId: true,
+
+ isPresent: true,
User: {
select: {
Profile: true,
},
},
- // Event: true,
+ Event: true,
eventId: true,
},
});
diff --git a/src/app_modules/event/fun/get/get_one_by_id.ts b/src/app_modules/event/fun/get/get_one_by_id.ts
index 0bf0ce1b..12fac9c7 100644
--- a/src/app_modules/event/fun/get/get_one_by_id.ts
+++ b/src/app_modules/event/fun/get/get_one_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function event_getOneById(eventId: string) {
diff --git a/src/app_modules/event/fun/get/new_get_list_peserta.ts b/src/app_modules/event/fun/get/new_get_list_peserta.ts
new file mode 100644
index 00000000..1b0f14c7
--- /dev/null
+++ b/src/app_modules/event/fun/get/new_get_list_peserta.ts
@@ -0,0 +1,43 @@
+"use server";
+
+import prisma from "@/lib/prisma";
+
+export async function event_newGetListPesertaById({
+ eventId,
+ page,
+}: {
+ eventId: string;
+ page: number;
+}) {
+ const takeData = 10;
+ const skipData = page * takeData - takeData;
+
+ const data = await prisma.event_Peserta.findMany({
+ take: takeData,
+ skip: skipData,
+ orderBy: {
+ updatedAt: "desc",
+ },
+ where: {
+ eventId: eventId,
+ },
+ select: {
+ id: true,
+ active: true,
+ createdAt: true,
+ updatedAt: true,
+ userId: true,
+
+ isPresent: true,
+ User: {
+ select: {
+ Profile: true,
+ },
+ },
+ Event: true,
+ eventId: true,
+ },
+ });
+
+ return data;
+}
diff --git a/src/app_modules/event/fun/get/riwayat/get_list_riwayat_saya.ts b/src/app_modules/event/fun/get/riwayat/get_list_riwayat_saya.ts
index 231a13a1..cd6f6837 100644
--- a/src/app_modules/event/fun/get/riwayat/get_list_riwayat_saya.ts
+++ b/src/app_modules/event/fun/get/riwayat/get_list_riwayat_saya.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function event_getListRiwayatSaya({ page }: { page: number }) {
diff --git a/src/app_modules/event/fun/get/riwayat/get_list_semua_riwayat.ts b/src/app_modules/event/fun/get/riwayat/get_list_semua_riwayat.ts
index 71817f4f..3bb19ceb 100644
--- a/src/app_modules/event/fun/get/riwayat/get_list_semua_riwayat.ts
+++ b/src/app_modules/event/fun/get/riwayat/get_list_semua_riwayat.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _ from "lodash";
export async function event_getListSemuaRiwayat({ page }: { page: number }) {
diff --git a/src/app_modules/event/fun/get/status/get_all_by_status_id.tsx b/src/app_modules/event/fun/get/status/get_all_by_status_id.tsx
index 152f24e5..5b3f6952 100644
--- a/src/app_modules/event/fun/get/status/get_all_by_status_id.tsx
+++ b/src/app_modules/event/fun/get/status/get_all_by_status_id.tsx
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function event_getAllByStatusId({
diff --git a/src/app_modules/event/fun/get/status/get_all_draft.ts b/src/app_modules/event/fun/get/status/get_all_draft.ts
index 2bfcdcb3..f0a6cc8f 100644
--- a/src/app_modules/event/fun/get/status/get_all_draft.ts
+++ b/src/app_modules/event/fun/get/status/get_all_draft.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function event_getAllDraft({ page }: { page: number }) {
diff --git a/src/app_modules/event/fun/get/status/get_all_reject.ts b/src/app_modules/event/fun/get/status/get_all_reject.ts
index 7cb1d020..e3cf816d 100644
--- a/src/app_modules/event/fun/get/status/get_all_reject.ts
+++ b/src/app_modules/event/fun/get/status/get_all_reject.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function event_getAllReject({ page }: { page: number }) {
diff --git a/src/app_modules/event/fun/get/status/get_all_review.ts b/src/app_modules/event/fun/get/status/get_all_review.ts
index facb92ba..c1d09c0f 100644
--- a/src/app_modules/event/fun/get/status/get_all_review.ts
+++ b/src/app_modules/event/fun/get/status/get_all_review.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function event_getAllReview({ page }: { page: number }) {
diff --git a/src/app_modules/event/fun/get/status/get_all_status_publish.ts b/src/app_modules/event/fun/get/status/get_all_status_publish.ts
index ba24bd37..7b18acb9 100644
--- a/src/app_modules/event/fun/get/status/get_all_status_publish.ts
+++ b/src/app_modules/event/fun/get/status/get_all_status_publish.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function event_funGetAllStatusPublish({ page }: { page: number }) {
diff --git a/src/app_modules/event/fun/index.ts b/src/app_modules/event/fun/index.ts
index e8dffb0d..b63c8c35 100644
--- a/src/app_modules/event/fun/index.ts
+++ b/src/app_modules/event/fun/index.ts
@@ -1,5 +1,13 @@
+import { event_funUpdateKehadiran } from "./edit/fun_update_konfirmasi_by_user_id";
+import { event_funCheckKehadiran } from "./get/fun_check_kehadiran";
+import { event_funCheckPesertaByUserId } from "./get/fun_check_peserta_by_user_id";
+import { event_newGetListPesertaById } from "./get/new_get_list_peserta";
import { event_getAllByStatusId } from "./get/status/get_all_by_status_id";
import { event_getMasterStatus } from "./master/get_status_event";
export { event_getAllByStatusId };
export { event_getMasterStatus };
+export { event_funCheckPesertaByUserId };
+export { event_funUpdateKehadiran };
+export { event_funCheckKehadiran };
+export { event_newGetListPesertaById };
diff --git a/src/app_modules/event/fun/master/get_status_event.ts b/src/app_modules/event/fun/master/get_status_event.ts
index e86db9cd..f6512e57 100644
--- a/src/app_modules/event/fun/master/get_status_event.ts
+++ b/src/app_modules/event/fun/master/get_status_event.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
export async function event_getMasterStatus() {
const data = await prisma.eventMaster_Status.findMany({});
diff --git a/src/app_modules/event/fun/master/get_tipe_acara.ts b/src/app_modules/event/fun/master/get_tipe_acara.ts
index 7b5f1683..476850da 100644
--- a/src/app_modules/event/fun/master/get_tipe_acara.ts
+++ b/src/app_modules/event/fun/master/get_tipe_acara.ts
@@ -1,6 +1,6 @@
"use server"
-import prisma from "@/app/lib/prisma"
+import prisma from "@/lib/prisma"
export async function Event_getMasterTipeAcara(){
const data = await prisma.eventMaster_TipeAcara.findMany({
diff --git a/src/app_modules/event/global_state/index.ts b/src/app_modules/event/global_state/index.ts
index 310e4a91..2574ed23 100644
--- a/src/app_modules/event/global_state/index.ts
+++ b/src/app_modules/event/global_state/index.ts
@@ -1,13 +1,24 @@
+import { atom } from "jotai";
import { atomWithStorage } from "jotai/utils";
/**
* @param index | 0 - 3 | 0: Beranda, 1: Status, 2: Kontibusi, 3: Riwayat
* @type number
*/
-export const gs_event_hotMenu = atomWithStorage("gs_event_hotMenu", 0)
+export const gs_event_hotMenu = atomWithStorage("gs_event_hotMenu", 0);
/**
* @param status | "Publish", "Review", "Draft", "Reject"
* @type string
*/
-export const gs_event_status = atomWithStorage("gs_status_event", "Publish")
+export const gs_event_status = atomWithStorage(
+ "gs_status_event",
+ "Publish"
+);
+
+export const gs_nominal_sponsor = atomWithStorage(
+ "gs_nominal_sponsor",
+ 0
+);
+
+export const gs_event_bank_id = atomWithStorage("gs_event_bank_id", "");
diff --git a/src/app_modules/event/index.ts b/src/app_modules/event/index.ts
index 1465e41a..d841ee6b 100644
--- a/src/app_modules/event/index.ts
+++ b/src/app_modules/event/index.ts
@@ -22,6 +22,8 @@ import LayoutEvent_DetailKontribusi from "./detail/kontribusi/layout";
import Event_Riwayat from "./main/riwayat";
import Event_DetailRiwayat from "./detail/riwayat";
import LayoutEvent_DetailRiwayat from "./detail/riwayat/layout";
+import LayoutEvent_Peserta from "./detail/peserta/layout";
+import LayoutEvent_Sponsor from "./detail/sponsor/layout";
export {
Event_SplashScreen,
@@ -47,5 +49,7 @@ export {
LayoutEvent_DetailKontribusi,
Event_Riwayat ,
Event_DetailRiwayat ,
- LayoutEvent_DetailRiwayat ,
+ LayoutEvent_DetailRiwayat,
+ LayoutEvent_Peserta,
+ LayoutEvent_Sponsor
};
diff --git a/src/app_modules/event/main/beranda.tsx b/src/app_modules/event/main/beranda.tsx
index 5714cc6a..e42b3b81 100644
--- a/src/app_modules/event/main/beranda.tsx
+++ b/src/app_modules/event/main/beranda.tsx
@@ -1,26 +1,31 @@
"use client";
-import { gs_eventTriggerBeranda } from "@/app/lib/global_state";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
import { AccentColor } from "@/app_modules/_global/color";
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import { Affix, Box, Button, Center, Loader, rem } from "@mantine/core";
+import { API_RouteEvent } from "@/lib/api_user_router/route_api_event";
+import { gs_eventTriggerBeranda } from "@/lib/global_state";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import {
+ Affix,
+ Box,
+ Button,
+ Center,
+ Loader,
+ rem
+} from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { useAtom } from "jotai";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
+import { MODEL_EVENT } from "../_lib/interface";
+import { Event_ComponentSkeletonBeranda } from "../component";
import { ComponentEvent_CardBeranda } from "../component/card_view/card_beranda";
import { event_getListAllPublish } from "../fun/get/get_list_all_publish";
-import { MODEL_EVENT } from "../model/interface";
-export default function Event_Beranda({
- dataEvent,
-}: {
- dataEvent: MODEL_EVENT[];
-}) {
- const [data, setData] = useState(dataEvent);
+export default function Event_Beranda() {
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
const [isLoading, setIsLoading] = useState(false);
@@ -31,23 +36,27 @@ export default function Event_Beranda({
const [isShowUpdate, setIsShowUpdate] = useState(false);
useShallowEffect(() => {
- onLoadData({
- onPublish(val) {
- setData(val);
- },
- });
- }, [setData]);
+ setIsShowUpdate(false);
+ loadData();
+ }, []);
useShallowEffect(() => {
if (isTriggerEventBeranda) {
setIsShowUpdate(true);
}
- }, [isTriggerEventBeranda, setIsShowUpdate]);
+ }, [isTriggerEventBeranda]);
- async function onLoadData({ onPublish }: { onPublish: (val: any) => void }) {
+ async function loadData() {
+ const res = await fetch(API_RouteEvent.get_all({ page: activePage }));
+ const data = await res.json();
+ setData(data.data as any);
+ }
+
+ async function onLoadNewData() {
setIsLoading(true);
- const loadData = await event_getListAllPublish({ page: 1 });
- onPublish(loadData);
+ const res = await fetch(API_RouteEvent.get_all({ page: 1 }));
+ const data = await res.json();
+ setData(data.data as any);
setIsShowUpdate(false);
setIsTriggerEventBeranca(false);
@@ -71,13 +80,7 @@ export default function Event_Beranda({
radius={"xl"}
opacity={0.8}
onClick={() => {
- onLoadData({
- onPublish(val) {
- setData(val);
- },
- });
-
-
+ onLoadNewData();
}}
>
Update beranda
@@ -87,7 +90,10 @@ export default function Event_Beranda({
)}
- {_.isEmpty(data) ? (
+
+ {data == null ? (
+
+ ) : _.isEmpty(data) ? (
) : (
@@ -99,7 +105,7 @@ export default function Event_Beranda({
)}
data={data}
- setData={setData}
+ setData={setData as any}
moreData={async () => {
const loadData = await event_getListAllPublish({
page: activePage + 1,
diff --git a/src/app_modules/event/main/kontribusi/index.tsx b/src/app_modules/event/main/kontribusi/index.tsx
index 68439f77..a6d44bd9 100644
--- a/src/app_modules/event/main/kontribusi/index.tsx
+++ b/src/app_modules/event/main/kontribusi/index.tsx
@@ -2,25 +2,69 @@
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
-import {
- Box,
- Center
-} from "@mantine/core";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Center, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
+import { MODEL_EVENT_PESERTA } from "../../_lib/interface";
+import {
+ apiGetKontribusiEvent
+} from "../../component/button/api_fetch_event";
import { ComponentEvent_CardKontributor } from "../../component/card_view/card_kontributor";
-import { event_getListKontibusiByUserId } from "../../fun/get/get_list_kontribusi_by_user_id";
-import { MODEL_EVENT_PESERTA } from "../../model/interface";
-export default function Event_Kontribusi({
- listKontribusi,
-}: {
- listKontribusi: MODEL_EVENT_PESERTA[];
-}) {
- const [data, setData] = useState(listKontribusi);
+export default function Event_Kontribusi() {
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetKontribusiEvent({
+ page: `${activePage}`,
+ });
+ if (response.success) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get kontribusi event", error);
+ setData(null);
+ }
+ };
+
+ const hanldeMoreData = async () => {
+ try {
+ const nextPage = activePage + 1;
+ const response = await apiGetKontribusiEvent({
+ page: `${nextPage}`,
+ });
+ if (response.success) {
+ setActivePage(nextPage);
+ return response.data;
+ }
+ } catch (error) {
+ clientLogger.error("Error get kontribusi event", error);
+ setData(null);
+ }
+ };
+
+ if (!data)
+ return (
+ <>
+
+
+
+
+ >
+ );
+
return (
{_.isEmpty(data) ? (
@@ -35,16 +79,8 @@ export default function Event_Kontribusi({
)}
data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await event_getListKontibusiByUserId({
- page: activePage + 1,
- });
-
- setActivePage((val) => val + 1);
-
- return loadData;
- }}
+ setData={setData as any}
+ moreData={hanldeMoreData}
>
{(item) => }
diff --git a/src/app_modules/event/main/layout.tsx b/src/app_modules/event/main/layout.tsx
index 4d530d49..26f9ae33 100644
--- a/src/app_modules/event/main/layout.tsx
+++ b/src/app_modules/event/main/layout.tsx
@@ -1,7 +1,7 @@
"use client";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
-import { RouterHome } from "@/app/lib/router_hipmi/router_home";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import { RouterHome } from "@/lib/router_hipmi/router_home";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
@@ -70,7 +70,7 @@ export default function LayoutEvent_Main({
e.path === ""
? ComponentGlobal_NotifikasiPeringatan("Cooming Soon")
@@ -80,7 +80,7 @@ export default function LayoutEvent_Main({
{e.icon}
diff --git a/src/app_modules/event/main/new_layout_event.tsx b/src/app_modules/event/main/new_layout_event.tsx
new file mode 100644
index 00000000..fa546fc5
--- /dev/null
+++ b/src/app_modules/event/main/new_layout_event.tsx
@@ -0,0 +1,31 @@
+"use client";
+
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewFooter,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { RouterHome } from "@/lib/router_hipmi/router_home";
+import React from "react";
+import { Event_ComponentNewFooter } from "../component/new_footer";
+
+export default function NewLayout_Event({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+
+
+
+
+ {children}
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/event/main/riwayat/index.tsx b/src/app_modules/event/main/riwayat/index.tsx
index 4d00dcaf..ffd1079b 100644
--- a/src/app_modules/event/main/riwayat/index.tsx
+++ b/src/app_modules/event/main/riwayat/index.tsx
@@ -1,55 +1,28 @@
"use client";
-import { Stack, Tabs } from "@mantine/core";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
import {
- AccentColor,
- MainColor,
+ MainColor
} from "@/app_modules/_global/color/color_pallet";
-import { useRouter } from "next/navigation";
-import { useState } from "react";
-import { MODEL_EVENT } from "../../model/interface";
-import Event_RiwayatSaya from "./saya";
-import Event_SemuaRiwayat from "./semua";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import { Stack, Tabs } from "@mantine/core";
+import { useParams, useRouter } from "next/navigation";
+import { listTabsRiwayatEvent } from "../../component/list_tab_riwayat";
+import Event_ViewRiwayat from "./view_riwayat";
-export default function Event_Riwayat({
- statusId,
- dataSemuaRiwayat,
- dataRiwayatSaya,
-}: {
- statusId: string;
- dataSemuaRiwayat?: MODEL_EVENT[];
- dataRiwayatSaya?: MODEL_EVENT[];
-}) {
+export default function Event_Riwayat() {
const router = useRouter();
- const [changeStatus, setChangeStatus] = useState(statusId);
-
- const listTabs = [
- {
- id: "1",
- label: "Semua Riwayat",
- value: "Semua",
- },
- {
- id: "2",
- label: "Riwayat Saya",
- value: "Saya",
- },
- ];
-
- async function onChangeStatus({ statusId }: { statusId: string }) {
- router.push(RouterEvent.riwayat({ id: statusId }));
- }
+ const param = useParams<{ id: string }>();
+ const statusId = param.id;
return (
<>
{
- setChangeStatus(val);
- onChangeStatus({ statusId: val });
+ router.replace(RouterEvent.riwayat({ id: val }));
}}
styles={{
tabsList: {
@@ -62,32 +35,24 @@ export default function Event_Riwayat({
>
- {listTabs.map((e) => (
+ {listTabsRiwayatEvent.map((e) => (
{e.label}
))}
- {statusId == "1" && (
-
- )}
- {statusId == "2" && (
-
- )}
+
+
>
diff --git a/src/app_modules/event/main/riwayat/saya.tsx b/src/app_modules/event/main/riwayat/saya.tsx
index bf83552c..4934517c 100644
--- a/src/app_modules/event/main/riwayat/saya.tsx
+++ b/src/app_modules/event/main/riwayat/saya.tsx
@@ -8,7 +8,7 @@ import { useRouter } from "next/navigation";
import { useState } from "react";
import { ComponentEvent_CardRiwayat } from "../../component/card_view/card_riwayat";
import { event_getListSemuaRiwayat } from "../../fun/get/riwayat/get_list_semua_riwayat";
-import { MODEL_EVENT } from "../../model/interface";
+import { MODEL_EVENT } from "../../_lib/interface";
import { event_getListRiwayatSaya } from "../../fun/get/riwayat/get_list_riwayat_saya";
export default function Event_RiwayatSaya({
diff --git a/src/app_modules/event/main/riwayat/semua.tsx b/src/app_modules/event/main/riwayat/semua.tsx
index a44ad05c..9df811f4 100644
--- a/src/app_modules/event/main/riwayat/semua.tsx
+++ b/src/app_modules/event/main/riwayat/semua.tsx
@@ -9,7 +9,7 @@ import { useRouter } from "next/navigation";
import { useState } from "react";
import { ComponentEvent_CardRiwayat } from "../../component/card_view/card_riwayat";
import { event_getListSemuaRiwayat } from "../../fun/get/riwayat/get_list_semua_riwayat";
-import { MODEL_EVENT } from "../../model/interface";
+import { MODEL_EVENT } from "../../_lib/interface";
export default function Event_SemuaRiwayat({
listData,
diff --git a/src/app_modules/event/main/riwayat/view_riwayat.tsx b/src/app_modules/event/main/riwayat/view_riwayat.tsx
new file mode 100644
index 00000000..debc7c5a
--- /dev/null
+++ b/src/app_modules/event/main/riwayat/view_riwayat.tsx
@@ -0,0 +1,94 @@
+"use client";
+
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Center, Loader, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { MODEL_EVENT } from "../../_lib/interface";
+import {
+ apiGetRiwayatEvent
+} from "../../component/button/api_fetch_event";
+import { ComponentEvent_CardRiwayat } from "../../component/card_view/card_riwayat";
+import { listTabsRiwayatEvent } from "../../component/list_tab_riwayat";
+
+export default function Event_ViewRiwayat() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [activePage, setActivePage] = useState(1);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const cek = listTabsRiwayatEvent.find((e) => e.id === param.id);
+ const response = await apiGetRiwayatEvent({
+ name: cek?.value as string,
+ page: `${activePage}`,
+ });
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get job", error);
+ }
+ };
+
+ const hanldeMoreData = async () => {
+ try {
+ const cek = listTabsRiwayatEvent.find((e) => e.id === param.id);
+ const nextPage = activePage + 1;
+ const response = await apiGetRiwayatEvent({
+ name: cek?.value as string,
+ page: `${activePage}`,
+ });
+ if (response.success) {
+ setActivePage(nextPage);
+ return response.data;
+ }
+ } catch (error) {
+ clientLogger.error("Error get job", error);
+ }
+ };
+
+ if (!data)
+ return (
+ <>
+
+
+
+
+ >
+ );
+
+ return (
+ <>
+ {_.isEmpty(data) ? (
+
+ ) : (
+ // --- Main component --- //
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={hanldeMoreData}
+ >
+ {(item) => }
+
+
+ )}
+ >
+ );
+}
diff --git a/src/app_modules/event/main/status_page/draft.tsx b/src/app_modules/event/main/status_page/draft.tsx
index 05f58d0a..65651d35 100644
--- a/src/app_modules/event/main/status_page/draft.tsx
+++ b/src/app_modules/event/main/status_page/draft.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { Box, Center, Loader } from "@mantine/core";
import _ from "lodash";
@@ -8,7 +8,7 @@ import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
import { event_getAllDraft } from "../../fun/get/status/get_all_draft";
-import { MODEL_EVENT } from "../../model/interface";
+import { MODEL_EVENT } from "../../_lib/interface";
export default function Event_StatusDraft({
listDraft,
diff --git a/src/app_modules/event/main/status_page/index.tsx b/src/app_modules/event/main/status_page/index.tsx
index d47484da..3df587ce 100644
--- a/src/app_modules/event/main/status_page/index.tsx
+++ b/src/app_modules/event/main/status_page/index.tsx
@@ -1,34 +1,29 @@
"use client";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
import { MODEL_NEW_DEFAULT_MASTER } from "@/app_modules/model_global/interface";
import { Box, Stack, Tabs } from "@mantine/core";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import Event_StatusDraft from "./draft";
import Event_StatusPublish from "./publish";
import Event_StatusReject from "./reject";
import Event_StatusReview from "./review";
+import { globalStatusApp } from "@/app_modules/_global/lib";
+import Event_ViewStatus from "./view_status";
-export default function Event_StatusPage({
- statusId,
- dataStatus,
- listStatus,
-}: {
- statusId: string;
- dataStatus: any[];
- listStatus: MODEL_NEW_DEFAULT_MASTER[];
-}) {
+export default function Event_StatusPage() {
+ // const [changeStatus, setChangeStatus] = useState(statusId);
+ // async function onChangeStatus({ statusId }: { statusId: string }) {
+ // router.replace(RouterEvent.status({ id: statusId }));
+ // }
const router = useRouter();
- const [changeStatus, setChangeStatus] = useState(statusId);
-
- async function onChangeStatus({ statusId }: { statusId: string }) {
- router.replace(RouterEvent.status({ id: statusId }));
- }
+ const param = useParams<{ id: string }>();
+ const statusId = param.id;
return (
<>
@@ -36,10 +31,10 @@ export default function Event_StatusPage({
variant="pills"
radius="xl"
mt={1}
- value={changeStatus}
+ defaultValue={statusId}
+ value={statusId}
onTabChange={(val: any) => {
- setChangeStatus(val);
- onChangeStatus({ statusId: val });
+ router.replace(RouterEvent.status({ id: val }));
}}
styles={{
tabsList: {
@@ -52,20 +47,23 @@ export default function Event_StatusPage({
>
- {listStatus.map((e) => (
+ {globalStatusApp.map((e) => (
{e.name}
@@ -73,7 +71,9 @@ export default function Event_StatusPage({
))}
-
+
+
+ {/*
{changeStatus === "1" && (
)}
@@ -86,7 +86,7 @@ export default function Event_StatusPage({
{changeStatus === "4" && (
)}
-
+ */}
>
diff --git a/src/app_modules/event/main/status_page/publish.tsx b/src/app_modules/event/main/status_page/publish.tsx
index c12bf6da..43cbc419 100644
--- a/src/app_modules/event/main/status_page/publish.tsx
+++ b/src/app_modules/event/main/status_page/publish.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { Box, Center } from "@mantine/core";
@@ -9,7 +9,7 @@ import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
import { event_getAllByStatusId } from "../../fun";
-import { MODEL_EVENT } from "../../model/interface";
+import { MODEL_EVENT } from "../../_lib/interface";
export default function Event_StatusPublish({
listPublish,
diff --git a/src/app_modules/event/main/status_page/reject.tsx b/src/app_modules/event/main/status_page/reject.tsx
index e9dca1d5..fd84db52 100644
--- a/src/app_modules/event/main/status_page/reject.tsx
+++ b/src/app_modules/event/main/status_page/reject.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import {
Box,
@@ -12,7 +12,7 @@ import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
import { event_getAllReject } from "../../fun/get/status/get_all_reject";
-import { MODEL_EVENT } from "../../model/interface";
+import { MODEL_EVENT } from "../../_lib/interface";
export default function Event_StatusReject({
listReject,
diff --git a/src/app_modules/event/main/status_page/review.tsx b/src/app_modules/event/main/status_page/review.tsx
index d2612807..fcfa8a41 100644
--- a/src/app_modules/event/main/status_page/review.tsx
+++ b/src/app_modules/event/main/status_page/review.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { Box, Center, Loader } from "@mantine/core";
import _ from "lodash";
@@ -8,7 +8,7 @@ import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
import { event_getAllReview } from "../../fun/get/status/get_all_review";
-import { MODEL_EVENT } from "../../model/interface";
+import { MODEL_EVENT } from "../../_lib/interface";
export default function Event_StatusReview({
listReview,
diff --git a/src/app_modules/event/main/status_page/view_status.tsx b/src/app_modules/event/main/status_page/view_status.tsx
new file mode 100644
index 00000000..88db4f56
--- /dev/null
+++ b/src/app_modules/event/main/status_page/view_status.tsx
@@ -0,0 +1,108 @@
+"use client";
+
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { globalStatusApp } from "@/app_modules/_global/lib";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Center, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import ComponentEvent_BoxListStatus from "../../component/box_list_status";
+import { apiGetEventByStatus } from "../../component/button/api_fetch_event";
+
+export default function Event_ViewStatus() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [activePage, setActivePage] = useState(1);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const cek = globalStatusApp.find((e) => e.id === param.id);
+ const response = await apiGetEventByStatus({
+ status: cek?.name as string,
+ page: `${activePage}`,
+ });
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get job", error);
+ }
+ };
+
+ const hanldeMoreData = async () => {
+ try {
+ const cek = globalStatusApp.find((e) => e.id === param.id);
+ const nextPage = activePage + 1;
+ const response = await apiGetEventByStatus({
+ status: cek?.name as string,
+ page: `${nextPage}`,
+ });
+ if (response.success) {
+ setActivePage(nextPage);
+ return response.data;
+ }
+ } catch (error) {
+ clientLogger.error("Error get job", error);
+ }
+ };
+
+ if (!data)
+ return (
+ <>
+
+
+
+
+ >
+ );
+
+ return (
+ <>
+ {_.isEmpty(data) ? (
+
+ ) : (
+ // --- Main component --- //
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={hanldeMoreData}
+ >
+ {(item) => (
+
+ )}
+
+
+ )}
+ >
+ );
+}
diff --git a/src/app_modules/event/splash/index.tsx b/src/app_modules/event/splash/index.tsx
index e6d75e20..39f85a44 100644
--- a/src/app_modules/event/splash/index.tsx
+++ b/src/app_modules/event/splash/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
import UIGlobal_SplashScreen from "@/app_modules/_global/ui/ui_splash";
import { useShallowEffect } from "@mantine/hooks";
import { IconPresentation } from "@tabler/icons-react";
@@ -16,7 +16,7 @@ export default function Event_SplashScreen() {
setTimeout(() => {
router.replace(RouterEvent.beranda);
setHotMenu(0);
- }, 1000);
+ }, 500);
}, []);
return (
<>
diff --git a/src/app_modules/forum/component/api_fetch_forum.ts b/src/app_modules/forum/component/api_fetch_forum.ts
new file mode 100644
index 00000000..3ba87191
--- /dev/null
+++ b/src/app_modules/forum/component/api_fetch_forum.ts
@@ -0,0 +1,274 @@
+export {
+ apiGetAllForum,
+ apiGetOneForumById,
+ apiGetForumkuByUserId as apiGetForumkuById,
+ apiGetKomentarForumById,
+ apiGetMasterReportForum,
+ apiGetOneReportedPostingById,
+ apiGetOneReportKomentarById,
+};
+
+const apiGetAllForum = async ({
+ page,
+ search,
+}: {
+ page: string;
+ search?: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const isSearch = search ? `&search=${search}` : "";
+ const response = await fetch(`/api/forum?page=${page}${isSearch}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get all forum", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get all forum");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get all forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiGetOneForumById = async ({ id }: { id: string }) => {
+ try {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/forum/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get all forum:", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get all forum");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get all forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiGetForumkuByUserId = async ({
+ id,
+ page,
+}: {
+ id: string;
+ page: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const isPage = `?page=${page}`;
+ const response = await fetch(`/api/forum/forumku/${id}${isPage}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get all forum:", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get all forum");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get all forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiGetKomentarForumById = async ({ id , page}: { id: string , page: string}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const nextPage = `?page=${page}`;
+ const response = await fetch(`/api/forum/${id}/komentar${nextPage}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get all forum:", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get all forum");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get all forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+
+const apiGetMasterReportForum = async () => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) =>
+ res.json()
+ );
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/forum/master`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get all forum:",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get all forum");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get all forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+
+}
+
+const apiGetOneReportedPostingById = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) =>
+ res.json()
+ );
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/forum/${id}/report-posting`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get all forum:",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get all forum");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get all forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+ };
+
+ const apiGetOneReportKomentarById = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) =>
+ res.json()
+ );
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/forum/${id}/report-komentar`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get all forum:",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get all forum");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get all forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+ };
\ No newline at end of file
diff --git a/src/app_modules/forum/component/button/button_create_posting.tsx b/src/app_modules/forum/component/button/button_create_posting.tsx
new file mode 100644
index 00000000..782af7ad
--- /dev/null
+++ b/src/app_modules/forum/component/button/button_create_posting.tsx
@@ -0,0 +1,65 @@
+import { MainColor } from "@/app_modules/_global/color";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
+import {
+ ComponentGlobal_NotifikasiBerhasil,
+ ComponentGlobal_NotifikasiGagal,
+} from "@/app_modules/_global/notif_global";
+import { Button } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { forum_funCreate } from "../../fun/create/fun_create";
+import mqtt_client from "@/util/mqtt_client";
+
+interface ButtonActionProps {
+ value: string;
+}
+
+export default function Forum_ButtonCreatePosting({
+ value,
+}: ButtonActionProps) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ async function onCreate() {
+ try {
+ setLoading(true);
+ const create = await forum_funCreate(value);
+ if (create.status === 201) {
+ ComponentGlobal_NotifikasiBerhasil(create.message);
+ router.back();
+
+ mqtt_client.publish(
+ "Forum_create_new",
+ JSON.stringify({ isNewPost: true, count: 1 })
+ );
+ } else {
+ ComponentGlobal_NotifikasiGagal(create.message);
+ setLoading(false);
+ }
+ } catch (error) {
+ console.log(error);
+ setLoading(false);
+ }
+ }
+
+ return (
+
" ||
+ value === "" ||
+ funReplaceHtml({ html: value }).length > maxInputLength
+ }
+ bg={MainColor.yellow}
+ color="yellow"
+ c="black"
+ radius="xl"
+ loading={loading}
+ loaderPosition="center"
+ onClick={onCreate}
+ >
+ Posting
+
+ );
+}
diff --git a/src/app_modules/forum/component/button/button_update_beranda.tsx b/src/app_modules/forum/component/button/button_update_beranda.tsx
new file mode 100644
index 00000000..2ce88e04
--- /dev/null
+++ b/src/app_modules/forum/component/button/button_update_beranda.tsx
@@ -0,0 +1,63 @@
+import { AccentColor } from "@/app_modules/_global/color";
+import { clientLogger } from "@/util/clientLogger";
+import { Center, Button } from "@mantine/core";
+import { useState } from "react";
+import { apiGetAllForum } from "../api_fetch_forum";
+
+export function ButtonUpdateBeranda({
+ countNewPost,
+ onSetData,
+ onSetIsNewPost,
+ onSetCountNewPosting,
+}: {
+ countNewPost: number;
+ onSetData: (val: any) => void;
+ onSetIsNewPost: (val: any) => void;
+ onSetCountNewPosting: (val: any) => void;
+}) {
+ const [isLoading, setIsLoading] = useState(false);
+
+ const handleLoadData = async (isSearch: string) => {
+ try {
+ setIsLoading(true);
+
+ const response = await apiGetAllForum({
+ page: `1`,
+ search: isSearch,
+ });
+
+ if (response) {
+ onSetData(response.data);
+ onSetIsNewPost(false);
+ setIsLoading(false);
+ onSetCountNewPosting(0);
+ }
+ } catch (error) {
+ setIsLoading(false);
+ clientLogger.error("Error get data forum", error);
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ return (
+ <>
+
+ handleLoadData("")}
+ >
+ Update beranda + {countNewPost}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/component/button/button_update_posting.tsx b/src/app_modules/forum/component/button/button_update_posting.tsx
new file mode 100644
index 00000000..b0c3eb16
--- /dev/null
+++ b/src/app_modules/forum/component/button/button_update_posting.tsx
@@ -0,0 +1,64 @@
+import { MainColor } from "@/app_modules/_global/color";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
+import { ComponentGlobal_NotifikasiBerhasil, ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global";
+import { clientLogger } from "@/util/clientLogger";
+import { Button } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { forum_funEditPostingById } from "../../fun/edit/fun_edit_posting_by_id";
+
+export default function Forum_ButtonUpdatePosting({
+ postingId,
+ diskusi,
+}: {
+ postingId: string;
+ diskusi: string;
+}) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ async function onUpdate() {
+ try {
+ setLoading(true);
+ const update = await forum_funEditPostingById(postingId, diskusi);
+
+ if (update.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(update.message);
+ router.back();
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(update.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error update forum", error);
+ }
+ }
+
+ return (
+ <>
+
" ||
+ diskusi === "" ||
+ funReplaceHtml({ html: diskusi }).length > maxInputLength
+ }
+ loaderPosition="center"
+ loading={loading}
+ radius={"xl"}
+ bg={MainColor.yellow}
+ color={"yellow"}
+ c={"black"}
+ onClick={() => {
+ onUpdate();
+ }}
+ >
+ Update
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/component/card_loader.tsx b/src/app_modules/forum/component/card_loader.tsx
deleted file mode 100644
index e3660996..00000000
--- a/src/app_modules/forum/component/card_loader.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-"use client";
-
-import { Overlay, Center, Loader } from "@mantine/core";
-
-export default function ComponentForum_CardLoadingOverlay({
- size,
- variant,
-}: {
- size?: number;
- variant?: any;
-}) {
- return (
- <>
-
-
-
-
-
- >
- );
-}
diff --git a/src/app_modules/forum/component/detail_component/comp_V3_create.comment.tsx b/src/app_modules/forum/component/detail_component/comp_V3_create.comment.tsx
new file mode 100644
index 00000000..f3e776e8
--- /dev/null
+++ b/src/app_modules/forum/component/detail_component/comp_V3_create.comment.tsx
@@ -0,0 +1,226 @@
+"use client";
+
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
+import { Component_V3_TextEditorWithSticker } from "@/app_modules/_global/lib/stiker/comp_V3_text_editor_stiker";
+import { Comp_ButtonSticker } from "@/app_modules/_global/lib/stiker/comp_button_sticker";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import notifikasiToUser_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_user";
+import { clientLogger } from "@/util/clientLogger";
+import mqtt_client from "@/util/mqtt_client";
+import {
+ ActionIcon,
+ Button,
+ Group,
+ Paper,
+ Stack,
+ Text
+} from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { IconX } from "@tabler/icons-react";
+import React, { useState } from "react";
+import { forum_funCreateKomentar } from "../../fun/create/fun_create_komentar";
+import {
+ MODEL_FORUM_KOMENTAR,
+ MODEL_FORUM_POSTING,
+} from "../../model/interface";
+import { ISticker } from "@/app_modules/_global/lib/interface/stiker";
+
+export default function Forum_V3_CreateKomentar({
+ postingId,
+ data,
+ userLoginId,
+ onSetLoadData,
+ dataSticker,
+}: {
+ postingId: string;
+ data: MODEL_FORUM_POSTING;
+ userLoginId: string;
+ onSetLoadData: (val: string) => void;
+ dataSticker: ISticker[] | null;
+}) {
+ const [loading, setLoading] = useState(false);
+ const [isComment, setIsComment] = useState(false);
+
+ // New State
+ const [editorContent, setEditorContent] = useState("");
+ const [opened, { open, close }] = useDisclosure(false);
+ const quillRef = React.useRef(null);
+ const [quillLoaded, setQuillLoaded] = useState(false);
+
+ async function onComment() {
+ if (editorContent.length > 500) {
+ return null;
+ }
+
+ try {
+ setLoading(true);
+ const createComment = await forum_funCreateKomentar(
+ postingId,
+ editorContent
+ );
+
+ if (createComment.status === 201) {
+ const newCommentar: MODEL_FORUM_KOMENTAR | any = {
+ komentar: editorContent,
+ Author: createComment.data?.Author,
+ createdAt: data.createdAt,
+ id: createComment.data?.id,
+ };
+ onSetLoadData(newCommentar);
+ setEditorContent("");
+ ComponentGlobal_NotifikasiBerhasil(createComment.message, 2000);
+
+ if (userLoginId !== data.Author.id) {
+ const dataNotif = {
+ appId: data.id,
+ userId: data.authorId,
+ pesan: editorContent,
+ kategoriApp: "FORUM",
+ title: "Komentar baru",
+ };
+
+ const createNotifikasi = await notifikasiToUser_funCreate({
+ data: dataNotif as any,
+ });
+
+ if (createNotifikasi.status === 201) {
+ mqtt_client.publish(
+ "USER",
+ JSON.stringify({
+ userId: dataNotif.userId,
+ count: 1,
+ })
+ );
+ }
+ }
+ } else {
+ ComponentGlobal_NotifikasiGagal(createComment.message);
+ }
+ } catch (error) {
+ clientLogger.error("Error create komentar forum", error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ useShallowEffect(() => {
+ // Add Quill CSS via tag
+ const link = document.createElement("link");
+ link.href = "https://cdn.quilljs.com/1.3.6/quill.snow.css";
+ link.rel = "stylesheet";
+ document.head.appendChild(link);
+
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .ql-editor img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ // .chat-content img {
+ // max-width: 70px !important;
+ // max-height: 70px !important;
+ // }
+ `;
+ document.head.appendChild(style);
+
+ setQuillLoaded(true);
+
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(link);
+ document.head.removeChild(style);
+ };
+ }, []);
+
+ // // Function to send message
+ // const sendMessage = () => {
+ // if (editorContent.trim() !== "") {
+ // setChat((prev) => [...prev, { content: editorContent }]);
+ // setEditorContent(""); // Clear after sending
+ // }
+ // };
+
+ return (
+ <>
+
+ {isComment ? (
+
+
+
+ setIsComment(false)}
+ variant="transparent"
+ >
+
+
+
+
+ {quillLoaded && (
+
+ )}
+
+
+
+
+
+
+
+
" ||
+ editorContent === "" ||
+ funReplaceHtml({ html: editorContent }).length >
+ maxInputLength
+ }
+ bg={MainColor.yellow}
+ color={"yellow"}
+ c="black"
+ loaderPosition="center"
+ loading={loading}
+ radius={"xl"}
+ onClick={() => onComment()}
+ >
+ Balas
+
+
+
+
+ ) : (
+ setIsComment(true)}
+ py="sm"
+ px={"xl"}
+ withBorder
+ shadow="lg"
+ bg={MainColor.white}
+ >
+
+ Buka kolom komentar untuk menambahkan komentar ...
+
+
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/component/detail_component/detail_create_komentar.tsx b/src/app_modules/forum/component/detail_component/detail_create_komentar.tsx
index a07eb6e0..2057c68d 100644
--- a/src/app_modules/forum/component/detail_component/detail_create_komentar.tsx
+++ b/src/app_modules/forum/component/detail_component/detail_create_komentar.tsx
@@ -19,16 +19,18 @@ import { MODEL_FORUM_POSTING } from "../../model/interface";
import { useRouter } from "next/navigation";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import mqtt_client from "@/util/mqtt_client";
+import backendLogger from "@/util/backendLogger";
+import { clientLogger } from "@/util/clientLogger";
export default function ComponentForum_DetailCreateKomentar({
postingId,
- onSetKomentar,
data,
userLoginId,
+ onSetNewKomentar,
}: {
postingId: string;
- onSetKomentar: (val: any) => void;
data: MODEL_FORUM_POSTING;
userLoginId: string;
+ onSetNewKomentar: (val: boolean) => void;
}) {
const router = useRouter();
const [value, setValue] = useState("");
@@ -40,45 +42,46 @@ export default function ComponentForum_DetailCreateKomentar({
return null;
}
- const createComment = await forum_funCreateKomentar(postingId, value);
- if (createComment.status === 201) {
- // const loadKomentar = await forum_funGetAllKomentarById(data.id);
+ try {
+ setLoading(true);
+ const createComment = await forum_funCreateKomentar(postingId, value);
+ if (createComment.status === 201) {
- const loadData = await forum_funGetAllKomentarById({
- postingId: data.id,
- page: 1,
- });
- onSetKomentar(loadData);
+ onSetNewKomentar(true);
+ setValue("");
+ setIsEmpty(true);
+ ComponentGlobal_NotifikasiBerhasil(createComment.message, 2000);
- setValue("");
- setIsEmpty(true);
- ComponentGlobal_NotifikasiBerhasil(createComment.message, 2000);
+ if (userLoginId !== data.Author.id) {
+ const dataNotif = {
+ appId: data.id,
+ userId: data.authorId,
+ pesan: value,
+ kategoriApp: "FORUM",
+ title: "Komentar baru",
+ };
- if (userLoginId !== data.Author.id) {
- const dataNotif = {
- appId: data.id,
- userId: data.authorId,
- pesan: value,
- kategoriApp: "FORUM",
- title: "Komentar baru",
- };
+ const createNotifikasi = await notifikasiToUser_funCreate({
+ data: dataNotif as any,
+ });
- const createNotifikasi = await notifikasiToUser_funCreate({
- data: dataNotif as any,
- });
-
- if (createNotifikasi.status === 201) {
- mqtt_client.publish(
- "USER",
- JSON.stringify({
- userId: dataNotif.userId,
- count: 1,
- })
- );
+ if (createNotifikasi.status === 201) {
+ mqtt_client.publish(
+ "USER",
+ JSON.stringify({
+ userId: dataNotif.userId,
+ count: 1,
+ })
+ );
+ }
}
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(createComment.message);
}
- } else {
- ComponentGlobal_NotifikasiGagal(createComment.message);
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error create komentar forum", error);
}
}
@@ -117,8 +120,9 @@ export default function ComponentForum_DetailCreateKomentar({
}
bg={MainColor.yellow}
color={"yellow"}
+ c="black"
loaderPosition="center"
- loading={loading ? true : false}
+ loading={loading}
radius={"xl"}
onClick={() => onComment()}
>
diff --git a/src/app_modules/forum/component/detail_component/detail_header.tsx b/src/app_modules/forum/component/detail_component/detail_header.tsx
index bf50128e..db38a22b 100644
--- a/src/app_modules/forum/component/detail_component/detail_header.tsx
+++ b/src/app_modules/forum/component/detail_component/detail_header.tsx
@@ -1,55 +1,46 @@
"use client";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
-import {
- Stack,
- Grid,
- Avatar,
- Divider,
- Text,
- Group,
- ThemeIcon,
- ActionIcon,
- Badge,
- Button,
- Drawer,
- Loader,
- Modal,
- Title,
-} from "@mantine/core";
-import { useRouter } from "next/navigation";
-import moment from "moment";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
-import {
- IconCircleFilled,
- IconDots,
- IconEdit,
- IconFlag3,
- IconMessageCircle,
- IconSquareCheck,
- IconSquareRoundedX,
- IconTrash,
-} 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";
-import { MODEL_FORUM_POSTING } from "../../model/interface";
-import { useDisclosure } from "@mantine/hooks";
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import { useState } from "react";
-import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
-import { forum_funEditStatusPostingById } from "../../fun/edit/fun_edit_status_posting_by_id";
-import { forum_getOnePostingById } from "../../fun/get/get_one_posting_by_id";
-import mqtt_client from "@/util/mqtt_client";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
+import { clientLogger } from "@/util/clientLogger";
+import mqtt_client from "@/util/mqtt_client";
+import {
+ ActionIcon,
+ Avatar,
+ Badge,
+ Button,
+ Drawer,
+ Grid,
+ Group,
+ Loader,
+ Modal,
+ Stack,
+ Text,
+ Title,
+} from "@mantine/core";
+import { useDisclosure } from "@mantine/hooks";
+import {
+ IconDots,
+ IconEdit,
+ IconFlag3,
+ IconSquareCheck,
+ IconSquareRoundedX,
+ IconTrash,
+} from "@tabler/icons-react";
+import _ from "lodash";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
+import { forum_funEditStatusPostingById } from "../../fun/edit/fun_edit_status_posting_by_id";
+import { MODEL_FORUM_POSTING } from "../../model/interface";
export default function ComponentForum_DetailHeader({
data,
@@ -123,7 +114,8 @@ export default function ComponentForum_DetailHeader({
postingId={data?.id}
authorId={data?.Author.id}
userLoginId={userLoginId}
- statusId={data?.forumMaster_StatusPostingId}
+ statusId={data?.ForumMaster_StatusPosting.id}
+ dataPosting={data}
onLoadData={(val) => {
onLoadData(val);
}}
@@ -141,12 +133,14 @@ function ComponentForum_DetailButtonMore_V2({
postingId,
statusId,
userLoginId,
+ dataPosting,
onLoadData,
}: {
authorId: any;
postingId?: any;
statusId: any;
userLoginId: any;
+ dataPosting: any;
onLoadData: (val: any) => void;
}) {
const router = useRouter();
@@ -273,6 +267,7 @@ function ComponentForum_DetailButtonMore_V2({
}}
radius={"xl"}
onClick={close}
+ c={"black"}
>
Batal
@@ -312,6 +307,7 @@ function ComponentForum_DetailButtonMore_V2({
postingId={postingId}
setOpenStatus={setOpenStatusClose}
statusId={statusId}
+ dataPosting={dataPosting}
onLoadData={(val) => {
onLoadData(val);
}}
@@ -335,16 +331,16 @@ function ButtonDelete({
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);
+ try {
+ setLoading(true);
+ const responseDelete = await forum_funDeletePostingById(postingId as any);
+ if (responseDelete.status === 200) {
+ setOpenDel(false);
router.back();
+ ComponentGlobal_NotifikasiBerhasil(`Postingan Terhapus`, 2000);
+
// mqtt_client.publish(
// "Forum_detail_hapus_data",
// JSON.stringify({
@@ -352,9 +348,13 @@ function ButtonDelete({
// })
// );
} else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(responseDelete.message);
}
- });
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error get data forum", error);
+ }
}
return (
<>
@@ -387,38 +387,40 @@ function ButtonStatus({
postingId,
setOpenStatus,
statusId,
+ dataPosting,
onLoadData,
}: {
postingId?: string;
setOpenStatus: any;
statusId?: any;
+ dataPosting: any;
onLoadData: (val: any) => void;
}) {
const [loading, setLoading] = useState(false);
async function onTutupForum() {
- setOpenStatus(false);
-
- const closeForum = await forum_funEditStatusPostingById(
- postingId as any,
- 2
- );
- if (closeForum.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(`Forum Ditutup`, 2000);
+ try {
setLoading(true);
+ const closeForum = await forum_funEditStatusPostingById(
+ postingId as any,
+ 2
+ );
- const loadData = await forum_getOnePostingById(postingId as any);
- onLoadData(loadData);
+ if (closeForum.status === 200) {
+ setOpenStatus(false);
+ ComponentGlobal_NotifikasiBerhasil(`Forum Ditutup`, 2000);
- if (loadData) {
+ const cloneData = _.clone(dataPosting);
const updateData = {
- ...loadData,
+ ...cloneData,
ForumMaster_StatusPosting: {
id: 2,
status: "Close",
},
};
+ onLoadData(updateData);
+
mqtt_client.publish(
"Forum_detail_ganti_status",
JSON.stringify({
@@ -426,32 +428,39 @@ function ButtonStatus({
data: updateData.ForumMaster_StatusPosting,
})
);
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(closeForum.message);
}
- } else {
- ComponentGlobal_NotifikasiGagal(closeForum.message);
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error get data forum", error);
}
}
async function onBukaForum() {
- setOpenStatus(false);
+ setLoading(true);
- const openForum = await forum_funEditStatusPostingById(postingId as any, 1);
- if (openForum.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(`Forum Dibuka`, 2000);
- setLoading(true);
+ try {
+ const openForum = await forum_funEditStatusPostingById(
+ postingId as any,
+ 1
+ );
+ if (openForum.status === 200) {
+ setOpenStatus(false);
+ ComponentGlobal_NotifikasiBerhasil(`Forum Dibuka`, 2000);
- const loadData = await forum_getOnePostingById(postingId as any);
- onLoadData(loadData);
-
- if (loadData) {
+ const cloneData = _.clone(dataPosting);
const updateData = {
- ...loadData,
+ ...cloneData,
ForumMaster_StatusPosting: {
id: 1,
status: "Open",
},
};
+ onLoadData(updateData);
+
mqtt_client.publish(
"Forum_detail_ganti_status",
JSON.stringify({
@@ -459,9 +468,13 @@ function ButtonStatus({
data: updateData.ForumMaster_StatusPosting,
})
);
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(openForum.message);
}
- } else {
- ComponentGlobal_NotifikasiGagal(openForum.message);
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error get data forum", error);
}
}
diff --git a/src/app_modules/forum/component/detail_component/detail_list_komentar.tsx b/src/app_modules/forum/component/detail_component/detail_list_komentar.tsx
index 04c42e52..febf389b 100644
--- a/src/app_modules/forum/component/detail_component/detail_list_komentar.tsx
+++ b/src/app_modules/forum/component/detail_component/detail_list_komentar.tsx
@@ -1,43 +1,72 @@
"use client";
-import {
- Card,
- Divider,
- Spoiler,
- Stack,
- Text
-} from "@mantine/core";
+import { MainColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import { Comp_V3_SetInnerHTMLWithStiker } from "@/app_modules/_global/component/new/comp_V3_set_html_with_stiker";
+import { Box, Spoiler, Stack, Text } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import { MODEL_FORUM_KOMENTAR } from "../../model/interface";
import ComponentForum_KomentarAuthorNameOnHeader from "../komentar_component/komentar_author_header_name";
export default function ComponentForum_KomentarView({
data,
+ listKomentar,
setKomentar,
postingId,
userLoginId,
}: {
data: MODEL_FORUM_KOMENTAR;
+ listKomentar: MODEL_FORUM_KOMENTAR[];
setKomentar: any;
postingId: string;
userLoginId: string;
}) {
+ useShallowEffect(() => {
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ // .ql-editor img {
+ // max-width: 40px !important;
+ // max-height: 40px !important;
+ // }
+ .chat-content img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ `;
+ document.head.appendChild(style);
+
+ // setQuillLoaded(true);
+
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(style);
+ };
+ }, []);
+
return (
<>
-
-
+
+
-
-
-
+
+
{data.komentar ? (
-
+
) : (
""
)}
-
-
-
-
-
-
-
-
-
-
- {/*
- {_.isEmpty(data) ? (
-
-
- Belum ada komentar
-
-
- ) : (
-
-
-
- {" "}
- Komentar
-
-
- {data.map((e, i) => (
-
- ))}
- )}
- */}
+
+
>
);
}
diff --git a/src/app_modules/forum/component/detail_component/detail_view.tsx b/src/app_modules/forum/component/detail_component/detail_view.tsx
index c445c779..10352d2a 100644
--- a/src/app_modules/forum/component/detail_component/detail_view.tsx
+++ b/src/app_modules/forum/component/detail_component/detail_view.tsx
@@ -1,14 +1,13 @@
"use client";
-import { Card, Stack, Group, Text, Box } from "@mantine/core";
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import { Box, Group, Stack, Text } from "@mantine/core";
import { IconMessageCircle, IconMessageCircleX } from "@tabler/icons-react";
import { MODEL_FORUM_POSTING } from "../../model/interface";
import ComponentForum_DetailHeader from "./detail_header";
-import {
- AccentColor,
- MainColor,
-} from "@/app_modules/_global/color/color_pallet";
-import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import { useShallowEffect } from "@mantine/hooks";
+import { Comp_V3_SetInnerHTMLWithStiker } from "@/app_modules/_global/component/new/comp_V3_set_html_with_stiker";
+import { MainColor } from "@/app_modules/_global/color";
export default function ComponentForum_DetailForumView({
data,
@@ -21,6 +20,22 @@ export default function ComponentForum_DetailForumView({
userLoginId: string;
onLoadData: (val: any) => void;
}) {
+ useShallowEffect(() => {
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .chat-content img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ `;
+ document.head.appendChild(style);
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(style);
+ };
+ }, []);
+
return (
<>
@@ -35,10 +50,19 @@ export default function ComponentForum_DetailForumView({
/>
{/* CONTENT */}
-
+
{data?.diskusi ? (
-
+
) : (
""
)}
diff --git a/src/app_modules/forum/component/detail_component/ui_report_komentar.tsx b/src/app_modules/forum/component/detail_component/ui_report_komentar.tsx
index e0cd88ec..c1714833 100644
--- a/src/app_modules/forum/component/detail_component/ui_report_komentar.tsx
+++ b/src/app_modules/forum/component/detail_component/ui_report_komentar.tsx
@@ -1,17 +1,67 @@
-"use client"
+"use client";
import { Stack, Paper, Text, List, Box } from "@mantine/core";
import { useState } from "react";
import { MODEL_FORUM_KOMENTAR } from "../../model/interface";
-import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
+import {
+ AccentColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
+import { useShallowEffect } from "@mantine/hooks";
+import { Comp_V3_SetInnerHTMLWithStiker } from "@/app_modules/_global/component/new/comp_V3_set_html_with_stiker";
+import { apiGetOneReportKomentarById } from "../api_fetch_forum";
+import { useParams } from "next/navigation";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+
+export function ComponentForum_UiDetailReportKomentar() {
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [list, setList] = useState([]);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetOneReportKomentarById({
+ id: params.id,
+ });
+
+ if (response.success) {
+ setData(response.data.data);
+ setList(response.data.list);
+ } else {
+ setData(null);
+ setList([]);
+ }
+ } catch (error) {
+ console.error("Error get data report posting", error);
+ setData(null);
+ setList([]);
+ }
+ }
+
+ useShallowEffect(() => {
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .chat-content img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ `;
+ document.head.appendChild(style);
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(style);
+ };
+ }, []);
+
+ if (!data || !list) {
+ return ;
+ }
-export function ComponentForum_UiDetailReportKomentar({
- dataKomentar,
-}: {
- dataKomentar: any;
-}) {
- const [data, setData] = useState(dataKomentar.data);
- const [list, setList] = useState(dataKomentar.list);
return (
<>
Komentar anda
-
-
-
+
+
+ {data?.komentar ? (
+
+ ) : (
+ ""
+ )}
-
+
Pada postingan : {data.Forum_Posting.Author.username}
-
-
-
+ {/* CONTENT */}
+
+
+ {data?.Forum_Posting.diskusi ? (
+
+ ) : (
+ ""
+ )}
-
+
Laporan yang diterima :
{list.map((x, i) => (
- {x}
+
+ {x}
+
))}
@@ -63,4 +138,4 @@ export function ComponentForum_UiDetailReportKomentar({
>
);
-}
\ No newline at end of file
+}
diff --git a/src/app_modules/forum/component/detail_component/ui_report_posting.tsx b/src/app_modules/forum/component/detail_component/ui_report_posting.tsx
index 345b670e..861426d8 100644
--- a/src/app_modules/forum/component/detail_component/ui_report_posting.tsx
+++ b/src/app_modules/forum/component/detail_component/ui_report_posting.tsx
@@ -1,20 +1,66 @@
"use client";
-import { Stack, Paper, Text, List, Box } from "@mantine/core";
-import { useState } from "react";
-import { MODEL_FORUM_POSTING } from "../../model/interface";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
+import { Comp_V3_SetInnerHTMLWithStiker } from "@/app_modules/_global/component/new/comp_V3_set_html_with_stiker";
+import { Box, List, Stack, Text } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { MODEL_FORUM_POSTING } from "../../model/interface";
+import { apiGetOneReportedPostingById } from "../api_fetch_forum";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export function ComponentForum_UiDetailReportPosting({
- dataPosting,
-}: {
- dataPosting: any;
-}) {
- const [data, setData] = useState(dataPosting.data);
- const [list, setList] = useState(dataPosting.list);
+export function ComponentForum_UiDetailReportPosting() {
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [list, setList] = useState([]);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetOneReportedPostingById({
+ id: params.id,
+ });
+
+ if (response.success) {
+ setData(response.data.data);
+ setList(response.data.list);
+ } else {
+ setData(null);
+ setList([]);
+ }
+ } catch (error) {
+ console.error("Error get data report posting", error);
+ setData(null);
+ setList([]);
+ }
+ }
+
+ useShallowEffect(() => {
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .chat-content img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ `;
+ document.head.appendChild(style);
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(style);
+ };
+ }, []);
+
+ if (!data || !list) {
+ return ;
+ }
return (
<>
@@ -33,15 +79,25 @@ export function ComponentForum_UiDetailReportPosting({
Pada postingan
-
-
-
+ {/* CONTENT */}
+
+
+ {data?.diskusi ? (
+
+ ) : (
+ ""
+ )}
-
+
diff --git a/src/app_modules/forum/component/forumku_component/forumku_header.tsx b/src/app_modules/forum/component/forumku_component/forumku_header.tsx
index 7a7711b5..e656b8c9 100644
--- a/src/app_modules/forum/component/forumku_component/forumku_header.tsx
+++ b/src/app_modules/forum/component/forumku_component/forumku_header.tsx
@@ -1,16 +1,13 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
-import { Avatar, Badge, Grid, Group, Loader, Stack, Text } from "@mantine/core";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
+import { Badge, Grid, Group, Stack, Text } from "@mantine/core";
import { IconCircle } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
-import { useState } from "react";
import { MODEL_FORUM_POSTING } from "../../model/interface";
import ComponentForum_ForumkuMoreButton from "./forumku_more_button";
-import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
-import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
export default function ComponentForum_ForumkuHeaderCard({
data,
@@ -52,7 +49,7 @@ export default function ComponentForum_ForumkuHeaderCard({
{data.Author.username
- ? data.Author.username
+ ? data.Author.Profile.name
: "Nama author "}
@@ -68,9 +65,7 @@ export default function ComponentForum_ForumkuHeaderCard({
: "red"
}
>
-
- {data?.ForumMaster_StatusPosting.status}
-
+ {data?.ForumMaster_StatusPosting.status}
diff --git a/src/app_modules/forum/component/forumku_component/forumku_more_button.tsx b/src/app_modules/forum/component/forumku_component/forumku_more_button.tsx
index eb769f65..4b546e97 100644
--- a/src/app_modules/forum/component/forumku_component/forumku_more_button.tsx
+++ b/src/app_modules/forum/component/forumku_component/forumku_more_button.tsx
@@ -1,7 +1,7 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
import {
ActionIcon,
Button,
@@ -26,16 +26,17 @@ import {
import { useRouter } from "next/navigation";
import { useState } from "react";
+import {
+ AccentColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import { clientLogger } from "@/util/clientLogger";
import mqtt_client from "@/util/mqtt_client";
import _ from "lodash";
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
import { forum_funEditStatusPostingById } from "../../fun/edit/fun_edit_status_posting_by_id";
import { MODEL_FORUM_POSTING } from "../../model/interface";
-import {
- AccentColor,
- MainColor,
-} from "@/app_modules/_global/color/color_pallet";
export default function ComponentForum_ForumkuMoreButton({
authorId,
@@ -177,6 +178,7 @@ export default function ComponentForum_ForumkuMoreButton({
border: `1px solid ${AccentColor.yellow}`,
}}
radius={"xl"}
+ c="black"
onClick={close}
>
Batal
@@ -254,11 +256,12 @@ function ButtonDelete({
const [loading, setLoading] = useState(false);
async function onDelete() {
- setOpenDel(false);
- await forum_funDeletePostingById(postingId as any).then(async (res) => {
- if (res.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(`Postingan Terhapus`, 2000);
- setLoading(true);
+ try {
+ setLoading(true);
+
+ const deleteData = await forum_funDeletePostingById(postingId as any);
+ if (deleteData.status === 200) {
+ setOpenDel(false);
const cloneData = _.clone(allData);
const hapusData = cloneData.filter((e) => e.id !== postingId);
@@ -271,10 +274,16 @@ function ButtonDelete({
data: hapusData,
})
);
+
+ ComponentGlobal_NotifikasiBerhasil(`Postingan Terhapus`, 2000);
} else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(deleteData.message);
}
- });
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error get data forum", error);
+ }
}
return (
<>
@@ -323,120 +332,131 @@ function ButtonStatus({
const [loading, setLoading] = useState(false);
async function onTutupForum() {
- setOpenStatus(false);
-
- const upateStatusClose = await forum_funEditStatusPostingById(
- postingId as any,
- 2
- );
- if (upateStatusClose.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(`Forum Ditutup`, 2000);
+ try {
setLoading(true);
-
- const cloneData = _.clone(allData);
- const loadData = cloneData.map(
- (e) => (
- e.id === postingId,
- {
- ...e,
- ForumMaster_StatusPosting: {
- id: e.id === postingId ? 2 : e.ForumMaster_StatusPosting.id,
- status:
- e.id === postingId
- ? "Close"
- : e.ForumMaster_StatusPosting.status,
- },
- }
- )
- );
- onLoadData(loadData);
-
- //
- mqtt_client.publish(
- "Forum_ganti_status",
- JSON.stringify({
- id: postingId,
- data: loadData,
- })
+ const upateStatusClose = await forum_funEditStatusPostingById(
+ postingId as any,
+ 2
);
- const findData = cloneData.find((val) => val.id === postingId);
- const updateDetail = {
- ...findData,
- ForumMaster_StatusPosting: {
- id: 2,
- status: "Close",
- },
- };
+ if (upateStatusClose.status === 200) {
+ setOpenStatus(false);
+ ComponentGlobal_NotifikasiBerhasil(`Forum Ditutup`, 2000);
- mqtt_client.publish(
- "Forum_detail_ganti_status",
- JSON.stringify({
- id: postingId,
- data: updateDetail.ForumMaster_StatusPosting,
- })
- );
- } else {
- ComponentGlobal_NotifikasiGagal(upateStatusClose.message);
+ const cloneData = _.clone(allData);
+ const loadData = cloneData.map(
+ (e) => (
+ e.id === postingId,
+ {
+ ...e,
+ ForumMaster_StatusPosting: {
+ id: e.id === postingId ? 2 : e.ForumMaster_StatusPosting.id,
+ status:
+ e.id === postingId
+ ? "Close"
+ : e.ForumMaster_StatusPosting.status,
+ },
+ }
+ )
+ );
+ onLoadData(loadData);
+
+ mqtt_client.publish(
+ "Forum_ganti_status",
+ JSON.stringify({
+ id: postingId,
+ data: loadData,
+ })
+ );
+
+ const findData = cloneData.find((val) => val.id === postingId);
+ const updateDetail = {
+ ...findData,
+ ForumMaster_StatusPosting: {
+ id: 2,
+ status: "Close",
+ },
+ };
+
+ mqtt_client.publish(
+ "Forum_detail_ganti_status",
+ JSON.stringify({
+ id: postingId,
+ data: updateDetail.ForumMaster_StatusPosting,
+ })
+ );
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(upateStatusClose.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error get data forum", error);
}
}
async function onBukaForum() {
- setOpenStatus(false);
-
- const updateStatusOpen = await forum_funEditStatusPostingById(
- postingId as any,
- 1
- );
- if (updateStatusOpen.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(`Forum Dibuka`, 2000);
+ try {
setLoading(true);
-
- const cloneData = _.clone(allData);
- const loadData = cloneData.map(
- (e) => (
- e.id === postingId,
- {
- ...e,
- ForumMaster_StatusPosting: {
- id: e.id === postingId ? 1 : e.ForumMaster_StatusPosting.id,
- status:
- e.id === postingId
- ? "Open"
- : e.ForumMaster_StatusPosting.status,
- },
- }
- )
+ const updateStatusOpen = await forum_funEditStatusPostingById(
+ postingId as any,
+ 1
);
- mqtt_client.publish(
- "Forum_ganti_status",
- JSON.stringify({
- id: postingId,
- data: loadData,
- })
- );
+ if (updateStatusOpen.status === 200) {
+ setOpenStatus(false);
+ ComponentGlobal_NotifikasiBerhasil(`Forum Dibuka`, 2000);
- onLoadData(loadData);
+ const cloneData = _.clone(allData);
+ const loadData = cloneData.map(
+ (e) => (
+ e.id === postingId,
+ {
+ ...e,
+ ForumMaster_StatusPosting: {
+ id: e.id === postingId ? 1 : e.ForumMaster_StatusPosting.id,
+ status:
+ e.id === postingId
+ ? "Open"
+ : e.ForumMaster_StatusPosting.status,
+ },
+ }
+ )
+ );
- const findData = cloneData.find((val) => val.id === postingId);
- const updateDetail = {
- ...findData,
- ForumMaster_StatusPosting: {
- id: 1,
- status: "Open",
- },
- };
+ mqtt_client.publish(
+ "Forum_ganti_status",
+ JSON.stringify({
+ id: postingId,
+ data: loadData,
+ })
+ );
- mqtt_client.publish(
- "Forum_detail_ganti_status",
- JSON.stringify({
- id: postingId,
- data: updateDetail.ForumMaster_StatusPosting,
- })
- );
- } else {
- ComponentGlobal_NotifikasiGagal(updateStatusOpen.message);
+ onLoadData(loadData);
+
+ const findData = cloneData.find((val) => val.id === postingId);
+ const updateDetail = {
+ ...findData,
+ ForumMaster_StatusPosting: {
+ id: 1,
+ status: "Open",
+ },
+ };
+
+ mqtt_client.publish(
+ "Forum_detail_ganti_status",
+ JSON.stringify({
+ id: postingId,
+ data: updateDetail.ForumMaster_StatusPosting,
+ })
+ );
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(updateStatusOpen.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error get data forum", error);
}
}
diff --git a/src/app_modules/forum/component/forumku_component/forumku_view.tsx b/src/app_modules/forum/component/forumku_component/forumku_view.tsx
index ddbdfa5d..3135ebe4 100644
--- a/src/app_modules/forum/component/forumku_component/forumku_view.tsx
+++ b/src/app_modules/forum/component/forumku_component/forumku_view.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
import {
ComponentGlobal_CardLoadingOverlay,
ComponentGlobal_CardStyles,
@@ -11,6 +11,9 @@ import { useRouter } from "next/navigation";
import { useState } from "react";
import { MODEL_FORUM_POSTING } from "../../model/interface";
import ComponentForum_ForumkuHeaderCard from "./forumku_header";
+import { Comp_V3_SetInnerHTMLWithStiker } from "@/app_modules/_global/component/new/comp_V3_set_html_with_stiker";
+import { useShallowEffect } from "@mantine/hooks";
+import { MainColor } from "@/app_modules/_global/color";
export default function ComponentForum_ForumkuMainCardView({
data,
@@ -26,6 +29,22 @@ export default function ComponentForum_ForumkuMainCardView({
const router = useRouter();
const [visable, setVisible] = useState(false);
+ useShallowEffect(() => {
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .chat-content img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ `;
+ document.head.appendChild(style);
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(style);
+ };
+ }, []);
+
return (
<>
@@ -39,15 +58,24 @@ export default function ComponentForum_ForumkuMainCardView({
/>
{
setVisible(true);
router.push(RouterForum.main_detail + data?.id);
}}
>
-
+
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
index 8720cce7..052db7f3 100644
--- a/src/app_modules/forum/component/header/detail_author_header_name.tsx
+++ b/src/app_modules/forum/component/header/detail_author_header_name.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
import {
Stack,
Grid,
@@ -15,7 +15,7 @@ import {
import { useRouter } from "next/navigation";
import moment from "moment";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
import {
IconCircleFilled,
IconDots,
diff --git a/src/app_modules/forum/component/komentar_component/komentar_author_header_name.tsx b/src/app_modules/forum/component/komentar_component/komentar_author_header_name.tsx
index daf86ea9..b3a9f3a9 100644
--- a/src/app_modules/forum/component/komentar_component/komentar_author_header_name.tsx
+++ b/src/app_modules/forum/component/komentar_component/komentar_author_header_name.tsx
@@ -1,7 +1,7 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
+import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import { Avatar, Divider, Grid, Group, Stack, Text } from "@mantine/core";
import { IconCircle } from "@tabler/icons-react";
@@ -12,6 +12,8 @@ import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { data } from "autoprefixer";
import { MODEL_PROFILE } from "@/app_modules/katalog/profile/model/interface";
+import moment from "moment";
+import { MODEL_FORUM_KOMENTAR } from "../../model/interface";
export default function ComponentForum_KomentarAuthorNameOnHeader({
userId,
@@ -23,6 +25,7 @@ export default function ComponentForum_KomentarAuthorNameOnHeader({
postingId,
userLoginId,
profile,
+ listKomentar,
}: {
userId?: string;
komentarId?: string;
@@ -33,6 +36,7 @@ export default function ComponentForum_KomentarAuthorNameOnHeader({
postingId?: string;
userLoginId: string;
profile: MODEL_PROFILE;
+ listKomentar?: MODEL_FORUM_KOMENTAR[];
}) {
const router = useRouter();
const [isLoading, setIsLoading] = useState(false);
@@ -84,10 +88,11 @@ export default function ComponentForum_KomentarAuthorNameOnHeader({
{tglPublish
- ? tglPublish.toLocaleDateString(["id-ID"], {
+ ? new Intl.DateTimeFormat("id-ID", {
day: "numeric",
month: "short",
- })
+ year: "numeric",
+ }).format(new Date(tglPublish))
: new Date().toLocaleDateString(["id-ID"], {
day: "numeric",
month: "short",
@@ -105,9 +110,10 @@ export default function ComponentForum_KomentarAuthorNameOnHeader({
) : (
diff --git a/src/app_modules/forum/component/komentar_component/komentar_button_more.tsx b/src/app_modules/forum/component/komentar_component/komentar_button_more.tsx
index 40de0bae..0c44c3ac 100644
--- a/src/app_modules/forum/component/komentar_component/komentar_button_more.tsx
+++ b/src/app_modules/forum/component/komentar_component/komentar_button_more.tsx
@@ -1,7 +1,7 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
import {
ActionIcon,
Button,
@@ -23,10 +23,11 @@ import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import _ from "lodash";
import { forum_funDeleteKomentarById } from "../../fun/delete/fun_delete_komentar_by_id";
-import { forum_funGetAllKomentarById } from "../../fun/get/get_all_komentar_by_id";
+import { MODEL_FORUM_KOMENTAR } from "../../model/interface";
export default function ComponentForum_KomentarButtonMore({
userId,
@@ -34,12 +35,14 @@ export default function ComponentForum_KomentarButtonMore({
setKomentar,
postingId,
userLoginId,
+ listKomentar,
}: {
userId: any;
komentarId: any;
setKomentar?: any;
postingId?: string;
userLoginId: string;
+ listKomentar?: MODEL_FORUM_KOMENTAR[];
}) {
const router = useRouter();
const [opened, { open, close }] = useDisclosure(false);
@@ -124,9 +127,10 @@ export default function ComponentForum_KomentarButtonMore({
border: `1px solid ${AccentColor.yellow}`,
}}
radius={"xl"}
+ c="black"
onClick={close}
>
- Batal
+ Batal
@@ -150,6 +154,7 @@ export default function ComponentForum_KomentarButtonMore({
setOpenDel={setOpenDel}
setKomentar={setKomentar}
postingId={postingId}
+ listKomentar={listKomentar}
/>
@@ -165,29 +170,39 @@ function ButtonDelete({
setOpenDel,
setKomentar,
postingId,
+ listKomentar,
}: {
komentarId?: string;
setOpenDel: any;
setKomentar?: any;
postingId?: string;
+ listKomentar?: MODEL_FORUM_KOMENTAR[];
}) {
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_funGetAllKomentarById(postingId as any).then((val) => {
- setKomentar(val);
+ try {
+ setLoading(true);
+ await forum_funDeleteKomentarById(komentarId as any).then(async (res) => {
+ if (res.status === 200) {
+ const cloneList = _.clone(listKomentar);
+ const filterData = cloneList?.filter(
+ (item) => item.id !== komentarId
+ );
+
+ setKomentar({ filterComment: filterData, triggerCount: true });
+
setOpenDel(false);
- setLoading(true);
ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
- });
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
+ } else {
+ ComponentGlobal_NotifikasiPeringatan(res.message);
+ }
+ });
+ } catch (error) {
+ ComponentGlobal_NotifikasiGagal("Gagal menghapus data");
+ } finally {
+ setLoading(false);
+ }
}
return (
<>
@@ -201,7 +216,7 @@ function ButtonDelete({
{
@@ -211,6 +226,7 @@ function ButtonDelete({
Hapus
+ {/* {JSON.stringify(listKomentar, null, 2)} */}
>
);
diff --git a/src/app_modules/forum/component/loading_drawer.tsx b/src/app_modules/forum/component/loading_drawer.tsx
deleted file mode 100644
index 3a1a53ac..00000000
--- a/src/app_modules/forum/component/loading_drawer.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-"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_component/card_header.tsx b/src/app_modules/forum/component/main_component/card_header.tsx
index 75839f59..3e82ded5 100644
--- a/src/app_modules/forum/component/main_component/card_header.tsx
+++ b/src/app_modules/forum/component/main_component/card_header.tsx
@@ -1,7 +1,7 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
+import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import { Avatar, Badge, Grid, Group, Loader, Stack, Text } from "@mantine/core";
import { IconCircle } from "@tabler/icons-react";
diff --git a/src/app_modules/forum/component/main_component/card_more_button.tsx b/src/app_modules/forum/component/main_component/card_more_button.tsx
index 7e68eb5e..9384bdf6 100644
--- a/src/app_modules/forum/component/main_component/card_more_button.tsx
+++ b/src/app_modules/forum/component/main_component/card_more_button.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import {
ActionIcon,
@@ -37,6 +37,7 @@ import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
+import { clientLogger } from "@/util/clientLogger";
export default function ComponentForum_BerandaMoreButton({
authorId,
@@ -179,7 +180,7 @@ export default function ComponentForum_BerandaMoreButton({
radius={"xl"}
onClick={close}
>
- Batal
+ Batal
@@ -255,11 +256,11 @@ function ButtonDelete({
const [loading, setLoading] = useState(false);
async function onDelete() {
- setOpenDel(false);
- await forum_funDeletePostingById(postingId as any).then(async (res) => {
- if (res.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(`Postingan Terhapus`, 2000);
- setLoading(true);
+ try {
+ setLoading(true);
+ const deleteData = await forum_funDeletePostingById(postingId as any);
+ if (deleteData.status === 200) {
+ setOpenDel(false);
const cloneData = _.clone(allData);
const hapusData = cloneData.filter((e) => e.id !== postingId);
@@ -272,10 +273,16 @@ function ButtonDelete({
data: hapusData,
})
);
+
+ ComponentGlobal_NotifikasiBerhasil(`Postingan Terhapus`, 2000);
} else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(deleteData.message);
}
- });
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error get data forum", error);
+ }
}
return (
<>
@@ -324,120 +331,132 @@ function ButtonStatus({
const [loading, setLoading] = useState(false);
async function onTutupForum() {
- setOpenStatus(false);
-
- const upateStatusClose = await forum_funEditStatusPostingById(
- postingId as any,
- 2
- );
- if (upateStatusClose.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(`Forum Ditutup`, 2000);
+ try {
setLoading(true);
-
- const cloneData = _.clone(allData);
- const loadData = cloneData.map(
- (e) => (
- e.id === postingId,
- {
- ...e,
- ForumMaster_StatusPosting: {
- id: e.id === postingId ? 2 : e.ForumMaster_StatusPosting.id,
- status:
- e.id === postingId
- ? "Close"
- : e.ForumMaster_StatusPosting.status,
- },
- }
- )
- );
- onLoadData(loadData);
-
- //
- mqtt_client.publish(
- "Forum_ganti_status",
- JSON.stringify({
- id: postingId,
- data: loadData,
- })
+ const upateStatusClose = await forum_funEditStatusPostingById(
+ postingId as any,
+ 2
);
- const findData = cloneData.find((val) => val.id === postingId);
- const updateDetail = {
- ...findData,
- ForumMaster_StatusPosting: {
- id: 2,
- status: "Close",
- },
- };
+ if (upateStatusClose.status === 200) {
+ setOpenStatus(false);
+ ComponentGlobal_NotifikasiBerhasil(`Forum Ditutup`, 2000);
- mqtt_client.publish(
- "Forum_detail_ganti_status",
- JSON.stringify({
- id: postingId,
- data: updateDetail.ForumMaster_StatusPosting,
- })
- );
- } else {
- ComponentGlobal_NotifikasiGagal(upateStatusClose.message);
+ const cloneData = _.clone(allData);
+ const loadData = cloneData.map(
+ (e) => (
+ e.id === postingId,
+ {
+ ...e,
+ ForumMaster_StatusPosting: {
+ id: e.id === postingId ? 2 : e.ForumMaster_StatusPosting.id,
+ status:
+ e.id === postingId
+ ? "Close"
+ : e.ForumMaster_StatusPosting.status,
+ },
+ }
+ )
+ );
+ onLoadData(loadData);
+
+ //
+ mqtt_client.publish(
+ "Forum_ganti_status",
+ JSON.stringify({
+ id: postingId,
+ data: loadData,
+ })
+ );
+
+ const findData = cloneData.find((val) => val.id === postingId);
+ const updateDetail = {
+ ...findData,
+ ForumMaster_StatusPosting: {
+ id: 2,
+ status: "Close",
+ },
+ };
+
+ mqtt_client.publish(
+ "Forum_detail_ganti_status",
+ JSON.stringify({
+ id: postingId,
+ data: updateDetail.ForumMaster_StatusPosting,
+ })
+ );
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(upateStatusClose.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error get data forum", error);
}
}
async function onBukaForum() {
- setOpenStatus(false);
-
- const updateStatusOpen = await forum_funEditStatusPostingById(
- postingId as any,
- 1
- );
- if (updateStatusOpen.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(`Forum Dibuka`, 2000);
+ try {
setLoading(true);
-
- const cloneData = _.clone(allData);
- const loadData = cloneData.map(
- (e) => (
- e.id === postingId,
- {
- ...e,
- ForumMaster_StatusPosting: {
- id: e.id === postingId ? 1 : e.ForumMaster_StatusPosting.id,
- status:
- e.id === postingId
- ? "Open"
- : e.ForumMaster_StatusPosting.status,
- },
- }
- )
+ const updateStatusOpen = await forum_funEditStatusPostingById(
+ postingId as any,
+ 1
);
- mqtt_client.publish(
- "Forum_ganti_status",
- JSON.stringify({
- id: postingId,
- data: loadData,
- })
- );
+ if (updateStatusOpen.status === 200) {
+ setOpenStatus(false);
+ ComponentGlobal_NotifikasiBerhasil(`Forum Dibuka`, 2000);
- onLoadData(loadData);
+ const cloneData = _.clone(allData);
+ const loadData = cloneData.map(
+ (e) => (
+ e.id === postingId,
+ {
+ ...e,
+ ForumMaster_StatusPosting: {
+ id: e.id === postingId ? 1 : e.ForumMaster_StatusPosting.id,
+ status:
+ e.id === postingId
+ ? "Open"
+ : e.ForumMaster_StatusPosting.status,
+ },
+ }
+ )
+ );
- const findData = cloneData.find((val) => val.id === postingId);
- const updateDetail = {
- ...findData,
- ForumMaster_StatusPosting: {
- id: 1,
- status: "Open",
- },
- };
+ mqtt_client.publish(
+ "Forum_ganti_status",
+ JSON.stringify({
+ id: postingId,
+ data: loadData,
+ })
+ );
- mqtt_client.publish(
- "Forum_detail_ganti_status",
- JSON.stringify({
- id: postingId,
- data: updateDetail.ForumMaster_StatusPosting,
- })
- );
- } else {
- ComponentGlobal_NotifikasiGagal(updateStatusOpen.message);
+ onLoadData(loadData);
+
+ const findData = cloneData.find((val) => val.id === postingId);
+ const updateDetail = {
+ ...findData,
+ ForumMaster_StatusPosting: {
+ id: 1,
+ status: "Open",
+ },
+ };
+
+ mqtt_client.publish(
+ "Forum_detail_ganti_status",
+ JSON.stringify({
+ id: postingId,
+ data: updateDetail.ForumMaster_StatusPosting,
+ })
+ );
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(updateStatusOpen.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error get data forum", error);
}
}
@@ -461,7 +480,7 @@ function ButtonStatus({
{statusId === 1 ? (
{
@@ -473,7 +492,7 @@ function ButtonStatus({
) : (
{
diff --git a/src/app_modules/forum/component/main_component/card_view.tsx b/src/app_modules/forum/component/main_component/card_view.tsx
index 200f3ee9..15355e60 100644
--- a/src/app_modules/forum/component/main_component/card_view.tsx
+++ b/src/app_modules/forum/component/main_component/card_view.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
import {
ComponentGlobal_CardLoadingOverlay,
ComponentGlobal_CardStyles,
@@ -11,6 +11,9 @@ import { useRouter } from "next/navigation";
import { useState } from "react";
import { MODEL_FORUM_POSTING } from "../../model/interface";
import ComponentForum_BerandaHeaderCard from "./card_header";
+import { Comp_V3_SetInnerHTMLWithStiker } from "@/app_modules/_global/component/new/comp_V3_set_html_with_stiker";
+import { useShallowEffect } from "@mantine/hooks";
+import { MainColor } from "@/app_modules/_global/color";
export default function ComponentForum_BerandaCardView({
data,
@@ -26,6 +29,22 @@ export default function ComponentForum_BerandaCardView({
const router = useRouter();
const [visible, setVisible] = useState(false);
+ useShallowEffect(() => {
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .chat-content img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ `;
+ document.head.appendChild(style);
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(style);
+ };
+ }, []);
+
return (
<>
@@ -40,13 +59,23 @@ export default function ComponentForum_BerandaCardView({
{
setVisible(true), router.push(RouterForum.main_detail + data?.id);
}}
>
-
-
+
+
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
index daec6d8d..61c24cc4 100644
--- a/src/app_modules/forum/component/more_button/detail_more_button.tsx
+++ b/src/app_modules/forum/component/more_button/detail_more_button.tsx
@@ -1,7 +1,7 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
import {
ActionIcon,
Button,
@@ -24,8 +24,6 @@ import {
} from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
-
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { IconSquareCheck } from "@tabler/icons-react";
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
@@ -51,8 +49,6 @@ export default function ComponentForum_DetailMoreButton({
const [loadingEdit, setLoadingEdit] = useState(false);
const [loadingReport, setLoadingReport] = useState(false);
- // if (loadingEdit) return ;
-
return (
<>
;
-
async function onDelete() {
setOpenDel(false);
await forum_funDeletePostingById(postingId as any).then((res) => {
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
index f56e51be..da16be3f 100644
--- a/src/app_modules/forum/component/more_button/posting_button_more.tsx
+++ b/src/app_modules/forum/component/more_button/posting_button_more.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import {
ActionIcon,
diff --git a/src/app_modules/forum/component/other_component.tsx b/src/app_modules/forum/component/other_component.tsx
new file mode 100644
index 00000000..8db009f6
--- /dev/null
+++ b/src/app_modules/forum/component/other_component.tsx
@@ -0,0 +1,19 @@
+import { Stack, Text } from "@mantine/core";
+import { IconSearchOff } from "@tabler/icons-react";
+
+export { Forum_ComponentIsDataEmpty };
+
+function Forum_ComponentIsDataEmpty() {
+ return (
+ <>
+
+
+
+
+ Tidak ada data
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/component/skeleton_view.tsx b/src/app_modules/forum/component/skeleton_view.tsx
new file mode 100644
index 00000000..67b6c18e
--- /dev/null
+++ b/src/app_modules/forum/component/skeleton_view.tsx
@@ -0,0 +1,73 @@
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Center, Grid, Group, Stack } from "@mantine/core";
+
+export {
+ Forum_SkeletonCard,
+ Forum_SkeletonForumku,
+ Forum_SkeletonKomentar,
+ Forum_SkeletonListKomentar,
+};
+
+function Forum_SkeletonCard() {
+ return (
+ <>
+
+
+
+
+ >
+ );
+}
+
+function Forum_SkeletonForumku() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+function Forum_SkeletonKomentar() {
+ return (
+ <>
+
+
+
+
+
+
+
+ >
+ );
+}
+
+function Forum_SkeletonListKomentar() {
+ return (
+ <>
+
+ {Array.from(new Array(2)).map((e, i) => (
+
+ ))}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/create/V3_create.tsx b/src/app_modules/forum/create/V3_create.tsx
new file mode 100644
index 00000000..8b8aa31f
--- /dev/null
+++ b/src/app_modules/forum/create/V3_create.tsx
@@ -0,0 +1,144 @@
+"use client";
+
+import { ComponentGlobal_InputCountDown } from "@/app_modules/_global/component";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+import { apiGetUserById } from "@/app_modules/_global/lib/api_user";
+import { ISticker } from "@/app_modules/_global/lib/interface/stiker";
+import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
+import { apiGetStickerForUser } from "@/app_modules/_global/lib/stiker/api_fecth_stiker_for_user";
+import { Component_V3_TextEditorWithSticker } from "@/app_modules/_global/lib/stiker/comp_V3_text_editor_stiker";
+import { Comp_ButtonSticker } from "@/app_modules/_global/lib/stiker/comp_button_sticker";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Group, Stack } from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import React, { useState } from "react";
+import Forum_ButtonCreatePosting from "../component/button/button_create_posting";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+
+export function Forum_V3_Create() {
+ const [editorContent, setEditorContent] = useState("");
+ const [opened, { open, close }] = useDisclosure(false);
+ const quillRef = React.useRef(null);
+ const [quillLoaded, setQuillLoaded] = useState(false);
+ const [isReady, setIsReady] = useState(false);
+ const [sticker, setSticker] = useState(null);
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ const responseDataProfile = await apiGetUserById({
+ id: response.userId,
+ });
+
+ if (responseDataProfile.success) {
+ try {
+ const response = await apiGetStickerForUser({
+ gender: responseDataProfile?.data?.Profile?.jenisKelamin,
+ });
+ if (response.success) {
+ setSticker(response.res.data);
+ } else {
+ console.error("Failed to get sticker", response.message);
+ setSticker([]);
+ }
+ } catch (error) {
+ console.error("Error get sticker", error);
+ setSticker([]);
+ }
+ } else {
+ console.error("Failed to get profile", responseDataProfile.message);
+ setSticker(null);
+ }
+ } else {
+ setUserLoginId(null);
+ }
+ } catch (error) {
+ console.error("Error get profile", error);
+ setSticker(null);
+ }
+ }
+
+ useShallowEffect(() => {
+ setIsReady(true); // Set ready on client-side mount
+ }, []);
+
+ useShallowEffect(() => {
+ setQuillLoaded(true); // Set ready on client-side mount
+ }, []);
+
+ useShallowEffect(() => {
+ // Add Quill CSS via tag
+ const link = document.createElement("link");
+ link.href = "https://cdn.quilljs.com/1.3.6/quill.snow.css";
+ link.rel = "stylesheet";
+ document.head.appendChild(link);
+
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .ql-editor img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ // .chat-content img {
+ // max-width: 70px !important;
+ // max-height: 70px !important;
+ // }
+ `;
+ document.head.appendChild(style);
+
+ setQuillLoaded(true);
+
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(link);
+ document.head.removeChild(style);
+ };
+ }, []);
+
+
+
+ return (
+ <>
+ {isReady && userLoginId ? (
+
+ {quillLoaded && (
+
+ )}
+
+
+
+
+
+
+
+
+
+
+
+ ) : (
+
+ )}
+ >
+ );
+}
diff --git a/src/app_modules/forum/create/index.tsx b/src/app_modules/forum/create/index.tsx
index c63a11d3..0266451a 100644
--- a/src/app_modules/forum/create/index.tsx
+++ b/src/app_modules/forum/create/index.tsx
@@ -1,23 +1,7 @@
"use client";
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-import {
- Button,
- Group,
- Paper,
- Stack
-} from "@mantine/core";
-import { useShallowEffect } from "@mantine/hooks";
-import { useRouter } from "next/navigation";
-import "react-quill/dist/quill.bubble.css";
+// import "react-quill/dist/quill.bubble.css";
import "react-quill/dist/quill.snow.css";
-
-import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
-import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import dynamic from "next/dynamic";
-import { useState } from "react";
-import { forum_funCreate } from "../fun/create/fun_create";
const ReactQuill = dynamic(
() => {
return import("react-quill");
@@ -25,61 +9,151 @@ const ReactQuill = dynamic(
{ ssr: false }
);
-import {
- AccentColor,
- MainColor,
-} from "@/app_modules/_global/color/color_pallet";
+import { Button, Group, Paper, ScrollArea, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useRouter } from "next/navigation";
+import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import dynamic from "next/dynamic";
+import { useState } from "react";
+import { forum_funCreate } from "../fun/create/fun_create";
+
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import mqtt_client from "@/util/mqtt_client";
+const maxLength = 100;
export default function Forum_Create() {
- const [value, setValue] = useState("");
- const [totalLength, setTotalLength] = useState(0);
+ const [data, setData] = useState("");
+ const [lengthData, setLengthData] = useState(0);
const [reload, setReload] = useState(false);
useShallowEffect(() => {
if (window && window.document) setReload(true);
}, []);
- if (!reload)
- return (
- <>
-
- >
- );
+ // if (!reload) return ;
return (
<>
+ {/* {
+ const longLength = input.replace(/<[^>]+>/g, "").trim(); // Remove HTML tags and trim whitespace
+ if (longLength.length === 0) {
+ setData(""); // Set value to an empty string
+ return;
+ }
+
+ setData(input);
+ setLengthData(longLength.length);
+ }}
+ modules={{
+ toolbar: [
+ [{ header: [1, 2, 3, 4, 5, 6, false] }],
+ ["bold", "italic", "underline", "link"],
+ // [{ align: [] }],
+ [{ list: "ordered" }, { list: "bullet" }],
+ ["clean"],
+ ],
+ }}
+ /> */}
+
+
+
+ {!reload ? (
+
+ ) : (
+ {
+ const text = input.replace(/<[^>]+>/g, "").trim(); // Remove HTML tags and trim whitespace
+ if(text.length > 100){
+
+
+ }
+
+
+ setData(input);
+ setLengthData(text.length);
+ }}
+ />
+ )}
+
+
+
+
+
+ {/*
{
- setValue(val);
+ const input = val;
+ const text = input.replace(/<[^>]+>/g, "").trim(); // Remove HTML tags and trim whitespace
+ if (text.length === 0) {
+ setData(""); // Set value to an empty string
+ return;
+ }
+ setData(val);
}}
/>
+
-
+
-
+ */}
>
);
}
-function ButtonAction({ value }: { value: string }) {
+function ButtonAction({
+ value,
+ lengthData,
+}: {
+ value: string;
+ lengthData: number;
+}) {
const router = useRouter();
const [loading, setLoading] = useState(false);
async function onCreate() {
- if (value.length > 500) {
+ if (value.length >= maxLength) {
return null;
}
@@ -87,7 +161,7 @@ function ButtonAction({ value }: { value: string }) {
if (create.status === 201) {
setLoading(true);
ComponentGlobal_NotifikasiBerhasil(create.message);
- setTimeout(() => router.back(), 1000);
+ setTimeout(() => router.back(), 200);
mqtt_client.publish(
"Forum_create_new",
@@ -101,20 +175,16 @@ function ButtonAction({ value }: { value: string }) {
<>
" || value === "" || value.length > 500
- ? ""
- : `1px solid ${AccentColor.yellow}`,
+ transition: "all 0.5s",
}}
bg={MainColor.yellow}
+ color={"yellow"}
+ c="black"
disabled={
- value === "
" || value === "" || value.length > 500
- ? true
- : false
+ value === "
" || value === "" || lengthData >= maxLength
}
radius={"xl"}
- loading={loading ? true : false}
+ loading={loading}
loaderPosition="center"
onClick={() => onCreate()}
>
diff --git a/src/app_modules/forum/create/new_create.tsx b/src/app_modules/forum/create/new_create.tsx
new file mode 100644
index 00000000..cc1fb7a6
--- /dev/null
+++ b/src/app_modules/forum/create/new_create.tsx
@@ -0,0 +1,88 @@
+"use client";
+
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import mqtt_client from "@/util/mqtt_client";
+import { Button, Group, Stack } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import "react-quill/dist/quill.snow.css";
+import { forum_funCreate } from "../fun/create/fun_create";
+
+export default function Forum_NewCreate() {
+ const [data, setData] = useState("");
+ const [lengthData, setLengthData] = useState(0);
+
+ return (
+
+ {/* {
+ setData(val);
+ }}
+ onSetLengthData={(val) => {
+ setLengthData(val);
+ }}
+ /> */}
+
+
+
+
+
+
+ );
+}
+
+interface ButtonActionProps {
+ value: string;
+ lengthData: number;
+}
+
+function ButtonAction({ value, lengthData }: ButtonActionProps) {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ async function onCreate() {
+ try {
+ setLoading(true);
+ const create = await forum_funCreate(value);
+ if (create.status === 201) {
+ ComponentGlobal_NotifikasiBerhasil(create.message);
+ router.back();
+
+ mqtt_client.publish(
+ "Forum_create_new",
+ JSON.stringify({ isNewPost: true, count: 1 })
+ );
+ } else {
+ ComponentGlobal_NotifikasiGagal(create.message);
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ return (
+ maxInputLength}
+ radius="xl"
+ loading={loading}
+ loaderPosition="center"
+ onClick={onCreate}
+ >
+ Posting
+
+ );
+}
diff --git a/src/app_modules/forum/detail/detail_report_komentar.tsx b/src/app_modules/forum/detail/detail_report_komentar.tsx
index 9228a894..c5cadc2c 100644
--- a/src/app_modules/forum/detail/detail_report_komentar.tsx
+++ b/src/app_modules/forum/detail/detail_report_komentar.tsx
@@ -2,21 +2,14 @@ import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_ta
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import { ComponentForum_UiDetailReportKomentar } from "../component/detail_component/ui_report_komentar";
-
-export default function Forum_DetailReportKomentar({
- dataKomentar,
-}: {
- dataKomentar: any;
-}) {
+export default function Forum_DetailReportKomentar() {
return (
<>
}
>
- {}
+
>
);
}
-
-
diff --git a/src/app_modules/forum/detail/detail_report_posting.tsx b/src/app_modules/forum/detail/detail_report_posting.tsx
index ccbe8cfa..820939b1 100644
--- a/src/app_modules/forum/detail/detail_report_posting.tsx
+++ b/src/app_modules/forum/detail/detail_report_posting.tsx
@@ -1,19 +1,14 @@
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import { Stack, Text } from "@mantine/core";
import { ComponentForum_UiDetailReportPosting } from "../component/detail_component/ui_report_posting";
-export default function Forum_DetailReportPosting({
- dataPosting,
-}: {
- dataPosting: any;
-}) {
+export default function Forum_DetailReportPosting() {
return (
<>
}
>
-
+
>
);
diff --git a/src/app_modules/forum/detail/layout.tsx b/src/app_modules/forum/detail/layout.tsx
index f563082f..c0aa6fbb 100644
--- a/src/app_modules/forum/detail/layout.tsx
+++ b/src/app_modules/forum/detail/layout.tsx
@@ -1,10 +1,11 @@
"use client";
-import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import { useRouter } from "next/navigation";
-import React, { useState } from "react";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import React from "react";
export const dynamic = "force-dynamic";
export default function LayoutForum_Detail({
@@ -12,20 +13,14 @@ export default function LayoutForum_Detail({
}: {
children: React.ReactNode;
}) {
- const router = useRouter();
- const [loading, setLoading] = useState(false);
-
- if (loading) return ;
-
return (
<>
-
- }
- >
- {children}
-
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/forum/detail/main_detail.tsx b/src/app_modules/forum/detail/main_detail.tsx
deleted file mode 100644
index 2ee67ed4..00000000
--- a/src/app_modules/forum/detail/main_detail.tsx
+++ /dev/null
@@ -1,124 +0,0 @@
-"use client";
-
-import { Box, Center, Loader, Stack, TextInput } from "@mantine/core";
-import _ from "lodash";
-import { MODEL_FORUM_KOMENTAR, MODEL_FORUM_POSTING } from "../model/interface";
-import mqtt_client from "@/util/mqtt_client";
-import { useShallowEffect } from "@mantine/hooks";
-import { useState } from "react";
-import "react-quill/dist/quill.bubble.css";
-import ComponentForum_DetailCreateKomentar from "../component/detail_component/detail_create_komentar";
-import ComponentForum_KomentarView from "../component/detail_component/detail_list_komentar";
-import ComponentForum_DetailForumView from "../component/detail_component/detail_view";
-import { ScrollOnly } from "next-scroll-loader";
-import { forum_funGetAllKomentarById } from "../fun/get/get_all_komentar_by_id";
-
-export default function Forum_MainDetail({
- dataPosting,
- listKomentar,
- userLoginId,
- countKomentar,
-}: {
- dataPosting: MODEL_FORUM_POSTING;
- listKomentar: MODEL_FORUM_KOMENTAR[];
- userLoginId: string;
- countKomentar: number;
-}) {
- const [data, setData] = useState(dataPosting);
- const [lsKomentar, setLsKomentar] = useState(listKomentar);
- const [activePage, setActivePage] = useState(1);
-
- // useShallowEffect(() => {
- // onLoadKomentar({
- // onLoad(val) {
- // setKomentar(val);
- // },
- // });
- // }, [setKomentar]);
-
- // async function onLoadKomentar({ onLoad }: { onLoad: (val: any) => void }) {
- // const loadKomentar = await forum_getKomentarById(data.id);
- // onLoad(loadKomentar);
- // }
-
- useShallowEffect(() => {
- mqtt_client.subscribe("Forum_detail_ganti_status");
-
- mqtt_client.on("message", (topic: any, message: any) => {
- const newData = JSON.parse(message.toString());
- if (newData.id === data.id) {
- const cloneData = _.clone(data);
-
- // console.log(newData.data);
- const updateData = {
- ...cloneData,
- ForumMaster_StatusPosting: {
- id: newData.data.id,
- status: newData.data.status,
- },
- };
-
- setData(updateData as any);
- }
- });
- }, [data]);
-
- return (
- <>
-
- {
- setData(val);
- }}
- />
-
- {(data?.ForumMaster_StatusPosting?.id as any) === 1 ? (
- {
- setLsKomentar(val);
- }}
- data={data}
- userLoginId={userLoginId}
- />
- ) : (
- ""
- )}
-
-
- (
-
-
-
- )}
- data={lsKomentar}
- setData={setLsKomentar}
- moreData={async () => {
- const loadData = await forum_funGetAllKomentarById({
- postingId: data.id,
- page: activePage + 1,
- });
- setActivePage((val) => val + 1);
-
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
-
-
- >
- );
-}
diff --git a/src/app_modules/forum/detail/v3_main_detail.tsx b/src/app_modules/forum/detail/v3_main_detail.tsx
new file mode 100644
index 00000000..1288e7c0
--- /dev/null
+++ b/src/app_modules/forum/detail/v3_main_detail.tsx
@@ -0,0 +1,268 @@
+"use client";
+
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { apiGetUserById } from "@/app_modules/_global/lib/api_user";
+import { ISticker } from "@/app_modules/_global/lib/interface/stiker";
+import { apiGetStickerForUser } from "@/app_modules/_global/lib/stiker/api_fecth_stiker_for_user";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
+import mqtt_client from "@/util/mqtt_client";
+import { Box, Center, Loader, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import "react-quill/dist/quill.bubble.css";
+import {
+ apiGetKomentarForumById,
+ apiGetOneForumById,
+} from "../component/api_fetch_forum";
+import Forum_V3_CreateKomentar from "../component/detail_component/comp_V3_create.comment";
+import ComponentForum_KomentarView from "../component/detail_component/detail_list_komentar";
+import ComponentForum_DetailForumView from "../component/detail_component/detail_view";
+import {
+ Forum_SkeletonKomentar,
+ Forum_SkeletonListKomentar,
+} from "../component/skeleton_view";
+import { MODEL_FORUM_KOMENTAR, MODEL_FORUM_POSTING } from "../model/interface";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+
+export default function Forum_V3_MainDetail() {
+ const param = useParams<{ id: string }>();
+ const [dataPosting, setDataPosting] = useState(
+ null
+ );
+ const [countNewComment, setCountNewComment] = useState(false);
+ const [listKomentar, setListKomentar] = useState<
+ MODEL_FORUM_KOMENTAR[] | null
+ >(null);
+ const [activePage, setActivePage] = useState(1);
+ const [isLoading, setIsLoading] = useState(false);
+ const [sticker, setSticker] = useState(null);
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadDataSticker();
+ }, []);
+
+ async function onLoadDataSticker() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ const responseDataProfile = await apiGetUserById({
+ id: response.userId,
+ });
+
+ if (responseDataProfile.success) {
+ try {
+ const response = await apiGetStickerForUser({
+ gender: responseDataProfile?.data?.Profile?.jenisKelamin,
+ });
+ if (response.success) {
+ setSticker(response.res.data);
+ } else {
+ setSticker([]);
+ }
+ } catch (error) {
+ setSticker([]);
+ }
+ } else {
+ console.error("Failed to get profile", responseDataProfile.message);
+ setSticker(null);
+ }
+ } else {
+ setUserLoginId(null);
+ }
+
+ } catch (error) {
+ console.error("Error get profile", error);
+ setSticker(null);
+ }
+ }
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ setIsLoading(true);
+ const response = await apiGetOneForumById({
+ id: param.id,
+ });
+
+ if (response) {
+ setDataPosting(response.data);
+ } else {
+ setDataPosting(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data forum", error);
+ setDataPosting(null);
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ useShallowEffect(() => {
+ handleLoadDataKomentar();
+ }, []);
+
+ const handleLoadDataKomentar = async () => {
+ try {
+ const response = await apiGetKomentarForumById({
+ id: param.id,
+ page: `${activePage}`,
+ });
+
+ if (response.success) {
+ setListKomentar(response.data);
+ } else {
+ setListKomentar([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data komentar forum", error);
+ setListKomentar([]);
+ }
+ };
+
+ const handleMoreDataKomentar = async (
+ currentKomentarList: MODEL_FORUM_KOMENTAR[]
+ ): Promise => {
+ try {
+ const nextPage = activePage + 1;
+ const response = await apiGetKomentarForumById({
+ id: param.id,
+ page: `${nextPage}`,
+ });
+
+ if (response.success) {
+ setActivePage(nextPage);
+ const filteredData = response.data.filter(
+ (itemBaru: MODEL_FORUM_KOMENTAR) =>
+ !currentKomentarList.some(
+ (itemLama: MODEL_FORUM_KOMENTAR) => itemLama.id === itemBaru.id
+ )
+ );
+
+ return filteredData;
+ } else {
+ return [];
+ }
+ } catch (error) {
+ clientLogger.error("Error get data komentar forum", error);
+ return [];
+ }
+ };
+
+ async function handlerCountComment({
+ count,
+ trigger,
+ }: {
+ count: number;
+ trigger: boolean;
+ }) {
+ if (trigger && dataPosting) {
+ const cloneData = _.clone(dataPosting);
+ const newCount = count - 1;
+ cloneData.count = newCount;
+ setDataPosting(cloneData);
+ setCountNewComment(false);
+ }
+ }
+
+ useShallowEffect(() => {
+ mqtt_client.subscribe("Forum_detail_ganti_status");
+
+ mqtt_client.on("message", (topic: any, message: any) => {
+ const newData = JSON.parse(message.toString());
+ if (newData.id === dataPosting?.id) {
+ const cloneData = _.clone(dataPosting);
+
+ // console.log(newData.data);
+ const updateData = {
+ ...cloneData,
+ ForumMaster_StatusPosting: {
+ id: newData.data.id,
+ status: newData.data.status,
+ },
+ };
+
+ setDataPosting(updateData as any);
+ }
+ });
+ }, [dataPosting]);
+
+ return (
+ <>
+
+ {!dataPosting || isLoading || !userLoginId ? (
+
+ ) : (
+ {
+ setDataPosting(val);
+ }}
+ />
+ )}
+
+ {!dataPosting || isLoading || !userLoginId ? (
+
+ ) : (
+ (dataPosting?.ForumMaster_StatusPosting?.id as any) === 1 && (
+ {
+ setListKomentar((prev: any) => [val, ...prev]);
+ }}
+ dataSticker={sticker}
+ />
+ )
+ )}
+
+ {!listKomentar || isLoading || !userLoginId ? (
+
+ ) : _.isEmpty(listKomentar) ? (
+
+ ) : (
+
+ (
+
+
+
+ )}
+ data={listKomentar || []}
+ setData={setListKomentar as any}
+ moreData={() => handleMoreDataKomentar(listKomentar as any)}
+ >
+ {(item) => (
+ (
+ setListKomentar(val.filterComment as any),
+ handlerCountComment({
+ count: dataPosting?.count as number,
+ trigger: val.triggerCount,
+ })
+ )}
+ postingId={dataPosting?.id as any}
+ userLoginId={userLoginId}
+ />
+ )}
+
+
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/edit/komentar/index.tsx b/src/app_modules/forum/edit/komentar/index.tsx
index 0d656e80..ef50eac5 100644
--- a/src/app_modules/forum/edit/komentar/index.tsx
+++ b/src/app_modules/forum/edit/komentar/index.tsx
@@ -1,24 +1,12 @@
"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/_global/loading_page_v2";
-
-import dynamic from "next/dynamic";
-import React, { useState } from "react";
+import { Button, Group, Paper, Stack } from "@mantine/core";
import { useAtom } from "jotai";
+import dynamic from "next/dynamic";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import "react-quill/dist/quill.bubble.css";
+import "react-quill/dist/quill.snow.css";
import { gs_forum_loading_edit_posting } from "../../global_state";
const ReactQuill = dynamic(
() => {
@@ -29,17 +17,6 @@ const ReactQuill = dynamic(
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 (
<>
@@ -55,9 +32,6 @@ export default function Forum_EditKomentar() {
/>
- {/*
-
- */}
diff --git a/src/app_modules/forum/edit/posting/V3_edit_posting.tsx b/src/app_modules/forum/edit/posting/V3_edit_posting.tsx
new file mode 100644
index 00000000..6708651d
--- /dev/null
+++ b/src/app_modules/forum/edit/posting/V3_edit_posting.tsx
@@ -0,0 +1,166 @@
+"use client";
+
+import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
+import { Comp_ButtonSticker } from "@/app_modules/_global/lib/stiker/comp_button_sticker";
+import { Component_V3_TextEditorWithSticker } from "@/app_modules/_global/lib/stiker/comp_V3_text_editor_stiker";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
+import { Group, Stack } from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import React, { useState } from "react";
+import { apiGetOneForumById } from "../../component/api_fetch_forum";
+import Forum_ButtonUpdatePosting from "../../component/button/button_update_posting";
+import { MODEL_FORUM_POSTING } from "../../model/interface";
+import { ISticker } from "@/app_modules/_global/lib/interface/stiker";
+import { apiGetStickerForUser } from "@/app_modules/_global/lib/stiker/api_fecth_stiker_for_user";
+import { apiGetUserById } from "@/app_modules/_global/lib/api_user";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+
+export default function Forum_V3_EditPosting() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+
+ // New State
+ const [opened, { open, close }] = useDisclosure(false);
+ const quillRef = React.useRef(null);
+ const [quillLoaded, setQuillLoaded] = useState(false);
+
+ const [sticker, setSticker] = useState(null);
+ const [emotion, setEmotion] = useState([]);
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ const responseDataProfile = await apiGetUserById({
+ id: response.userId,
+ });
+
+ if (responseDataProfile.success) {
+ try {
+ const response = await apiGetStickerForUser({
+ gender: responseDataProfile?.data?.Profile?.jenisKelamin,
+ });
+ if (response.success) {
+ setSticker(response.res.data);
+ } else {
+ console.error("Failed to get sticker", response.message);
+ setSticker([]);
+ }
+ } catch (error) {
+ console.error("Error get sticker", error);
+ setSticker([]);
+ }
+ } else {
+ console.error("Failed to get profile", responseDataProfile.message);
+ setSticker(null);
+ }
+ } else {
+ setUserLoginId(null);
+ }
+ } catch (error) {
+ console.error("Error get profile", error);
+ setSticker(null);
+ }
+ }
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetOneForumById({
+ id: param.id,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data forum", error);
+ }
+ };
+
+ useShallowEffect(() => {
+ // Add Quill CSS via tag
+ const link = document.createElement("link");
+ link.href = "https://cdn.quilljs.com/1.3.6/quill.snow.css";
+ link.rel = "stylesheet";
+ document.head.appendChild(link);
+
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .ql-editor img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ // .chat-content img {
+ // max-width: 70px !important;
+ // max-height: 70px !important;
+ // }
+ `;
+ document.head.appendChild(style);
+
+ setQuillLoaded(true);
+
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(link);
+ document.head.removeChild(style);
+ };
+ }, []);
+
+ if (!data || !userLoginId) return ;
+
+ return (
+ <>
+
+ {quillLoaded && (
+ {
+ setData({
+ ...data,
+ diskusi: val,
+ });
+ }}
+ />
+ )}
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/forum/edit/posting/index.tsx b/src/app_modules/forum/edit/posting/index.tsx
index d17d721e..c93373b4 100644
--- a/src/app_modules/forum/edit/posting/index.tsx
+++ b/src/app_modules/forum/edit/posting/index.tsx
@@ -1,91 +1,101 @@
"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/_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 { MainColor } from "@/app_modules/_global/color/color_pallet";
+import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
-import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
-import {
- AccentColor,
- MainColor,
-} from "@/app_modules/_global/color/color_pallet";
-const ReactQuill = dynamic(
- () => {
- return import("react-quill");
- },
- { ssr: false }
-);
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
+import { Button, Group, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import { apiGetOneForumById } from "../../component/api_fetch_forum";
+import { forum_funEditPostingById } from "../../fun/edit/fun_edit_posting_by_id";
+import { MODEL_FORUM_POSTING } from "../../model/interface";
+
+export default function Forum_EditPosting() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [lengthData, setLengthData] = useState(0);
-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);
+ handleLoadData();
}, []);
- if (!reload)
- return (
- <>
-
- >
- );
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetOneForumById({
+ id: param.id,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data forum", error);
+ }
+ };
+
+ if (!data) return ;
return (
<>
-
+ {/* {
+ setData({
+ ...data,
+ diskusi: value,
+ });
+ }}
+ onSetLengthData={(value) => {
+ console.log(value);
+ setLengthData(value);
+ }}
+ /> */}
+
+ {/*
{
- setValue({
- ...value,
+ const input = val;
+ const text = input.replace(/<[^>]+>/g, "").trim(); // Remove HTML tags and trim whitespace
+
+ if (text.length === 0) {
+ setData({
+ ...data,
+ diskusi: "",
+ });
+
+ return;
+ }
+ setData({
+ ...data,
diskusi: val,
});
}}
/>
-
-
+ */}
+
+
+
-
- {/*
-
- */}
-
-
- {/* */}
>
);
}
@@ -93,26 +103,34 @@ export default function Forum_EditPosting({
function ButtonAction({
postingId,
diskusi,
+ lengthData,
}: {
postingId: string;
diskusi: string;
+ lengthData: number;
}) {
const router = useRouter();
const [loading, setLoading] = useState(false);
async function onUpdate() {
- if (diskusi === "
" || diskusi === "")
- return ComponentGlobal_NotifikasiPeringatan("Masukan postingan anda");
+ // if (diskusi === "
" || diskusi === "")
+ // return ComponentGlobal_NotifikasiPeringatan("Masukan postingan anda");
- await forum_funEditPostingById(postingId, diskusi).then((res) => {
- if (res.status === 200) {
- setLoading(true);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- setTimeout(() => router.back(), 1000);
+ try {
+ setLoading(true);
+ const update = await forum_funEditPostingById(postingId, diskusi);
+
+ if (update.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(update.message);
+ router.back();
} else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ ComponentGlobal_NotifikasiGagal(update.message);
}
- });
+ } catch (error) {
+ clientLogger.error("Error update forum", error);
+ } finally {
+ setLoading(false);
+ }
}
return (
@@ -120,23 +138,14 @@ function ButtonAction({
" || diskusi === "" || diskusi.length > 500
- ? ""
- : `1px solid ${AccentColor.yellow}`,
- backgroundColor:
- diskusi === "
" || diskusi === "" || diskusi.length > 500
- ? ""
- : MainColor.yellow,
}}
- disabled={
- diskusi === "
" || diskusi === "" || diskusi.length > 500
- ? true
- : false
- }
+ disabled={lengthData === 0 || lengthData > maxInputLength}
loaderPosition="center"
- loading={loading ? true : false}
+ loading={loading}
radius={"xl"}
+ bg={MainColor.yellow}
+ color={"yellow"}
+ c={"black"}
onClick={() => {
onUpdate();
}}
diff --git a/src/app_modules/forum/forumku/forum_profile.tsx b/src/app_modules/forum/forumku/forum_profile.tsx
index 7ec720b7..ec5b9cde 100644
--- a/src/app_modules/forum/forumku/forum_profile.tsx
+++ b/src/app_modules/forum/forumku/forum_profile.tsx
@@ -1,8 +1,8 @@
"use client";
-import { pathAssetImage } from "@/app/lib";
-import { RouterImagePreview } from "@/app/lib/router_hipmi/router_image_preview";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
+import { pathAssetImage } from "@/lib";
+import { RouterImagePreview } from "@/lib/router_hipmi/router_image_preview";
+import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
import {
AccentColor,
MainColor,
diff --git a/src/app_modules/forum/forumku/index.tsx b/src/app_modules/forum/forumku/index.tsx
index ead4dfb8..15bb5a03 100644
--- a/src/app_modules/forum/forumku/index.tsx
+++ b/src/app_modules/forum/forumku/index.tsx
@@ -1,104 +1,168 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
-import {
- AccentColor
-} from "@/app_modules/_global/color/color_pallet";
+import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+import { apiGetUserById } from "@/app_modules/_global/lib/api_user";
import { MODEL_USER } from "@/app_modules/home/model/interface";
-import {
- ActionIcon,
- Affix,
- Center,
- Loader,
- Stack,
- Text,
- rem,
-} from "@mantine/core";
-import { useWindowScroll } from "@mantine/hooks";
-import { IconPencilPlus, IconSearchOff } from "@tabler/icons-react";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
+import { clientLogger } from "@/util/clientLogger";
+import { Center, Loader, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import { apiGetForumkuById } from "../component/api_fetch_forum";
import ComponentForum_ForumkuMainCardView from "../component/forumku_component/forumku_view";
-import { forum_getAllPostingByAuhtorId } from "../fun/get/get_list_posting_by_author_id";
+import { Forum_ComponentIsDataEmpty } from "../component/other_component";
+import {
+ Forum_SkeletonCard,
+ Forum_SkeletonForumku,
+} from "../component/skeleton_view";
import { MODEL_FORUM_POSTING } from "../model/interface";
import ComponentForum_ViewForumProfile from "./forum_profile";
-import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
-export default function Forum_Forumku({
- auhtorSelectedData,
- dataPosting,
- totalPosting,
- userLoginId,
-}: {
- auhtorSelectedData: MODEL_USER;
- dataPosting: MODEL_FORUM_POSTING[];
- totalPosting: number;
- userLoginId: string;
-}) {
+export default function Forum_Forumku() {
const router = useRouter();
- const [data, setData] = useState(dataPosting);
+ const params = useParams<{ id: string }>();
+ const userId = params.id;
+ const [dataUser, setDataUser] = useState(null);
+ const [dataPosting, setDataPosting] = useState(
+ null
+ );
+ const [isLoading, setIsLoading] = useState(false);
const [activePage, setActivePage] = useState(1);
+ const [userLoginId, setUserLoginId] = useState(null);
- const [scroll, scrollTo] = useWindowScroll();
- const [loadingCreate, setLoadingCreate] = useState(false);
+ useShallowEffect(() => {
+ handleGetUserLoginId();
+ }, []);
+
+ async function handleGetUserLoginId() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ } else {
+ setUserLoginId(null);
+ }
+ } catch (error) {
+ setUserLoginId(null);
+ }
+ }
+
+ useShallowEffect(() => {
+ const handleLoadDataUser = async () => {
+ try {
+ const response = await apiGetUserById({
+ id: userId,
+ });
+
+ if (response) {
+ setDataUser(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get user", error);
+ }
+ };
+
+ handleLoadDataUser();
+ }, []);
+
+ useShallowEffect(() => {
+ handleLoadDataForum();
+ }, []);
+
+ const handleLoadDataForum = async () => {
+ try {
+ setIsLoading(true);
+ const response = await apiGetForumkuById({
+ id: userId,
+ page: "1",
+ });
+
+ if (response.success) {
+ setDataPosting(response.data);
+ setActivePage(1);
+ setIsLoading(false);
+ } else {
+ setDataPosting([]);
+ setIsLoading(false);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data forum");
+ setIsLoading(false);
+ setDataPosting([]);
+ }
+ };
+
+ const handleMoreData = async () => {
+ try {
+ const nextPage = activePage + 1;
+
+ const response = await apiGetForumkuById({
+ id: userId,
+ page: `${nextPage}`,
+ });
+
+ if (response.success) {
+ setActivePage(nextPage);
+ return response.data;
+ } else {
+ return null;
+ }
+ } catch (error) {
+ clientLogger.error("Error get data forum");
+ return null;
+ }
+ };
return (
<>
- {userLoginId === auhtorSelectedData.id && (
-
- )}
-
-
+ {!dataUser || !userLoginId ? (
+
+ ) : (
+
+ )}
- {_.isEmpty(data) ? (
-
-
-
-
- Tidak ada data
-
-
-
+ {!dataPosting || isLoading || !userLoginId ? (
+
+ ) : _.isEmpty(dataPosting) ? (
+
) : (
// --- Main component --- //
(
)}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await forum_getAllPostingByAuhtorId({
- page: activePage + 1,
- authorId: auhtorSelectedData.id,
- });
- setActivePage((val) => val + 1);
-
- return loadData;
- }}
+ data={dataPosting as MODEL_FORUM_POSTING[]}
+ setData={setDataPosting as any}
+ moreData={handleMoreData}
>
{(item) => (
{
- setData(val);
+ setDataPosting(val);
}}
- allData={data}
+ allData={dataPosting || []}
/>
)}
)}
+
+ {userLoginId === dataUser?.id && (
+
+ )}
>
);
}
diff --git a/src/app_modules/forum/forumku/layout.tsx b/src/app_modules/forum/forumku/layout.tsx
index 83db14b8..51652060 100644
--- a/src/app_modules/forum/forumku/layout.tsx
+++ b/src/app_modules/forum/forumku/layout.tsx
@@ -1,26 +1,36 @@
"use client";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import UI_NewLayoutTamplate, {
+ UI_NewHeader,
+ UI_NewChildren,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { IconX } from "@tabler/icons-react";
import React from "react";
export default function LayoutForum_Forumku({
children,
- username,
}: {
children: React.ReactNode;
- username: string;
}) {
return (
<>
- } />
+ } />
}
>
{children}
-
+ */}
+
+
+
+ } />
+
+ {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
index 1ae8a3b9..19493d02 100644
--- 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
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function forum_countOneTotalKomentarById(postingId: any) {
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
index b8477694..6c00fd1d 100644
--- 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
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function forum_countPostingByAuthorId(authorId: string) {
const data = await prisma.forum_Posting.count({
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
index d6a5f9d6..2bf93585 100644
--- 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
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
// PERCOBAAN
export async function forum_countTotalKomenById(postingId: string) {
diff --git a/src/app_modules/forum/fun/create/fun_create.tsx b/src/app_modules/forum/fun/create/fun_create.tsx
index 1db0be9c..3467b047 100644
--- a/src/app_modules/forum/fun/create/fun_create.tsx
+++ b/src/app_modules/forum/fun/create/fun_create.tsx
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { revalidatePath } from "next/cache";
export async function forum_funCreate(value: string) {
diff --git a/src/app_modules/forum/fun/create/fun_create_komentar.tsx b/src/app_modules/forum/fun/create/fun_create_komentar.tsx
index e9585e38..3a3559f1 100644
--- a/src/app_modules/forum/fun/create/fun_create_komentar.tsx
+++ b/src/app_modules/forum/fun/create/fun_create_komentar.tsx
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { revalidatePath } from "next/cache";
@@ -8,17 +8,49 @@ export async function forum_funCreateKomentar(
postingId: string,
komentar: string
) {
- const userLoginId = await funGetUserIdByToken();
+ try {
+ const userLoginId = await funGetUserIdByToken();
- const create = await prisma.forum_Komentar.create({
- data: {
- komentar: komentar,
- forum_PostingId: postingId,
- authorId: userLoginId,
- },
- });
+ const create = await prisma.forum_Komentar.create({
+ data: {
+ komentar: komentar,
+ forum_PostingId: postingId,
+ authorId: userLoginId,
+ },
+ select: {
+ id: true,
+ isActive: true,
+ komentar: true,
+ createdAt: true,
+ Author: {
+ select: {
+ id: true,
+ username: true,
+ Profile: {
+ select: {
+ name: true,
+ imageId: true,
+ },
+ },
+ },
+ },
+ authorId: true,
+ },
+ });
- if (!create) return { status: 400, message: "Gagal menambahkan komentar" };
- revalidatePath("/dev/forum/detail");
- return { status: 201, message: "Berhasil menambahkan komentar" };
+ if (!create) return { status: 400, message: "Gagal menambahkan komentar" };
+
+ return {
+ status: 201,
+ message: "Berhasil menambahkan komentar",
+ data: create,
+ };
+ } catch (error) {
+ console.log(error);
+ return {
+ status: 500,
+ message: "Error API",
+ error: (error as Error).message,
+ };
+ }
}
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
index 72c7d9a9..2d5697a8 100644
--- a/src/app_modules/forum/fun/create/fun_create_report_komentar.ts
+++ b/src/app_modules/forum/fun/create/fun_create_report_komentar.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function forum_funCreateReportKomentar({
@@ -12,6 +12,9 @@ export async function forum_funCreateReportKomentar({
}) {
const userLoginId = await funGetUserIdByToken();
+ if (!userLoginId)
+ return { status: 400, message: "Gagal menambahkan report komentar !" };
+
try {
const createReport = await prisma.forum_ReportKomentar.create({
data: {
@@ -23,9 +26,15 @@ export async function forum_funCreateReportKomentar({
if (!createReport)
return { status: 400, message: "Gagal menambahkan report komentar !" };
+
+ return { status: 201, message: "Berhasil me-report komentar !" };
} catch (error) {
console.log(error);
+ return {
+ status: 500,
+ message: "Error API",
+ error: (error as Error).message,
+ };
}
- 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
index 5282b0b2..b4ff58de 100644
--- 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
@@ -1,22 +1,34 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
export async function forum_funCreateReportKomentarLainnya(
komentarId: string,
deskripsi: string
) {
- const userLoginId = await funGetUserIdByToken();
+ try {
+ const userLoginId = await funGetUserIdByToken();
+ if (!userLoginId)
+ return { status: 400, message: "Gagal menambah report !" };
- const create = await prisma.forum_ReportKomentar.create({
- data: {
- forum_KomentarId: komentarId,
- deskripsi: deskripsi,
- userId: userLoginId,
- },
- });
+ const create = await prisma.forum_ReportKomentar.create({
+ data: {
+ forum_KomentarId: komentarId,
+ deskripsi: deskripsi,
+ userId: userLoginId,
+ },
+ });
- if (!create) return { status: 400, message: "Gagal menambah report !" };
- return { status: 201, message: "Berhasil menambah report !" };
+ if (!create) return { status: 400, message: "Gagal menambah report !" };
+ return { status: 201, message: "Berhasil menambah report !" };
+ } catch (error) {
+ backendLogger.error("Error create report komentar lainnya", error);
+ return {
+ status: 500,
+ message: "Error API",
+ error: (error as Error).message,
+ };
+ }
}
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
index 9eb64d4d..db705a27 100644
--- a/src/app_modules/forum/fun/create/fun_create_report_posting.ts
+++ b/src/app_modules/forum/fun/create/fun_create_report_posting.ts
@@ -1,9 +1,8 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-
export async function forum_funCreateReportPosting({
postingId,
kategoriId,
@@ -11,18 +10,28 @@ export async function forum_funCreateReportPosting({
postingId: string;
kategoriId: number;
}) {
+ try {
const userLoginId = await funGetUserIdByToken();
+ if (!userLoginId)
+ return { status: 400, message: "Gagal menambahkan report posting!" };
+ const createReport = await prisma.forum_ReportPosting.create({
+ data: {
+ userId: userLoginId,
+ forum_PostingId: postingId,
+ forumMaster_KategoriReportId: kategoriId,
+ },
+ });
- const createReport = await prisma.forum_ReportPosting.create({
- data: {
- userId: userLoginId,
- forum_PostingId: postingId,
- forumMaster_KategoriReportId: kategoriId,
- },
- });
+ if (!createReport)
+ return { status: 400, message: "Gagal menambahkan report posting!" };
- if (!createReport)
- return { status: 400, message: "Gagal menambahkan report posting!" };
- return { status: 201, message: "Berhasil me-report posting!" };
+ return { status: 201, message: "Berhasil me-report posting!" };
+ } catch (error) {
+ return {
+ status: 400,
+ message: "Error menambahkan report posting",
+ error: (error as Error).message,
+ };
+ }
}
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
index 8c6d721b..70dcb2df 100644
--- 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
@@ -1,22 +1,34 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
-
export async function forum_funCreateReportPostingLainnya(
postingId: string,
deskripsi: string
) {
- const userLoginId = await funGetUserIdByToken();
- const create = await prisma.forum_ReportPosting.create({
- data: {
- forum_PostingId: postingId,
- deskripsi: deskripsi,
- userId: userLoginId,
- },
- });
+ try {
+ const userLoginId = await funGetUserIdByToken();
+ if (!userLoginId)
+ return { status: 400, message: "Gagal menambah report !" };
- if (!create) return { status: 400, message: "Gagal menambah report !" };
- return { status: 201, message: "Berhasil menambah report !" };
+ const create = await prisma.forum_ReportPosting.create({
+ data: {
+ forum_PostingId: postingId,
+ deskripsi: deskripsi,
+ userId: userLoginId,
+ },
+ });
+
+ if (!create) return { status: 400, message: "Gagal menambah report !" };
+
+ return { status: 201, message: "Berhasil menambah report !" };
+ } catch (error) {
+ console.log(error);
+ return {
+ status: 500,
+ message: "Error API",
+ error: (error as Error).message,
+ };
+ }
}
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
index d7da0b55..22509c0f 100644
--- 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
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function forum_funDeleteKomentarById(komentarId: string) {
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
index f002e727..0e59acaf 100644
--- 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
@@ -1,19 +1,28 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/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,
- },
- });
+ try {
+ 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" };
+ if (!del) return { status: 400, message: "Gagal dihapus" };
+ revalidatePath("/dev/forum/main");
+ return { status: 200, message: "Berhasil dihapus" };
+ } catch (error) {
+ console.log(error);
+ return {
+ status: 500,
+ message: "Error API",
+ error: (error as Error).message,
+ };
+ }
}
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
index 90341f54..0bcff152 100644
--- 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
@@ -1,22 +1,28 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/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,
- },
- });
+ try {
+ 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" };
+ if (!updt) {
+ return { success: false, message: "Update gagal", status: 400 }; // Plain object dengan status
+ }
+ revalidatePath("/dev/forum/main");
+ return { success: true, message: "Berhasil update", status: 200 }; // Plain object dengan status
+ } catch (error) {
+ return { success: false, message: "Update error", status: 500 }; // Plain object dengan status
+ }
}
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
index 38645743..6ea8b94a 100644
--- 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
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function forum_funEditStatusPostingById(
diff --git a/src/app_modules/forum/fun/get/get_all_komentar_by_id.ts b/src/app_modules/forum/fun/get/get_all_komentar_by_id.ts
index 5b4cd508..9fd1d0d7 100644
--- a/src/app_modules/forum/fun/get/get_all_komentar_by_id.ts
+++ b/src/app_modules/forum/fun/get/get_all_komentar_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function forum_funGetAllKomentarById({
postingId,
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
index 07c16404..c005879e 100644
--- a/src/app_modules/forum/fun/get/get_list_all_posting.ts
+++ b/src/app_modules/forum/fun/get/get_list_all_posting.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _ from "lodash";
export async function forum_getListAllPosting() {
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
index d1b502c0..d6bf264b 100644
--- 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
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function forum_getAllPostingByAuhtorId({
authorId,
diff --git a/src/app_modules/forum/fun/get/get_one_kategori_by_id.ts b/src/app_modules/forum/fun/get/get_one_kategori_by_id.ts
index e32ce4c4..4f29c664 100644
--- a/src/app_modules/forum/fun/get/get_one_kategori_by_id.ts
+++ b/src/app_modules/forum/fun/get/get_one_kategori_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function forum_getOneKategoriById({
kategoriId,
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
index c8af1e02..109bab5d 100644
--- 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
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function forum_getOnePostingById(postingId: string) {
const data = await prisma.forum_Posting.findFirst({
diff --git a/src/app_modules/forum/fun/get/get_one_posting_reported_by_id.ts b/src/app_modules/forum/fun/get/get_one_posting_reported_by_id.ts
index 7ea057dc..fe4dbc34 100644
--- a/src/app_modules/forum/fun/get/get_one_posting_reported_by_id.ts
+++ b/src/app_modules/forum/fun/get/get_one_posting_reported_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _ from "lodash";
export default async function forum_funGetOneReportedPostingById({
diff --git a/src/app_modules/forum/fun/get/get_one_report_komentar_by_id.tsx b/src/app_modules/forum/fun/get/get_one_report_komentar_by_id.tsx
index 36993d76..9c08e188 100644
--- a/src/app_modules/forum/fun/get/get_one_report_komentar_by_id.tsx
+++ b/src/app_modules/forum/fun/get/get_one_report_komentar_by_id.tsx
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _ from "lodash";
import { MODEL_FORUM_KOMENTAR } from "../../model/interface";
import { group } from "console";
diff --git a/src/app_modules/forum/fun/get/new_get_all_posting.ts b/src/app_modules/forum/fun/get/new_get_all_posting.ts
index 4bba8274..a5c809a6 100644
--- a/src/app_modules/forum/fun/get/new_get_all_posting.ts
+++ b/src/app_modules/forum/fun/get/new_get_all_posting.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { ceil } from "lodash";
export async function forum_new_getAllPosting({
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
index 50c0acc7..b10aeab5 100644
--- a/src/app_modules/forum/fun/master/get_master_kategori_report.ts
+++ b/src/app_modules/forum/fun/master/get_master_kategori_report.ts
@@ -1,11 +1,8 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/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
index c8fae42a..cb8d84e8 100644
--- a/src/app_modules/forum/fun/search/fun_search_list_posting.ts
+++ b/src/app_modules/forum/fun/search/fun_search_list_posting.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _ from "lodash";
export async function forum_funSearchListPosting(text: string) {
diff --git a/src/app_modules/forum/index.ts b/src/app_modules/forum/index.ts
index 68eab0a0..d5b28258 100644
--- a/src/app_modules/forum/index.ts
+++ b/src/app_modules/forum/index.ts
@@ -5,7 +5,6 @@ import Forum_Forumku from "./forumku";
import Forum_Create from "./create";
import LayoutForum_Create from "./create/layout";
import LayoutForum_Forumku from "./forumku/layout";
-import Forum_MainDetail from "./detail/main_detail";
import LayoutForum_Detail from "./detail/layout";
import Forum_EditPosting from "./edit/posting";
import LayoutForum_EditPosting from "./edit/posting/layout";
@@ -28,7 +27,6 @@ export {
Forum_Create,
LayoutForum_Create,
LayoutForum_Forumku,
- Forum_MainDetail as Forum_Detail,
LayoutForum_Detail,
Forum_EditPosting,
LayoutForum_EditPosting,
diff --git a/src/app_modules/forum/main/beranda.tsx b/src/app_modules/forum/main/beranda.tsx
index 3209a27f..a85a1fba 100644
--- a/src/app_modules/forum/main/beranda.tsx
+++ b/src/app_modules/forum/main/beranda.tsx
@@ -1,58 +1,115 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
-import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
+import { clientLogger } from "@/util/clientLogger";
import mqtt_client from "@/util/mqtt_client";
import {
Affix,
- Button,
+ Box,
Center,
Loader,
Stack,
- Text,
TextInput,
rem,
} from "@mantine/core";
-import { useShallowEffect, useWindowScroll } from "@mantine/hooks";
-import { IconSearchOff } from "@tabler/icons-react";
+import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
-import { useRouter } from "next/navigation";
import { useState } from "react";
+import { apiGetAllForum } from "../component/api_fetch_forum";
+import { ButtonUpdateBeranda } from "../component/button/button_update_beranda";
import ComponentForum_BerandaCardView from "../component/main_component/card_view";
-import { forum_new_getAllPosting } from "../fun/get/new_get_all_posting";
+import { Forum_ComponentIsDataEmpty } from "../component/other_component";
+import { Forum_SkeletonCard } from "../component/skeleton_view";
import { MODEL_FORUM_POSTING } from "../model/interface";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
-export default function Forum_Beranda({
- listForum,
- userLoginId,
-}: {
- listForum: any;
- userLoginId: string;
-}) {
- const router = useRouter();
- const [scroll, scrollTo] = useWindowScroll();
-
- const [data, setData] = useState(listForum);
+export default function Forum_Beranda() {
+ const [data, setData] = useState([]);
const [activePage, setActivePage] = useState(1);
const [isSearch, setIsSearch] = useState("");
const [isNewPost, setIsNewPost] = useState(false);
const [countNewPost, setCountNewPost] = useState(0);
+ const [hasMore, setHasMore] = useState(true);
+ const [isLoading, setIsLoading] = useState(false);
+ const [userLoginId, setUserLoginId] = useState(null);
useShallowEffect(() => {
- onLoadAllData({
- onLoad(val) {
- setData(val);
- },
- });
- }, [setData]);
+ handleGetUserLoginId();
+ }, []);
- async function onLoadAllData({ onLoad }: { onLoad: (val: any) => void }) {
- const loadData = await forum_new_getAllPosting({ page: 1 });
- onLoad(loadData);
+ async function handleGetUserLoginId() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ } else {
+ setUserLoginId(null);
+ }
+ } catch (error) {
+ setUserLoginId(null);
+ }
}
+ useShallowEffect(() => {
+ handleLoadData(isSearch);
+ }, [isSearch]);
+
+ const handleLoadData = async (isSearch: string) => {
+ setIsLoading(true);
+ try {
+ const response = await apiGetAllForum({
+ page: "1",
+ search: isSearch,
+ });
+
+ if (response) {
+ setData(response.data);
+ setActivePage(1);
+ setHasMore(response.data.length > 0);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data forum", error);
+ setData([]);
+ setHasMore(false);
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ const handleMoreData = async () => {
+ if (!hasMore || isLoading) return null;
+
+ try {
+ const nextPage = activePage + 1;
+
+ const response = await apiGetAllForum({
+ page: `${nextPage}`,
+ search: isSearch,
+ });
+
+ if (response?.data && response.data.length > 0) {
+ setActivePage(nextPage);
+ setHasMore(response.data.length > 0);
+ return response.data;
+ } else {
+ setHasMore(false);
+ return null;
+ }
+ } catch (error) {
+ clientLogger.error("Error get data forum", error);
+ setHasMore(false);
+ return null;
+ }
+ };
+
+ const hanldeSearch = async (text: string) => {
+ setIsSearch(text);
+ setActivePage(1);
+ setHasMore(true);
+ };
+
useShallowEffect(() => {
mqtt_client.subscribe("Forum_create_new");
mqtt_client.subscribe("Forum_ganti_status");
@@ -83,7 +140,7 @@ export default function Forum_Beranda({
if (topic === "Forum_detail_ganti_status") {
const newData = JSON.parse(message.toString());
- const updateOneData = cloneData.map((val) => ({
+ const updateOneData = cloneData?.map((val) => ({
...val,
ForumMaster_StatusPosting: {
id:
@@ -102,16 +159,6 @@ export default function Forum_Beranda({
});
}, [countNewPost, data]);
- async function onSearch(text: string) {
- setIsSearch(text);
- const loadSearch = await forum_new_getAllPosting({
- page: activePage,
- search: text,
- });
- setData(loadSearch as any);
- setActivePage(1);
- }
-
return (
<>
{isNewPost && (
@@ -131,106 +178,50 @@ export default function Forum_Beranda({
-
+
{
- onSearch(val.currentTarget.value);
+ hanldeSearch(val.currentTarget.value);
}}
/>
- {_.isEmpty(data) ? (
-
-
-
-
- Tidak ada data
-
-
-
+ {/* {JSON.stringify(data, null, 2)} */}
+
+ {!data.length && isLoading && !userLoginId ? (
+
+ ) : _.isEmpty(data) ? (
+
) : (
// --- Main component --- //
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await forum_new_getAllPosting({
- page: activePage + 1,
- search: isSearch,
- });
- setActivePage((val) => val + 1);
-
- return loadData;
- }}
- >
- {(item) => (
- {
- setData(val);
- }}
- allData={data}
- />
- )}
-
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={handleMoreData}
+ >
+ {(item) => (
+ {
+ setData(val);
+ }}
+ allData={data}
+ />
+ )}
+
+
)}
>
);
}
-
-function ButtonUpdateBeranda({
- countNewPost,
- onSetData,
- onSetIsNewPost,
- onSetCountNewPosting,
-}: {
- countNewPost: number;
- onSetData: (val: any) => void;
- onSetIsNewPost: (val: any) => void;
- onSetCountNewPosting: (val: any) => void;
-}) {
- const [scroll, scrollTo] = useWindowScroll();
- const [isLoading, setIsLoading] = useState(false);
-
- async function onLoadData() {
- setIsLoading(true);
- const loadData = await forum_new_getAllPosting({ page: 1 });
-
- if (loadData) {
- onSetData(loadData);
- onSetIsNewPost(false);
- setIsLoading(false);
- onSetCountNewPosting(0);
- }
- }
-
- return (
- <>
-
- 0 ? 0.5 : 0.8}
- onClick={() => onLoadData()}
- >
- Update beranda + {countNewPost}
-
-
- >
- );
-}
diff --git a/src/app_modules/forum/main/layout.tsx b/src/app_modules/forum/main/layout.tsx
index a9ad4ff6..dd09b6b8 100644
--- a/src/app_modules/forum/main/layout.tsx
+++ b/src/app_modules/forum/main/layout.tsx
@@ -1,65 +1,144 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+import { apiGetUserById } from "@/app_modules/_global/lib/api_user";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { MODEL_USER } from "@/app_modules/home/model/interface";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
+import { clientLogger } from "@/util/clientLogger";
import { ActionIcon, Avatar } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation";
import React, { useState } from "react";
export default function LayoutForum_Main({
children,
- dataAuthor,
}: {
children: React.ReactNode;
- dataAuthor: MODEL_USER;
}) {
const router = useRouter();
+ const [data, setData] = useState(null);
const [isLoading, setIsLoading] = useState(false);
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const responseUserId = await apiNewGetUserIdByToken();
+ if (responseUserId.success) {
+ setUserLoginId(responseUserId.userId);
+ const responseUser = await apiGetUserById({
+ id: responseUserId.userId,
+ });
+
+ if (responseUser.success) {
+ setData(responseUser.data);
+ }
+ } else {
+ setUserLoginId(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get user", error);
+ }
+ };
return (
<>
-
+
+
+ ) : (
+ {
+ setIsLoading(true);
+ router.push(RouterForum.forumku + userLoginId);
+ }}
+ >
+ {isLoading ? (
+
+
+
+ ) : (
+
+ )}
+
+ )
+ }
+ />
+
+
+ {children}
+
+
+ {/* {
- setIsLoading(true);
- router.push(RouterForum.forumku + dataAuthor?.id);
- }}
- >
- {isLoading ? (
-
-
-
- ) : (
-
- )}
-
+ !data ? (
+
+ ) : (
+ {
+ setIsLoading(true);
+ router.push(RouterForum.forumku + data?.id);
+ }}
+ >
+ {isLoading ? (
+
+
+
+ ) : (
+
+ )}
+
+ )
}
/>
}
>
{children}
-
+ */}
>
);
}
diff --git a/src/app_modules/forum/model/interface.tsx b/src/app_modules/forum/model/interface.tsx
index 5210898f..0a001618 100644
--- a/src/app_modules/forum/model/interface.tsx
+++ b/src/app_modules/forum/model/interface.tsx
@@ -14,6 +14,7 @@ export interface MODEL_FORUM_POSTING {
Forum_ReportPosting: MODEL_FORUM_MASTER_REPORT[];
ForumMaster_StatusPosting: MODEL_FORUM_MASTER_STATUS;
forumMaster_StatusPostingId: number;
+ count: number
}
export interface MODEL_FORUM_KOMENTAR {
@@ -61,6 +62,7 @@ export interface MODEL_FORUM_REPORT_POSTING {
}
export interface MODEL_FORUM_REPORT_KOMENTAR {
+ komentar: string | TrustedHTML;
id: string;
isActive: boolean;
createdAt: Date;
@@ -73,3 +75,8 @@ export interface MODEL_FORUM_REPORT_KOMENTAR {
userId: string;
User: MODEL_USER;
}
+
+export type CommentItem = {
+ deskripsi: string;
+ // Add any other properties that CommentItem should have
+};
\ No newline at end of file
diff --git a/src/app_modules/forum/report/komentar/index.tsx b/src/app_modules/forum/report/komentar/index.tsx
index 4d1122ec..9f81a01a 100644
--- a/src/app_modules/forum/report/komentar/index.tsx
+++ b/src/app_modules/forum/report/komentar/index.tsx
@@ -1,12 +1,12 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
import mqtt_client from "@/util/mqtt_client";
import { Button, Radio, Stack, Text, Title } from "@mantine/core";
import { toNumber } from "lodash";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import { forum_funCreateReportKomentar } from "../../fun/create/fun_create_report_komentar";
@@ -14,20 +14,58 @@ import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
+import { clientLogger } from "@/util/clientLogger";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetMasterReportForum } from "../../component/api_fetch_forum";
import forum_getOneKategoriById from "../../fun/get/get_one_kategori_by_id";
import { MODEL_FORUM_MASTER_REPORT } from "../../model/interface";
-export default function Forum_ReportKomentar({
- komentarId,
- listReport,
- userLoginId,
-}: {
- komentarId: string;
- listReport: MODEL_FORUM_MASTER_REPORT[];
- userLoginId: string;
-}) {
+export default function Forum_ReportKomentar() {
+ const param = useParams<{ id: string }>();
+ const komentarId = param.id;
+ const [listReport, setListReport] = useState<
+ MODEL_FORUM_MASTER_REPORT[] | null
+ >(null);
const [reportValue, setReportValue] = useState("1");
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ handleGetUserLoginId();
+ }, []);
+
+ async function handleGetUserLoginId() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ } else {
+ setUserLoginId(null);
+ }
+ } catch (error) {
+ setUserLoginId(null);
+ }
+ }
+
+ useShallowEffect(() => {
+ handleLoadMasterReport();
+ }, []);
+
+ const handleLoadMasterReport = async () => {
+ try {
+ const response = await apiGetMasterReportForum();
+ if (response.success) {
+ setListReport(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get master report", error);
+ }
+ };
+
+ if (!listReport || !userLoginId)
+ return ;
return (
<>
@@ -87,37 +125,43 @@ function ButtonAction({
const [isLoadingLain, setIsLoadingLain] = useState(false);
async function onReport() {
- const report = await forum_funCreateReportKomentar({
- komentarId: komentarId,
- kategoriId: kategoriId,
- });
-
- if (report.status === 201) {
- const getKategori = await forum_getOneKategoriById({
+ try {
+ setLoading(true);
+ const report = await forum_funCreateReportKomentar({
+ komentarId: komentarId,
kategoriId: kategoriId,
});
- // console.log(getKategori);
- const dataNotif = {
- appId: komentarId,
- pesan: getKategori?.deskripsi,
- kategoriApp: "FORUM",
- title: getKategori?.title,
- userId: userLoginId,
- status: "Report Komentar",
- };
- const createNotif = await notifikasiToAdmin_funCreate({
- data: dataNotif as any,
- });
- if (createNotif.status === 201) {
- mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
+ if (report.status === 201) {
+ const getKategori = await forum_getOneKategoriById({
+ kategoriId: kategoriId,
+ });
+ // console.log(getKategori);
+ const dataNotif = {
+ appId: komentarId,
+ pesan: getKategori?.deskripsi,
+ kategoriApp: "FORUM",
+ title: getKategori?.title,
+ userId: userLoginId,
+ status: "Report Komentar",
+ };
+ const createNotif = await notifikasiToAdmin_funCreate({
+ data: dataNotif as any,
+ });
+
+ if (createNotif.status === 201) {
+ mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
+ }
+
+ router.back();
+ return ComponentGlobal_NotifikasiBerhasil(report.message, 2000);
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(report.message);
}
-
- setLoading(true);
- router.back();
- return ComponentGlobal_NotifikasiBerhasil(report.message, 2000);
- } else {
- ComponentGlobal_NotifikasiGagal(report.message);
+ } catch (error) {
+ clientLogger.error("Error report komentar", error);
+ setLoading(false);
}
}
return (
@@ -125,7 +169,7 @@ function ButtonAction({
{
setIsLoadingLain(true);
@@ -138,7 +182,7 @@ function ButtonAction({
radius={"xl"}
color="orange"
loaderPosition="center"
- loading={loading ? true : false}
+ loading={loading}
onClick={() => onReport()}
>
Report
diff --git a/src/app_modules/forum/report/komentar/lainnya.tsx b/src/app_modules/forum/report/komentar/lainnya.tsx
index 112b8eb0..c5a3f77b 100644
--- a/src/app_modules/forum/report/komentar/lainnya.tsx
+++ b/src/app_modules/forum/report/komentar/lainnya.tsx
@@ -1,25 +1,46 @@
"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 { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_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";
-import mqtt_client from "@/util/mqtt_client";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
+import { clientLogger } from "@/util/clientLogger";
+import mqtt_client from "@/util/mqtt_client";
+import { Button, Group, Stack, Textarea } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import { forum_funCreateReportKomentarLainnya } from "../../fun/create/fun_create_report_komentar_lainnya";
-export default function Forum_ReportKomentarLainnya({
- komentarId,
- userLoginId,
-}: {
- komentarId: string;
- userLoginId: string;
-}) {
+export default function Forum_ReportKomentarLainnya() {
+ const param = useParams<{ id: string }>();
+ const komentarId = param.id;
const [deskripsi, setDeskripsi] = useState("");
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ handleGetUserLoginId();
+ }, []);
+
+ async function handleGetUserLoginId() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ } else {
+ setUserLoginId(null);
+ }
+ } catch (error) {
+ setUserLoginId(null);
+ }
+ }
+
+ if (!userLoginId) {
+ return ;
+ }
+
return (
<>
@@ -51,41 +72,53 @@ function ButtonAction({
userLoginId: string;
}) {
const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
async function onReport() {
- const report = await forum_funCreateReportKomentarLainnya(
- komentarId,
- deskripsi
- );
+ try {
+ setLoading(true);
+ const report = await forum_funCreateReportKomentarLainnya(
+ komentarId,
+ deskripsi
+ );
- if (report.status === 201) {
- const dataNotif = {
- appId: komentarId,
- pesan: deskripsi,
- kategoriApp: "FORUM",
- title: "Lainnya",
- userId: userLoginId,
- status: "Report Komentar",
- };
+ if (report.status === 201) {
+ const dataNotif = {
+ appId: komentarId,
+ pesan: deskripsi,
+ kategoriApp: "FORUM",
+ title: "Lainnya",
+ userId: userLoginId,
+ status: "Report Komentar",
+ };
- const createNotifikasi = await notifikasiToAdmin_funCreate({
- data: dataNotif as any,
- });
+ const createNotifikasi = await notifikasiToAdmin_funCreate({
+ data: dataNotif as any,
+ });
- if (createNotifikasi.status === 201) {
- mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
+ if (createNotifikasi.status === 201) {
+ mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
+ }
+
+ ComponentGlobal_NotifikasiBerhasil(report.message);
+ router.back();
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(report.message);
}
-
- ComponentGlobal_NotifikasiBerhasil(report.message);
- router.back();
- } else {
- ComponentGlobal_NotifikasiGagal(report.message);
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error report komentar lainnya", error);
}
}
return (
<>
router.replace(RouterForum.report_komentar + komentarId)
@@ -94,6 +127,8 @@ function ButtonAction({
Batal
-
}
>
{children}
-
- {/*
- }
- >
- {children}
- */}
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/forum/report/posting/index.tsx b/src/app_modules/forum/report/posting/index.tsx
index 237d503c..39ef1b6e 100644
--- a/src/app_modules/forum/report/posting/index.tsx
+++ b/src/app_modules/forum/report/posting/index.tsx
@@ -1,32 +1,70 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
+import { clientLogger } from "@/util/clientLogger";
import mqtt_client from "@/util/mqtt_client";
import { Button, Radio, Stack, Text, Title } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import { toNumber } from "lodash";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import { apiGetMasterReportForum } from "../../component/api_fetch_forum";
import { forum_funCreateReportPosting } from "../../fun/create/fun_create_report_posting";
import forum_getOneKategoriById from "../../fun/get/get_one_kategori_by_id";
import { MODEL_FORUM_MASTER_REPORT } from "../../model/interface";
-export default function Forum_ReportPosting({
- postingId,
- listReport,
- userLoginId,
-}: {
- postingId: string;
- listReport: MODEL_FORUM_MASTER_REPORT[];
- userLoginId: string;
-}) {
+export default function Forum_ReportPosting() {
+ const param = useParams<{ id: string }>();
+ const postingId = param.id;
+ const [listReport, setListReport] = useState<
+ MODEL_FORUM_MASTER_REPORT[] | null
+ >(null);
const [reportValue, setReportValue] = useState("1");
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ handleGetUserLoginId();
+ }, []);
+
+ async function handleGetUserLoginId() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ } else {
+ setUserLoginId(null);
+ }
+ } catch (error) {
+ setUserLoginId(null);
+ }
+ }
+
+ useShallowEffect(() => {
+ handleLoadMasterReport();
+ }, []);
+
+ const handleLoadMasterReport = async () => {
+ try {
+ const response = await apiGetMasterReportForum();
+ if (response.success) {
+ setListReport(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get master report", error);
+ }
+ };
+
+ if (!listReport || !userLoginId)
+ return ;
return (
<>
@@ -86,38 +124,45 @@ function ButtonAction({
const [isLoadingLain, setIsLoadingLain] = useState(false);
async function onReport() {
- const report = await forum_funCreateReportPosting({
- postingId: postingId,
- kategoriId: kategoriId,
- });
- if (report.status === 201) {
- const getKategori = await forum_getOneKategoriById({
- kategoriId: toNumber(kategoriId),
- });
- // console.log(getKategori);
-
- ComponentGlobal_NotifikasiBerhasil(report.message, 2000);
- router.back();
-
- const dataNotif = {
- appId: postingId,
- pesan: getKategori?.deskripsi,
- kategoriApp: "FORUM",
- title: getKategori?.title,
- userId: userLoginId,
- status: "Report Posting",
- };
-
- const createNotifikasi = await notifikasiToAdmin_funCreate({
- data: dataNotif as any,
- });
-
- if (createNotifikasi.status === 201) {
- mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
- }
+ try {
setIsLoading(true);
- } else {
- ComponentGlobal_NotifikasiGagal(report.message);
+
+ const report = await forum_funCreateReportPosting({
+ postingId: postingId,
+ kategoriId: kategoriId,
+ });
+ if (report.status === 201) {
+ const getKategori = await forum_getOneKategoriById({
+ kategoriId: toNumber(kategoriId),
+ });
+ // console.log(getKategori);
+
+ ComponentGlobal_NotifikasiBerhasil(report.message, 2000);
+ router.back();
+
+ const dataNotif = {
+ appId: postingId,
+ pesan: getKategori?.deskripsi,
+ kategoriApp: "FORUM",
+ title: getKategori?.title,
+ userId: userLoginId,
+ status: "Report Posting",
+ };
+
+ const createNotifikasi = await notifikasiToAdmin_funCreate({
+ data: dataNotif as any,
+ });
+
+ if (createNotifikasi.status === 201) {
+ mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
+ }
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(report.message);
+ }
+ } catch (error) {
+ clientLogger.error("Error Report Posting", error);
+ setIsLoading(false);
}
}
return (
diff --git a/src/app_modules/forum/report/posting/lainnya.tsx b/src/app_modules/forum/report/posting/lainnya.tsx
index fce98a6f..7f603fb9 100644
--- a/src/app_modules/forum/report/posting/lainnya.tsx
+++ b/src/app_modules/forum/report/posting/lainnya.tsx
@@ -1,24 +1,46 @@
"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 { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import { forum_funCreateReportPostingLainnya } from "../../fun/create/fun_create_report_posting_lainnya";
-import mqtt_client from "@/util/mqtt_client";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
+import { clientLogger } from "@/util/clientLogger";
+import mqtt_client from "@/util/mqtt_client";
+import { Button, Group, Stack, Textarea } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import { forum_funCreateReportPostingLainnya } from "../../fun/create/fun_create_report_posting_lainnya";
-export default function Forum_ReportPostingLainnya({
- postingId,
- userLoginId,
-}: {
- postingId: string;
- userLoginId: string;
-}) {
+export default function Forum_ReportPostingLainnya() {
+ const param = useParams<{ id: string }>();
+ const postingId = param.id;
const [deskripsi, setDeskripsi] = useState("");
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ handleGetUserLoginId();
+ }, []);
+
+ async function handleGetUserLoginId() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ } else {
+ setUserLoginId(null);
+ }
+ } catch (error) {
+ setUserLoginId(null);
+ }
+ }
+
+ if (!userLoginId) {
+ return ;
+ }
+
return (
<>
@@ -50,50 +72,64 @@ function ButtonAction({
userLoginId: string;
}) {
const router = useRouter();
+ const [isLoading, setIsLoading] = useState(false);
async function onReport() {
- const report = await forum_funCreateReportPostingLainnya(
- postingId,
- deskripsi
- );
- if (report.status === 201) {
- ComponentGlobal_NotifikasiBerhasil(report.message);
- router.back();
+ try {
+ setIsLoading(true);
+ const report = await forum_funCreateReportPostingLainnya(
+ postingId,
+ deskripsi
+ );
+ if (report.status === 201) {
+ ComponentGlobal_NotifikasiBerhasil(report.message);
+ router.back();
- const dataNotif = {
- appId: postingId,
- pesan: deskripsi,
- kategoriApp: "FORUM",
- title: "Lainnya",
- userId: userLoginId,
- status: "Report Posting",
- };
+ const dataNotif = {
+ appId: postingId,
+ pesan: deskripsi,
+ kategoriApp: "FORUM",
+ title: "Lainnya",
+ userId: userLoginId,
+ status: "Report Posting",
+ };
- const createNotifikasi = await notifikasiToAdmin_funCreate({
- data: dataNotif as any,
- });
+ const createNotifikasi = await notifikasiToAdmin_funCreate({
+ data: dataNotif as any,
+ });
- if (createNotifikasi.status === 201) {
- mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
+ if (createNotifikasi.status === 201) {
+ mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
+ }
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(report.message);
}
- } else {
- ComponentGlobal_NotifikasiGagal(report.message);
+ } catch (error) {
+ setIsLoading(false);
+ clientLogger.error("Error create report posting", error);
}
}
return (
<>
router.replace(RouterForum.report_posting + postingId)}
>
Batal
onReport()}
diff --git a/src/app_modules/forum/report/posting/layout.tsx b/src/app_modules/forum/report/posting/layout.tsx
index 46bd631c..803c5571 100644
--- a/src/app_modules/forum/report/posting/layout.tsx
+++ b/src/app_modules/forum/report/posting/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutForum_ReportPosting({
@@ -11,15 +14,20 @@ export default function LayoutForum_ReportPosting({
}) {
return (
<>
-
+
}
>
{children}
-
+ */}
-
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/forum/splash/index.tsx b/src/app_modules/forum/splash/index.tsx
index 205abb33..fb89e11b 100644
--- a/src/app_modules/forum/splash/index.tsx
+++ b/src/app_modules/forum/splash/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
import UIGlobal_SplashScreen from "@/app_modules/_global/ui/ui_splash";
import { useShallowEffect } from "@mantine/hooks";
import { IconMessages } from "@tabler/icons-react";
@@ -11,7 +11,7 @@ export default function Forum_Splash() {
useShallowEffect(() => {
setTimeout(() => {
router.replace(RouterForum.beranda, { scroll: false });
- }, 1000);
+ }, 500);
}, []);
return (
diff --git a/src/app_modules/fun_global/get_user_profile.ts b/src/app_modules/fun_global/get_user_profile.ts
index f8b27ba7..bec716ec 100644
--- a/src/app_modules/fun_global/get_user_profile.ts
+++ b/src/app_modules/fun_global/get_user_profile.ts
@@ -1,5 +1,5 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function funGetUserProfile( userId: string ) {
diff --git a/src/app_modules/fun_global/get_user_token.ts b/src/app_modules/fun_global/get_user_token.ts
index 1eb9689a..d8c3f9b6 100644
--- a/src/app_modules/fun_global/get_user_token.ts
+++ b/src/app_modules/fun_global/get_user_token.ts
@@ -1,7 +1,7 @@
"use server";
-import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
-import { ServerEnv } from "@/app/lib/server_env";
+import { RouterAuth } from "@/lib/router_hipmi/router_auth";
+import { ServerEnv } from "@/lib/server_env";
import { unsealData } from "iron-session";
import _ from "lodash";
import { cookies } from "next/headers";
diff --git a/src/app_modules/home/component/body_home.tsx b/src/app_modules/home/component/body_home.tsx
new file mode 100644
index 00000000..5e381847
--- /dev/null
+++ b/src/app_modules/home/component/body_home.tsx
@@ -0,0 +1,206 @@
+import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ ActionIcon,
+ Box,
+ Grid,
+ Group,
+ Image,
+ Paper,
+ SimpleGrid,
+ Stack,
+ Text,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconUserSearch } from "@tabler/icons-react";
+import _ from "lodash";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { apiGetDataHome } from "../fun/get/api_home";
+import { listMenuHomeBody, menuHomeJob } from "./list_menu_home";
+
+export default function BodyHome({ dataUser }: { dataUser: any | null }) {
+ const router = useRouter();
+ const [dataJob, setDataJob] = useState(null);
+ const [loadingJob, setLoadingJob] = useState(true);
+ const [loading, setLoading] = useState(true);
+
+ useShallowEffect(() => {
+ getHomeJob();
+ }, []);
+
+ async function getHomeJob() {
+ try {
+ setLoadingJob(true);
+ const response = await apiGetDataHome({
+ path: "?cat=job",
+ });
+
+ if (response) {
+ setDataJob(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data job", error);
+ } finally {
+ setLoadingJob(false);
+ }
+ }
+
+ return (
+
+ setLoading(false)}
+ styles={{
+ imageWrapper: {
+ border: `2px solid ${AccentColor.blue}`,
+ borderRadius: "10px 10px 10px 10px",
+ },
+ image: {
+ borderRadius: "8px 8px 8px 8px",
+ },
+ }}
+ />
+
+
+
+ {listMenuHomeBody.map((e, i) => (
+ {
+ if (!dataUser) {
+ return null;
+ } else if (dataUser.profile === undefined) {
+ router.push(RouterProfile.create, { scroll: false });
+ } else if (e.link == "") {
+ ComponentGlobal_NotifikasiPeringatan("Cooming Soon");
+ } else {
+ router.push(e.link, { scroll: false });
+ }
+ }}
+ >
+
+
+ {e.icon}
+
+
+ {e.name}
+
+
+
+ ))}
+
+
+ {/* Job View */}
+
+ {
+ if (!dataUser) {
+ return null;
+ } else if (dataUser.profile === undefined) {
+ router.push(RouterProfile.create, { scroll: false });
+ } else if (menuHomeJob.link == "") {
+ ComponentGlobal_NotifikasiPeringatan("Cooming Soon ");
+ } else {
+ router.push(menuHomeJob.link, { scroll: false });
+ }
+ }}
+ >
+
+
+ {menuHomeJob.icon}
+
+
+ {menuHomeJob.name}
+
+
+ {loadingJob ? (
+ Array(1)
+ .fill(null)
+ .map((_, i) => (
+
+
+
+
+
+
+
+
+
+
+
+
+ ))
+ ) : _.isEmpty(dataJob) ? (
+
+ ) : (
+
+ {dataJob?.map((e, i) => (
+
+
+
+
+
+
+
+ {e?.Author.username}
+
+
+ {e?.title}
+
+
+
+
+ ))}
+
+ )}
+
+
+
+
+ );
+}
diff --git a/src/app_modules/home/component/button_header.tsx b/src/app_modules/home/component/button_header.tsx
index 494abc28..d97d157f 100644
--- a/src/app_modules/home/component/button_header.tsx
+++ b/src/app_modules/home/component/button_header.tsx
@@ -1,8 +1,8 @@
"use client";
-import { gs_user_ntf } from "@/app/lib/global_state";
-import { RouterNotifikasi } from "@/app/lib/router_hipmi/router_notifikasi";
-import { RouterUserSearch } from "@/app/lib/router_hipmi/router_user_search";
+import { gs_user_ntf } from "@/lib/global_state";
+import { RouterNotifikasi } from "@/lib/router_hipmi/router_notifikasi";
+import { RouterUserSearch } from "@/lib/router_hipmi/router_user_search";
import {
AccentColor,
MainColor,
diff --git a/src/app_modules/home/component/footer_home.tsx b/src/app_modules/home/component/footer_home.tsx
new file mode 100644
index 00000000..0fb72dd7
--- /dev/null
+++ b/src/app_modules/home/component/footer_home.tsx
@@ -0,0 +1,110 @@
+import { APIs } from "@/lib";
+import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
+import { MainColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import {
+ ActionIcon,
+ Box,
+ Center,
+ SimpleGrid,
+ Stack,
+ Text,
+} from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { Home_ComponentAvatarProfile } from "./comp_avatar_profile";
+import { listMenuHomeFooter } from "./list_menu_home";
+import { IconUser } from "@tabler/icons-react";
+import { IconUserCircle } from "@tabler/icons-react";
+
+export default function FooterHome({ dataUser }: { dataUser: any | null }) {
+ const router = useRouter();
+
+ return (
+
+
+ {listMenuHomeFooter.map((e) => (
+
+ {
+ if (!dataUser) {
+ return null;
+ } else if (dataUser?.profile === undefined) {
+ router.push(RouterProfile.create, { scroll: false });
+ } else if (e.link == "") {
+ ComponentGlobal_NotifikasiPeringatan("Cooming Soon");
+ } else {
+ router.push(e.link, { scroll: false });
+ }
+ }}
+ >
+
+ {e.icon}
+
+
+ {e.name}
+
+
+
+ ))}
+
+
+
+ {!dataUser ? (
+
+ ) : dataUser?.profile === undefined ? (
+
+ router.push(RouterProfile.create, { scroll: false })
+ }
+ >
+
+
+ ) : (
+ {
+ router.push(
+ RouterProfile.katalogOLD + `${dataUser?.profile}`,
+ {
+ scroll: false,
+ }
+ );
+ }}
+ >
+
+
+ )}
+
+ Profile
+
+
+
+
+
+ );
+}
diff --git a/src/app_modules/home/state/global_state.ts b/src/app_modules/home/component/global_state.ts
similarity index 79%
rename from src/app_modules/home/state/global_state.ts
rename to src/app_modules/home/component/global_state.ts
index 638d7246..5b97c4ef 100644
--- a/src/app_modules/home/state/global_state.ts
+++ b/src/app_modules/home/component/global_state.ts
@@ -1,3 +1,4 @@
import { atomWithStorage } from "jotai/utils";
+import { atom } from "jotai";
export const gs_token = atomWithStorage("gs_token", null);
diff --git a/src/app_modules/home/component/list_menu_home.tsx b/src/app_modules/home/component/list_menu_home.tsx
new file mode 100644
index 00000000..2613123a
--- /dev/null
+++ b/src/app_modules/home/component/list_menu_home.tsx
@@ -0,0 +1,67 @@
+import { RouterColab } from '@/lib/router_hipmi/router_colab';
+import { RouterEvent } from '@/lib/router_hipmi/router_event';
+import { RouterForum } from '@/lib/router_hipmi/router_forum';
+import { RouterJob } from '@/lib/router_hipmi/router_job';
+import { RouterMap } from '@/lib/router_hipmi/router_map';
+import { RouterVote } from '@/lib/router_hipmi/router_vote';
+import { IconAffiliate, IconBriefcase, IconHeartHandshake, IconMap2, IconMessages, IconPackageImport, IconPresentation, IconShoppingBag } from '@tabler/icons-react';
+
+
+// yg ada di footer home
+export const listMenuHomeFooter = [
+ {
+ id: 1,
+ name: "Forum",
+ icon: ,
+ link: RouterForum.splash,
+ },
+ {
+ id: 2,
+ name: "Marketplace",
+ icon: ,
+ link: "",
+ },
+ {
+ id: 3,
+ name: "Business Maps",
+ icon: ,
+ link: RouterMap.splash,
+ },
+];
+
+
+// yg ada di kotak2 home (body)
+export const listMenuHomeBody = [
+ {
+ id: 1,
+ name: "Event",
+ icon: ,
+ link: RouterEvent.splash,
+ },
+ {
+ id: 2,
+ name: "Collaboration",
+ icon: ,
+ link: RouterColab.splash,
+ },
+
+ {
+ id: 3,
+ name: "Voting",
+ icon: ,
+ link: RouterVote.splash,
+ },
+
+ {
+ id: 4,
+ name: "Crowdfunding",
+ icon: ,
+ link: `/dev/crowd/splash`,
+ },
+];
+
+export const menuHomeJob = {
+ name: "Job Vacancy",
+ icon: ,
+ link: RouterJob.spalsh,
+};
\ No newline at end of file
diff --git a/src/app_modules/home/component/new_footer_home.tsx b/src/app_modules/home/component/new_footer_home.tsx
new file mode 100644
index 00000000..82b3510a
--- /dev/null
+++ b/src/app_modules/home/component/new_footer_home.tsx
@@ -0,0 +1,97 @@
+import { APIs } from "@/lib";
+import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
+import { MainColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import {
+ ActionIcon,
+ Box,
+ Center,
+ SimpleGrid,
+ Stack,
+ Text,
+} from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { Home_ComponentAvatarProfile } from "./comp_avatar_profile";
+import { listMenuHomeFooter } from "./list_menu_home";
+import { IconUser } from "@tabler/icons-react";
+import { IconUserCircle } from "@tabler/icons-react";
+
+export default function NewFooterHome({ dataUser }: { dataUser: any | null }) {
+ const router = useRouter();
+
+ return (
+
+ {listMenuHomeFooter.map((e) => (
+
+ {
+ if (!dataUser) {
+ return null;
+ } else if (dataUser?.profile === undefined) {
+ router.push(RouterProfile.create, { scroll: false });
+ } else if (e.link == "") {
+ ComponentGlobal_NotifikasiPeringatan("Cooming Soon");
+ } else {
+ router.push(e.link, { scroll: false });
+ }
+ }}
+ >
+
+ {e.icon}
+
+
+ {e.name}
+
+
+
+ ))}
+
+
+
+ {!dataUser ? (
+
+ ) : dataUser?.profile === undefined ? (
+
+ router.push(RouterProfile.create, { scroll: false })
+ }
+ >
+
+
+ ) : (
+ {
+ router.push(RouterProfile.katalogOLD + `${dataUser?.profile}`, {
+ scroll: false,
+ });
+ }}
+ >
+
+
+ )}
+
+ Profile
+
+
+
+
+ );
+}
diff --git a/src/app_modules/home/component/ui_home.tsx b/src/app_modules/home/component/ui_home.tsx
index 9ce1203d..aaee11e9 100644
--- a/src/app_modules/home/component/ui_home.tsx
+++ b/src/app_modules/home/component/ui_home.tsx
@@ -1,9 +1,9 @@
"use client";
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import {
AccentColor,
MainColor,
@@ -40,11 +40,11 @@ import { useRouter } from "next/navigation";
import { useState } from "react";
import { MODEL_USER } from "../model/interface";
import { MODEL_JOB } from "@/app_modules/job/model/interface";
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
-import { RouterMap } from "@/app/lib/router_hipmi/router_map";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
+import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
+import { RouterMap } from "@/lib/router_hipmi/router_map";
import { Home_ComponentAvatarProfile } from "./comp_avatar_profile";
-import { APIs } from "@/app/lib";
+import { APIs } from "@/lib";
export function Home_UiView({
dataUser,
@@ -104,7 +104,7 @@ export function Home_UiView({
border: `2px solid ${AccentColor.blue}`,
}}
>
-
+
diff --git a/src/app_modules/home/fun/get/api_home.ts b/src/app_modules/home/fun/get/api_home.ts
new file mode 100644
index 00000000..c9c58610
--- /dev/null
+++ b/src/app_modules/home/fun/get/api_home.ts
@@ -0,0 +1,73 @@
+export const apiGetDataHome = async ({ path }: { path?: string }) => {
+ // Fetch token from cookie
+ try {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/new/home${path ? path : ""}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // if (!response.ok) return null;
+ // const data: Record = await response.json();
+ // return data;
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error get admin contact:",
+ errorData?.message || "Unknown error"
+ );
+
+ return null;
+ }
+
+ const result = await response.json();
+ return result;
+ } catch (error) {
+ console.error("Error get admin contact:", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+export const apiGetNotifikasiHome = async () => {
+ // Fetch token from cookie
+ try {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/notifikasi/count`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error get admin contact:",
+ errorData?.message || "Unknown error"
+ );
+
+ return null;
+ }
+
+ const result = await response.json();
+ return result;
+ } catch (error) {
+ console.error("Error get admin contact:", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
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 ec7f5ca6..14c8e958 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
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function user_getOneByUserId(userId?: string) {
const data = await prisma.user.findFirst({
diff --git a/src/app_modules/home/index.ts b/src/app_modules/home/index.ts
index 07785dd4..e0eda0b5 100644
--- a/src/app_modules/home/index.ts
+++ b/src/app_modules/home/index.ts
@@ -1,4 +1,6 @@
+import { listMenuHomeFooter } from './component/list_menu_home';
import HomeView from "./view_home";
+import HomeViewNew from "./view_home_new";
import Home_UserNotActive from "./user_non_active";
-export { HomeView, Home_UserNotActive as Home_UserNonActive };
+export { HomeView, HomeViewNew, listMenuHomeFooter, Home_UserNotActive as Home_UserNonActive };
diff --git a/src/app_modules/home/v2_home_view.tsx b/src/app_modules/home/v2_home_view.tsx
new file mode 100644
index 00000000..c29df2d1
--- /dev/null
+++ b/src/app_modules/home/v2_home_view.tsx
@@ -0,0 +1,171 @@
+"use client";
+
+import { gs_user_ntf } from "@/lib/global_state";
+import global_limit from "@/lib/limit";
+import { clientLogger } from "@/util/clientLogger";
+import { useShallowEffect } from "@mantine/hooks";
+import { useAtom } from "jotai";
+import { useState } from "react";
+import { NewUI_Header } from "../_global/ui/new_ui_header";
+import { gs_notifikasi_kategori_app } from "../notifikasi/lib";
+import { apiGetNotifikasiHome, apiGetDataHome } from "./fun/get/api_home";
+import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
+import { RouterNotifikasi } from "@/lib/router_hipmi/router_notifikasi";
+import { RouterUserSearch } from "@/lib/router_hipmi/router_user_search";
+import { ActionIcon, Image, Indicator, Text } from "@mantine/core";
+import { IconUserSearch, IconBell } from "@tabler/icons-react";
+import { AccentColor, MainColor } from "../_global/color";
+import { useRouter } from "next/navigation";
+import BodyHome from "./component/body_home";
+import { NewUI_Footer } from "../_global/ui/new_ui_footer";
+import NewFooterHome from "./component/new_footer_home";
+import { NewUI_Content } from "../_global/ui/new_ui_content";
+import { NewUI_Tamplate } from "../_global/ui/new_ui_tamplate";
+
+export function V2_View_Home() {
+ const [countNtf, setCountNtf] = useState(null);
+ const [newUserNtf, setNewUserNtf] = useAtom(gs_user_ntf);
+ const [dataUser, setDataUser] = useState(null);
+ const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
+ const router = useRouter();
+
+ useShallowEffect(() => {
+ if (countNtf != null) {
+ setCountNtf(countNtf + newUserNtf);
+ setNewUserNtf(0);
+ }
+ }, [newUserNtf]);
+
+ useShallowEffect(() => {
+ hanlderLoadData();
+ }, []);
+
+ async function hanlderLoadData() {
+ try {
+ const listLoadData = [
+ global_limit(() => onLoadNotifikasi()),
+ global_limit(() => cekUserLogin()),
+ ];
+
+ await Promise.all(listLoadData);
+ } catch (error) {
+ clientLogger.error("Error handler load data", error);
+ }
+ }
+
+ async function onLoadNotifikasi() {
+ try {
+ const response = await apiGetNotifikasiHome();
+ if (response && response.success) {
+ setCountNtf(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error load notifikasi", error);
+ }
+ }
+
+ async function cekUserLogin() {
+ try {
+ const response = await apiGetDataHome({
+ path: "?cat=cek_profile",
+ });
+ if (response && response.success) {
+ setDataUser(response.data);
+ } else {
+ setDataUser(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data home", error);
+ setDataUser(null);
+ }
+ }
+
+ return (
+ <>
+
+
+
+
+ ) : dataUser?.profile === undefined ? (
+ {
+ router.push(RouterProfile.create, { scroll: false });
+ }}
+ >
+
+
+ ) : (
+ {
+ router.push(RouterUserSearch.main, { scroll: false });
+ }}
+ >
+
+
+ )
+ }
+ customButtonRight={
+ !dataUser && !countNtf ? (
+
+
+
+ ) : dataUser?.profile === undefined ? (
+ {
+ router.push(RouterProfile.create, { scroll: false });
+ }}
+ >
+
+
+ ) : (
+ {
+ setCategoryPage("Semua");
+ router.push(RouterNotifikasi.categoryApp({ name: "semua" }), {
+ scroll: false,
+ });
+ }}
+ >
+ {countNtf != null && countNtf > 0 ? (
+
+ {countNtf > 99 ? "99+" : countNtf}
+
+ }
+ >
+
+
+ ) : (
+
+ )}
+
+ )
+ }
+ />
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/home/v3_home_view.tsx b/src/app_modules/home/v3_home_view.tsx
new file mode 100644
index 00000000..4295db15
--- /dev/null
+++ b/src/app_modules/home/v3_home_view.tsx
@@ -0,0 +1,177 @@
+"use client";
+
+import { gs_user_ntf } from "@/lib/global_state";
+import global_limit from "@/lib/limit";
+import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
+import { RouterNotifikasi } from "@/lib/router_hipmi/router_notifikasi";
+import { RouterUserSearch } from "@/lib/router_hipmi/router_user_search";
+import { clientLogger } from "@/util/clientLogger";
+import { ActionIcon, Indicator, Text } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconBell, IconUserSearch } from "@tabler/icons-react";
+import { useAtom } from "jotai";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { MainColor } from "../_global/color";
+import { Component_Header } from "../_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewFooter,
+ UI_NewHeader,
+} from "../_global/ui/V2_layout_tamplate";
+import { gs_notifikasi_kategori_app } from "../notifikasi/lib";
+import BodyHome from "./component/body_home";
+import NewFooterHome from "./component/new_footer_home";
+import { apiGetDataHome, apiGetNotifikasiHome } from "./fun/get/api_home";
+
+export function V3_View_Home() {
+ const [countNtf, setCountNtf] = useState(null);
+ const [newUserNtf, setNewUserNtf] = useAtom(gs_user_ntf);
+ const [dataUser, setDataUser] = useState(null);
+ const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
+ const router = useRouter();
+
+ useShallowEffect(() => {
+ if (countNtf != null) {
+ setCountNtf(countNtf + newUserNtf);
+ setNewUserNtf(0);
+ }
+ }, [newUserNtf]);
+
+ useShallowEffect(() => {
+ hanlderLoadData();
+ }, []);
+
+ async function hanlderLoadData() {
+ try {
+ const listLoadData = [
+ global_limit(() => onLoadNotifikasi()),
+ global_limit(() => cekUserLogin()),
+ ];
+
+ await Promise.all(listLoadData);
+ } catch (error) {
+ clientLogger.error("Error handler load data", error);
+ }
+ }
+
+ async function onLoadNotifikasi() {
+ try {
+ const response = await apiGetNotifikasiHome();
+ if (response && response.success) {
+ setCountNtf(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error load notifikasi", error);
+ }
+ }
+
+ async function cekUserLogin() {
+ try {
+ const response = await apiGetDataHome({
+ path: "?cat=cek_profile",
+ });
+ if (response && response.success) {
+ setDataUser(response.data);
+ } else {
+ setDataUser(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data home", error);
+ setDataUser(null);
+ }
+ }
+
+ return (
+ <>
+
+
+
+
+
+ ) : dataUser?.profile === undefined ? (
+ {
+ router.push(RouterProfile.create, { scroll: false });
+ }}
+ >
+
+
+ ) : (
+ {
+ router.push(RouterUserSearch.main, { scroll: false });
+ }}
+ >
+
+
+ )
+ }
+ customButtonRight={
+ !dataUser && !countNtf ? (
+
+
+
+ ) : dataUser?.profile === undefined ? (
+ {
+ router.push(RouterProfile.create, { scroll: false });
+ }}
+ >
+
+
+ ) : (
+ {
+ setCategoryPage("Semua");
+ router.push(
+ RouterNotifikasi.categoryApp({ name: "semua" }),
+ {
+ scroll: false,
+ }
+ );
+ }}
+ >
+ {countNtf != null && countNtf > 0 ? (
+
+ {countNtf > 99 ? "99+" : countNtf}
+
+ }
+ >
+
+
+ ) : (
+
+ )}
+
+ )
+ }
+ />
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/home/view_home.tsx b/src/app_modules/home/view_home.tsx
index 01d0052d..5a7e52e5 100644
--- a/src/app_modules/home/view_home.tsx
+++ b/src/app_modules/home/view_home.tsx
@@ -1,20 +1,15 @@
"use client";
-
-import { useEffect, useState } from "react";
+import { gs_user_ntf } from "@/lib/global_state";
+import { useShallowEffect } from "@mantine/hooks";
+import { useAtom } from "jotai";
+import { useState } from "react";
import UIGlobal_LayoutHeaderTamplate from "../_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "../_global/ui/ui_layout_tamplate";
import { MODEL_JOB } from "../job/model/interface";
-import {
- ComponentHome_ButtonHeaderLeft,
- ComponentHome_ButtonHeaderRight,
-} from "./component/button_header";
+import notifikasi_countUserNotifikasi from "../notifikasi/fun/count/fun_count_by_id";
+import { ComponentHome_ButtonHeaderLeft, ComponentHome_ButtonHeaderRight, } from "./component/button_header";
import { Home_UiFooter, Home_UiView } from "./component/ui_home";
import { MODEL_USER } from "./model/interface";
-import { useShallowEffect } from "@mantine/hooks";
-import { gs_count_ntf, gs_user_ntf } from "@/app/lib/global_state";
-import { useAtom } from "jotai";
-import notifikasi_countUserNotifikasi from "../notifikasi/fun/count/fun_count_by_id";
-import { Center, Text, Title } from "@mantine/core";
export default function HomeView({
dataUser,
@@ -27,17 +22,26 @@ export default function HomeView({
}) {
const [countNtf, setCountNtf] = useState(countNotifikasi);
const [newUserNtf, setNewUserNtf] = useAtom(gs_user_ntf);
- const [countLoadNtf, setCountLoadNtf] = useAtom(gs_count_ntf);
+ // const [countLoadNtf, setCountLoadNtf] = useAtom(gs_count_ntf);
+ const userRoleId = dataUser.masterUserRoleId;
- useShallowEffect(() => {
- onLoadNotifikasi({
- onLoad(val) {
- setCountNtf(val);
- },
- });
+ // useShallowEffect(() => {
+ // if (userRoleId === "2" || userRoleId === "3") {
+ // setTimeout(() => {
+ // router.push("/waiting-room", { scroll: false });
+ // }, 1000);
+ // }
+ // }, [userRoleId]);
- setCountNtf(countLoadNtf as any);
- }, [countLoadNtf, setCountNtf]);
+ // useShallowEffect(() => {
+ // onLoadNotifikasi({
+ // onLoad(val) {
+ // setCountNtf(val);
+ // },
+ // });
+
+ // setCountNtf(countLoadNtf as any);
+ // }, [countLoadNtf, setCountNtf]);
useShallowEffect(() => {
setCountNtf(countNtf + newUserNtf);
@@ -49,15 +53,11 @@ export default function HomeView({
onLoad(loadNotif);
}
- // console.log(dataUser, "dipage")
return (
<>
- // HIPMI
- //
(null);
+ const [newUserNtf, setNewUserNtf] = useAtom(gs_user_ntf);
+ const [dataUser, setDataUser] = useState(null);
+ const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
+ const router = useRouter();
+
+ useShallowEffect(() => {
+ if (countNtf != null) {
+ setCountNtf(countNtf + newUserNtf);
+ setNewUserNtf(0);
+ }
+ }, [newUserNtf]);
+
+ useShallowEffect(() => {
+ hanlderLoadData();
+ }, []);
+
+ async function hanlderLoadData() {
+ try {
+ const listLoadData = [
+ global_limit(() => onLoadNotifikasi()),
+ global_limit(() => cekUserLogin()),
+ ];
+
+ await Promise.all(listLoadData);
+ } catch (error) {
+ clientLogger.error("Error handler load data", error);
+ }
+ }
+
+ async function onLoadNotifikasi() {
+ try {
+ const response = await apiGetNotifikasiHome();
+ if (response && response.success) {
+ setCountNtf(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error load notifikasi", error);
+ }
+ }
+
+ async function cekUserLogin() {
+ try {
+ const response = await apiGetDataHome({
+ path: "?cat=cek_profile",
+ });
+ if (response && response.success) {
+ setDataUser(response.data);
+ } else {
+ setDataUser(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data home", error);
+ setDataUser(null);
+ }
+ }
+
+
+ return (
+ <>
+
+
+
+ ) : dataUser?.profile === undefined ? (
+ {
+ router.push(RouterProfile.create, { scroll: false });
+ }}
+ >
+
+
+ ) : (
+ {
+ router.push(RouterUserSearch.main, { scroll: false });
+ }}
+ >
+
+
+ )
+ }
+ customButtonRight={
+ !dataUser && !countNtf ? (
+
+
+
+ ) : dataUser?.profile === undefined ? (
+ {
+ router.push(RouterProfile.create, { scroll: false });
+ }}
+ >
+
+
+ ) : (
+ {
+ setCategoryPage("Semua");
+ router.push(
+ RouterNotifikasi.categoryApp({ name: "semua" }),
+ {
+ scroll: false,
+ }
+ );
+ }}
+ >
+ {countNtf != null && countNtf > 0 ? (
+
+ {countNtf > 99 ? "99+" : countNtf}
+
+ }
+ >
+
+
+ ) : (
+
+ )}
+
+ )
+ }
+ />
+ }
+ footer={}
+ >
+
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_component/button/comp_button_create_new_investasi.tsx b/src/app_modules/investasi/_component/button/comp_button_create_new_investasi.tsx
index f7c09f94..319bd5f2 100644
--- a/src/app_modules/investasi/_component/button/comp_button_create_new_investasi.tsx
+++ b/src/app_modules/investasi/_component/button/comp_button_create_new_investasi.tsx
@@ -1,7 +1,5 @@
"use client";
-import { DIRECTORY_ID } from "@/app/lib";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
import { MainColor } from "@/app_modules/_global/color";
import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
import {
@@ -10,11 +8,15 @@ import {
ComponentGlobal_NotifikasiPeringatan,
} from "@/app_modules/_global/notif_global";
import { notifikasiToAdmin_funCreate } from "@/app_modules/notifikasi/fun";
-import mqtt_client from "@/util/mqtt_client";
+import { DIRECTORY_ID } from "@/lib";
+import { IRealtimeData } from "@/lib/global_state";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
+import { clientLogger } from "@/util/clientLogger";
import { Button } from "@mantine/core";
import { useAtom } from "jotai";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { WibuRealtime } from "wibu-pkg";
import { investasi_funCreateNewInvestasi } from "../../_fun";
import { gs_investas_menu, gs_investasi_status } from "../../g_state";
@@ -23,85 +25,97 @@ export function Investasi_ComponentButtonCreateNewInvestasi({
totalLembar,
fileImage,
filePdf,
+ isMinimalTarget,
}: {
data: any;
totalLembar: number;
fileImage: File;
filePdf: File;
+ isMinimalTarget: boolean;
}) {
const router = useRouter();
const [isLoading, setIsLoading] = useState(false);
const [activeTab, setActiveTab] = useAtom(gs_investasi_status);
const [hotMenu, setHotMenu] = useAtom(gs_investas_menu);
- async function onSubmit() {
- setIsLoading(true);
- const body = {
- title: data.title,
- targetDana: data.targetDana,
- hargaLembar: data.hargaLembar,
- totalLembar: totalLembar,
- roi: data.roi,
- masterPeriodeDevidenId: data.periodeDevidenId,
- masterPembagianDevidenId: data.pembagianDevidenId,
- masterPencarianInvestorId: data.pencarianInvestorId,
- };
-
- const uploadImage = await funGlobal_UploadToStorage({
- file: fileImage,
- dirId: DIRECTORY_ID.investasi_image,
- });
- if (!uploadImage.success) {
- setIsLoading(false);
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload file gambar");
- }
-
- const uploadFilePdf = await funGlobal_UploadToStorage({
- file: filePdf,
- dirId: DIRECTORY_ID.investasi_prospektus,
- });
- if (!uploadFilePdf.success) {
- setIsLoading(false);
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload file pdf");
- }
-
- const res = await investasi_funCreateNewInvestasi({
- data: body as any,
- fileImageId: uploadImage.data.id,
- filePdfId: uploadFilePdf.data.id,
- });
-
- if (res.status === 201) {
- const dataNotif = {
- appId: res.data?.id,
- status: res.data?.MasterStatusInvestasi?.name,
- userId: res.data?.authorId,
- pesan: res.data?.title,
- kategoriApp: "INVESTASI",
- title: "Investasi baru",
+ async function onCreate() {
+ try {
+ setIsLoading(true);
+ const body = {
+ title: data.title,
+ targetDana: data.targetDana,
+ hargaLembar: data.hargaLembar,
+ totalLembar: totalLembar,
+ roi: data.roi,
+ masterPeriodeDevidenId: data.periodeDevidenId,
+ masterPembagianDevidenId: data.pembagianDevidenId,
+ masterPencarianInvestorId: data.pencarianInvestorId,
};
- const notif = await notifikasiToAdmin_funCreate({
- data: dataNotif as any,
+ const uploadImage = await funGlobal_UploadToStorage({
+ file: fileImage,
+ dirId: DIRECTORY_ID.investasi_image,
+ });
+ if (!uploadImage.success) {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload file gambar");
+ return;
+ }
+
+ const uploadFilePdf = await funGlobal_UploadToStorage({
+ file: filePdf,
+ dirId: DIRECTORY_ID.investasi_prospektus,
+ });
+ if (!uploadFilePdf.success) {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload file pdf");
+ return;
+ }
+
+ const res = await investasi_funCreateNewInvestasi({
+ data: body as any,
+ fileImageId: uploadImage.data.id,
+ filePdfId: uploadFilePdf.data.id,
});
- if (notif.status === 201) {
- mqtt_client.publish(
- "ADMIN",
- JSON.stringify({
- count: 1,
- })
- );
- setActiveTab("Review");
- setHotMenu(1);
- setIsLoading(true);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- router.push(NEW_RouterInvestasi.portofolio({ id: "2" }));
+ if (res.status === 201) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res.data?.id as string,
+ status: res.data?.MasterStatusInvestasi?.name as any,
+ userId: res.data?.authorId as string,
+ pesan: res.data?.title as string,
+ kategoriApp: "INVESTASI",
+ title: "Investasi baru",
+ };
+
+ const notif = await notifikasiToAdmin_funCreate({
+ data: dataNotifikasi as any,
+ });
+
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "ADMIN",
+ });
+
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "ADMIN",
+ dataMessage: dataNotifikasi,
+ });
+
+ router.push(NEW_RouterInvestasi.portofolio({ id: "2" }));
+ setActiveTab("Review");
+ setHotMenu(1);
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ }
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
}
+ } catch (error) {
setIsLoading(false);
- } else {
- setIsLoading(false);
- ComponentGlobal_NotifikasiGagal(res.message);
+ clientLogger.error("Error create new investasi", error);
}
}
@@ -123,15 +137,14 @@ export function Investasi_ComponentButtonCreateNewInvestasi({
data.periodeDevidenId === "" ||
data.pembagianDevidenId === "" ||
fileImage === null ||
- filePdf === null
- ? true
- : false
+ filePdf === null ||
+ isMinimalTarget
}
radius={50}
bg={MainColor.yellow}
color="yellow"
c={"black"}
- onClick={() => onSubmit()}
+ onClick={() => onCreate()}
>
Simpan
diff --git a/src/app_modules/investasi/_component/button/comp_button_update_investasi.tsx b/src/app_modules/investasi/_component/button/comp_button_update_investasi.tsx
index 5556c207..17fcd33a 100644
--- a/src/app_modules/investasi/_component/button/comp_button_update_investasi.tsx
+++ b/src/app_modules/investasi/_component/button/comp_button_update_investasi.tsx
@@ -5,12 +5,16 @@ import {
ComponentGlobal_NotifikasiBerhasil,
ComponentGlobal_NotifikasiPeringatan,
} from "@/app_modules/_global/notif_global";
-import { DIRECTORY_ID } from "@/app/lib";
-import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
+import { DIRECTORY_ID } from "@/lib";
+import {
+ funGlobal_DeleteFileById,
+ funGlobal_UploadToStorage,
+} from "@/app_modules/_global/fun";
import _ from "lodash";
import { investasi_funUpdateInvestasi } from "../../_fun";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { clientLogger } from "@/util/clientLogger";
export function Investasi_ComponentButtonUpdateDataInvestasi({
data,
@@ -25,6 +29,7 @@ export function Investasi_ComponentButtonUpdateDataInvestasi({
const [isLoading, setIsLoading] = useState(false);
async function onUpdate() {
+ setIsLoading(true);
if (totalLembar === "0")
return ComponentGlobal_NotifikasiPeringatan("Total lembar kosong");
@@ -36,11 +41,21 @@ export function Investasi_ComponentButtonUpdateDataInvestasi({
file: file as any,
dirId: DIRECTORY_ID.investasi_image,
});
+
if (!uploadImage.success) {
setIsLoading(false);
return ComponentGlobal_NotifikasiPeringatan("Gagal upload file gambar");
}
+ const deleteFile = await funGlobal_DeleteFileById({
+ fileId: data.imageId,
+ });
+
+ if (!deleteFile.success) {
+ setIsLoading(false);
+ clientLogger.error("Error delete file:", deleteFile.message);
+ }
+
const updtWithImage = await investasi_funUpdateInvestasi({
data: data,
imageId: uploadImage.data.id,
@@ -74,6 +89,8 @@ export function Investasi_ComponentButtonUpdateDataInvestasi({
return (
{
+ try {
+ setIsLoading(true);
+ const buffer = URL.createObjectURL(
+ new Blob([new Uint8Array(await files.arrayBuffer())])
+ );
+
+ if (files.size > 100 * 1024 * 1024) {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("File terlalu besar");
+ return;
+ }
+
+ if (files.type !== "application/pdf") {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Tipe file bukan PDF");
+ return;
+ }
+
+ onSetFile(files);
+ onSetImage(buffer);
+ } catch (error) {
+ clientLogger.error("Upload image error:", error);
+ } finally {
+ setIsLoading(false);
+ }
+ }}
+ accept={"application/pdf"}
+ >
+ {(props) => (
+ }
+ c={MainColor.darkblue}
+ >
+ {text ? text : "Upload"}
+
+ )}
+
+ );
+}
diff --git a/src/app_modules/investasi/_component/comp_card_border_and_background.tsx b/src/app_modules/investasi/_component/comp_card_border_and_background.tsx
index a6942af2..28c496b0 100644
--- a/src/app_modules/investasi/_component/comp_card_border_and_background.tsx
+++ b/src/app_modules/investasi/_component/comp_card_border_and_background.tsx
@@ -1,4 +1,4 @@
-import { AccentColor } from "@/app_modules/_global/color";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { Card } from "@mantine/core";
import React from "react";
@@ -26,7 +26,7 @@ export function Investasi_ComponentStylesCard({
paddingInline: "15px",
paddingBlock: "15px",
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
marginBottom: marginBottom ? marginBottom : "0x",
}}
onClick={onClickHandler}
diff --git a/src/app_modules/investasi/_component/detail/comp_box_daftar_berita.tsx b/src/app_modules/investasi/_component/detail/comp_box_daftar_berita.tsx
index 84919ace..fc6adb93 100644
--- a/src/app_modules/investasi/_component/detail/comp_box_daftar_berita.tsx
+++ b/src/app_modules/investasi/_component/detail/comp_box_daftar_berita.tsx
@@ -1,8 +1,8 @@
import {
NEW_RouterInvestasi,
RouterInvestasi_OLD,
-} from "@/app/lib/router_hipmi/router_investasi";
-import { AccentColor } from "@/app_modules/_global/color";
+} from "@/lib/router_hipmi/router_investasi";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { ActionIcon, Flex, Loader, Paper, Text } from "@mantine/core";
import { IconFileDescription } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
@@ -34,12 +34,12 @@ export function Investasi_ComponentBoxDaftarBerita({
}}
>
- Berita
+ Berita
{isLoading ? (
) : (
-
+
)}
diff --git a/src/app_modules/investasi/_component/detail/comp_box_daftar_dokumen.tsx b/src/app_modules/investasi/_component/detail/comp_box_daftar_dokumen.tsx
index a422ac7c..0f20c65b 100644
--- a/src/app_modules/investasi/_component/detail/comp_box_daftar_dokumen.tsx
+++ b/src/app_modules/investasi/_component/detail/comp_box_daftar_dokumen.tsx
@@ -1,8 +1,8 @@
import {
NEW_RouterInvestasi,
RouterInvestasi_OLD,
-} from "@/app/lib/router_hipmi/router_investasi";
-import { AccentColor } from "@/app_modules/_global/color";
+} from "@/lib/router_hipmi/router_investasi";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { ActionIcon, Flex, Loader, Paper, Text } from "@mantine/core";
import { IconFileDescription } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
@@ -35,12 +35,12 @@ export function Investasi_ComponentBoxDaftarDokumen({
}}
>
- Dokumen
+ Dokumen
{isLoading ? (
) : (
-
+
)}
diff --git a/src/app_modules/investasi/_component/detail/comp_box_investor.tsx b/src/app_modules/investasi/_component/detail/comp_box_investor.tsx
new file mode 100644
index 00000000..7303fa02
--- /dev/null
+++ b/src/app_modules/investasi/_component/detail/comp_box_investor.tsx
@@ -0,0 +1,45 @@
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { ActionIcon, Flex, Loader, Paper, Text } from "@mantine/core";
+import { IconBookDownload, IconZoomMoney } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+
+export function Investasi_ComponentBoxInvestor({ id }: { id: string }) {
+ const router = useRouter();
+ const [isLoading, setLoading] = useState(false);
+
+ return (
+ <>
+ {
+ setLoading(true);
+ router.push(NEW_RouterInvestasi.list_investor({ id: id }), {
+ scroll: false,
+ });
+ }}
+ >
+
+
+ Investor
+
+
+ {isLoading ? (
+
+ ) : (
+
+ )}
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_component/detail/comp_box_prospektus.tsx b/src/app_modules/investasi/_component/detail/comp_box_prospektus.tsx
index 1af7d87e..884b055e 100644
--- a/src/app_modules/investasi/_component/detail/comp_box_prospektus.tsx
+++ b/src/app_modules/investasi/_component/detail/comp_box_prospektus.tsx
@@ -1,9 +1,10 @@
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
-import { AccentColor } from "@/app_modules/_global/color";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { ActionIcon, Flex, Loader, Paper, Text } from "@mantine/core";
import { IconBookDownload } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
export function Investasi_ComponentBoxProspektus({
prospektusFileId,
@@ -24,6 +25,10 @@ export function Investasi_ComponentBoxProspektus({
color: "white",
}}
onClick={() => {
+ if (!prospektusFileId)
+ return ComponentGlobal_NotifikasiPeringatan(
+ "Prospektus belum diupload"
+ );
setLoading(true);
router.push(
NEW_RouterInvestasi.file_prospektus({ id: prospektusFileId }),
@@ -32,12 +37,14 @@ export function Investasi_ComponentBoxProspektus({
}}
>
- Prospektus
+
+ Prospektus
+
{isLoading ? (
) : (
-
+
)}
diff --git a/src/app_modules/investasi/_component/detail/comp_card_daftar_document.tsx b/src/app_modules/investasi/_component/detail/comp_card_daftar_document.tsx
index 5bfdab9e..bcb30abf 100644
--- a/src/app_modules/investasi/_component/detail/comp_card_daftar_document.tsx
+++ b/src/app_modules/investasi/_component/detail/comp_card_daftar_document.tsx
@@ -1,4 +1,4 @@
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import {
ComponentGlobal_CardLoadingOverlay,
ComponentGlobal_CardStyles,
@@ -22,10 +22,9 @@ export function Investasi_ComponentCardDaftarDocument({
justify="center"
h={"100%"}
onClick={() => {
- router.push(
- NEW_RouterInvestasi.file_prospektus({ id: data.fileId }),
- { scroll: false }
- );
+ router.push(NEW_RouterInvestasi.file_dokumen({ id: data.fileId }), {
+ scroll: false,
+ });
setVisible(true);
}}
>
diff --git a/src/app_modules/investasi/_component/detail/comp_card_rekap_document.tsx b/src/app_modules/investasi/_component/detail/comp_card_rekap_document.tsx
index 5e62a0f2..9bfa2458 100644
--- a/src/app_modules/investasi/_component/detail/comp_card_rekap_document.tsx
+++ b/src/app_modules/investasi/_component/detail/comp_card_rekap_document.tsx
@@ -1,4 +1,4 @@
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import {
ComponentGlobal_CardLoadingOverlay,
ComponentGlobal_CardStyles,
@@ -17,7 +17,7 @@ import {
Text,
} from "@mantine/core";
import { IconDots, IconEdit, IconTrash } from "@tabler/icons-react";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import { MODEL_INVESTASI_DOKUMEN } from "../../_lib/interface";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
@@ -30,6 +30,8 @@ import {
ComponentGlobal_NotifikasiBerhasil,
ComponentGlobal_NotifikasiPeringatan,
} from "@/app_modules/_global/notif_global";
+import { apiGetDokumenInvestasiById } from "../../_lib/api_interface";
+import { clientLogger } from "@/util/clientLogger";
export function Investasi_ComponentCardRekapDocument({
data,
@@ -38,6 +40,9 @@ export function Investasi_ComponentCardRekapDocument({
data: MODEL_INVESTASI_DOKUMEN;
onSetData: (val: any) => any[];
}) {
+ const params = useParams<{ id: string }>();
+ const investasiId = params.id;
+
const router = useRouter();
const [openDrawer, setOpenDrawer] = useState(false);
const [isLoadingEdit, setIsLoadingEdit] = useState(false);
@@ -63,18 +68,22 @@ export function Investasi_ComponentCardRekapDocument({
if (deleteFromDB.status !== 200) {
ComponentGlobal_NotifikasiPeringatan(deleteFromDB.message);
+ return;
}
ComponentGlobal_NotifikasiBerhasil(deleteFromDB.message);
setOpenModal(false);
- const loadData = await investasi_funGetAllDocumentById({
- investasiId: data.investasiId,
- page: 1,
+ const respone = await apiGetDokumenInvestasiById({
+ id: investasiId,
+ kategori: "get-all",
+ page: "1",
});
- onSetData(loadData);
+ if (respone.success) {
+ onSetData(respone.data);
+ }
} catch (error) {
- console.log(error);
+ clientLogger.error("Error hapus dokumen", error);
} finally {
setIsLoadingDelete(false);
}
@@ -88,7 +97,7 @@ export function Investasi_ComponentCardRekapDocument({
span={"auto"}
onClick={() => {
router.push(
- NEW_RouterInvestasi.file_prospektus({ id: data.fileId }),
+ NEW_RouterInvestasi.file_dokumen({ id: data.fileId }),
{ scroll: false }
);
setVisible(true);
diff --git a/src/app_modules/investasi/_component/detail/comp_title_and_value_in_detail.tsx b/src/app_modules/investasi/_component/detail/comp_title_and_value_in_detail.tsx
index 3f8ca614..84e93f58 100644
--- a/src/app_modules/investasi/_component/detail/comp_title_and_value_in_detail.tsx
+++ b/src/app_modules/investasi/_component/detail/comp_title_and_value_in_detail.tsx
@@ -1,3 +1,4 @@
+import { MainColor } from "@/app_modules/_global/color";
import { Grid, Text } from "@mantine/core";
import { data } from "autoprefixer";
import React from "react";
@@ -13,7 +14,7 @@ export function Investasi_ComponentTitleAndValueInDetail({
<>
- {title}
+ {title}
:
{value}
diff --git a/src/app_modules/investasi/_component/detail/saham_saya/comp_detail_data.tsx b/src/app_modules/investasi/_component/detail/saham_saya/comp_detail_data.tsx
index 7457c457..f15deaa6 100644
--- a/src/app_modules/investasi/_component/detail/saham_saya/comp_detail_data.tsx
+++ b/src/app_modules/investasi/_component/detail/saham_saya/comp_detail_data.tsx
@@ -4,17 +4,12 @@ import {
ComponentGlobal_LoadImageLandscape,
} from "@/app_modules/_global/component";
import { MODEL_INVOICE_INVESTASI } from "@/app_modules/investasi/_lib/interface";
-import {
- Box,
- Grid,
- SimpleGrid,
- Stack,
- Text,
- Title
-} from "@mantine/core";
+import { Box, Grid, SimpleGrid, Stack, Text, Title } from "@mantine/core";
import { Investasi_ComponentBoxDaftarBerita } from "../comp_box_daftar_berita";
import { Investasi_ComponentBoxDaftarDokumen } from "../comp_box_daftar_dokumen";
import { Investasi_ComponentBoxProspektus } from "../comp_box_prospektus";
+import { MainColor } from "@/app_modules/_global/color";
+import { Investasi_ComponentBoxInvestor } from "../comp_box_investor";
export function Investasi_ComponentBoxDetailData({
data,
@@ -31,7 +26,7 @@ export function Investasi_ComponentBoxDetailData({
-
+
{data?.Investasi.title}
@@ -115,6 +110,8 @@ export function Investasi_ComponentBoxDetailData({
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
]}
>
+
+
diff --git a/src/app_modules/investasi/_component/detail/saham_saya/comp_harga_dan_lembar.tsx b/src/app_modules/investasi/_component/detail/saham_saya/comp_harga_dan_lembar.tsx
index 5effc7a5..91a5d44f 100644
--- a/src/app_modules/investasi/_component/detail/saham_saya/comp_harga_dan_lembar.tsx
+++ b/src/app_modules/investasi/_component/detail/saham_saya/comp_harga_dan_lembar.tsx
@@ -6,6 +6,7 @@ import { Stack, Grid, Text } from "@mantine/core";
import { data } from "autoprefixer";
import { Investasi_ComponentStylesCard } from "../../comp_card_border_and_background";
import { MODEL_INVOICE_INVESTASI } from "@/app_modules/investasi/_lib/interface";
+import { MainColor } from "@/app_modules/_global/color";
export function Investasi_ComponentBoxHargaDanLembarSaham({
data,
@@ -19,7 +20,7 @@ export function Investasi_ComponentBoxHargaDanLembarSaham({
- Transaksi Saham
+ Transaksi Saham
- Saham Terbeli
+ Saham Terbeli
- Progres Saham
+ Progres Saham
diff --git a/src/app_modules/investasi/_component/index.ts b/src/app_modules/investasi/_component/index.ts
index ef436387..6d83948f 100644
--- a/src/app_modules/investasi/_component/index.ts
+++ b/src/app_modules/investasi/_component/index.ts
@@ -18,6 +18,7 @@ import { Investasi_ComponentDetailDataNonPublish } from "./detail/comp_detail_da
import { Investasi_ComponentButtonUpdateDataInvestasi } from "./button/comp_button_update_investasi";
import { Investasi_ComponentCardRekapDocument } from "./detail/comp_card_rekap_document";
import { Investasi_ComponentCardDaftarDocument } from "./detail/comp_card_daftar_document";
+import { Investasi_ComponentBoxInvestor } from "./detail/comp_box_investor";
export { Investasi_ComponentFooterMain };
export { Investasi_ComponentCardBeranda };
@@ -39,3 +40,4 @@ export { Investasi_ComponentDetailDataNonPublish };
export { Investasi_ComponentButtonUpdateDataInvestasi };
export { Investasi_ComponentCardRekapDocument };
export { Investasi_ComponentCardDaftarDocument };
+export { Investasi_ComponentBoxInvestor };
diff --git a/src/app_modules/investasi/_component/main/com_card_beranda_new.tsx b/src/app_modules/investasi/_component/main/com_card_beranda_new.tsx
new file mode 100644
index 00000000..7024609f
--- /dev/null
+++ b/src/app_modules/investasi/_component/main/com_card_beranda_new.tsx
@@ -0,0 +1,141 @@
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
+import { Warna } from "@/lib/warna";
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import {
+ ComponentGlobal_CardStyles,
+ ComponentGlobal_LoadImageCustom,
+} from "@/app_modules/_global/component";
+import { Box, Grid, Group, Progress, Stack, Text } from "@mantine/core";
+import { IconCircleCheck, IconXboxX } from "@tabler/icons-react";
+import moment from "moment";
+import { useRouter } from "next/navigation";
+import { IDataInvestasiBursa } from "../../_lib/type_investasi";
+
+export function Investasi_ComponentCardBerandaNew({
+ data,
+}: {
+ data: IDataInvestasiBursa;
+}) {
+ const router = useRouter();
+
+ return (
+ <>
+ {
+ router.push(NEW_RouterInvestasi.detail_main({ id: data.id }), {
+ scroll: false,
+ });
+ }}
+ >
+
+
+
+
+
+
+
+
+ {data?.title}
+
+
+
+
+
+ {data?.progress === "100" ? (
+
+
+
+ Selesai
+
+
+ ) : (
+
+ {+data?.pencarianInvestor -
+ moment(new Date()).diff(
+ new Date(data?.countDown),
+ "days"
+ ) <=
+ 0 ? (
+
+
+
+ Waktu Habis
+
+
+ ) : (
+
+
+ Sisa waktu:
+
+
+ {Number(data?.pencarianInvestor) -
+ moment(new Date()).diff(
+ new Date(data?.countDown),
+ "days"
+ )}
+
+
+ Hari
+
+
+ )}
+
+ )}
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_component/main/comp_card_beranda.tsx b/src/app_modules/investasi/_component/main/comp_card_beranda.tsx
index 6f8f6e8e..6d7aaa7f 100644
--- a/src/app_modules/investasi/_component/main/comp_card_beranda.tsx
+++ b/src/app_modules/investasi/_component/main/comp_card_beranda.tsx
@@ -1,8 +1,8 @@
import {
NEW_RouterInvestasi,
RouterInvestasi_OLD,
-} from "@/app/lib/router_hipmi/router_investasi";
-import { Warna } from "@/app/lib/warna";
+} from "@/lib/router_hipmi/router_investasi";
+import { Warna } from "@/lib/warna";
import {
AccentColor,
MainColor,
diff --git a/src/app_modules/investasi/_component/main/comp_card_daftar_transaksi.tsx b/src/app_modules/investasi/_component/main/comp_card_daftar_transaksi.tsx
index c11bac0f..4ca95042 100644
--- a/src/app_modules/investasi/_component/main/comp_card_daftar_transaksi.tsx
+++ b/src/app_modules/investasi/_component/main/comp_card_daftar_transaksi.tsx
@@ -14,7 +14,7 @@ import moment from "moment";
import { MODEL_INVOICE_INVESTASI } from "../../_lib/interface";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component";
diff --git a/src/app_modules/investasi/_component/main/comp_card_daftar_transaksi_new.tsx b/src/app_modules/investasi/_component/main/comp_card_daftar_transaksi_new.tsx
new file mode 100644
index 00000000..70556c7c
--- /dev/null
+++ b/src/app_modules/investasi/_component/main/comp_card_daftar_transaksi_new.tsx
@@ -0,0 +1,94 @@
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
+import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
+import { Card, Group, Stack, Text, Title } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { IDataSahamSaya } from "../../_lib/type_investasi";
+
+export function Investasi_ComponentCardDaftarTransaksiNew({ data }: { data: IDataSahamSaya; }) {
+ const router = useRouter();
+
+ async function onClick({ invoiceId, statusInvoiceId, }: { invoiceId: string; statusInvoiceId: string; }) {
+ // Berhasil
+ if (statusInvoiceId === "1") {
+ return router.push(NEW_RouterInvestasi.transaksi_berhasil + invoiceId, {
+ scroll: false,
+ });
+ }
+
+ // Proses
+ if (statusInvoiceId === "2") {
+ return router.push(NEW_RouterInvestasi.proses_transaksi + invoiceId, {
+ scroll: false,
+ });
+ }
+
+ // Menunggu
+ if (statusInvoiceId === "3") {
+ return router.push(NEW_RouterInvestasi.invoice + invoiceId, {
+ scroll: false,
+ });
+ }
+
+ if (statusInvoiceId === "4") {
+ return router.push(NEW_RouterInvestasi.transaksi_gagal + invoiceId, {
+ scroll: false,
+ });
+ }
+ ComponentGlobal_NotifikasiPeringatan("Status Belum Tersedia");
+ }
+
+
+
+ return (
+ <>
+
+ onClick({
+ invoiceId: data.id,
+ statusInvoiceId: data.statusInvoiceId,
+ })
+ }
+ >
+
+ {data.title}
+
+ Rp.
+ {new Intl.NumberFormat("id-ID", {
+ maximumFractionDigits: 10,
+ }).format(+data.nominal)}
+
+
+
+
+
+ {new Intl.DateTimeFormat("id-ID", { dateStyle: "long" }).format(new Date(data.createdAt))}
+
+
+
+ {data.statusInvoice}
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_component/main/comp_card_portofolio_not_publish_new.tsx b/src/app_modules/investasi/_component/main/comp_card_portofolio_not_publish_new.tsx
new file mode 100644
index 00000000..eec1255a
--- /dev/null
+++ b/src/app_modules/investasi/_component/main/comp_card_portofolio_not_publish_new.tsx
@@ -0,0 +1,44 @@
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
+import { ComponentGlobal_CardStyles, ComponentGlobal_LoadImageCustom } from "@/app_modules/_global/component";
+import { Grid, Stack, Text } from "@mantine/core";
+import _ from "lodash";
+import { useRouter } from "next/navigation";
+import { IDataInvestasiBursa } from "../../_lib/type_investasi";
+
+export function Investasi_ComponentCardPortofolio_NotPublishNew({ data, }: { data: IDataInvestasiBursa; }) {
+ const router = useRouter();
+ return (
+ <>
+ {
+ router.push(NEW_RouterInvestasi.detail_portofolio({ id: data.id }), { scroll: false });
+ }}
+ >
+
+
+
+ {" "}
+ {_.startCase(data.title)}
+
+
+ Target Dana:
+
+ Rp.{" "}
+ {new Intl.NumberFormat("id-ID", {
+ maximumSignificantDigits: 10,
+ }).format(+data.targetDana)}
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_component/main/comp_card_portofolio_publish.tsx b/src/app_modules/investasi/_component/main/comp_card_portofolio_publish.tsx
index 678170f7..3353880d 100644
--- a/src/app_modules/investasi/_component/main/comp_card_portofolio_publish.tsx
+++ b/src/app_modules/investasi/_component/main/comp_card_portofolio_publish.tsx
@@ -1,7 +1,7 @@
import {
NEW_RouterInvestasi,
RouterInvestasi_OLD,
-} from "@/app/lib/router_hipmi/router_investasi";
+} from "@/lib/router_hipmi/router_investasi";
import {
Grid,
Stack,
diff --git a/src/app_modules/investasi/_component/main/comp_card_portofolio_publish_new.tsx b/src/app_modules/investasi/_component/main/comp_card_portofolio_publish_new.tsx
new file mode 100644
index 00000000..367bd173
--- /dev/null
+++ b/src/app_modules/investasi/_component/main/comp_card_portofolio_publish_new.tsx
@@ -0,0 +1,85 @@
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
+import { ComponentGlobal_LoadImageCustom } from "@/app_modules/_global/component";
+import { Box, Grid, Group, Stack, Text } from "@mantine/core";
+import { IconChecklist, IconCircleCheck } from "@tabler/icons-react";
+import _ from "lodash";
+import moment from "moment";
+import { useRouter } from "next/navigation";
+import { IDataInvestasiBursa } from "../../_lib/type_investasi";
+import { Investasi_ComponentStylesCard } from "../comp_card_border_and_background";
+
+export function Investasi_ComponentCardPortofolioPublishNew({ data }: { data: IDataInvestasiBursa; }) {
+ const router = useRouter();
+
+ return (
+ <>
+ {
+ router.push(NEW_RouterInvestasi.detail_main({ id: data?.id }), {
+ scroll: false,
+ });
+ }}
+ >
+
+
+ {_.capitalize(data?.title)}
+
+ Target Dana:
+
+ Rp.{" "}
+ {new Intl.NumberFormat("id-ID", {
+ maximumSignificantDigits: 10,
+ }).format(+data?.targetDana)}
+
+
+
+
+
+
+
+
+
+
+ {Number(data?.pencarianInvestor) -
+ moment(new Date()).diff(new Date(data?.updatedAt), "days") <=
+ 0 ? (
+
+
+ Selesai
+
+ ) : (
+
+
+ {Number(data?.pencarianInvestor) -
+ moment(new Date()).diff(new Date(data?.countDown), "days") <=
+ 0 ? (
+
+
+ Selesai
+
+ ) : (
+
+ Sisa Waktu : {}
+ {Number(data?.pencarianInvestor) -
+ moment(new Date()).diff(
+ new Date(data?.countDown),
+ "days"
+ )}{" "}
+ hari
+
+ )}
+
+
+ )}
+
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_component/main/comp_card_saham_saya.tsx b/src/app_modules/investasi/_component/main/comp_card_saham_saya.tsx
index 52d44bee..ca05a778 100644
--- a/src/app_modules/investasi/_component/main/comp_card_saham_saya.tsx
+++ b/src/app_modules/investasi/_component/main/comp_card_saham_saya.tsx
@@ -21,7 +21,7 @@ import {
ComponentGlobal_TampilanRupiah,
} from "@/app_modules/_global/component";
import { useRouter } from "next/navigation";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import { useState } from "react";
import { Investasi_ComponentStylesCard } from "../comp_card_border_and_background";
diff --git a/src/app_modules/investasi/_component/main/comp_card_saham_saya_new.tsx b/src/app_modules/investasi/_component/main/comp_card_saham_saya_new.tsx
new file mode 100644
index 00000000..caa9bd2b
--- /dev/null
+++ b/src/app_modules/investasi/_component/main/comp_card_saham_saya_new.tsx
@@ -0,0 +1,66 @@
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_TampilanAngkaRatusan, ComponentGlobal_TampilanRupiah } from "@/app_modules/_global/component";
+import { Box, Progress, SimpleGrid, Stack, Text } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { IDataSahamSaya } from "../../_lib/type_investasi";
+import { Investasi_ComponentStylesCard } from "../comp_card_border_and_background";
+
+export function Investasi_ComponentSahamSayaNew({ data }: { data: IDataSahamSaya; }) {
+ const router = useRouter();
+
+ return (
+ <>
+ {
+ router.push(NEW_RouterInvestasi.detail_saham + data?.id, {
+ scroll: false,
+ });
+ }}
+ marginBottom={"15px"}
+ >
+
+
+
+
+ {data?.title}
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_component/main/comp_footer_main.tsx b/src/app_modules/investasi/_component/main/comp_footer_main.tsx
index 98559873..53ba7b2d 100644
--- a/src/app_modules/investasi/_component/main/comp_footer_main.tsx
+++ b/src/app_modules/investasi/_component/main/comp_footer_main.tsx
@@ -1,7 +1,7 @@
import {
NEW_RouterInvestasi,
RouterInvestasi_OLD,
-} from "@/app/lib/router_hipmi/router_investasi";
+} from "@/lib/router_hipmi/router_investasi";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import { SimpleGrid, Stack, ActionIcon, Text } from "@mantine/core";
import {
@@ -47,13 +47,13 @@ export function Investasi_ComponentFooterMain() {
return (
<>
-
+
{listFooter.map((e: any, i) => (
{
router.push(e.route, { scroll: false });
setHotMenu(i);
@@ -62,7 +62,7 @@ export function Investasi_ComponentFooterMain() {
{e.icon}
diff --git a/src/app_modules/investasi/_component/main/comp_update_beranda.tsx b/src/app_modules/investasi/_component/main/comp_update_beranda.tsx
index adb5a168..935e09a4 100644
--- a/src/app_modules/investasi/_component/main/comp_update_beranda.tsx
+++ b/src/app_modules/investasi/_component/main/comp_update_beranda.tsx
@@ -1,31 +1,29 @@
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import { Affix, Button, Center, rem } from "@mantine/core";
import { useState } from "react";
-import { investasi_funGetAllPublish } from "../../fun/get_all_investasi";
-import { data } from "autoprefixer";
+import { apiFetchGetAllInvestasi } from "../../_lib/api_fetch_new_investasi";
export function Investasi_ComponentButtonUpdateBeranda({
onLoadData,
}: {
onLoadData: (val: any) => void;
}) {
- const [isLoading, setIsLoading] = useState(false);
+ const [isLoading, setLoading] = useState(false);
async function onLoaded() {
try {
- await investasi_funGetAllPublish({ page: 1 });
- } catch (error) {
- console.log(error);
- } finally {
- const loadData = await investasi_funGetAllPublish({ page: 1 });
-
- onLoadData({
- data: loadData,
- isNewPost: false,
+ setLoading(true);
+ const response = await apiFetchGetAllInvestasi({
+ page: "1",
});
+ if (response.success) {
+ onLoadData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
}
-
- setIsLoading(true);
}
return (
diff --git a/src/app_modules/investasi/_component/skeleton_view.tsx b/src/app_modules/investasi/_component/skeleton_view.tsx
new file mode 100644
index 00000000..4b7e4075
--- /dev/null
+++ b/src/app_modules/investasi/_component/skeleton_view.tsx
@@ -0,0 +1,46 @@
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Box, Center, Stack } from "@mantine/core";
+
+export { Investasi_SkeletonEditProspektus, Investasi_SkeletonListDokumen };
+
+function Investasi_SkeletonEditProspektus() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+function Investasi_SkeletonListDokumen() {
+ return (
+ <>
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_fun/create/fun_create_berita.tsx b/src/app_modules/investasi/_fun/create/fun_create_berita.tsx
index bdd38188..900dd9df 100644
--- a/src/app_modules/investasi/_fun/create/fun_create_berita.tsx
+++ b/src/app_modules/investasi/_fun/create/fun_create_berita.tsx
@@ -1,10 +1,10 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import _ from "lodash";
import { Model_Berita_Investasi } from "../../_lib/interface";
import { revalidatePath } from "next/cache";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
export async function investasi_funCreateBerita({
data,
diff --git a/src/app_modules/investasi/_fun/create/fun_create_document.tsx b/src/app_modules/investasi/_fun/create/fun_create_document.tsx
index 7fc84e4c..d3e29b5a 100644
--- a/src/app_modules/investasi/_fun/create/fun_create_document.tsx
+++ b/src/app_modules/investasi/_fun/create/fun_create_document.tsx
@@ -1,7 +1,7 @@
"use server";
-import { prisma } from "@/app/lib";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { prisma } from "@/lib";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import { revalidatePath } from "next/cache";
type ICreateDocument = {
diff --git a/src/app_modules/investasi/_fun/create/fun_create_invoice.ts b/src/app_modules/investasi/_fun/create/fun_create_invoice.ts
index 0ca34d1c..4a5cd55e 100644
--- a/src/app_modules/investasi/_fun/create/fun_create_invoice.ts
+++ b/src/app_modules/investasi/_fun/create/fun_create_invoice.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
interface Model_Invoice_Masuk {
diff --git a/src/app_modules/investasi/_fun/create/fun_create_new_investasi.tsx b/src/app_modules/investasi/_fun/create/fun_create_new_investasi.tsx
index 20559163..a048d474 100644
--- a/src/app_modules/investasi/_fun/create/fun_create_new_investasi.tsx
+++ b/src/app_modules/investasi/_fun/create/fun_create_new_investasi.tsx
@@ -1,7 +1,7 @@
"use server";
-import { prisma } from "@/app/lib";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { prisma } from "@/lib";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import _ from "lodash";
import { revalidatePath } from "next/cache";
diff --git a/src/app_modules/investasi/_fun/delete/fun_delete_berita.tsx b/src/app_modules/investasi/_fun/delete/fun_delete_berita.tsx
index cee4c243..75430f1e 100644
--- a/src/app_modules/investasi/_fun/delete/fun_delete_berita.tsx
+++ b/src/app_modules/investasi/_fun/delete/fun_delete_berita.tsx
@@ -1,7 +1,7 @@
"use server";
-import { prisma } from "@/app/lib";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { prisma } from "@/lib";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import { revalidatePath } from "next/cache";
export async function investasi_funDeleteBerita({
diff --git a/src/app_modules/investasi/_fun/delete/fun_delete_dokumen.tsx b/src/app_modules/investasi/_fun/delete/fun_delete_dokumen.tsx
index 360c09fe..18987606 100644
--- a/src/app_modules/investasi/_fun/delete/fun_delete_dokumen.tsx
+++ b/src/app_modules/investasi/_fun/delete/fun_delete_dokumen.tsx
@@ -1,7 +1,7 @@
"use server";
-import { prisma } from "@/app/lib";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { prisma } from "@/lib";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import { revalidatePath } from "next/cache";
export async function investasi_funDeleteDokumenById({
diff --git a/src/app_modules/investasi/_fun/edit/fun_edit_document.tsx b/src/app_modules/investasi/_fun/edit/fun_edit_document.tsx
index 56332497..1936122a 100644
--- a/src/app_modules/investasi/_fun/edit/fun_edit_document.tsx
+++ b/src/app_modules/investasi/_fun/edit/fun_edit_document.tsx
@@ -1,8 +1,8 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import { MODEL_INVESTASI_DOKUMEN } from "../../_lib/interface";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import { revalidatePath } from "next/cache";
export async function investasi_funUpdateDocument({
diff --git a/src/app_modules/investasi/_fun/edit/fun_edit_investasi.tsx b/src/app_modules/investasi/_fun/edit/fun_edit_investasi.tsx
index 1ddd2312..7e93694f 100644
--- a/src/app_modules/investasi/_fun/edit/fun_edit_investasi.tsx
+++ b/src/app_modules/investasi/_fun/edit/fun_edit_investasi.tsx
@@ -1,7 +1,7 @@
"use server";
-import { prisma } from "@/app/lib";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { prisma } from "@/lib";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import _ from "lodash";
import { revalidatePath } from "next/cache";
import { MODEL_INVESTASI } from "../../_lib/interface";
diff --git a/src/app_modules/investasi/_fun/edit/fun_edit_prospektus.tsx b/src/app_modules/investasi/_fun/edit/fun_edit_prospektus.tsx
index e8bf3575..c3066638 100644
--- a/src/app_modules/investasi/_fun/edit/fun_edit_prospektus.tsx
+++ b/src/app_modules/investasi/_fun/edit/fun_edit_prospektus.tsx
@@ -1,7 +1,7 @@
"use server";
-import { prisma } from "@/app/lib";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { prisma } from "@/lib";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import { revalidatePath } from "next/cache";
export async function investasi_funUpdateProspektus({
diff --git a/src/app_modules/investasi/_fun/get/fun_get_all_document_by_id.tsx b/src/app_modules/investasi/_fun/get/fun_get_all_document_by_id.tsx
index 26373d7f..5813950c 100644
--- a/src/app_modules/investasi/_fun/get/fun_get_all_document_by_id.tsx
+++ b/src/app_modules/investasi/_fun/get/fun_get_all_document_by_id.tsx
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
export async function investasi_funGetAllDocumentById({
investasiId,
diff --git a/src/app_modules/investasi/_fun/get/fun_get_all_investasi_by_user_id.ts b/src/app_modules/investasi/_fun/get/fun_get_all_investasi_by_user_id.ts
index 296496a4..76c58af4 100644
--- a/src/app_modules/investasi/_fun/get/fun_get_all_investasi_by_user_id.ts
+++ b/src/app_modules/investasi/_fun/get/fun_get_all_investasi_by_user_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function investasi_funGetAllPublishByUserId({
diff --git a/src/app_modules/investasi/_fun/get/fun_get_all_investasi_non_publish_by_user_id.tsx b/src/app_modules/investasi/_fun/get/fun_get_all_investasi_non_publish_by_user_id.tsx
index 7db342e0..5ea4579d 100644
--- a/src/app_modules/investasi/_fun/get/fun_get_all_investasi_non_publish_by_user_id.tsx
+++ b/src/app_modules/investasi/_fun/get/fun_get_all_investasi_non_publish_by_user_id.tsx
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function investasi_funGetAllInvestasiNonPublishByUserId({
diff --git a/src/app_modules/investasi/_fun/get/fun_get_all_transaksi_by_user_id.ts b/src/app_modules/investasi/_fun/get/fun_get_all_transaksi_by_user_id.ts
index 1684ae57..37e1d963 100644
--- a/src/app_modules/investasi/_fun/get/fun_get_all_transaksi_by_user_id.ts
+++ b/src/app_modules/investasi/_fun/get/fun_get_all_transaksi_by_user_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function investasi_funGetTransaksiByUserId({
diff --git a/src/app_modules/investasi/_fun/get/fun_get_berita_by_id.tsx b/src/app_modules/investasi/_fun/get/fun_get_berita_by_id.tsx
index e5ff197e..60774cbf 100644
--- a/src/app_modules/investasi/_fun/get/fun_get_berita_by_id.tsx
+++ b/src/app_modules/investasi/_fun/get/fun_get_berita_by_id.tsx
@@ -1,7 +1,7 @@
"use server";
-import { prisma } from "@/app/lib";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { prisma } from "@/lib";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import { revalidatePath } from "next/cache";
export async function investasi_funGetBeritaById({
diff --git a/src/app_modules/investasi/_fun/get/fun_get_file_by_prospek_id.ts b/src/app_modules/investasi/_fun/get/fun_get_file_by_prospek_id.ts
index 43fc99ad..6da64e34 100644
--- a/src/app_modules/investasi/_fun/get/fun_get_file_by_prospek_id.ts
+++ b/src/app_modules/investasi/_fun/get/fun_get_file_by_prospek_id.ts
@@ -1,6 +1,6 @@
"use server"
-import prisma from "@/app/lib/prisma"
+import prisma from "@/lib/prisma"
export async function investasi_funGetProspekById({prospekId}: {prospekId: string}) {
const data = await prisma.prospektusInvestasi.findFirst({
diff --git a/src/app_modules/investasi/_fun/get/fun_get_one_berita_by_id.tsx b/src/app_modules/investasi/_fun/get/fun_get_one_berita_by_id.tsx
index 02dab73c..a6c4a663 100644
--- a/src/app_modules/investasi/_fun/get/fun_get_one_berita_by_id.tsx
+++ b/src/app_modules/investasi/_fun/get/fun_get_one_berita_by_id.tsx
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
export async function investasi_funGetOneBeritaById({
beritaId,
diff --git a/src/app_modules/investasi/_fun/get/fun_get_one_document_by_id.tsx b/src/app_modules/investasi/_fun/get/fun_get_one_document_by_id.tsx
index e31ef426..9f44c24c 100644
--- a/src/app_modules/investasi/_fun/get/fun_get_one_document_by_id.tsx
+++ b/src/app_modules/investasi/_fun/get/fun_get_one_document_by_id.tsx
@@ -1,13 +1,17 @@
-"use server"
+"use server";
-import { prisma } from "@/app/lib"
+import { prisma } from "@/lib";
-export async function investasi_funGetOneDocumentById({ documentId }: { documentId: string }) {
- const data = await prisma.dokumenInvestasi.findFirst({
- where: {
- id: documentId
- }
- })
+export async function investasi_funGetOneDocumentById({
+ documentId,
+}: {
+ documentId: string;
+}) {
+ const data = await prisma.dokumenInvestasi.findFirst({
+ where: {
+ id: documentId,
+ },
+ });
- return data
-}
\ No newline at end of file
+ return data;
+}
diff --git a/src/app_modules/investasi/_fun/get/fun_get_one_investasi_by_id.ts b/src/app_modules/investasi/_fun/get/fun_get_one_investasi_by_id.ts
index 7f0c6b3f..4926bd54 100644
--- a/src/app_modules/investasi/_fun/get/fun_get_one_investasi_by_id.ts
+++ b/src/app_modules/investasi/_fun/get/fun_get_one_investasi_by_id.ts
@@ -1,5 +1,5 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function investasi_funGetOneInvestasiById({
investasiId,
diff --git a/src/app_modules/investasi/_fun/get/fun_get_one_invoice_by_id.ts b/src/app_modules/investasi/_fun/get/fun_get_one_invoice_by_id.ts
index e77a6c3c..d2aa5fa4 100644
--- a/src/app_modules/investasi/_fun/get/fun_get_one_invoice_by_id.ts
+++ b/src/app_modules/investasi/_fun/get/fun_get_one_invoice_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function investasi_funGetOneInvoiceById({
invoiceId,
diff --git a/src/app_modules/investasi/_fun/get/fun_get_portofolio_by_status_id.ts b/src/app_modules/investasi/_fun/get/fun_get_portofolio_by_status_id.ts
index 22f2cd57..3f24690c 100644
--- a/src/app_modules/investasi/_fun/get/fun_get_portofolio_by_status_id.ts
+++ b/src/app_modules/investasi/_fun/get/fun_get_portofolio_by_status_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function investasi_funGetPortofolioByStatusId({
diff --git a/src/app_modules/investasi/_fun/get/fun_get_success_transaction_by_id.ts b/src/app_modules/investasi/_fun/get/fun_get_success_transaction_by_id.ts
index 519288b8..cc46d9e1 100644
--- a/src/app_modules/investasi/_fun/get/fun_get_success_transaction_by_id.ts
+++ b/src/app_modules/investasi/_fun/get/fun_get_success_transaction_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function investasi_funGetSuccessTransactionById({
diff --git a/src/app_modules/investasi/_fun/upload/fun_upload_bukti_transfer.tsx b/src/app_modules/investasi/_fun/upload/fun_upload_bukti_transfer.tsx
index f8a2b1b4..d2dd1716 100644
--- a/src/app_modules/investasi/_fun/upload/fun_upload_bukti_transfer.tsx
+++ b/src/app_modules/investasi/_fun/upload/fun_upload_bukti_transfer.tsx
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _ from "lodash";
import { v4 } from "uuid";
import fs from "fs";
diff --git a/src/app_modules/investasi/_lib/api_fetch_new_investasi.ts b/src/app_modules/investasi/_lib/api_fetch_new_investasi.ts
new file mode 100644
index 00000000..878d622e
--- /dev/null
+++ b/src/app_modules/investasi/_lib/api_fetch_new_investasi.ts
@@ -0,0 +1,201 @@
+export {
+ apiFetchGetAllInvestasi,
+ apiNewGetOneInvestasiById,
+ apiGetInvestorById,
+ apiGetOneSahamInvestasiById,
+ apiGetInvoiceById,
+};
+
+const apiFetchGetAllInvestasi = async ({ page }: { page: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const nextPage = `?page=${page}`;
+ const response = await fetch(`/api/investasi${nextPage}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get all forum:", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get all forum");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get all forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiNewGetOneInvestasiById = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/investasi/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get all forum:", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get all forum");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get all forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiGetInvestorById = async ({
+ id,
+ page,
+}: {
+ id: string;
+ page: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const nextPage = `?page=${page}`;
+ const response = await fetch(`/api/investasi/${id}/investor${nextPage}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get list investor",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get list investor");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get list investor", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiGetOneSahamInvestasiById = async ({
+ id,
+}: {
+ id: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/investasi/saham/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get list investor",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get list investor");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get list investor", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+
+const apiGetInvoiceById = async ({
+ id,
+}: {
+ id: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/investasi/${id}/invoice`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get list investor",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get list investor");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get list investor", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
diff --git a/src/app_modules/investasi/_lib/api_interface.ts b/src/app_modules/investasi/_lib/api_interface.ts
new file mode 100644
index 00000000..63a70b3c
--- /dev/null
+++ b/src/app_modules/investasi/_lib/api_interface.ts
@@ -0,0 +1,117 @@
+import { data } from "autoprefixer";
+export const apiGetOneInvestasiById = async ({ id }: { id: string }) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/new/investasi/${id}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ return await response.json().catch(() => null);
+};
+
+export const apiGetMasterInvestasi = async (path?: string) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/new/investasi/master${path ? path : ""}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+export const apiGetAllInvestasi = async (path?: string) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/new/investasi${path ? path : ""}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+export const apiGetAllSahamSaya = async (path?: string) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(
+ `/api/new/investasi/invoice${path ? path : ""}`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+ return await response.json().catch(() => null);
+};
+
+export const apiGetDokumenInvestasiById = async ({
+ id,
+ kategori,
+ page,
+}: {
+ id: string;
+ kategori?: undefined | "get-all";
+ page?: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(
+ `/api/new/investasi/dokumen/${id}${kategori ? `?kategori=${kategori}&page=${page}` : ""}`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+ return await response.json().catch(() => null);
+};
+
+export const apiGetBeritaInvestasiById = async ({
+ id,
+ kategori,
+ page,
+}: {
+ id: string;
+ kategori?: undefined | "get-all";
+ page?: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const onCategory = kategori ? `?kategori=${kategori}&page=${page}` : "";
+
+ const response = await fetch(`/api/new/investasi/berita/${id}${onCategory}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
diff --git a/src/app_modules/investasi/_lib/interface.ts b/src/app_modules/investasi/_lib/interface.ts
index 72268726..1c630364 100644
--- a/src/app_modules/investasi/_lib/interface.ts
+++ b/src/app_modules/investasi/_lib/interface.ts
@@ -121,6 +121,7 @@ export interface Model_Status_Transaksi_Investasi {
}
export interface MODEL_INVOICE_INVESTASI {
+ Profile: any;
id: string;
isActive: boolean;
createdAt: Date;
diff --git a/src/app_modules/investasi/_lib/type_investasi.ts b/src/app_modules/investasi/_lib/type_investasi.ts
new file mode 100644
index 00000000..fed5c0ad
--- /dev/null
+++ b/src/app_modules/investasi/_lib/type_investasi.ts
@@ -0,0 +1,37 @@
+export interface IDataInvestasi {
+ id: string
+ title: string
+ targetDana: string
+ hargaLembar: string
+ totalLembar: string
+ roi: string
+ countDown: string
+ catatan: string
+ sisaLembar: string
+ imageId: string
+ masterPencarianInvestorId: string
+ masterPeriodeDevidenId: string
+ masterPembagianDevidenId: string
+}
+
+export interface IDataInvestasiBursa {
+ id: string
+ title: string
+ imageId: string
+ progress: string
+ countDown: string
+ targetDana: string
+ pencarianInvestor: string
+ updatedAt: Date
+}
+
+export interface IDataSahamSaya {
+ id: string
+ nominal: string
+ lembarTerbeli: string
+ statusInvoiceId: string
+ createdAt: Date
+ statusInvoice: string
+ title: string
+ progress: string
+}
\ No newline at end of file
diff --git a/src/app_modules/investasi/_ui/create/ui_create_berita.tsx b/src/app_modules/investasi/_ui/create/ui_create_berita.tsx
index 9ae233e7..07eb6dea 100644
--- a/src/app_modules/investasi/_ui/create/ui_create_berita.tsx
+++ b/src/app_modules/investasi/_ui/create/ui_create_berita.tsx
@@ -1,23 +1,29 @@
"use client";
-import {
- UIGlobal_LayoutHeaderTamplate,
- UIGlobal_LayoutTamplate,
-} from "@/app_modules/_global/ui";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { Investasi_ViewCreateBerita } from "../../_view";
-export function Investasi_UiCreateBerita({
- investasiId,
-}: {
- investasiId: string;
-}) {
+export function Investasi_UiCreateBerita() {
return (
<>
- }
>
-
-
+
+ */}
+
+
+
+
+
+
+
+
+
>
);
}
diff --git a/src/app_modules/investasi/_ui/create/ui_create_document.tsx b/src/app_modules/investasi/_ui/create/ui_create_document.tsx
index ada8bef7..aba5ee87 100644
--- a/src/app_modules/investasi/_ui/create/ui_create_document.tsx
+++ b/src/app_modules/investasi/_ui/create/ui_create_document.tsx
@@ -1,16 +1,29 @@
-"use client"
+"use client";
-import { UIGlobal_LayoutHeaderTamplate, UIGlobal_LayoutTamplate } from "@/app_modules/_global/ui"
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { Investasi_ViewCreateDocument } from "../../_view";
-export function Investasi_UiCreateDocument({ investasiId }: { investasiId : string}) {
+export function Investasi_UiCreateDocument() {
return (
<>
- }
>
-
-
+
+ */}
+
+
+
+
+
+
+
+
+
>
);
-}
\ No newline at end of file
+}
diff --git a/src/app_modules/investasi/_ui/detail/ui_berita.tsx b/src/app_modules/investasi/_ui/detail/ui_berita.tsx
index 959d27d2..ad60185f 100644
--- a/src/app_modules/investasi/_ui/detail/ui_berita.tsx
+++ b/src/app_modules/investasi/_ui/detail/ui_berita.tsx
@@ -10,62 +10,131 @@ import {
UIGlobal_DrawerCustom,
UIGlobal_LayoutHeaderTamplate,
UIGlobal_LayoutTamplate,
- UIGlobal_Modal
+ UIGlobal_Modal,
} from "@/app_modules/_global/ui";
import { ActionIcon, Button, Center, Stack, Text } from "@mantine/core";
import { IconDotsVertical, IconTrash } from "@tabler/icons-react";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import { investasi_funDeleteBerita } from "../../_fun";
import { Investasi_ViewDetailBerita } from "../../_view";
+import { DIRECTORY_ID } from "@/lib";
+import { clientLogger } from "@/util/clientLogger";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetBeritaInvestasiById } from "../../_lib/api_interface";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewHeader,
+ UI_NewChildren,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+
+export function Investasi_UiDetailBerita() {
+ const params = useParams<{ id: string }>();
+ const id = params.id;
-export function Investasi_UiDetailBerita({ dataBerita }: { dataBerita: any }) {
const router = useRouter();
const [openDrawer, setOpenDrawer] = useState(false);
const [openModal, setOpenModal] = useState(false);
- const [data, setData] = useState(dataBerita);
+ const [data, setData] = useState(null);
+ const [isLoading, setLoading] = useState(false);
- async function onDelete() {
- const del = await investasi_funDeleteBerita({
- beritaId: dataBerita.id,
- });
+ const [userLoginId, setUserLoginId] = useState(null);
- if (del.status === 200) {
- const deleteImage = await funGlobal_DeleteFileById({
- fileId: data.imageId,
+ useShallowEffect(() => {
+ handleGetUserId();
+ onLoadData();
+ }, []);
+
+ async function handleGetUserId() {
+ try {
+ const respone = await apiNewGetUserIdByToken();
+
+ if (respone) {
+ setUserLoginId(respone.userId);
+ }
+ } catch (error) {
+ console.error("Error get data detail", error);
+ }
+ }
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetBeritaInvestasiById({
+ id: id,
});
- if (!deleteImage.success) {
- ComponentGlobal_NotifikasiPeringatan("Gagal hapus gambar ");
+ if (respone) {
+ setData(respone.data);
}
+ } catch (error) {
+ clientLogger.error("Error get detail berita", error);
+ }
+ }
- ComponentGlobal_NotifikasiBerhasil(del.message);
- setOpenModal(false);
- router.back();
- } else {
- ComponentGlobal_NotifikasiGagal(del.message);
+ async function onDelete() {
+ try {
+ setLoading(true);
+ const del = await investasi_funDeleteBerita({
+ beritaId: id,
+ });
+
+ if (del.status === 200) {
+ if (data.imageId != null) {
+ const deleteImage = await funGlobal_DeleteFileById({
+ fileId: data.imageId,
+ dirId: DIRECTORY_ID.investasi_berita,
+ });
+
+ if (!deleteImage.success) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal hapus gambar ");
+ }
+ }
+
+ router.back();
+ ComponentGlobal_NotifikasiBerhasil(del.message);
+ setOpenModal(false);
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(del.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error delete berita", error);
}
}
return (
<>
-
+
+ setOpenDrawer(true)}
- >
-
-
+ data && userLoginId === data.investasi.authorId ? (
+ setOpenDrawer(true)}
+ >
+
+
+ ) : (
+ ""
+ )
}
/>
- }
- >
-
-
+
+
+
+
+
{
diff --git a/src/app_modules/investasi/_ui/detail/ui_daftar_berita.tsx b/src/app_modules/investasi/_ui/detail/ui_daftar_berita.tsx
index 350bcaf6..240004e5 100644
--- a/src/app_modules/investasi/_ui/detail/ui_daftar_berita.tsx
+++ b/src/app_modules/investasi/_ui/detail/ui_daftar_berita.tsx
@@ -1,21 +1,27 @@
"use client";
-import {
- UIGlobal_LayoutHeaderTamplate,
- UIGlobal_LayoutTamplate,
-} from "@/app_modules/_global/ui";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { Investasi_ViewDaftarBerita } from "../../_view";
-export function Investasi_UiDaftarBerita({
- dataBerita,
-}: {
- dataBerita: any[];
-}) {
+export function Investasi_UiDaftarBerita() {
return (
- }
- >
-
-
+ // }
+ // >
+ //
+ //
+
+
+
+
+
+
+
+
+
);
}
diff --git a/src/app_modules/investasi/_ui/detail/ui_daftar_dokumen.tsx b/src/app_modules/investasi/_ui/detail/ui_daftar_dokumen.tsx
index becc1705..2fba491b 100644
--- a/src/app_modules/investasi/_ui/detail/ui_daftar_dokumen.tsx
+++ b/src/app_modules/investasi/_ui/detail/ui_daftar_dokumen.tsx
@@ -1,28 +1,29 @@
"use client";
-import {
- UIGlobal_LayoutHeaderTamplate,
- UIGlobal_LayoutTamplate,
-} from "@/app_modules/_global/ui";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { Investasi_ViewDaftarDokumen } from "../../_view";
-export function Investasi_UiDaftarDokmen({
- dataDokumen,
- investasiId,
-}: {
- dataDokumen: any[];
- investasiId: string
-}) {
+export function Investasi_UiDaftarDokmen() {
return (
<>
- }
>
-
-
+
+ */}
+
+
+
+
+
+
+
+
+
>
);
}
diff --git a/src/app_modules/investasi/_ui/detail/ui_detail_main.tsx b/src/app_modules/investasi/_ui/detail/ui_detail_main.tsx
index 94bfc7b1..2b78c2dd 100644
--- a/src/app_modules/investasi/_ui/detail/ui_detail_main.tsx
+++ b/src/app_modules/investasi/_ui/detail/ui_detail_main.tsx
@@ -1,73 +1,110 @@
"use client";
-import {
- UIGlobal_Drawer,
- UIGlobal_LayoutHeaderTamplate,
- UIGlobal_LayoutTamplate,
-} from "@/app_modules/_global/ui";
+import { MainColor } from "@/app_modules/_global/color";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+import { UIGlobal_Drawer } from "@/app_modules/_global/ui";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import { ActionIcon } from "@mantine/core";
-import { IconCategoryPlus, IconDotsVertical } from "@tabler/icons-react";
+import { useShallowEffect } from "@mantine/hooks";
+import {
+ IconCategoryPlus,
+ IconDeviceIpadPlus,
+ IconDotsVertical,
+} from "@tabler/icons-react";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { apiNewGetOneInvestasiById } from "../../_lib/api_fetch_new_investasi";
import { MODEL_INVESTASI } from "../../_lib/interface";
import { Investasi_ViewDetailPublish } from "../../_view";
-import { useRouter } from "next/navigation";
-import { useState } from "react";
-import {
- NEW_RouterInvestasi,
- RouterInvestasi_OLD,
-} from "@/app/lib/router_hipmi/router_investasi";
-import { IconDeviceIpadPlus } from "@tabler/icons-react";
-export function Investasi_UiDetailMain({
- dataInvestasi,
- userLoginId,
-}: {
- dataInvestasi: MODEL_INVESTASI;
- userLoginId: string;
-}) {
- const router = useRouter();
+export function Investasi_UiDetailMain() {
+ const param = useParams<{ id: string }>();
const [openDrawer, setOpenDrawer] = useState(false);
+ const [data, setData] = useState(null);
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ handleGetUserId();
+ }, []);
+
+ async function handleGetUserId() {
+ try {
+ const respone = await apiNewGetUserIdByToken();
+
+ if (respone) {
+ setUserLoginId(respone.userId);
+ }
+ } catch (error) {
+ console.error("Error get data detail", error);
+ }
+ }
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiNewGetOneInvestasiById({ id: param.id });
+
+ if (response.success) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ console.error("Error get investasi", error);
+ setData(null);
+ }
+ };
const listPage = [
{
id: "1",
name: "Tambah & Edit Dokumen",
icon: ,
- path: NEW_RouterInvestasi.rekap_dokumen({ id: dataInvestasi.id }),
+ path: NEW_RouterInvestasi.rekap_dokumen({ id: data?.id as any }),
},
{
id: "2",
name: "Tambah & Edit Berita",
icon: ,
- path: NEW_RouterInvestasi.rekap_berita({ id: dataInvestasi.id }),
+ path: NEW_RouterInvestasi.rekap_berita({ id: data?.id as any }),
},
];
return (
<>
-
+
+ setOpenDrawer(true)}
>
-
+
) : (
)
}
/>
- }
- >
-
-
+
+
+
+
+
();
+ const investasiId = params.id;
-export function Investasi_UiDetailPortofolio({
- dataInvestasi,
- userLoginId,
-}: {
- dataInvestasi: MODEL_INVESTASI;
- userLoginId: string;
-}) {
const router = useRouter();
const [isLoading, setLoading] = useState(false);
const [pageId, setPageId] = useState("");
const [openDrawer, setOpenDrawer] = useState(false);
- const [data, setData] = useState(dataInvestasi);
+ const [data, setData] = useState(null);
const listPage = [
{
id: "1",
name: "Edit Investasi",
icon: ,
- path: NEW_RouterInvestasi.edit_investasi({ id: data.id }),
+ path: NEW_RouterInvestasi.edit_investasi({ id: investasiId }),
},
{
id: "2",
name: "Edit Prospektus",
icon: ,
- path: NEW_RouterInvestasi.edit_prospektus({ id: data.id }),
+ path: NEW_RouterInvestasi.edit_prospektus({ id: investasiId }),
},
{
id: "3",
name: "Tambah & Edit Dokumen",
icon: ,
- path: NEW_RouterInvestasi.rekap_dokumen({ id: data.id }),
+ path: NEW_RouterInvestasi.rekap_dokumen({ id: investasiId }),
},
];
- if (data.masterStatusInvestasiId == "3")
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetOneInvestasiById({
+ id: investasiId,
+ });
+
+ if (respone.success) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get detail investasi:", error);
+ }
+ }
+
+ if (data === null) {
return (
<>
}
+ >
+
+
+ >
+ );
+ }
+
+ // DRAFT
+ if (data.masterStatusInvestasiId == "3")
+ return (
+ <>
+ {/* setOpenDrawer(true)}
>
-
+
}
/>
}
>
-
-
+
+ */}
- {/* setOpenDrawer(false)}
- component={listPage}
- /> */}
+
+
+ setOpenDrawer(true)}
+ >
+
+
+ }
+ />
+
+
+
+
+
{
setPageId(e?.id);
setLoading(true);
- if (e.id === "1") {
- setData({});
- }
+
router.push(e?.path, { scroll: false });
}}
>
@@ -109,7 +157,7 @@ export function Investasi_UiDetailPortofolio({
e?.icon
)}
-
+
{e?.name}
@@ -121,20 +169,34 @@ export function Investasi_UiDetailPortofolio({
);
return (
-
- }
- >
- {dataInvestasi.masterStatusInvestasiId === "2" && (
-
- )}
+ //
+ // }
+ // >
+ // {data.masterStatusInvestasiId === "2" && (
+ //
+ // )}
- {dataInvestasi.masterStatusInvestasiId === "4" && (
-
- )}
-
+ // {data.masterStatusInvestasiId === "4" && (
+ //
+ // )}
+ //
+
+
+
+
+
+ {data.masterStatusInvestasiId === "2" && (
+
+ )}
+
+ {data.masterStatusInvestasiId === "4" && (
+
+ )}
+
+
);
}
diff --git a/src/app_modules/investasi/_ui/detail/ui_detail_prospektus.tsx b/src/app_modules/investasi/_ui/detail/ui_detail_prospektus.tsx
index d235f84d..83f096ec 100644
--- a/src/app_modules/investasi/_ui/detail/ui_detail_prospektus.tsx
+++ b/src/app_modules/investasi/_ui/detail/ui_detail_prospektus.tsx
@@ -1,23 +1,23 @@
"use client";
-import {
- UIGlobal_LayoutHeaderTamplate,
- UIGlobal_LayoutTamplate,
-} from "@/app_modules/_global/ui";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { Investasi_ViewDetailProspektus } from "../../_view";
-export function Investasi_UiDetailProspektus({
- dataInvestasi,
-}: {
- dataInvestasi: any;
-}) {
+export function Investasi_UiDetailProspektus() {
return (
<>
- }
- >
-
-
+
+
+
+
+
+
+
+
>
);
}
diff --git a/src/app_modules/investasi/_ui/detail/ui_detail_saham_saya.tsx b/src/app_modules/investasi/_ui/detail/ui_detail_saham_saya.tsx
index cd41bc49..c8a3f630 100644
--- a/src/app_modules/investasi/_ui/detail/ui_detail_saham_saya.tsx
+++ b/src/app_modules/investasi/_ui/detail/ui_detail_saham_saya.tsx
@@ -3,15 +3,26 @@
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import { Investasi_ViewDetailSahamSaya } from "../../_view";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, { UI_NewHeader, UI_NewChildren } from "@/app_modules/_global/ui/V2_layout_tamplate";
-export function Investasi_UiDetailSahamSaya({ dataSaham }: { dataSaham: any }) {
+export function Investasi_UiDetailSahamSaya() {
return (
<>
- }
>
-
-
+
+ */}
+
+
+
+
+
+
+
+
+
>
);
}
diff --git a/src/app_modules/investasi/_ui/detail/ui_list_investor.tsx b/src/app_modules/investasi/_ui/detail/ui_list_investor.tsx
new file mode 100644
index 00000000..e385963c
--- /dev/null
+++ b/src/app_modules/investasi/_ui/detail/ui_list_investor.tsx
@@ -0,0 +1,26 @@
+"use client";
+
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, { UI_NewChildren, UI_NewHeader } from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { Investasi_ViewListInvestor } from "../../_view/detail/view_list_investor";
+
+export function Investasi_UiListInvestor() {
+ return (
+ <>
+ {/* }
+ >
+
+ */}
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_ui/detail/ui_rekap_berita.tsx b/src/app_modules/investasi/_ui/detail/ui_rekap_berita.tsx
index 5bad3146..383ea7a5 100644
--- a/src/app_modules/investasi/_ui/detail/ui_rekap_berita.tsx
+++ b/src/app_modules/investasi/_ui/detail/ui_rekap_berita.tsx
@@ -1,25 +1,23 @@
"use client";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import {
- UIGlobal_Drawer,
- UIGlobal_LayoutHeaderTamplate,
- UIGlobal_LayoutTamplate,
+ UIGlobal_Drawer
} from "@/app_modules/_global/ui";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import { ActionIcon } from "@mantine/core";
import { IconCirclePlus, IconDotsVertical } from "@tabler/icons-react";
-import { useRouter } from "next/navigation";
+import { useParams } from "next/navigation";
import { useState } from "react";
import { Investasi_ViewRekapBerita } from "../../_view";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
-export function Investasi_UiRekapBerita({
- investasiId,
- dataBerita,
-}: {
- investasiId: string;
- dataBerita: any[]
-}) {
- const router = useRouter();
+export function Investasi_UiRekapBerita() {
+ const params = useParams<{ id: string }>();
+ const investasiId = params.id;
const [openDrawer, setOpenDrawer] = useState(false);
const listPage = [
@@ -32,32 +30,53 @@ export function Investasi_UiRekapBerita({
];
return (
- {
- setOpenDrawer(true);
- }}
- >
-
-
- }
- />
- }
- >
+ <>
+ {/* {
+ setOpenDrawer(true);
+ }}
+ >
+
+
+ }
+ />
+ }
+ >
+
+ */}
-
-
+
+
+ {
+ setOpenDrawer(true);
+ }}
+ >
+
+
+ }
+ />
+
+
+
+
+
setOpenDrawer(false)}
component={listPage}
/>
-
+ >
);
}
diff --git a/src/app_modules/investasi/_ui/detail/ui_rekap_dokumen.tsx b/src/app_modules/investasi/_ui/detail/ui_rekap_dokumen.tsx
index 9d66d28d..d8021680 100644
--- a/src/app_modules/investasi/_ui/detail/ui_rekap_dokumen.tsx
+++ b/src/app_modules/investasi/_ui/detail/ui_rekap_dokumen.tsx
@@ -1,6 +1,6 @@
"use client";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import {
UIGlobal_Drawer,
UIGlobal_LayoutHeaderTamplate,
@@ -10,16 +10,15 @@ import { ActionIcon } from "@mantine/core";
import { IconCirclePlus, IconDotsVertical } from "@tabler/icons-react";
import { useState } from "react";
import { Investasi_ViewRekapDokumen } from "../../_view";
+import { useParams } from "next/navigation";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, { UI_NewHeader, UI_NewChildren } from "@/app_modules/_global/ui/V2_layout_tamplate";
+
+export function Investasi_UiRekapDokumen() {
+ const params = useParams<{ id: string }>();
+ const investasiId = params.id;
-export function Investasi_UiRekapDokumen({
- investasiId,
- dataDokumen,
-}: {
- investasiId: string;
- dataDokumen: any[]
-}) {
const [openDrawer, setOpenDrawer] = useState(false);
-
const listPage = [
{
id: "1",
@@ -31,7 +30,7 @@ export function Investasi_UiRekapDokumen({
return (
<>
-
}
>
-
-
+
+ */}
+
+
+
+ setOpenDrawer(true)}
+ variant="transparent"
+ >
+
+
+ }
+ />
+
+
+
+
+
- }
>
-
-
+
+ */}
+
+
+
+
+
+
+
+
+
>
);
}
diff --git a/src/app_modules/investasi/_ui/edit/ui_edit_investasi_new.tsx b/src/app_modules/investasi/_ui/edit/ui_edit_investasi_new.tsx
new file mode 100644
index 00000000..b58e90a8
--- /dev/null
+++ b/src/app_modules/investasi/_ui/edit/ui_edit_investasi_new.tsx
@@ -0,0 +1,33 @@
+"use client";
+
+import {
+ UIGlobal_LayoutHeaderTamplate,
+ UIGlobal_LayoutTamplate,
+} from "@/app_modules/_global/ui";
+import { Investasi_ViewEditInvestasiNew } from "../../_view/edit/view_edit_investasi_new";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewHeader,
+ UI_NewChildren,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+
+export function Investasi_UiEditInvestasiNew() {
+ return (
+ <>
+ {/* }
+ >
+
+ */}
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_ui/edit/ui_edit_prospektus.tsx b/src/app_modules/investasi/_ui/edit/ui_edit_prospektus.tsx
index d4aea25c..648d2b9f 100644
--- a/src/app_modules/investasi/_ui/edit/ui_edit_prospektus.tsx
+++ b/src/app_modules/investasi/_ui/edit/ui_edit_prospektus.tsx
@@ -1,23 +1,28 @@
"use client";
-import {
- UIGlobal_LayoutHeaderTamplate,
- UIGlobal_LayoutTamplate,
-} from "@/app_modules/_global/ui";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { Investasi_ViewEditProspektus } from "../../_view";
-export function Investasi_UiEditProspektus({
- investasiId,
-}: {
- investasiId: string;
-}) {
+export function Investasi_UiEditProspektus() {
return (
<>
- }
>
-
-
+
+ */}
+
+
+
+
+
+
+
+
>
);
}
diff --git a/src/app_modules/investasi/_ui/file_view/ui_file_view_dokumen.tsx b/src/app_modules/investasi/_ui/file_view/ui_file_view_dokumen.tsx
index 3ef116a5..5339404d 100644
--- a/src/app_modules/investasi/_ui/file_view/ui_file_view_dokumen.tsx
+++ b/src/app_modules/investasi/_ui/file_view/ui_file_view_dokumen.tsx
@@ -1,31 +1,195 @@
"use client";
-import { APIs } from "@/app/lib";
+import { MainColor } from "@/app_modules/_global/color";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import {
+ apiGetPdfToImage,
+ PageData,
+} from "@/app_modules/_global/lib/api_fetch_global";
+import { UIGlobal_DrawerCustom } from "@/app_modules/_global/ui";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import { Box } from "@mantine/core";
-import { IconX } from "@tabler/icons-react";
-import dynamic from "next/dynamic";
-const PdfToImage = dynamic(
- () =>
- import("../../_view/file_view/view_file_viewer").then((mod) => mod.default),
- { ssr: false }
-);
+import UI_NewLayoutTamplate, { UI_NewHeader, UI_NewChildren } from "@/app_modules/_global/ui/V2_layout_tamplate";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { ActionIcon, Box, Stack, Text } from "@mantine/core";
+import { IconDotsVertical, IconDownload, IconX } from "@tabler/icons-react";
+import Image from "next/image";
+import { useParams } from "next/navigation";
+import { useEffect, useRef, useState } from "react";
+
+export function Investasi_UiFileViewDokumen() {
+ const param = useParams<{ id: string }>();
+ const dokumenId = param.id;
+
+ const [pdfPages, setPdfPages] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState(null);
+ const pdfsRef = useRef(null);
+ const [isOpen, setOpen] = useState(false);
+
+ useEffect(() => {
+ const fetchPdfData = async () => {
+ try {
+ setLoading(true);
+ const response = await apiGetPdfToImage({ id: dokumenId });
+
+ if (response) {
+ setPdfPages(response.pages as any);
+ setLoading(false);
+ }
+ } catch (err) {
+ console.error("Error fetching PDF:", err);
+ setError(err instanceof Error ? err.message : "Unknown error occurred");
+ setLoading(false);
+ }
+ };
+
+ fetchPdfData();
+ }, [dokumenId]);
+
+ const handleDownloadFromAPI = async () => {
+ try {
+ const response = await fetch(
+ `https://wibu-storage.wibudev.com/api/files/${dokumenId}`
+ );
+ const blob = await response.blob(); // Konversi respons ke Blob
+ const url = window.URL.createObjectURL(blob); // Buat URL untuk Blob
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = `file-dokumen-${new Date()}.pdf`; // Nama file yang akan diunduh
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ window.URL.revokeObjectURL(url); // Bersihkan URL
+ } catch (error) {
+ console.error("Error downloading file:", error);
+ }
+ };
-export function Investasi_UiFileViewDokumen({
- dokumenId,
-}: {
- dokumenId: string;
-}) {
return (
<>
- } />}
+ {/* }
+ customButtonRight={
+ {
+ setOpen(true);
+ }}
+ >
+
+
+ }
+ />
+ }
>
-
-
+
+ {loading ? (
+
+ ) : error ? (
+
+
+
+
+ ) : (
+
+ {pdfPages?.map((page, index) => (
+
+ ))}
+
+ )}
-
+ */}
+
+
+
+ }
+ customButtonRight={
+ {
+ setOpen(true);
+ }}
+ >
+
+
+ }
+ />
+
+
+
+ {loading ? (
+
+ ) : error ? (
+
+
+
+
+ ) : (
+
+ {pdfPages?.map((page, index) => (
+
+ ))}
+
+ )}
+
+
+
+
+ setOpen(false)}
+ opened={isOpen}
+ component={
+
+
+
+
+
+ Download
+
+
+ }
+ />
>
);
}
diff --git a/src/app_modules/investasi/_ui/file_view/ui_file_view_prospektus.tsx b/src/app_modules/investasi/_ui/file_view/ui_file_view_prospektus.tsx
index 224a1f93..0256eb01 100644
--- a/src/app_modules/investasi/_ui/file_view/ui_file_view_prospektus.tsx
+++ b/src/app_modules/investasi/_ui/file_view/ui_file_view_prospektus.tsx
@@ -1,35 +1,212 @@
"use client";
-import { APIs } from "@/app/lib";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { MainColor } from "@/app_modules/_global/color";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import {
+ apiGetPdfToImage,
+ PageData,
+} from "@/app_modules/_global/lib/api_fetch_global";
+import { UIGlobal_DrawerCustom } from "@/app_modules/_global/ui";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import { Box } from "@mantine/core";
-import { IconX } from "@tabler/icons-react";
-import dynamic from "next/dynamic";
-const PdfToImage = dynamic(
- () =>
- import("../../_view/file_view/view_file_viewer").then((mod) => mod.default),
- { ssr: false }
-);
+import UI_NewLayoutTamplate, {
+ UI_NewHeader,
+ UI_NewChildren,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { ActionIcon, Box, Stack, Text } from "@mantine/core";
+import { IconDotsVertical, IconDownload, IconX } from "@tabler/icons-react";
+import Image from "next/image";
+import { useParams } from "next/navigation";
+import { useEffect, useRef, useState } from "react";
+
+export function Investasi_UiFileViewProspektus() {
+ const param = useParams<{ id: string }>();
+ const prospektusId = param.id;
+
+ const [pdfPages, setPdfPages] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState(null);
+ const pdfsRef = useRef(null);
+ const [isOpen, setOpen] = useState(false);
+
+ useEffect(() => {
+ const fetchPdfData = async () => {
+ try {
+ setLoading(true);
+ const response = await apiGetPdfToImage({ id: prospektusId });
+
+ if (response) {
+ setPdfPages(response.pages as any);
+ setLoading(false);
+ }
+ } catch (error) {
+ console.error("Error fetching PDF:", error);
+ setError(
+ error instanceof Error ? error.message : "Unknown error occurred"
+ );
+ setLoading(false);
+ setPdfPages(null);
+ }
+ };
+
+ fetchPdfData();
+ }, [prospektusId]);
+
+ const handleDownloadFromAPI = async () => {
+ try {
+ const response = await fetch(
+ `https://wibu-storage.wibudev.com/api/files/${prospektusId}`
+ );
+ const blob = await response.blob(); // Konversi respons ke Blob
+ const url = window.URL.createObjectURL(blob); // Buat URL untuk Blob
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = `file-portofolio-${new Date()}.pdf`; // Nama file yang akan diunduh
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ window.URL.revokeObjectURL(url); // Bersihkan URL
+ } catch (error) {
+ console.error("Error downloading file:", error);
+ }
+ };
-export function Investasi_UiFileViewProspektus({
- pospektusId,
-}: {
- pospektusId: string;
-}) {
return (
<>
- } />}
- >
-
- }
+ customButtonRight={
+ loading ? (
+
+ ) : error && error !== "" ? (
+
+ ) : (
+ {
+ setOpen(true);
+ }}
+ >
+
+
+ )
+ }
/>
+ }
+ >
+
+ {loading ? (
+
+ ) : error && error !== "" ? (
+
+
+
+ ) : (
+
+ {pdfPages?.map((page, index) => (
+
+ ))}
+
+ )}
-
+ */}
+
+
+
+ }
+ customButtonRight={
+ loading ? (
+
+ ) : error && error !== "" ? (
+
+ ) : (
+ {
+ setOpen(true);
+ }}
+ >
+
+
+ )
+ }
+ />
+
+
+
+ {loading ? (
+
+ ) : error && error !== "" ? (
+
+
+ {/* */}
+
+ ) : (
+
+ {pdfPages?.map((page, index) => (
+
+ ))}
+
+ )}
+
+
+
+
+ setOpen(false)}
+ opened={isOpen}
+ component={
+
+
+
+
+
+ Download
+
+
+ }
+ />
>
);
}
diff --git a/src/app_modules/investasi/_ui/index.ts b/src/app_modules/investasi/_ui/index.ts
index 65b18d7b..956c4bef 100644
--- a/src/app_modules/investasi/_ui/index.ts
+++ b/src/app_modules/investasi/_ui/index.ts
@@ -24,6 +24,9 @@ import { Investasi_UiDaftarBerita } from "./detail/ui_daftar_berita";
import { Investasi_UiRekapBerita } from "./detail/ui_rekap_berita";
import { Investasi_UiCreateBerita } from "./create/ui_create_berita";
import { Investasi_UiDetailBerita } from "./detail/ui_berita";
+import { Investasi_UiEditInvestasiNew } from "./edit/ui_edit_investasi_new";
+import { Investasi_ViewBerandaNew } from "../_view/main/view_beranda_new";
+import { Investasi_UiPortofolioNew } from "./main/ui_portofolio_new";
export { Investasi_UiProsesPembelian };
export { Investasi_UiMetodePembayaran };
@@ -51,3 +54,6 @@ export { Investasi_UiDaftarBerita };
export { Investasi_UiRekapBerita };
export { Investasi_UiCreateBerita };
export { Investasi_UiDetailBerita };
+export { Investasi_UiEditInvestasiNew }
+export { Investasi_ViewBerandaNew }
+export { Investasi_UiPortofolioNew }
diff --git a/src/app_modules/investasi/_ui/main/ui_layout_main.tsx b/src/app_modules/investasi/_ui/main/ui_layout_main.tsx
index 777f8fe9..953a9117 100644
--- a/src/app_modules/investasi/_ui/main/ui_layout_main.tsx
+++ b/src/app_modules/investasi/_ui/main/ui_layout_main.tsx
@@ -1,8 +1,14 @@
"use client";
-import { RouterCrowd } from "@/app/lib/router_hipmi/router_crowd";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewFooter,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { RouterCrowd } from "@/lib/router_hipmi/router_crowd";
import React from "react";
import { Investasi_ComponentFooterMain } from "../../_component";
@@ -13,7 +19,7 @@ export function Investasi_UiLayoutMain({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
+
+
+
>
);
}
diff --git a/src/app_modules/investasi/_ui/main/ui_portofolio.tsx b/src/app_modules/investasi/_ui/main/ui_portofolio.tsx
index 189d86af..15f6eb72 100644
--- a/src/app_modules/investasi/_ui/main/ui_portofolio.tsx
+++ b/src/app_modules/investasi/_ui/main/ui_portofolio.tsx
@@ -1,6 +1,6 @@
"use client";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { MODEL_NEW_DEFAULT_MASTER } from "@/app_modules/model_global/interface";
import { Stack, Tabs } from "@mantine/core";
diff --git a/src/app_modules/investasi/_ui/main/ui_portofolio_new.tsx b/src/app_modules/investasi/_ui/main/ui_portofolio_new.tsx
new file mode 100644
index 00000000..7ad8bc9f
--- /dev/null
+++ b/src/app_modules/investasi/_ui/main/ui_portofolio_new.tsx
@@ -0,0 +1,77 @@
+"use client";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { Stack, Tabs } from "@mantine/core";
+import { useParams, useRouter } from "next/navigation";
+import { Investasi_ViewPortofolioNew } from "../../_view/main/portofolio/view_portofolio_new";
+
+export function Investasi_UiPortofolioNew() {
+ const param = useParams<{ id: string }>();
+ const router = useRouter();
+ const status = [
+ {
+ id: "1",
+ name: "Publish",
+ color: "green"
+ },
+ {
+ id: "2",
+ name: "Review",
+ color: "orange"
+ },
+ {
+ id: "3",
+ name: "Draft",
+ color: "yellow"
+ },
+ {
+ id: "4",
+ name: "Reject",
+ color: "red"
+ }
+ ]
+
+ return (
+ <>
+ {
+ router.push(NEW_RouterInvestasi.portofolio({ id: val }));
+ }}
+ >
+
+
+ {status.map((e) => (
+
+ {e.name}
+
+ ))}
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_ui/status_transaksi/ui_transaksi_berhasil.tsx b/src/app_modules/investasi/_ui/status_transaksi/ui_transaksi_berhasil.tsx
index 16c6c8e5..32b8fbca 100644
--- a/src/app_modules/investasi/_ui/status_transaksi/ui_transaksi_berhasil.tsx
+++ b/src/app_modules/investasi/_ui/status_transaksi/ui_transaksi_berhasil.tsx
@@ -1,8 +1,11 @@
"use client";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { ActionIcon, Loader } from "@mantine/core";
import { IconX } from "@tabler/icons-react";
import { useAtom } from "jotai";
@@ -11,19 +14,38 @@ import { useState } from "react";
import { Investasi_ViewTransaksiBerhasil } from "../../_view";
import { gs_investas_menu } from "../../g_state";
-export function Investasi_UiTransaksiBerhasil({
- dataTransaksi,
-}: {
- dataTransaksi: any;
-}) {
+export function Investasi_UiTransaksiBerhasil() {
const router = useRouter();
const [hotMenu, setHotMenu] = useAtom(gs_investas_menu);
const [isLoading, setLoading] = useState(false);
return (
- {
+ // setHotMenu(3);
+ // setLoading(true);
+ // router.push(RouterInvestasi_OLD.main_transaksi);
+ // }}
+ // >
+ // {isLoading ? : }
+ //
+ // }
+ // />
+ // }
+ // >
+
+ //
+ //
+
+
+
+
}
/>
- }
- >
-
-
+
+
+
+
+
);
}
diff --git a/src/app_modules/investasi/_ui/status_transaksi/ui_transaksi_gagal.tsx b/src/app_modules/investasi/_ui/status_transaksi/ui_transaksi_gagal.tsx
index 4bf32e6e..fa67dab6 100644
--- a/src/app_modules/investasi/_ui/status_transaksi/ui_transaksi_gagal.tsx
+++ b/src/app_modules/investasi/_ui/status_transaksi/ui_transaksi_gagal.tsx
@@ -1,8 +1,11 @@
"use client";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { ActionIcon, Loader } from "@mantine/core";
import { IconX } from "@tabler/icons-react";
import { useAtom } from "jotai";
@@ -11,21 +14,37 @@ import { useState } from "react";
import { Investasi_ViewTransaksiGagal } from "../../_view";
import { gs_investas_menu } from "../../g_state";
-export function Investasi_UiTransaksiGagal({
- dataTransaksi,
- nomorAdmin,
-}: {
- dataTransaksi: any;
- nomorAdmin: any
-}) {
+export function Investasi_UiTransaksiGagal() {
const router = useRouter();
const [hotMenu, setHotMenu] = useAtom(gs_investas_menu);
const [isLoading, setLoading] = useState(false);
return (
- {
+ // setHotMenu(3);
+ // setLoading(true);
+ // router.push(RouterInvestasi_OLD.main_transaksi);
+ // }}
+ // >
+ // {isLoading ? : }
+ //
+ // }
+ // />
+ // }
+ // >
+ //
+ //
+
+
+
+
}
/>
- }
- >
-
-
+
+
+
+
+
);
}
diff --git a/src/app_modules/investasi/_ui/transaksi/ui_invoice.tsx b/src/app_modules/investasi/_ui/transaksi/ui_invoice.tsx
index 77d538fd..356ae68f 100644
--- a/src/app_modules/investasi/_ui/transaksi/ui_invoice.tsx
+++ b/src/app_modules/investasi/_ui/transaksi/ui_invoice.tsx
@@ -1,27 +1,28 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import { Investasi_ViewInvoice } from "../../_view";
import { useAtom } from "jotai";
-
-import { useState } from "react";
-import { gs_investas_menu } from "../../g_state";
-import { useRouter } from "next/navigation";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { Investasi_ViewInvoice } from "../../_view";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { ActionIcon, Loader } from "@mantine/core";
import { IconX } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { gs_investas_menu } from "../../g_state";
-export function Investasi_UiInvoice({ dataInvoice }: { dataInvoice : any}) {
+export function Investasi_UiInvoice() {
const router = useRouter();
const [hotMenu, setHotMenu] = useAtom(gs_investas_menu);
const [isLoading, setLoading] = useState(false);
-
return (
-
+
+
}
/>
- }
- >
-
-
+
+
+
+
+
);
}
diff --git a/src/app_modules/investasi/_ui/transaksi/ui_metode_pembayaran.tsx b/src/app_modules/investasi/_ui/transaksi/ui_metode_pembayaran.tsx
index f0504984..a687f76f 100644
--- a/src/app_modules/investasi/_ui/transaksi/ui_metode_pembayaran.tsx
+++ b/src/app_modules/investasi/_ui/transaksi/ui_metode_pembayaran.tsx
@@ -1,26 +1,23 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { Investasi_ViewMetodePembayaran } from "../../_view";
-export function Investasi_UiMetodePembayaran({
- listBank,
- investasiId,
-}: {
- listBank: any[];
- investasiId: string
-}) {
+export function Investasi_UiMetodePembayaran() {
return (
<>
- }
- >
-
-
+
+
+
+
+
+
+
+
>
);
}
diff --git a/src/app_modules/investasi/_ui/transaksi/ui_proses_pembelian.tsx b/src/app_modules/investasi/_ui/transaksi/ui_proses_pembelian.tsx
index e2de8d5c..17c9fc07 100644
--- a/src/app_modules/investasi/_ui/transaksi/ui_proses_pembelian.tsx
+++ b/src/app_modules/investasi/_ui/transaksi/ui_proses_pembelian.tsx
@@ -1,21 +1,24 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { Investasi_ViewProsesPembelian } from "../../_view";
-export function Investasi_UiProsesPembelian({
- dataInvestasi,
-}: {
- dataInvestasi: any;
-}) {
+export function Investasi_UiProsesPembelian() {
return (
<>
- }
- >
-
-
+
+
+
+
+
+
+
+
+
>
);
}
diff --git a/src/app_modules/investasi/_ui/transaksi/ui_proses_transaksi.tsx b/src/app_modules/investasi/_ui/transaksi/ui_proses_transaksi.tsx
index d12ff092..1538ab20 100644
--- a/src/app_modules/investasi/_ui/transaksi/ui_proses_transaksi.tsx
+++ b/src/app_modules/investasi/_ui/transaksi/ui_proses_transaksi.tsx
@@ -9,10 +9,10 @@ import { gs_donasi_hot_menu } from "@/app_modules/donasi/global_state";
import { useAtom } from "jotai";
import { gs_investas_menu } from "../../g_state";
import { useRouter } from "next/navigation";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { useState } from "react";
-export function Investasi_UiProsesTransaksi({ nomorAdmin }: { nomorAdmin : any}) {
+export function Investasi_UiProsesTransaksi() {
const router = useRouter();
const [hotMenu, setHotMenu] = useAtom(gs_investas_menu);
const [isLoading, setLoading] = useState(false);
@@ -38,7 +38,7 @@ export function Investasi_UiProsesTransaksi({ nomorAdmin }: { nomorAdmin : any})
/>
}
>
-
+
>
);
diff --git a/src/app_modules/investasi/_view/create/view_create_berita.tsx b/src/app_modules/investasi/_view/create/view_create_berita.tsx
index 1b5067d2..b80408f0 100644
--- a/src/app_modules/investasi/_view/create/view_create_berita.tsx
+++ b/src/app_modules/investasi/_view/create/view_create_berita.tsx
@@ -1,39 +1,37 @@
-import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { DIRECTORY_ID } from "@/lib";
+import { MainColor } from "@/app_modules/_global/color";
import {
- ComponentGlobal_BoxInformation,
- ComponentGlobal_BoxUploadImage,
- ComponentGlobal_InputCountDown,
+ ComponentGlobal_BoxInformation,
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
+ ComponentGlobal_InputCountDown,
} from "@/app_modules/_global/component";
-import {
- ComponentGlobal_NotifikasiBerhasil,
- ComponentGlobal_NotifikasiGagal,
- ComponentGlobal_NotifikasiPeringatan,
-} from "@/app_modules/_global/notif_global";
-import {
- AspectRatio,
- Button,
- Center,
- FileButton,
- Image,
- Stack,
- Text,
- TextInput,
- Textarea,
-} from "@mantine/core";
-import { IconCamera, IconUpload } from "@tabler/icons-react";
-
-import { DIRECTORY_ID } from "@/app/lib";
import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
+import {
+ ComponentGlobal_NotifikasiBerhasil,
+ ComponentGlobal_NotifikasiGagal,
+ ComponentGlobal_NotifikasiPeringatan,
+} from "@/app_modules/_global/notif_global";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ AspectRatio,
+ Button,
+ Center,
+ Image,
+ Stack,
+ TextInput,
+ Textarea,
+} from "@mantine/core";
import { Prisma } from "@prisma/client";
-import { useRouter } from "next/navigation";
+import { IconPhoto } from "@tabler/icons-react";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import { investasi_funCreateBerita } from "../../_fun";
-export function Investasi_ViewCreateBerita({
- investasiId,
-}: {
- investasiId: string;
-}) {
+export function Investasi_ViewCreateBerita() {
+ const params = useParams<{ id: string }>();
+ const investasiId = params.id;
+
const router = useRouter();
const [file, setFile] = useState(null);
const [img, setImg] = useState();
@@ -48,9 +46,6 @@ export function Investasi_ViewCreateBerita({
});
async function onCreate() {
- if (data.data.title == "" || data.data.deskripsi == "")
- return ComponentGlobal_NotifikasiPeringatan("Lengkapi data");
-
try {
setIsLoading(true);
if (file != null) {
@@ -59,32 +54,39 @@ export function Investasi_ViewCreateBerita({
dirId: DIRECTORY_ID.investasi_berita,
});
- if (!uploadFile.success)
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ if (!uploadFile.success) {
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ return;
+ }
const createWithFile = await investasi_funCreateBerita({
data: data.data as any,
fileId: uploadFile.data.id,
});
- createWithFile.status === 201
- ? (ComponentGlobal_NotifikasiBerhasil(createWithFile.message),
- router.back())
- : ComponentGlobal_NotifikasiGagal(createWithFile.message);
+ if (createWithFile.status === 201) {
+ ComponentGlobal_NotifikasiBerhasil(createWithFile.message);
+ router.back();
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(createWithFile.message);
+ }
} else {
const createNoFile = await investasi_funCreateBerita({
data: data.data as any,
});
- createNoFile.status === 201
- ? (ComponentGlobal_NotifikasiBerhasil(createNoFile.message),
- router.back())
- : ComponentGlobal_NotifikasiGagal(createNoFile.message);
+ if (createNoFile.status === 201) {
+ ComponentGlobal_NotifikasiBerhasil(createNoFile.message);
+ router.back();
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(createNoFile.message);
+ }
}
} catch (error) {
- console.log(error);
- } finally {
setIsLoading(false);
+ clientLogger.error("Error create news", error);
}
}
@@ -106,43 +108,16 @@ export function Investasi_ViewCreateBerita({
) : (
-
-
- Upload Gambar
-
+
)}
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
- setImg(buffer);
- setFile(files);
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
-
-
-
- )}
-
+
@@ -187,6 +162,10 @@ export function Investasi_ViewCreateBerita({
();
+ const investasiId = params.id;
-export function Investasi_ViewCreateDocument({
- investasiId,
-}: {
- investasiId: string;
-}) {
const router = useRouter();
const [filePdf, setFilePdf] = useState(null);
const [isLoading, setIsLoading] = useState(false);
const [title, setTitle] = useState("");
async function onCreate() {
- setIsLoading(true);
- const uploadFileDokumen = await funGlobal_UploadToStorage({
- file: filePdf as any,
- dirId: DIRECTORY_ID.investasi_dokumen,
- });
- if (!uploadFileDokumen.success) {
- setIsLoading(false);
- ComponentGlobal_NotifikasiPeringatan("Gagal upload file pdf");
- }
-
try {
+ setIsLoading(true);
+ const uploadFileDokumen = await funGlobal_UploadToStorage({
+ file: filePdf as any,
+ dirId: DIRECTORY_ID.investasi_dokumen,
+ });
+
+ if (!uploadFileDokumen.success) {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload file pdf");
+ return;
+ }
+
const create = await investasi_funCreateDocument({
data: {
investasiId: investasiId,
@@ -54,15 +56,17 @@ export function Investasi_ViewCreateDocument({
},
});
- if (create.status !== 201)
+ if (create.status !== 201) {
+ setIsLoading(false);
ComponentGlobal_NotifikasiPeringatan(create.message);
+ return;
+ }
- router.back();
ComponentGlobal_NotifikasiBerhasil(create.message);
+ router.back();
} catch (error) {
- console.log(error);
- } finally {
setIsLoading(false);
+ clientLogger.error("Error create document", error);
}
}
@@ -73,6 +77,7 @@ export function Investasi_ViewCreateDocument({
{!filePdf ? (
-
- Upload Dokumen
-
+
+
+
) : (
@@ -104,55 +109,43 @@ export function Investasi_ViewCreateDocument({
)}
-
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
-
- setFilePdf(files);
- } catch (error) {
- console.log(error);
- }
- }}
- >
- {(props) => (
- }
- {...props}
- radius={"xl"}
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload Dokumen
-
- )}
-
-
+
+
+
- {
- onCreate();
+ display: "flex",
+ justifyContent: "center",
}}
>
- Simpan
-
+ {
+ onCreate();
+ }}
+ >
+ Simpan
+
+
>
);
diff --git a/src/app_modules/investasi/_view/detail/portofolio/view_detail_draft.tsx b/src/app_modules/investasi/_view/detail/portofolio/view_detail_draft.tsx
index 33df1681..adb433a1 100644
--- a/src/app_modules/investasi/_view/detail/portofolio/view_detail_draft.tsx
+++ b/src/app_modules/investasi/_view/detail/portofolio/view_detail_draft.tsx
@@ -1,7 +1,9 @@
"use client";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
-import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import {
+ AccentColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
import { funGlobal_DeleteFileById } from "@/app_modules/_global/fun";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
@@ -13,6 +15,8 @@ import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
import { investasi_funEditStatusById } from "@/app_modules/investasi/fun/edit/fun_edit_status_by_id";
import funDeleteInvestasi from "@/app_modules/investasi/fun/fun_delete_investasi";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
+import { clientLogger } from "@/util/clientLogger";
import mqtt_client from "@/util/mqtt_client";
import { Button, Group, Stack } from "@mantine/core";
import _ from "lodash";
@@ -34,77 +38,86 @@ export default function Investasi_ViewDetailDraft({
const [openModalDelete, setOpenModalDelete] = useState(false);
async function onChangeStatus() {
- const res = await investasi_funEditStatusById({
- investasiId: data.id,
- statusId: "2",
- });
-
- if (res.status === 200) {
+ try {
setIsLoading(true);
- ComponentGlobal_NotifikasiBerhasil("Review Berhasil Diajukan");
- router.replace(NEW_RouterInvestasi.portofolio({ id: "2" }));
-
- const dataNotif = {
- appId: res.data?.id,
- userId: res.data?.authorId,
- pesan: res.data?.title,
- status: res.data?.MasterStatusInvestasi?.name,
- kategoriApp: "INVESTASI",
- title: "Mengajukan review",
- };
-
- const notif = await notifikasiToAdmin_funCreate({
- data: dataNotif as any,
+ const res = await investasi_funEditStatusById({
+ investasiId: data.id,
+ statusId: "2",
});
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil("Review Berhasil Diajukan");
+ router.replace(NEW_RouterInvestasi.portofolio({ id: "2" }));
- if (notif.status === 201) {
- mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
+ const dataNotif = {
+ appId: res.data?.id,
+ userId: res.data?.authorId,
+ pesan: res.data?.title,
+ status: res.data?.MasterStatusInvestasi?.name,
+ kategoriApp: "INVESTASI",
+ title: "Mengajukan review",
+ };
+
+ const notif = await notifikasiToAdmin_funCreate({
+ data: dataNotif as any,
+ });
+
+ if (notif.status === 201) {
+ mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
+ }
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
}
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ } catch (error) {
+ setIsLoading(false);
+ clientLogger.error("Error update investasi", error);
}
}
async function onDelete() {
- const res = await funDeleteInvestasi(data.id);
- if (res.status === 200) {
+ try {
setIsLoadingDelete(true);
+ const res = await funDeleteInvestasi(data.id);
+ if (res.status === 200) {
+ const delImage = await funGlobal_DeleteFileById({
+ fileId: data.imageId,
+ });
+ if (!delImage.success) {
+ ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus image ");
+ }
- const delImage = await funGlobal_DeleteFileById({
- fileId: data.imageId,
- });
- if (!delImage.success) {
- ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus image ");
- }
+ const delFileProspektus = await funGlobal_DeleteFileById({
+ fileId: data.prospektusFileId,
+ });
+ if (!delFileProspektus.success) {
+ ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus prospektus ");
+ }
- const delFileProspektus = await funGlobal_DeleteFileById({
- fileId: data.prospektusFileId,
- });
- if (!delFileProspektus.success) {
- ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus prospektus ");
- }
+ if (!_.isEmpty(data.DokumenInvestasi)) {
+ for (let i of data.DokumenInvestasi) {
+ const delFileDokumen = await funGlobal_DeleteFileById({
+ fileId: i.fileId,
+ });
- if (!_.isEmpty(data.DokumenInvestasi)) {
- for (let i of data.DokumenInvestasi) {
- const delFileDokumen = await funGlobal_DeleteFileById({
- fileId: i.fileId,
- });
-
- if (!delFileDokumen.success) {
- ComponentAdminGlobal_NotifikasiPeringatan(
- "Gagal hapus prospektus "
- );
+ if (!delFileDokumen.success) {
+ ComponentAdminGlobal_NotifikasiPeringatan(
+ "Gagal hapus prospektus "
+ );
+ }
}
}
- }
- ComponentGlobal_NotifikasiBerhasil(res.message);
- setOpenModal(false);
- router.replace(NEW_RouterInvestasi.portofolio({ id: "3" }));
- setIsLoadingDelete(false);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ setOpenModal(false);
+ router.replace(NEW_RouterInvestasi.portofolio({ id: "3" }));
+ setIsLoadingDelete(false);
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ setIsLoadingDelete(false);
+ }
+ } catch (error) {
setIsLoadingDelete(false);
+ clientLogger.error("Error delete investasi", error);
}
}
@@ -119,9 +132,8 @@ export default function Investasi_ViewDetailDraft({
setOpenModal(true)}
>
Ajukan Review
@@ -129,8 +141,8 @@ export default function Investasi_ViewDetailDraft({
setOpenModalDelete(true)}
>
Hapus
@@ -144,7 +156,12 @@ export default function Investasi_ViewDetailDraft({
close={() => setOpenModal(false)}
title={"Anda yakin ingin mengajukan review ?"}
buttonKiri={
- setOpenModal(false)}>
+ setOpenModal(false)}
+ >
Batal
}
@@ -152,11 +169,13 @@ export default function Investasi_ViewDetailDraft({
onChangeStatus()}
>
Simpan
@@ -170,7 +189,12 @@ export default function Investasi_ViewDetailDraft({
close={() => setOpenModalDelete(false)}
title={"Anda yakin ingin menghapus ?"}
buttonKiri={
- setOpenModalDelete(false)}>
+ setOpenModalDelete(false)}
+ >
Batal
}
@@ -178,11 +202,12 @@ export default function Investasi_ViewDetailDraft({
{
onDelete();
}}
diff --git a/src/app_modules/investasi/_view/detail/portofolio/view_detail_publish.tsx b/src/app_modules/investasi/_view/detail/portofolio/view_detail_publish.tsx
index e13258de..2dacbb90 100644
--- a/src/app_modules/investasi/_view/detail/portofolio/view_detail_publish.tsx
+++ b/src/app_modules/investasi/_view/detail/portofolio/view_detail_publish.tsx
@@ -1,23 +1,22 @@
"use client";
-import {
- NEW_RouterInvestasi,
- RouterInvestasi_OLD,
-} from "@/app/lib/router_hipmi/router_investasi";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import {
ComponentGlobal_AvatarAndUsername,
ComponentGlobal_CardStyles,
ComponentGlobal_LoadImageLandscape,
} from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import {
Investasi_ComponentBoxDaftarBerita,
Investasi_ComponentBoxDaftarDokumen,
+ Investasi_ComponentBoxInvestor,
Investasi_ComponentBoxProgress,
Investasi_ComponentBoxProspektus,
Investasi_ComponentTitleAndValueInDetail,
} from "@/app_modules/investasi/_component";
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import {
Box,
Button,
@@ -28,27 +27,19 @@ import {
Title,
} from "@mantine/core";
import { useLocalStorage } from "@mantine/hooks";
-import {
- IconBookDownload,
- IconFileDescription,
- IconSpeakerphone,
-} from "@tabler/icons-react";
import _ from "lodash";
import moment from "moment";
import { useRouter } from "next/navigation";
import { useState } from "react";
export default function Investasi_ViewDetailPublish({
- dataInvestasi,
+ data,
userLoginId,
}: {
- dataInvestasi: MODEL_INVESTASI;
+ data: MODEL_INVESTASI | null;
userLoginId: string;
}) {
const router = useRouter();
- const [data, setData] = useState(dataInvestasi);
- const [boxId, setBoxId] = useState(0);
- const [isLoadingBox, setLoadingBox] = useState(false);
const [isLoadingButton, setLoadingButton] = useState(false);
const [total, setTotal] = useLocalStorage({
key: "total_investasi",
@@ -62,26 +53,28 @@ export default function Investasi_ViewDetailPublish({
setLoadingButton(true);
//NEW
- router.push(NEW_RouterInvestasi.pembelian + data.id, { scroll: false });
+ router.push(NEW_RouterInvestasi.pembelian + data?.id, { scroll: false });
setTotal(0);
setJumlah(0);
}
+ if (!data) return ;
+
return (
-
+
-
+
{/* Title dan Persentase */}
-
- {_.startCase(data.title)}
+
+ {_.startCase(data?.title)}
@@ -90,16 +83,20 @@ export default function Investasi_ViewDetailPublish({
{data.Investasi_Invoice.length} }
+ value={
+
+ {data?.Investasi_Invoice.length}{" "}
+
+ }
/>
+
Rp.{" "}
{new Intl.NumberFormat("id-ID", {
maximumSignificantDigits: 20,
- }).format(+data.targetDana)}{" "}
+ }).format(+data?.targetDana)}{" "}
}
/>
@@ -107,27 +104,31 @@ export default function Investasi_ViewDetailPublish({
+
Rp.{" "}
{new Intl.NumberFormat("id-ID", {
maximumSignificantDigits: 10,
- }).format(+data.hargaLembar)}
+ }).format(+data?.hargaLembar)}
}
/>
Return Of Invesment (RoI)}
- value={{data.roi} %}
+ title={
+
+ Return Of Invesment (RoI)
+
+ }
+ value={{data?.roi} %}
/>
+
{new Intl.NumberFormat("id-ID", {
maximumSignificantDigits: 10,
- }).format(+data.totalLembar)}{" "}
+ }).format(+data?.totalLembar)}{" "}
lembar
}
@@ -136,10 +137,10 @@ export default function Investasi_ViewDetailPublish({
+
{new Intl.NumberFormat("id-ID", {
maximumSignificantDigits: 10,
- }).format(+data.sisaLembar)}{" "}
+ }).format(+data?.sisaLembar)}{" "}
lembar
}
@@ -147,29 +148,42 @@ export default function Investasi_ViewDetailPublish({
{data.MasterPembagianDeviden.name} Bulan }
+ value={
+
+ {data?.MasterPembagianDeviden.name} Bulan{" "}
+
+ }
/>
{data.MasterPeriodeDeviden.name}}
+ value={
+
+ {data?.MasterPeriodeDeviden.name}
+
+ }
/>
{data.MasterPencarianInvestor.name} Hari }
+ value={
+
+ {data?.MasterPencarianInvestor.name} Hari{" "}
+
+ }
/>
{/* List Box */}
+
@@ -178,9 +192,9 @@ export default function Investasi_ViewDetailPublish({
- {data.sisaLembar === "0" ||
- Number(data.MasterPencarianInvestor.name) -
- moment(new Date()).diff(new Date(data.countDown), "days") <=
+ {data?.sisaLembar === "0" ||
+ Number(data?.MasterPencarianInvestor.name) -
+ moment(new Date()).diff(new Date(data?.countDown), "days") <=
0 ? (
@@ -189,7 +203,7 @@ export default function Investasi_ViewDetailPublish({
) : (
- {userLoginId === data.authorId ? (
+ {userLoginId === data?.authorId ? (
Investasi Ini Milik Anda
diff --git a/src/app_modules/investasi/_view/detail/portofolio/view_detail_reject.tsx b/src/app_modules/investasi/_view/detail/portofolio/view_detail_reject.tsx
index 17f9f89a..c9f2360a 100644
--- a/src/app_modules/investasi/_view/detail/portofolio/view_detail_reject.tsx
+++ b/src/app_modules/investasi/_view/detail/portofolio/view_detail_reject.tsx
@@ -1,6 +1,6 @@
"use client";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
import { funGlobal_DeleteFileById } from "@/app_modules/_global/fun";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
@@ -11,6 +11,8 @@ import { Investasi_ComponentDetailDataNonPublish } from "@/app_modules/investasi
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
import { investasi_funEditStatusById } from "@/app_modules/investasi/fun/edit/fun_edit_status_by_id";
import funDeleteInvestasi from "@/app_modules/investasi/fun/fun_delete_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
+import { clientLogger } from "@/util/clientLogger";
import { Button, Group, Stack } from "@mantine/core";
import _ from "lodash";
import { useRouter } from "next/navigation";
@@ -23,63 +25,74 @@ export default function Investasi_ViewDetailReject({
}) {
const router = useRouter();
const [data, setData] = useState(dataInvestasi);
- const [openModal, setOpenModal] = useState(false);
- const [isLoading, setLoading] = useState(false);
+ const [openModalDel, setOpenModalDel] = useState(false);
+ const [openModalEdit, setOpenModalEdit] = useState(false);
+ const [isLoadingDel, setLoadingDel] = useState(false);
+ const [isLoadingEdit, setLoadingEdit] = useState(false);
async function onAjukan() {
- const res = await investasi_funEditStatusById({
- investasiId: data.id,
- statusId: "3",
- });
-
- if (res.status === 200) {
- ComponentGlobal_NotifikasiBerhasil("Project Diajukan Kembali");
- router.replace(NEW_RouterInvestasi.portofolio({ id: "3" }));
- } else {
- ComponentGlobal_NotifikasiGagal("Gagal Pengajuan");
+ try {
+ setLoadingEdit(true);
+ const res = await investasi_funEditStatusById({
+ investasiId: data.id,
+ statusId: "3",
+ });
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil("Project Diajukan Kembali");
+ router.replace(NEW_RouterInvestasi.portofolio({ id: "3" }));
+ } else {
+ ComponentGlobal_NotifikasiGagal("Gagal Pengajuan");
+ }
+ } catch (error) {
+ clientLogger.error("Error ajukan kembali", error);
+ } finally {
+ setLoadingEdit(false);
}
}
async function onDelete() {
- const res = await funDeleteInvestasi(data.id);
- if (res.status === 200) {
- setLoading(true);
+ try {
+ setLoadingDel(true);
+ const res = await funDeleteInvestasi(data.id);
+ if (res.status === 200) {
+ const delImage = await funGlobal_DeleteFileById({
+ fileId: data.imageId,
+ });
+ if (!delImage.success) {
+ ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus image ");
+ }
- const delImage = await funGlobal_DeleteFileById({
- fileId: data.imageId,
- });
- if (!delImage.success) {
- ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus image ");
- }
+ const delFileProspektus = await funGlobal_DeleteFileById({
+ fileId: data.prospektusFileId,
+ });
+ if (!delFileProspektus.success) {
+ ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus prospektus ");
+ }
- const delFileProspektus = await funGlobal_DeleteFileById({
- fileId: data.prospektusFileId,
- });
- if (!delFileProspektus.success) {
- ComponentAdminGlobal_NotifikasiPeringatan("Gagal hapus prospektus ");
- }
+ if (!_.isEmpty(data.DokumenInvestasi)) {
+ for (let i of data.DokumenInvestasi) {
+ const delFileDokumen = await funGlobal_DeleteFileById({
+ fileId: i.fileId,
+ });
- if (!_.isEmpty(data.DokumenInvestasi)) {
- for (let i of data.DokumenInvestasi) {
- const delFileDokumen = await funGlobal_DeleteFileById({
- fileId: i.fileId,
- });
-
- if (!delFileDokumen.success) {
- ComponentAdminGlobal_NotifikasiPeringatan(
- "Gagal hapus prospektus "
- );
+ if (!delFileDokumen.success) {
+ ComponentAdminGlobal_NotifikasiPeringatan(
+ "Gagal hapus prospektus "
+ );
+ }
}
}
- }
- ComponentGlobal_NotifikasiBerhasil(res.message);
- setOpenModal(false);
- router.replace(NEW_RouterInvestasi.portofolio({ id: "4" }));
- setLoading(false);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- setLoading(false);
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ setOpenModalDel(false);
+ router.replace(NEW_RouterInvestasi.portofolio({ id: "4" }));
+ } else {
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ console.error("Error delete investasi", error);
+ } finally {
+ setLoadingDel(false);
}
}
@@ -88,19 +101,24 @@ export default function Investasi_ViewDetailReject({
{/* Pop up */}
setOpenModal(false)}
+ opened={openModalDel}
+ close={() => setOpenModalDel(false)}
buttonKiri={
- setOpenModal(false)}>
+ setOpenModalDel(false)}
+ >
Batal
}
buttonKanan={
onDelete()}
>
@@ -109,6 +127,34 @@ export default function Investasi_ViewDetailReject({
}
/>
+ setOpenModalEdit(false)}
+ buttonKiri={
+ setOpenModalEdit(false)}
+ >
+ Batal
+
+ }
+ buttonKanan={
+ onAjukan()}
+ >
+ Edit
+
+ }
+ />
+
{/* Alasan */}
@@ -119,9 +165,9 @@ export default function Investasi_ViewDetailReject({
{/* Tombol Ajukan */}
onAjukan()}
+ style={{ backgroundColor: AccentColor.yellow }}
+ onClick={() => setOpenModalEdit(true)}
+ c={MainColor.darkblue}
>
Edit Kembali
@@ -129,9 +175,9 @@ export default function Investasi_ViewDetailReject({
{/* Tombol Hapus */}
setOpenModal(true)}
+ style={{ backgroundColor: MainColor.red }}
+ c={AccentColor.white}
+ onClick={() => setOpenModalDel(true)}
>
Hapus
diff --git a/src/app_modules/investasi/_view/detail/portofolio/view_detail_review.tsx b/src/app_modules/investasi/_view/detail/portofolio/view_detail_review.tsx
index 688dde83..e0613cd5 100644
--- a/src/app_modules/investasi/_view/detail/portofolio/view_detail_review.tsx
+++ b/src/app_modules/investasi/_view/detail/portofolio/view_detail_review.tsx
@@ -1,6 +1,7 @@
"use client";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import { UIGlobal_Modal } from "@/app_modules/_global/ui";
@@ -8,6 +9,7 @@ import { Investasi_ComponentDetailDataNonPublish } from "@/app_modules/investasi
import { MODEL_INVESTASI } from "@/app_modules/investasi/_lib/interface";
import { investasi_funEditStatusById } from "@/app_modules/investasi/fun/edit/fun_edit_status_by_id";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
+import { clientLogger } from "@/util/clientLogger";
import mqtt_client from "@/util/mqtt_client";
import { Button, Stack } from "@mantine/core";
import { useRouter } from "next/navigation";
@@ -24,35 +26,40 @@ export default function Investasi_ViewDetailReview({
const [openModal, setOpenModal] = useState(false);
async function onChangeStatus() {
- const res = await investasi_funEditStatusById({
- investasiId: data.id,
- statusId: "3",
- });
- if (res.status === 200) {
+ try {
setLoading(true);
- ComponentGlobal_NotifikasiBerhasil("Review Dibatalkan");
- router.replace(NEW_RouterInvestasi.portofolio({ id: "3" }));
-
- const dataNotif = {
- appId: res.data?.id,
- userId: res.data?.authorId,
- pesan: res.data?.title,
- status: res.data?.MasterStatusInvestasi?.name,
- kategoriApp: "INVESTASI",
- title: "Membatalkan review",
- };
-
- const notif = await notifikasiToAdmin_funCreate({
- data: dataNotif as any,
+ const res = await investasi_funEditStatusById({
+ investasiId: data.id,
+ statusId: "3",
});
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil("Review Dibatalkan");
+ router.replace(NEW_RouterInvestasi.portofolio({ id: "3" }));
- if (notif.status === 201) {
- mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
+ const dataNotif = {
+ appId: res.data?.id,
+ userId: res.data?.authorId,
+ pesan: res.data?.title,
+ status: res.data?.MasterStatusInvestasi?.name,
+ kategoriApp: "INVESTASI",
+ title: "Membatalkan review",
+ };
+
+ const notif = await notifikasiToAdmin_funCreate({
+ data: dataNotif as any,
+ });
+
+ if (notif.status === 201) {
+ mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
+ }
+ setLoading(false);
+ } else {
+ ComponentGlobal_NotifikasiPeringatan(res.message);
+ setLoading(false);
}
+ } catch (error) {
setLoading(false);
- } else {
- ComponentGlobal_NotifikasiPeringatan(res.message);
- setLoading(false);
+ clientLogger.error("Error ajukan kembali", error);
}
}
@@ -65,9 +72,10 @@ export default function Investasi_ViewDetailReview({
setOpenModal(true)}
>
Batalkan Review
@@ -80,7 +88,12 @@ export default function Investasi_ViewDetailReview({
close={() => setOpenModal(false)}
title={"Anda yakin ingin batalkan review?"}
buttonKiri={
- setOpenModal(false)}>
+ setOpenModal(false)}
+ >
Batal
}
@@ -88,11 +101,13 @@ export default function Investasi_ViewDetailReview({
onChangeStatus()}
>
Simpan
diff --git a/src/app_modules/investasi/_view/detail/view_berita.tsx b/src/app_modules/investasi/_view/detail/view_berita.tsx
index 81ec6231..9a46fd90 100644
--- a/src/app_modules/investasi/_view/detail/view_berita.tsx
+++ b/src/app_modules/investasi/_view/detail/view_berita.tsx
@@ -3,29 +3,55 @@ import {
ComponentGlobal_LoadImageLandscape,
} from "@/app_modules/_global/component";
import { Stack, Text, Title } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import { Prisma } from "@prisma/client";
+import { useParams } from "next/navigation";
import { useState } from "react";
+import { apiGetBeritaInvestasiById } from "../../_lib/api_interface";
+import { clientLogger } from "@/util/clientLogger";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export function Investasi_ViewDetailBerita({
- dataBerita,
-}: {
- dataBerita: any;
-}) {
- const [data, setData] =
- useState>(dataBerita);
+type MODEL_DATA = Prisma.BeritaInvestasiGetPayload<{}>;
+
+export function Investasi_ViewDetailBerita() {
+ const params = useParams<{ id: string }>();
+ const id = params.id;
+
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetBeritaInvestasiById({
+ id: id,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get detail berita", error);
+ }
+ }
+
+ if (!data) {
+ return ;
+ }
return (
<>
- {data.imageId == null ? (
- ""
- ) : (
-
+ {data.imageId && (
+
)}
- {" "}
{data.title}
diff --git a/src/app_modules/investasi/_view/detail/view_daftar_berita.tsx b/src/app_modules/investasi/_view/detail/view_daftar_berita.tsx
index bfbb5b2c..c9f6343c 100644
--- a/src/app_modules/investasi/_view/detail/view_daftar_berita.tsx
+++ b/src/app_modules/investasi/_view/detail/view_daftar_berita.tsx
@@ -1,45 +1,106 @@
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import {
ComponentGlobal_CardStyles,
ComponentGlobal_CardLoadingOverlay,
} from "@/app_modules/_global/component";
-import { Box, Title } from "@mantine/core";
-import { useRouter } from "next/navigation";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Center, Title } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import { Investasi_SkeletonListDokumen } from "../../_component/skeleton_view";
+import { apiGetBeritaInvestasiById } from "../../_lib/api_interface";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { ScrollOnly } from "next-scroll-loader";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import _ from "lodash";
+
+export function Investasi_ViewDaftarBerita() {
+ const params = useParams<{ id: string }>();
+ const investasiId = params.id;
-export function Investasi_ViewDaftarBerita({
- dataBerita,
-}: {
- dataBerita: any[];
-}) {
const router = useRouter();
- const [data, setData] = useState(dataBerita);
+ const [data, setData] = useState(null);
+ const [activePage, setActivePage] = useState(1);
+
const [visible, setVisible] = useState(false);
const [dataId, setDataId] = useState("");
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetBeritaInvestasiById({
+ id: investasiId,
+ kategori: "get-all",
+ page: `${activePage}`,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get daftar berita", error);
+ }
+ }
+
+ if (data === null) {
+ return ;
+ }
+
return (
<>
-
- {data.map((e, i) => (
- {
- router.push(NEW_RouterInvestasi.berita({ id: e.id }), {
- scroll: false,
- });
- setVisible(true);
- setDataId(e.id);
+ {_.isEmpty(data) ? (
+
+ ) : (
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={async () => {
+ try {
+ const respone = await apiGetBeritaInvestasiById({
+ id: investasiId,
+ kategori: "get-all",
+ page: `${activePage + 1}`,
+ });
+
+ if (respone.success) {
+ setActivePage((val) => val + 1);
+
+ return respone.data;
+ }
+ } catch (error) {
+ clientLogger.error("Error load data dokumen:", error);
+ }
}}
>
-
- {e.title}
-
- {visible && dataId === e.id && (
-
+ {(item) => (
+ {
+ router.push(NEW_RouterInvestasi.berita({ id: item.id }), {
+ scroll: false,
+ });
+ setVisible(true);
+ }}
+ >
+
+ {item.title}
+
+ {visible && }
+
)}
-
- ))}
-
+
+
+ )}
>
);
}
diff --git a/src/app_modules/investasi/_view/detail/view_daftar_dokemen.tsx b/src/app_modules/investasi/_view/detail/view_daftar_dokemen.tsx
index 979f3430..76db03e8 100644
--- a/src/app_modules/investasi/_view/detail/view_daftar_dokemen.tsx
+++ b/src/app_modules/investasi/_view/detail/view_daftar_dokemen.tsx
@@ -7,17 +7,43 @@ import { useState } from "react";
import { Investasi_ComponentCardDaftarDocument } from "../../_component";
import { investasi_funGetAllDocumentById } from "../../_fun";
import { MODEL_INVESTASI_DOKUMEN } from "../../_lib/interface";
+import { useParams } from "next/navigation";
+import { Investasi_SkeletonListDokumen } from "../../_component/skeleton_view";
+import { clientLogger } from "@/util/clientLogger";
+import { apiGetDokumenInvestasiById } from "../../_lib/api_interface";
+import { useShallowEffect } from "@mantine/hooks";
-export function Investasi_ViewDaftarDokumen({
- dataDokumen,
- investasiId,
-}: {
- dataDokumen: any[];
- investasiId: string;
-}) {
- const [data, setData] = useState(dataDokumen);
+export function Investasi_ViewDaftarDokumen() {
+ const params = useParams<{ id: string }>();
+ const investasiId = params.id;
+
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetDokumenInvestasiById({
+ id: investasiId,
+ kategori: "get-all",
+ page: `${activePage}`,
+ });
+
+ if (respone.success) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data dokumen", error);
+ }
+ }
+
+ if (data === null) {
+ return ;
+ }
+
return (
<>
@@ -27,23 +53,30 @@ export function Investasi_ViewDaftarDokumen({
) : (
(
)}
data={data}
- setData={setData}
+ setData={setData as any}
moreData={async () => {
- const loadData = await investasi_funGetAllDocumentById({
- investasiId: investasiId,
- page: activePage + 1,
- });
+ try {
+ const respone = await apiGetDokumenInvestasiById({
+ id: investasiId,
+ kategori: "get-all",
+ page: `${activePage + 1}`,
+ });
- setActivePage((val) => val + 1);
+ if (respone.success) {
+ setActivePage((val) => val + 1);
- return loadData;
+ return respone.data;
+ }
+ } catch (error) {
+ clientLogger.error("Error load data dokumen:", error);
+ }
}}
>
{(item) => (
diff --git a/src/app_modules/investasi/_view/detail/view_detail_prospektusl.tsx b/src/app_modules/investasi/_view/detail/view_detail_prospektusl.tsx
index 3c3c95cc..f3abb5e1 100644
--- a/src/app_modules/investasi/_view/detail/view_detail_prospektusl.tsx
+++ b/src/app_modules/investasi/_view/detail/view_detail_prospektusl.tsx
@@ -1,30 +1,52 @@
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
import { MainColor } from "@/app_modules/_global/color";
import {
- ComponentGlobal_CardLoadingOverlay,
- ComponentGlobal_CardStyles,
+ ComponentGlobal_CardLoadingOverlay,
+ ComponentGlobal_CardStyles,
} from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import { Center, Group, Text } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import { IconFileTypePdf } from "@tabler/icons-react";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import { apiNewGetOneInvestasiById } from "../../_lib/api_fetch_new_investasi";
import { MODEL_INVESTASI } from "../../_lib/interface";
-export function Investasi_ViewDetailProspektus({
- dataInvestasi,
-}: {
- dataInvestasi: MODEL_INVESTASI;
-}) {
+export function Investasi_ViewDetailProspektus() {
+ const param = useParams<{ id: string }>();
const router = useRouter();
const [visible, setVisible] = useState(false);
+ const [dataInvestasi, setDataInvestasi] = useState(
+ null
+ );
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiNewGetOneInvestasiById({ id: param.id });
+ if (response.success) {
+ setDataInvestasi(response.data);
+ } else {
+ setDataInvestasi(null);
+ }
+ } catch (error) {
+ console.log(error);
+ }
+ }
+
+ if (!dataInvestasi) return ;
+
return (
<>
{
router.push(
NEW_RouterInvestasi.file_prospektus({
- id: dataInvestasi.prospektusFileId,
+ id: dataInvestasi?.prospektusFileId,
}),
{ scroll: false }
);
diff --git a/src/app_modules/investasi/_view/detail/view_detail_saham_saya.tsx b/src/app_modules/investasi/_view/detail/view_detail_saham_saya.tsx
index cdcfb312..9c128c81 100644
--- a/src/app_modules/investasi/_view/detail/view_detail_saham_saya.tsx
+++ b/src/app_modules/investasi/_view/detail/view_detail_saham_saya.tsx
@@ -1,25 +1,50 @@
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
import { useState } from "react";
import {
Investasi_ComponentBoxDetailData,
Investasi_ComponentBoxHargaDanLembarSaham,
Investasi_ComponentBoxProgress,
} from "../../_component";
+import {
+ apiGetOneSahamInvestasiById
+} from "../../_lib/api_fetch_new_investasi";
import { MODEL_INVOICE_INVESTASI } from "../../_lib/interface";
-export function Investasi_ViewDetailSahamSaya({
- dataSaham,
-}: {
- dataSaham: MODEL_INVOICE_INVESTASI;
-}) {
- const [data, setData] = useState(dataSaham);
+export function Investasi_ViewDetailSahamSaya() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetOneSahamInvestasiById({ id: param.id });
+ if (response.success) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ console.error("Error get investasi", error);
+ setData(null);
+ }
+ };
+
+ if (!data) return ;
return (
<>
-
-
-
+
+
+
>
);
diff --git a/src/app_modules/investasi/_view/detail/view_list_investor.tsx b/src/app_modules/investasi/_view/detail/view_list_investor.tsx
new file mode 100644
index 00000000..a67a4fd4
--- /dev/null
+++ b/src/app_modules/investasi/_view/detail/view_list_investor.tsx
@@ -0,0 +1,91 @@
+"use client";
+
+import {
+ ComponentGlobal_AvatarAndUsername,
+ ComponentGlobal_CardStyles,
+ ComponentGlobal_TampilanRupiah,
+} from "@/app_modules/_global/component";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Box, Center, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { apiGetInvestorById } from "../../_lib/api_fetch_new_investasi";
+
+export function Investasi_ViewListInvestor() {
+ const param = useParams<{ id: string }>();
+ const investasiId = param.id;
+
+ const [data, setData] = useState(null);
+ const [activePage, setActivePage] = useState(1);
+
+ useShallowEffect(() => {
+ handleGetListInvestor();
+ }, []);
+
+ const handleGetListInvestor = async () => {
+ try {
+ const response = await apiGetInvestorById({
+ id: investasiId,
+ page: String(activePage),
+ });
+
+ if (response) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ console.error("Error get list investor", error);
+ setData(null);
+ }
+ };
+
+ if (!data) return ;
+
+ return (
+ <>
+ {_.isEmpty(data) ? (
+
+ ) : (
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={async () => {
+ const nextPage = activePage + 1;
+ const loadData = await apiGetInvestorById({
+ id: investasiId,
+ page: String(nextPage),
+ });
+ setActivePage(nextPage);
+ return loadData.data;
+ }}
+ >
+ {(item) => (
+
+
+
+
+
+
+ )}
+
+
+ )}
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_view/detail/view_rekap_berita.tsx b/src/app_modules/investasi/_view/detail/view_rekap_berita.tsx
index ab955a86..7b6f7e67 100644
--- a/src/app_modules/investasi/_view/detail/view_rekap_berita.tsx
+++ b/src/app_modules/investasi/_view/detail/view_rekap_berita.tsx
@@ -1,45 +1,108 @@
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+"use client";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import {
ComponentGlobal_CardLoadingOverlay,
ComponentGlobal_CardStyles,
} from "@/app_modules/_global/component";
-import { Box, Group, Title } from "@mantine/core";
-import { useRouter } from "next/navigation";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Center, Title } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import { Investasi_SkeletonListDokumen } from "../../_component/skeleton_view";
+import { apiGetBeritaInvestasiById } from "../../_lib/api_interface";
+
+export function Investasi_ViewRekapBerita() {
+ const params = useParams<{ id: string }>();
+ const investasiId = params.id;
-export function Investasi_ViewRekapBerita({
- dataBerita,
-}: {
- dataBerita: any[];
-}) {
const router = useRouter();
- const [data, setData] = useState(dataBerita);
+ const [data, setData] = useState(null);
+ const [activePage, setActivePage] = useState(1);
const [visible, setVisible] = useState(false);
- const [dataId, setDataId] = useState("");
+
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetBeritaInvestasiById({
+ id: investasiId,
+ kategori: "get-all",
+ page: `${activePage}`,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data berita", error);
+ }
+ }
+
+ if (data === null) {
+ return ;
+ }
return (
<>
-
- {data.map((e, i) => (
- {
- router.push(NEW_RouterInvestasi.berita({ id: e.id }), {
- scroll: false,
- });
- setVisible(true);
- setDataId(e.id);
+ {_.isEmpty(data) ? (
+
+ ) : (
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={async () => {
+ try {
+ const respone = await apiGetBeritaInvestasiById({
+ id: investasiId,
+ kategori: "get-all",
+ page: `${activePage + 1}`,
+ });
+
+ if (respone.success) {
+ setActivePage((val) => val + 1);
+
+ return respone.data;
+ }
+ } catch (error) {
+ clientLogger.error("Error load data dokumen:", error);
+ }
}}
>
-
- {e.title}
-
- {visible && dataId === e.id && (
-
+ {(item) => (
+ {
+ router.push(NEW_RouterInvestasi.berita({ id: item.id }), {
+ scroll: false,
+ });
+ setVisible(true);
+ }}
+ >
+
+ {item.title}
+
+ {visible && (
+
+ )}
+
)}
-
- ))}
-
+
+
+ )}
>
);
}
diff --git a/src/app_modules/investasi/_view/detail/view_rekap_dokumen.tsx b/src/app_modules/investasi/_view/detail/view_rekap_dokumen.tsx
index 5b0e0285..d1f573b8 100644
--- a/src/app_modules/investasi/_view/detail/view_rekap_dokumen.tsx
+++ b/src/app_modules/investasi/_view/detail/view_rekap_dokumen.tsx
@@ -8,17 +8,41 @@ import { Investasi_ComponentCardRekapDocument } from "../../_component";
import { investasi_funGetAllDocumentById } from "../../_fun";
import { MODEL_INVESTASI_DOKUMEN } from "../../_lib/interface";
import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import { apiGetDokumenInvestasiById } from "../../_lib/api_interface";
+import { Investasi_SkeletonListDokumen } from "../../_component/skeleton_view";
+import { clientLogger } from "@/util/clientLogger";
-export function Investasi_ViewRekapDokumen({
- dataDokumen,
- investasiId,
-}: {
- dataDokumen: any[];
- investasiId: string;
-}) {
- const [data, setData] = useState(dataDokumen);
+export function Investasi_ViewRekapDokumen() {
+ const params = useParams<{ id: string }>();
+ const investasiId = params.id;
+
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetDokumenInvestasiById({
+ id: investasiId,
+ kategori: "get-all",
+ page: `${activePage}`,
+ });
+
+ if (respone.success) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data dokumen", error);
+ }
+ }
+
+ if (data === null) {
+ return ;
+ }
return (
<>
@@ -34,16 +58,23 @@ export function Investasi_ViewRekapDokumen({
)}
data={data}
- setData={setData}
+ setData={setData as any}
moreData={async () => {
- const loadData = await investasi_funGetAllDocumentById({
- investasiId: investasiId,
- page: activePage + 1,
- });
+ try {
+ const respone = await apiGetDokumenInvestasiById({
+ id: investasiId,
+ kategori: "get-all",
+ page: `${activePage + 1}`,
+ });
- setActivePage((val) => val + 1);
+ if (respone.success) {
+ setActivePage((val) => val + 1);
- return loadData;
+ return respone.data;
+ }
+ } catch (error) {
+ clientLogger.error("Error load data dokumen:", error);
+ }
}}
>
{(item) => (
diff --git a/src/app_modules/investasi/_view/edit/skeleton_edit_investasi.tsx b/src/app_modules/investasi/_view/edit/skeleton_edit_investasi.tsx
new file mode 100644
index 00000000..d0ea1348
--- /dev/null
+++ b/src/app_modules/investasi/_view/edit/skeleton_edit_investasi.tsx
@@ -0,0 +1,24 @@
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Box, Stack } from "@mantine/core";
+
+export default function SkeletonEditInvestasi() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+ {[...Array(5)].map((_, index) => (
+
+ ))}
+
+
+
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/investasi/_view/edit/view_edit_dokumen.tsx b/src/app_modules/investasi/_view/edit/view_edit_dokumen.tsx
index 802b36ec..25a85107 100644
--- a/src/app_modules/investasi/_view/edit/view_edit_dokumen.tsx
+++ b/src/app_modules/investasi/_view/edit/view_edit_dokumen.tsx
@@ -1,7 +1,8 @@
-import { DIRECTORY_ID } from "@/app/lib";
+import { DIRECTORY_ID } from "@/lib";
import { MainColor } from "@/app_modules/_global/color";
import {
- ComponentGlobal_CardStyles
+ ComponentGlobal_ButtonUploadFileImage,
+ ComponentGlobal_CardStyles,
} from "@/app_modules/_global/component";
import {
funGlobal_DeleteFileById,
@@ -11,44 +12,61 @@ import {
ComponentGlobal_NotifikasiBerhasil,
ComponentGlobal_NotifikasiPeringatan,
} from "@/app_modules/_global/notif_global";
+import { clientLogger } from "@/util/clientLogger";
import {
+ Box,
Button,
Center,
- FileButton,
Grid,
- Group,
Stack,
Text,
TextInput,
} from "@mantine/core";
-import { IconCamera, IconCircleCheck } from "@tabler/icons-react";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconCircleCheck } from "@tabler/icons-react";
import _ from "lodash";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import { Investasi_SkeletonEditProspektus } from "../../_component/skeleton_view";
import { investasi_funUpdateDocument } from "../../_fun";
+import { apiGetDokumenInvestasiById } from "../../_lib/api_interface";
import { MODEL_INVESTASI_DOKUMEN } from "../../_lib/interface";
-export function Investasi_ViewEditDokumen({
- dataDokumen,
-}: {
- dataDokumen: MODEL_INVESTASI_DOKUMEN;
-}) {
+export function Investasi_ViewEditDokumen() {
+ const params = useParams<{ id: string }>();
+ const dokumenId = params.id;
+
const router = useRouter();
const [filePdf, setFilePdf] = useState(null);
const [isLoading, setIsLoading] = useState(false);
- const [data, setData] = useState(dataDokumen);
- const [title, setTitle] = useState(data.title);
+ const [data, setData] = useState(null);
+ // const [title, setTitle] = useState(data.title);
+ const [loading, setLoading] = useState(true);
+
+ useShallowEffect(() => {
+ onGetDataDokumenById();
+ }, []);
+
+ async function onGetDataDokumenById() {
+ try {
+ setLoading(true);
+ const response = await apiGetDokumenInvestasiById({
+ id: dokumenId,
+ });
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
+ }
+ }
async function onUpdate() {
try {
setIsLoading(true);
if (filePdf) {
- const delfile = await funGlobal_DeleteFileById({ fileId: data.fileId });
-
- if (!delfile.success) {
- ComponentGlobal_NotifikasiPeringatan("Gagal hapus file lama");
- }
-
const uploadFile = await funGlobal_UploadToStorage({
file: filePdf,
dirId: DIRECTORY_ID.investasi_dokumen,
@@ -57,35 +75,54 @@ export function Investasi_ViewEditDokumen({
if (!uploadFile.success) {
setIsLoading(false);
ComponentGlobal_NotifikasiPeringatan("Gagal upload file dokumen");
+ return;
+ }
+
+ const delfile = await funGlobal_DeleteFileById({
+ fileId: data?.fileId as any,
+ dirId: DIRECTORY_ID.investasi_dokumen,
+ });
+
+ if (!delfile.success) {
+ setIsLoading(false);
+ clientLogger.error("Gagal hapus file lama", delfile.message);
}
const updateWithFile = await investasi_funUpdateDocument({
- data: data,
+ data: data as any,
fileId: uploadFile.data.id,
});
if (updateWithFile.status !== 200) {
+ setIsLoading(false);
ComponentGlobal_NotifikasiPeringatan(updateWithFile.message);
}
+
ComponentGlobal_NotifikasiBerhasil(updateWithFile.message);
+ router.back();
} else {
const updateNoFile = await investasi_funUpdateDocument({
- data: data,
+ data: data as any,
});
if (updateNoFile.status !== 200) {
+ setIsLoading(false);
ComponentGlobal_NotifikasiPeringatan(updateNoFile.message);
}
ComponentGlobal_NotifikasiBerhasil(updateNoFile.message);
+ router.back();
+
}
} catch (error) {
- console.log(error);
- } finally {
- router.back();
setIsLoading(false);
+ clientLogger.error(" Error update dokumen", error);
}
}
+ if (loading) {
+ return ;
+ }
+
return (
<>
@@ -95,18 +132,23 @@ export function Investasi_ViewEditDokumen({
setData({ ...data, title: val.target.value })}
+ onChange={(val) =>
+ setData({
+ ...(data as any),
+ title: val.target.value,
+ })
+ }
/>
{!filePdf ? (
- Dokumen {_.startCase(title)}.pdf
+ {_.startCase(data?.title)}.pdf
) : (
@@ -125,7 +167,15 @@ export function Investasi_ViewEditDokumen({
)}
-
+
+
+
+
+ {/*
{
@@ -153,27 +203,37 @@ export function Investasi_ViewEditDokumen({
)}
-
+ */}
- {
- onUpdate();
+ display: "flex",
+ justifyContent: "center",
}}
>
- Update
-
+ {
+ onUpdate();
+ }}
+ >
+ Update
+
+
>
);
diff --git a/src/app_modules/investasi/_view/edit/view_edit_investasi_new.tsx b/src/app_modules/investasi/_view/edit/view_edit_investasi_new.tsx
new file mode 100644
index 00000000..fc474b77
--- /dev/null
+++ b/src/app_modules/investasi/_view/edit/view_edit_investasi_new.tsx
@@ -0,0 +1,465 @@
+import { MainColor } from "@/app_modules/_global/color";
+import {
+ ComponentGlobal_BoxInformation,
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
+ ComponentGlobal_LoadImage,
+} from "@/app_modules/_global/component";
+import {
+ AspectRatio,
+ Box,
+ Button,
+ Center,
+ FileButton,
+ Group,
+ Image,
+ Select,
+ Stack,
+ Text,
+ TextInput,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconCamera } from "@tabler/icons-react";
+import _ from "lodash";
+import { useState } from "react";
+import { Investasi_ComponentButtonUpdateDataInvestasi } from "../../_component";
+import {
+ apiGetMasterInvestasi,
+ apiGetOneInvestasiById,
+} from "../../_lib/api_interface";
+import { IDataInvestasi } from "../../_lib/type_investasi";
+import { useParams } from "next/navigation";
+import SkeletonEditInvestasi from "./skeleton_edit_investasi";
+
+export function Investasi_ViewEditInvestasiNew() {
+ const param = useParams<{ id: string }>();
+ const [loading, setLoading] = useState(true);
+ const [loadingMasterInvestor, setLoadingMasterInvestor] = useState(true);
+ const [loadingMasterPeriodeDeviden, setLoadingMasterPeriodeDeviden] =
+ useState(true);
+ const [loadingMasterPembagianDeviden, setLoadingMasterPembagianDeviden] =
+ useState(true);
+ const [periodeDeviden, setPeriodeDeviden] = useState([]);
+ const [pembagianDeviden, setPembagianDeviden] = useState([]);
+ const [pencarianInvestor, setPencarianInvestor] = useState([]);
+ const [data, setData] = useState();
+ const [file, setFile] = useState(null);
+ const [img, setImg] = useState();
+ const [target, setTarget] = useState("");
+ const [harga, setHarga] = useState("");
+ const [totalLembar, setTotalLembar] = useState("");
+
+ async function onGetOneInvestasiById() {
+ try {
+ setLoading(true);
+ const response = await apiGetOneInvestasiById({
+ id: param.id,
+
+ });
+ if (response.success) {
+ setData(response.data);
+ setTotalLembar(response.data.totalLembar);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ async function onGetMasterInvestor() {
+ try {
+ setLoadingMasterInvestor(true);
+ const response = await apiGetMasterInvestasi("?cat=pencarian-investor");
+ if (response.success) {
+ setPencarianInvestor(response.data);
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setLoadingMasterInvestor(false);
+ }
+ }
+
+ async function onGetMasterPeriodeDeviden() {
+ try {
+ setLoadingMasterPeriodeDeviden(true);
+ const response = await apiGetMasterInvestasi("?cat=periode-deviden");
+ if (response.success) {
+ setPeriodeDeviden(response.data);
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setLoadingMasterPeriodeDeviden(false);
+ }
+ }
+
+ async function onGetMasterPembagianDeviden() {
+ try {
+ setLoadingMasterPembagianDeviden(true);
+ const response = await apiGetMasterInvestasi("?cat=pembagian-deviden");
+ if (response.success) {
+ setPembagianDeviden(response.data);
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setLoadingMasterPembagianDeviden(false);
+ }
+ }
+
+ useShallowEffect(() => {
+ onGetOneInvestasiById();
+ onGetMasterInvestor();
+ onGetMasterPeriodeDeviden();
+ onGetMasterPembagianDeviden();
+ }, []);
+
+ async function onTotalLembar({
+ target,
+ harga,
+ }: {
+ target?: number | any;
+ harga?: number | any;
+ }) {
+ if (target !== 0 && harga !== 0) {
+ const hasil: any = target / harga;
+ const result = _.floor(hasil === Infinity ? 0 : hasil);
+ setTotalLembar(result.toString());
+ }
+ }
+
+ return (
+ <>
+
+ {loading ? (
+
+ ) : (
+ <>
+
+
+
+
+
+ {img ? (
+
+
+
+ ) : (
+
+ )}
+
+ {/* Upload Foto */}
+
+
+
+
+ {/*
+ {
+ try {
+ const buffer = URL.createObjectURL(
+ new Blob([new Uint8Array(await files.arrayBuffer())])
+ );
+ setImg(buffer);
+ setFile(files);
+ } catch (error) {
+ console.log(error);
+ }
+ }}
+ accept="image/png,image/jpeg"
+ >
+ {(props) => (
+ }
+ radius={50}
+ bg={MainColor.yellow}
+ color="yellow"
+ c={"black"}
+ >
+ Upload Gambar
+
+ )}
+
+ */}
+
+
+ {
+ setData({
+ ...(data as any),
+ title: val.target.value,
+ });
+ }}
+ />
+
+ Rp.}
+ min={0}
+ withAsterisk
+ label="Dana Dibutuhkan"
+ placeholder="0"
+ value={target ? target : data?.targetDana}
+ onChange={(val) => {
+ const match = val.currentTarget.value
+ .replace(/\./g, "")
+ .match(/^[0-9]+$/);
+
+ if (val.currentTarget.value === "") return setTarget(0 + "");
+ if (!match?.[0]) return null;
+
+ const nilai = val.currentTarget.value.replace(/\./g, "");
+ const targetNilai = Intl.NumberFormat("id-ID").format(+nilai);
+
+ onTotalLembar({
+ target: +nilai,
+ harga: +Number(data?.hargaLembar),
+ });
+
+ setTarget(targetNilai);
+ setData({
+ ...(data as any),
+ targetDana: nilai as string,
+ });
+ }}
+ />
+
+ Rp.}
+ min={0}
+ withAsterisk
+ label="Harga Per Lembar"
+ placeholder="0"
+ value={harga ? harga : data?.hargaLembar}
+ onChange={(val) => {
+ try {
+ const match = val.currentTarget.value
+ .replace(/\./g, "")
+ .match(/^[0-9]+$/);
+
+ if (val.currentTarget.value === "") return setHarga(0 + "");
+
+ if (!match?.[0]) return null;
+
+ const nilai = val.currentTarget.value.replace(/\./g, "");
+ const targetNilai = Intl.NumberFormat("id-ID").format(+nilai);
+
+ onTotalLembar({
+ harga: +nilai,
+ target: +Number(data?.targetDana),
+ });
+
+ setHarga(targetNilai);
+ setData({
+ ...(data as any),
+ hargaLembar: nilai as string,
+ });
+ } catch (error) {
+ console.log(error);
+ }
+ }}
+ />
+
+
+
+
+ %
+
+ }
+ withAsterisk
+ type="number"
+ label={"Rasio Keuntungan / ROI %"}
+ placeholder="Masukan rasio keuntungan"
+ value={data?.roi}
+ onChange={(val) => {
+ setData({
+ ...(data as any),
+ roi: val.target.value,
+ });
+ }}
+ />
+
+ ({
+ value: e.id,
+ label: e.name + " " + "hari",
+ }))}
+ value={data?.masterPencarianInvestorId}
+ onChange={(val) => {
+ setData({
+ ...(data as any),
+ masterPencarianInvestorId: val,
+ });
+ }}
+ />
+
+ ({ value: e.id, label: e.name }))}
+ value={data?.masterPeriodeDevidenId}
+ onChange={(val) => {
+ setData({
+ ...(data as any),
+ masterPeriodeDevidenId: val,
+ });
+ }}
+ />
+
+ ({
+ value: e.id,
+ label: e.name + " " + "bulan",
+ }))}
+ value={data?.masterPembagianDevidenId}
+ onChange={(val) => {
+ setData({
+ ...(data as any),
+ masterPembagianDevidenId: val,
+ });
+ }}
+ />
+
+
+ >
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_view/edit/view_edit_prospektus.tsx b/src/app_modules/investasi/_view/edit/view_edit_prospektus.tsx
index 6b7ea3b0..9ad4ba4b 100644
--- a/src/app_modules/investasi/_view/edit/view_edit_prospektus.tsx
+++ b/src/app_modules/investasi/_view/edit/view_edit_prospektus.tsx
@@ -1,82 +1,110 @@
import { MainColor } from "@/app_modules/_global/color";
import {
ComponentGlobal_BoxInformation,
+ ComponentGlobal_ButtonUploadFileImage,
ComponentGlobal_CardStyles,
} from "@/app_modules/_global/component";
-import {
- Button,
- Center,
- FileButton,
- Grid,
- Group,
- Stack,
- Text
-} from "@mantine/core";
-import {
- IconCamera,
- IconCircleCheck
-} from "@tabler/icons-react";
+import { Box, Button, Center, Grid, Stack, Text } from "@mantine/core";
+import { IconCircleCheck, IconFileTypePdf } from "@tabler/icons-react";
-import { DIRECTORY_ID } from "@/app/lib";
-import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
+import {
+ funGlobal_DeleteFileById,
+ funGlobal_UploadToStorage,
+} from "@/app_modules/_global/fun";
import {
ComponentGlobal_NotifikasiBerhasil,
ComponentGlobal_NotifikasiPeringatan,
} from "@/app_modules/_global/notif_global";
-import { useRouter } from "next/navigation";
+import { DIRECTORY_ID } from "@/lib";
+import { clientLogger } from "@/util/clientLogger";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import { Investasi_SkeletonEditProspektus } from "../../_component/skeleton_view";
import { investasi_funUpdateProspektus } from "../../_fun";
+import { apiGetOneInvestasiById } from "../../_lib/api_interface";
-export function Investasi_ViewEditProspektus({
- investasiId,
-}: {
- investasiId: string;
-}) {
+export function Investasi_ViewEditProspektus() {
+ const params = useParams<{ id: string }>();
+ const investasiId = params.id;
const router = useRouter();
const [filePdf, setFilePdf] = useState(null);
const [isLoading, setIsLoading] = useState(false);
+ const [fileRemoveId, setFileRemoveId] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetOneInvestasiById({
+ id: investasiId,
+ });
+ if (respone.success) {
+ setFileRemoveId(respone.data.prospektusFileId);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data investasi:", error);
+ }
+ }
async function onUpload() {
- setIsLoading(true);
- const uploadFilePdf = await funGlobal_UploadToStorage({
- file: filePdf as any,
- dirId: DIRECTORY_ID.investasi_prospektus,
- });
-
- if (!uploadFilePdf.success) {
- setIsLoading(false);
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload file pdf");
- }
-
try {
+ setIsLoading(true);
+ const uploadFilePdf = await funGlobal_UploadToStorage({
+ file: filePdf as any,
+ dirId: DIRECTORY_ID.investasi_prospektus,
+ });
+
+ if (!uploadFilePdf.success) {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload file pdf");
+ return;
+ }
+
+ const deleteFile = await funGlobal_DeleteFileById({
+ fileId: fileRemoveId as string,
+ dirId: DIRECTORY_ID.investasi_prospektus,
+ });
+
+ if (!deleteFile.success) {
+ setIsLoading(false);
+ clientLogger.error("Error delete file:", deleteFile.message);
+ }
+
const updte = await investasi_funUpdateProspektus({
fileId: uploadFilePdf.data.id,
investasiId: investasiId,
});
if (updte.status !== 200) {
- return ComponentGlobal_NotifikasiPeringatan("Gagal update prospektus");
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal update prospektus");
+ return;
}
+ ComponentGlobal_NotifikasiBerhasil(updte.message);
router.back();
-
- return ComponentGlobal_NotifikasiBerhasil(updte.message);
} catch (error) {
- console.log(error);
- } finally {
setIsLoading(false);
+ clientLogger.error("Error update prospektus:", error);
}
}
+ if (fileRemoveId == null) {
+ return ;
+ }
+
return (
<>
-
+
{!filePdf ? (
-
- Upload File Prospektus
-
+
+
+
) : (
@@ -94,54 +122,43 @@ export function Investasi_ViewEditProspektus({
)}
-
-
+ {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
+ text="Upload File"
+ />
+
- setFilePdf(files);
- } catch (error) {
- console.log(error);
- }
- }}
- >
- {(props) => (
- }
- {...props}
- radius={"xl"}
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload File
-
- )}
-
-
-
- {
- onUpload();
+ display: "flex",
+ justifyContent: "center",
}}
>
- Update
-
+ {
+ onUpload();
+ }}
+ >
+ Update
+
+
>
);
diff --git a/src/app_modules/investasi/_view/file_view/view_file_viewer.tsx b/src/app_modules/investasi/_view/file_view/view_file_viewer.tsx
index a56025fb..00a1e3e9 100644
--- a/src/app_modules/investasi/_view/file_view/view_file_viewer.tsx
+++ b/src/app_modules/investasi/_view/file_view/view_file_viewer.tsx
@@ -1,66 +1,64 @@
"use client";
-import { useEffect, useState } from "react";
-import { getDocument, GlobalWorkerOptions } from "pdfjs-dist";
-import { Image, Skeleton, Stack, Text } from "@mantine/core";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { Image, Skeleton, Stack } from "@mantine/core";
+import { useState } from "react";
-GlobalWorkerOptions.workerSrc =
- "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/4.6.82/pdf.worker.min.mjs";
+// GlobalWorkerOptions.workerSrc =
+// "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/4.6.82/pdf.worker.min.mjs";
const PdfToImage = ({ id, path }: { id: string; path: string }) => {
const [images, setImages] = useState([]);
const [loading, setLoading] = useState(true);
- useEffect(() => {
- if (typeof window !== "undefined") {
- const renderPages = async () => {
- try {
- const loadingTask = getDocument(path + id); // Menggunakan md sebagai URL PDF
- const pdf = await loadingTask.promise;
- const numPages = pdf.numPages;
- const imagePromises: Promise[] = [];
+ // useEffect(() => {
+ // if (typeof window !== "undefined") {
+ // const renderPages = async () => {
+ // try {
+ // const loadingTask = getDocument(path + id); // Menggunakan md sebagai URL PDF
+ // const pdf = await loadingTask.promise;
+ // const numPages = pdf.numPages;
+ // const imagePromises: Promise[] = [];
- for (let pageNum = 1; pageNum <= numPages; pageNum++) {
- const renderPage = async (pageNum: number): Promise => {
- const page = await pdf.getPage(pageNum);
- const viewport = page.getViewport({ scale: 2.0 });
+ // for (let pageNum = 1; pageNum <= numPages; pageNum++) {
+ // const renderPage = async (pageNum: number): Promise => {
+ // const page = await pdf.getPage(pageNum);
+ // const viewport = page.getViewport({ scale: 2.0 });
- // Buat elemen canvas
- const canvas = document.createElement("canvas");
- const context = canvas.getContext("2d");
- if (context) {
- canvas.width = viewport.width;
- canvas.height = viewport.height;
+ // // Buat elemen canvas
+ // const canvas = document.createElement("canvas");
+ // const context = canvas.getContext("2d");
+ // if (context) {
+ // canvas.width = viewport.width;
+ // canvas.height = viewport.height;
- // Render halaman PDF ke dalam canvas
- const renderContext = {
- canvasContext: context,
- viewport: viewport,
- };
- await page.render(renderContext).promise;
+ // // Render halaman PDF ke dalam canvas
+ // const renderContext = {
+ // canvasContext: context,
+ // viewport: viewport,
+ // };
+ // await page.render(renderContext).promise;
- // Konversi canvas ke gambar (data URL)
- return canvas.toDataURL("image/png");
- }
- return "";
- };
+ // // Konversi canvas ke gambar (data URL)
+ // return canvas.toDataURL("image/png");
+ // }
+ // return "";
+ // };
- imagePromises.push(renderPage(pageNum));
- }
+ // imagePromises.push(renderPage(pageNum));
+ // }
- const imageSrcs = await Promise.all(imagePromises);
- setImages(imageSrcs);
- } catch (error) {
- console.error("Error rendering PDF to images:", error);
- } finally {
- setLoading(false);
- }
- };
+ // const imageSrcs = await Promise.all(imagePromises);
+ // setImages(imageSrcs);
+ // } catch (error) {
+ // console.error("Error rendering PDF to images:", error);
+ // } finally {
+ // setLoading(false);
+ // }
+ // };
- renderPages();
- }
- }, [id, path]);
+ // renderPages();
+ // }
+ // }, [id, path]);
return (
diff --git a/src/app_modules/investasi/_view/index.ts b/src/app_modules/investasi/_view/index.ts
index 7178a3c6..b8634cd4 100644
--- a/src/app_modules/investasi/_view/index.ts
+++ b/src/app_modules/investasi/_view/index.ts
@@ -1,8 +1,23 @@
+import { Investasi_ViewCreateBerita } from "./create/view_create_berita";
+import { Investasi_ViewCreateDocument } from "./create/view_create_document";
+import Investasi_ViewDetailDraft from "./detail/portofolio/view_detail_draft";
+import Investasi_ViewDetailPublish from "./detail/portofolio/view_detail_publish";
+import Investasi_ViewDetailReject from "./detail/portofolio/view_detail_reject";
+import Investasi_ViewDetailReview from "./detail/portofolio/view_detail_review";
+import { Investasi_ViewDetailBerita } from "./detail/view_berita";
+import { Investasi_ViewDaftarBerita } from "./detail/view_daftar_berita";
+import { Investasi_ViewDaftarDokumen } from "./detail/view_daftar_dokemen";
+import { Investasi_ViewDetailMain } from "./detail/view_detail_main";
+import { Investasi_ViewDetailProspektus } from "./detail/view_detail_prospektusl";
import { Investasi_ViewDetailSahamSaya } from "./detail/view_detail_saham_saya";
+import { Investasi_ViewRekapBerita } from "./detail/view_rekap_berita";
+import { Investasi_ViewRekapDokumen } from "./detail/view_rekap_dokumen";
+import { Investasi_ViewEditDokumen } from "./edit/view_edit_dokumen";
+import { Investasi_ViewEditInvestasi } from "./edit/view_edit_investasi";
+import { Investasi_ViewEditProspektus } from "./edit/view_edit_prospektus";
import PdfToImage from "./file_view/view_file_viewer";
import { Investasi_ViewBeranda } from "./main/view_beranda";
import { Investasi_ViewPortofolio } from "./main/view_portofolio";
-import { Investasi_ViewPortofolioReview } from "./main/portofolio/view_portofolio_review";
import { Investasi_ViewSahamSaya } from "./main/view_saham_saya";
import { Investasi_ViewTransaksiBerhasil } from "./status_transaksi/view_invoice_berhasil";
import { Investasi_ViewTransaksiGagal } from "./status_transaksi/view_transaksi_gagal";
@@ -10,47 +25,33 @@ import { Investasi_ViewInvoice } from "./transaksi/view_invoice";
import { Investasi_ViewMetodePembayaran } from "./transaksi/view_metode_pembayaran";
import { Investasi_ViewProsesPembelian } from "./transaksi/view_proses_pembelian";
import { Investasi_ViewProsesTransaksi } from "./transaksi/view_proses_transaksi";
-import Investasi_ViewDetailPublish from "./detail/portofolio/view_detail_publish";
-import Investasi_ViewDetailReview from "./detail/portofolio/view_detail_review";
-import Investasi_ViewDetailDraft from "./detail/portofolio/view_detail_draft";
-import Investasi_ViewDetailReject from "./detail/portofolio/view_detail_reject";
-import { Investasi_ViewDetailProspektus } from "./detail/view_detail_prospektusl";
-import { Investasi_ViewDaftarDokumen } from "./detail/view_daftar_dokemen";
-import { Investasi_ViewEditDokumen } from "./edit/view_edit_dokumen";
-import { Investasi_ViewEditInvestasi } from "./edit/view_edit_investasi";
-import { Investasi_ViewEditProspektus } from "./edit/view_edit_prospektus";
-import { Investasi_ViewCreateDocument } from "./create/view_create_document";
-import { Investasi_ViewRekapDokumen } from "./detail/view_rekap_dokumen";
-import { Investasi_ViewDetailMain } from "./detail/view_detail_main";
-import { Investasi_ViewRekapBerita } from "./detail/view_rekap_berita";
-import { Investasi_ViewDaftarBerita } from "./detail/view_daftar_berita";
-import { Investasi_ViewCreateBerita } from "./create/view_create_berita";
-import { Investasi_ViewDetailBerita } from "./detail/view_berita";
-export { Investasi_ViewProsesPembelian };
-export { Investasi_ViewMetodePembayaran };
-export { Investasi_ViewInvoice };
-export { Investasi_ViewProsesTransaksi };
-export { Investasi_ViewBeranda };
-export { Investasi_ViewTransaksiGagal };
-export { Investasi_ViewTransaksiBerhasil };
-export { PdfToImage as Investasi_ViewFileViewer };
-export { Investasi_ViewSahamSaya };
-export { Investasi_ViewDetailSahamSaya };
-export { Investasi_ViewPortofolio };
-export { Investasi_ViewDetailPublish };
-export { Investasi_ViewDetailReview };
-export { Investasi_ViewDetailDraft };
-export { Investasi_ViewDetailReject };
-export { Investasi_ViewDetailProspektus };
-export { Investasi_ViewDaftarDokumen };
-export { Investasi_ViewEditDokumen };
-export { Investasi_ViewEditInvestasi };
-export { Investasi_ViewEditProspektus };
-export { Investasi_ViewCreateDocument };
-export { Investasi_ViewRekapDokumen };
-export { Investasi_ViewDetailMain };
-export { Investasi_ViewRekapBerita };
-export { Investasi_ViewDaftarBerita };
-export { Investasi_ViewCreateBerita };
-export { Investasi_ViewDetailBerita };
+export {
+ Investasi_ViewBeranda,
+ Investasi_ViewCreateBerita,
+ Investasi_ViewCreateDocument,
+ Investasi_ViewDaftarBerita,
+ Investasi_ViewDaftarDokumen,
+ Investasi_ViewDetailBerita,
+ Investasi_ViewDetailDraft,
+ Investasi_ViewDetailMain,
+ Investasi_ViewDetailProspektus,
+ Investasi_ViewDetailPublish,
+ Investasi_ViewDetailReject,
+ Investasi_ViewDetailReview,
+ Investasi_ViewDetailSahamSaya,
+ Investasi_ViewEditDokumen,
+ Investasi_ViewEditInvestasi,
+ Investasi_ViewEditProspektus,
+ PdfToImage as Investasi_ViewFileViewer,
+ Investasi_ViewInvoice,
+ Investasi_ViewMetodePembayaran,
+ Investasi_ViewPortofolio,
+ Investasi_ViewProsesPembelian,
+ Investasi_ViewProsesTransaksi,
+ Investasi_ViewRekapBerita,
+ Investasi_ViewRekapDokumen,
+ Investasi_ViewSahamSaya,
+ Investasi_ViewTransaksiBerhasil,
+ Investasi_ViewTransaksiGagal,
+};
diff --git a/src/app_modules/investasi/_view/main/portofolio/skeleton_portofolio.tsx b/src/app_modules/investasi/_view/main/portofolio/skeleton_portofolio.tsx
new file mode 100644
index 00000000..1d834c21
--- /dev/null
+++ b/src/app_modules/investasi/_view/main/portofolio/skeleton_portofolio.tsx
@@ -0,0 +1,32 @@
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Box, Grid } from "@mantine/core";
+
+export default function SkeletonInvestasiPortofolio() {
+ return (
+ <>
+ {[...Array(4)].map((_, index) => (
+
+
+
+
+ {[...Array(3)].map((_, i) => (
+
+
+
+
+
+
+
+ ))}
+
+
+
+
+
+
+
+ ))}
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/investasi/_view/main/portofolio/view_portofolio_draft.tsx b/src/app_modules/investasi/_view/main/portofolio/view_portofolio_draft.tsx
index 59ebfc94..8cf898c6 100644
--- a/src/app_modules/investasi/_view/main/portofolio/view_portofolio_draft.tsx
+++ b/src/app_modules/investasi/_view/main/portofolio/view_portofolio_draft.tsx
@@ -1,4 +1,4 @@
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { Box, Center } from "@mantine/core";
diff --git a/src/app_modules/investasi/_view/main/portofolio/view_portofolio_new.tsx b/src/app_modules/investasi/_view/main/portofolio/view_portofolio_new.tsx
new file mode 100644
index 00000000..5c0a76c0
--- /dev/null
+++ b/src/app_modules/investasi/_view/main/portofolio/view_portofolio_new.tsx
@@ -0,0 +1,79 @@
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { Investasi_ComponentCardPortofolio_NotPublishNew } from "@/app_modules/investasi/_component/main/comp_card_portofolio_not_publish_new";
+import { Investasi_ComponentCardPortofolioPublishNew } from "@/app_modules/investasi/_component/main/comp_card_portofolio_publish_new";
+import { apiGetAllInvestasi } from "@/app_modules/investasi/_lib/api_interface";
+import { IDataInvestasiBursa } from "@/app_modules/investasi/_lib/type_investasi";
+import { Box, Center } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import SkeletonInvestasiPortofolio from "./skeleton_portofolio";
+
+export function Investasi_ViewPortofolioNew() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState([]);
+ const [activePage, setActivePage] = useState(1);
+ const [loading, setLoading] = useState(true)
+
+ async function getDataInvestasi() {
+ try {
+ setLoading(true)
+ const response = await apiGetAllInvestasi(`?cat=portofolio&status=${param.id}&page=1`)
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false)
+ }
+ }
+
+
+ useShallowEffect(() => {
+ getDataInvestasi()
+ }, []);
+
+ return (
+ <>
+
+ {
+ loading ?
+
+ :
+ _.isEmpty(data) ? (
+
+ ) : (
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData}
+ moreData={async () => {
+ const pageNew = activePage + 1
+ const loadData = await apiGetAllInvestasi(`?cat=portofolio&status=${param.id}&page=${pageNew}`)
+ setActivePage((val) => val + 1);
+
+ return loadData.data;
+ }}
+ >
+ {
+ param.id == "1" ?
+ (item) => ()
+ :
+ (item) => ()
+ }
+
+ )
+ }
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_view/main/portofolio/view_portofolio_reject.tsx b/src/app_modules/investasi/_view/main/portofolio/view_portofolio_reject.tsx
index 9e5e327b..9d438b7b 100644
--- a/src/app_modules/investasi/_view/main/portofolio/view_portofolio_reject.tsx
+++ b/src/app_modules/investasi/_view/main/portofolio/view_portofolio_reject.tsx
@@ -1,4 +1,4 @@
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { Box, Center } from "@mantine/core";
diff --git a/src/app_modules/investasi/_view/main/portofolio/view_portofolio_review.tsx b/src/app_modules/investasi/_view/main/portofolio/view_portofolio_review.tsx
index 299ef84f..e4915626 100644
--- a/src/app_modules/investasi/_view/main/portofolio/view_portofolio_review.tsx
+++ b/src/app_modules/investasi/_view/main/portofolio/view_portofolio_review.tsx
@@ -1,4 +1,4 @@
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { Box, Center } from "@mantine/core";
diff --git a/src/app_modules/investasi/_view/main/skeleton_beranda.tsx b/src/app_modules/investasi/_view/main/skeleton_beranda.tsx
new file mode 100644
index 00000000..b9eba1e4
--- /dev/null
+++ b/src/app_modules/investasi/_view/main/skeleton_beranda.tsx
@@ -0,0 +1,32 @@
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Box, Grid } from "@mantine/core";
+
+export default function SkeletonInvestasiBursa() {
+ return (
+ <>
+ {[...Array(4)].map((_, index) => (
+
+
+
+
+
+
+
+ {[...Array(3)].map((_, i) => (
+
+
+
+
+
+
+
+ ))}
+
+
+
+
+ ))}
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/investasi/_view/main/skeleton_saham_saya.tsx b/src/app_modules/investasi/_view/main/skeleton_saham_saya.tsx
new file mode 100644
index 00000000..2334fe63
--- /dev/null
+++ b/src/app_modules/investasi/_view/main/skeleton_saham_saya.tsx
@@ -0,0 +1,19 @@
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Grid } from "@mantine/core";
+
+export default function SkeletonInvestasiSahamSaya() {
+ return (
+ <>
+ {[...Array(4)].map((_, index) => (
+
+
+
+
+
+
+
+ ))}
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/investasi/_view/main/view_beranda.tsx b/src/app_modules/investasi/_view/main/view_beranda.tsx
index 77b5660a..e5fd173a 100644
--- a/src/app_modules/investasi/_view/main/view_beranda.tsx
+++ b/src/app_modules/investasi/_view/main/view_beranda.tsx
@@ -1,4 +1,4 @@
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
diff --git a/src/app_modules/investasi/_view/main/view_beranda_new.tsx b/src/app_modules/investasi/_view/main/view_beranda_new.tsx
new file mode 100644
index 00000000..91af79fb
--- /dev/null
+++ b/src/app_modules/investasi/_view/main/view_beranda_new.tsx
@@ -0,0 +1,112 @@
+"use client";
+import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { gs_investasiTriggerBeranda } from "@/lib/global_state";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Center } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useAtom } from "jotai";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useState } from "react";
+import { Investasi_ComponentButtonUpdateBeranda } from "../../_component";
+import { Investasi_ComponentCardBerandaNew } from "../../_component/main/com_card_beranda_new";
+import { apiFetchGetAllInvestasi } from "../../_lib/api_fetch_new_investasi";
+import { IDataInvestasiBursa } from "../../_lib/type_investasi";
+import SkeletonInvestasiBursa from "./skeleton_beranda";
+
+export function Investasi_ViewBerandaNew() {
+ const [data, setData] = useState([]);
+ const [activePage, setActivePage] = useState(1);
+ const [loading, setLoading] = useState(true);
+
+ // Realtime
+ const [isShowUpdate, setIsShowUpdate] = useState(false);
+ const [isTriggerReload, setIsTriggerReload] = useAtom(
+ gs_investasiTriggerBeranda
+ );
+
+ useShallowEffect(() => {
+ if (isTriggerReload) {
+ setIsShowUpdate(true);
+ }
+ }, [isTriggerReload]);
+
+ useShallowEffect(() => {
+ setIsTriggerReload(false);
+ setIsShowUpdate(false);
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ setLoading(true);
+ const response = await apiFetchGetAllInvestasi({
+ page: `${activePage}`,
+ });
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ const handleMoreData = async () => {
+ try {
+ const nextPage = activePage + 1;
+ const loadData = await apiFetchGetAllInvestasi({
+ page: `${nextPage}`,
+ });
+ if (loadData.success) {
+ setActivePage(nextPage);
+ return loadData.data;
+ } else {
+ return [];
+ }
+ } catch (error) {
+ clientLogger.error("Error ", error);
+ return [];
+ }
+ };
+
+ return (
+ <>
+ {isShowUpdate && (
+ {
+ setData(val);
+ setIsShowUpdate(false);
+ }}
+ />
+ )}
+
+
+
+ {loading ? (
+
+ ) : _.isEmpty(data) ? (
+
+ ) : (
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData}
+ moreData={handleMoreData}
+ >
+ {(item) => }
+
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_view/main/view_saham_saya_new.tsx b/src/app_modules/investasi/_view/main/view_saham_saya_new.tsx
new file mode 100644
index 00000000..44306610
--- /dev/null
+++ b/src/app_modules/investasi/_view/main/view_saham_saya_new.tsx
@@ -0,0 +1,72 @@
+'use client'
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { Box, Center } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useState } from "react";
+import { Investasi_ComponentSahamSayaNew } from "../../_component/main/comp_card_saham_saya_new";
+import { apiGetAllSahamSaya } from "../../_lib/api_interface";
+import { IDataSahamSaya } from "../../_lib/type_investasi";
+import SkeletonInvestasiSahamSaya from "./skeleton_saham_saya";
+
+export function Investasi_ViewSahamSayaNew() {
+ const [data, setData] = useState([]);
+ const [activePage, setActivePage] = useState(1);
+ const [loading, setLoading] = useState(true)
+
+
+ async function getDataSahamSaya() {
+ try {
+ setLoading(true)
+ const response = await apiGetAllSahamSaya(`?cat=saham-saya&page=1`)
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false)
+ }
+ }
+
+
+ useShallowEffect(() => {
+ getDataSahamSaya()
+ }, []);
+
+ return (
+ <>
+
+ {loading ? (
+
+ ) : _.isEmpty(data) ? (
+
+ ) : (
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData}
+ moreData={async () => {
+ const pageNew = activePage + 1;
+ const loadData = await apiGetAllSahamSaya(
+ `?cat=saham-saya&page=${pageNew}`
+ );
+ setActivePage((val) => val + 1);
+
+ return loadData.data;
+ }}
+ >
+ {(item) => }
+
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_view/main/view_transaksi_new.tsx b/src/app_modules/investasi/_view/main/view_transaksi_new.tsx
new file mode 100644
index 00000000..87726193
--- /dev/null
+++ b/src/app_modules/investasi/_view/main/view_transaksi_new.tsx
@@ -0,0 +1,72 @@
+'use client'
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { Box, Center, Loader } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useState } from "react";
+import { Investasi_ComponentCardDaftarTransaksiNew } from "../../_component/main/comp_card_daftar_transaksi_new";
+import { apiGetAllSahamSaya } from "../../_lib/api_interface";
+import { IDataSahamSaya } from "../../_lib/type_investasi";
+import SkeletonInvestasiSahamSaya from "./skeleton_saham_saya";
+
+export function Investasi_ViewDaftarTransaksiNew() {
+ const [data, setData] = useState([]);
+ const [activePage, setActivePage] = useState(1);
+ const [loading, setLoading] = useState(true)
+
+
+ async function getDataTransaksi() {
+ try {
+ setLoading(true)
+ const response = await apiGetAllSahamSaya(`?cat=transaksi&page=1`)
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false)
+ }
+ }
+
+
+ useShallowEffect(() => {
+ getDataTransaksi()
+ }, []);
+
+ return (
+ <>
+ {
+ loading ?
+
+ :
+ _.isEmpty(data) ? (
+
+ ) : (
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData}
+ moreData={async () => {
+ const pageNew = activePage + 1
+ const loadData = await apiGetAllSahamSaya(`?cat=transaksi&page=${pageNew}`)
+ setActivePage((val) => val + 1);
+
+ return loadData.data;
+ }}
+ >
+ {(item) => }
+
+
+ )
+ }
+ >
+ );
+}
diff --git a/src/app_modules/investasi/_view/status_transaksi/view_invoice_berhasil.tsx b/src/app_modules/investasi/_view/status_transaksi/view_invoice_berhasil.tsx
index 9b20f7d5..e968ec78 100644
--- a/src/app_modules/investasi/_view/status_transaksi/view_invoice_berhasil.tsx
+++ b/src/app_modules/investasi/_view/status_transaksi/view_invoice_berhasil.tsx
@@ -1,36 +1,58 @@
"use client";
-import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
-import { AccentColor } from "@/app_modules/_global/color/color_pallet";
-import { ComponentGlobal_LoadImage, ComponentGlobal_TampilanRupiah } from "@/app_modules/_global/component";
+import {
+ AccentColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
+import {
+ ComponentGlobal_LoadImage,
+ ComponentGlobal_TampilanRupiah,
+} from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import {
Box,
Button,
Collapse,
Grid,
Group,
- Image,
Paper,
Stack,
Text,
- Title
+ Title,
} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import { IconBrandCashapp } from "@tabler/icons-react";
-import { useRouter } from "next/navigation";
+import { useParams } from "next/navigation";
import { useState } from "react";
+import { apiGetOneSahamInvestasiById } from "../../_lib/api_fetch_new_investasi";
import { MODEL_INVOICE_INVESTASI } from "../../_lib/interface";
-export function Investasi_ViewTransaksiBerhasil({
- dataTransaksi,
-}: {
- dataTransaksi: any;
-}) {
- const router = useRouter();
- const [data, setData] = useState(dataTransaksi);
- const [isLoading, setLoading] = useState(false);
- const [file, setFile] = useState(null);
+export function Investasi_ViewTransaksiBerhasil() {
const [opened, setOpened] = useState(false);
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetOneSahamInvestasiById({ id: param.id });
+ if (response.success) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ console.error("Error get investasi", error);
+ setData(null);
+ }
+ };
+
+ if (!data) return ;
+
return (
<>
@@ -43,7 +65,7 @@ export function Investasi_ViewTransaksiBerhasil({
padding: "15px",
cursor: "pointer",
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
}}
>
@@ -60,7 +82,7 @@ export function Investasi_ViewTransaksiBerhasil({
padding: "15px",
cursor: "pointer",
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
marginBottom: "15px",
}}
>
@@ -157,12 +179,7 @@ export function Investasi_ViewTransaksiBerhasil({
transitionDuration={500}
transitionTimingFunction="linear"
>
-
-
- {/* */}
+
diff --git a/src/app_modules/investasi/_view/status_transaksi/view_transaksi_gagal.tsx b/src/app_modules/investasi/_view/status_transaksi/view_transaksi_gagal.tsx
index e0fcfb16..fe34f04e 100644
--- a/src/app_modules/investasi/_view/status_transaksi/view_transaksi_gagal.tsx
+++ b/src/app_modules/investasi/_view/status_transaksi/view_transaksi_gagal.tsx
@@ -1,8 +1,11 @@
"use client";
-import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
+import { RouterAdminInvestasi } from "@/lib/router_admin/router_admin_investasi";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
-import { ComponentGlobal_TampilanRupiah } from "@/app_modules/_global/component";
+import {
+ ComponentGlobal_LoadImage,
+ ComponentGlobal_TampilanRupiah,
+} from "@/app_modules/_global/component";
import {
ActionIcon,
Box,
@@ -18,23 +21,58 @@ import {
Title,
} from "@mantine/core";
import { IconBrandWhatsapp } from "@tabler/icons-react";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import { MODEL_INVOICE_INVESTASI } from "../../_lib/interface";
import { Prisma } from "@prisma/client";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetOneSahamInvestasiById } from "../../_lib/api_fetch_new_investasi";
+import { apiGetAdminContact } from "@/app_modules/_global/lib/api_fetch_master";
-export function Investasi_ViewTransaksiGagal({
- dataTransaksi,
- nomorAdmin,
-}: {
- dataTransaksi: any;
- nomorAdmin: Prisma.NomorAdminCreateInput;
-}) {
- const router = useRouter();
- const [data, setData] = useState(dataTransaksi);
- const [isLoading, setLoading] = useState(false);
- const [file, setFile] = useState(null);
+export function Investasi_ViewTransaksiGagal() {
const [opened, setOpened] = useState(false);
+ const router = useRouter();
+
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [nomorAdmin, setNomorAdmin] =
+ useState(null);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ handleLoadNomorAdmin();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetOneSahamInvestasiById({ id: param.id });
+ if (response.success) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ console.error("Error get investasi", error);
+ setData(null);
+ }
+ };
+
+ const handleLoadNomorAdmin = async () => {
+ try {
+ const response = await apiGetAdminContact();
+ if (response.success) {
+ setNomorAdmin(response.data);
+ } else {
+ setNomorAdmin(null);
+ }
+ } catch (error) {
+ console.error("Error get nomor admin", error);
+ }
+ };
+
+ if (!data || !nomorAdmin)
+ return ;
return (
<>
@@ -58,7 +96,7 @@ export function Investasi_ViewTransaksiGagal({
@@ -170,10 +208,7 @@ export function Investasi_ViewTransaksiGagal({
transitionDuration={500}
transitionTimingFunction="linear"
>
-
+
diff --git a/src/app_modules/investasi/_view/transaksi/view_invoice.tsx b/src/app_modules/investasi/_view/transaksi/view_invoice.tsx
index 775f869c..ba740268 100644
--- a/src/app_modules/investasi/_view/transaksi/view_invoice.tsx
+++ b/src/app_modules/investasi/_view/transaksi/view_invoice.tsx
@@ -1,6 +1,6 @@
"use client";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
import {
AccentColor,
MainColor,
@@ -19,46 +19,107 @@ import {
Text,
} from "@mantine/core";
import { IconCamera, IconCircleCheck } from "@tabler/icons-react";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import { MODEL_INVOICE_INVESTASI } from "../../_lib/interface";
import { investasi_funUploadBuktiTransferById } from "../../_fun";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
-import { DIRECTORY_ID } from "@/app/lib";
+import { DIRECTORY_ID } from "@/lib";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { IRealtimeData } from "@/lib/global_state";
+import { notifikasiToAdmin_funCreate } from "@/app_modules/notifikasi/fun";
+import { WibuRealtime } from "wibu-pkg";
+import { clientLogger } from "@/util/clientLogger";
+import { ComponentGlobal_ButtonUploadFileImage } from "@/app_modules/_global/component";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetInvoiceById } from "../../_lib/api_fetch_new_investasi";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export function Investasi_ViewInvoice({
- dataInvoice,
-}: {
- dataInvoice: MODEL_INVOICE_INVESTASI;
-}) {
+export function Investasi_ViewInvoice() {
+ const param = useParams<{ id: string }>();
+ const invoiceId = param.id;
const router = useRouter();
const [isLoading, setLoading] = useState(false);
- const [data, setData] = useState(dataInvoice);
+ const [data, setData] = useState(null);
const [file, setFile] = useState(null);
+ const [img, setImg] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, [invoiceId]);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetInvoiceById({ id: invoiceId });
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error("Error get invoice", error);
+ }
+ }
async function onUpload() {
- const uploadFileToStorage = await funGlobal_UploadToStorage({
- file: file as any,
- dirId: DIRECTORY_ID.investasi_bukti_transfer,
- });
+ try {
+ setLoading(true);
+ const uploadFileToStorage = await funGlobal_UploadToStorage({
+ file: file as any,
+ dirId: DIRECTORY_ID.investasi_bukti_transfer,
+ });
- if (!uploadFileToStorage.success)
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload bukti transfer")
+ if (!uploadFileToStorage.success) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload bukti transfer");
+ return;
+ }
- const res = await investasi_funUploadBuktiTransferById({
- invoiceId: data.id,
- fileId: uploadFileToStorage.data.id,
- });
+ const res = await investasi_funUploadBuktiTransferById({
+ invoiceId: invoiceId as string,
+ fileId: uploadFileToStorage.data.id,
+ });
- if (res.status !== 200) return ComponentGlobal_NotifikasiGagal(res.message);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- setLoading(true);
- router.push(NEW_RouterInvestasi.proses_transaksi + data.id, {
- scroll: false,
- });
+ if (res.status != 200) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ return;
+ }
+
+ const dataNotifikasi: IRealtimeData = {
+ appId: data?.Investasi.id,
+ status: "Proses",
+ userId: data?.authorId as string,
+ pesan: "Bukti transfer telah diupload",
+ kategoriApp: "INVESTASI",
+ title: "Invoice baru",
+ };
+
+ const notif = await notifikasiToAdmin_funCreate({
+ data: dataNotifikasi as any,
+ });
+
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "ADMIN",
+ dataMessage: dataNotifikasi,
+ });
+
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+
+ router.push(NEW_RouterInvestasi.proses_transaksi + invoiceId, {
+ scroll: false,
+ });
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error(" Error upload invoice", error);
+ }
+ }
+
+ if (!data) {
+ return
}
return (
@@ -72,7 +133,7 @@ export function Investasi_ViewInvoice({
padding: "15px",
cursor: "pointer",
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
}}
>
Mohon transfer ke rekening dibawah
@@ -85,7 +146,7 @@ export function Investasi_ViewInvoice({
padding: "15px",
cursor: "pointer",
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
marginBottom: "15px",
}}
>
@@ -125,7 +186,7 @@ export function Investasi_ViewInvoice({
color={copied ? "teal" : "yellow"}
c={"black"}
>
- {copied ? "Berhasil" : "Salin"}
+ {copied ? "Disalin" : "Salin"}
)}
@@ -143,7 +204,7 @@ export function Investasi_ViewInvoice({
padding: "15px",
cursor: "pointer",
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
marginBottom: "15px",
}}
>
@@ -158,7 +219,7 @@ export function Investasi_ViewInvoice({
padding: "15px",
cursor: "pointer",
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
}}
>
@@ -183,7 +244,7 @@ export function Investasi_ViewInvoice({
c={"black"}
onClick={copy}
>
- {copied ? "Berhasil" : "Salin"}
+ {copied ? "Disalin" : "Salin"}
)}
@@ -207,34 +268,15 @@ export function Investasi_ViewInvoice({
>
- {
- try {
- setFile(files);
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
- }
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload
-
- )}
-
+
{file ? (
-
+
Upload berhasil{" "}
@@ -242,7 +284,7 @@ export function Investasi_ViewInvoice({
) : (
-
+
Upload bukti transfer anda !
diff --git a/src/app_modules/investasi/_view/transaksi/view_metode_pembayaran.tsx b/src/app_modules/investasi/_view/transaksi/view_metode_pembayaran.tsx
index c0ed8d22..8d456d3d 100644
--- a/src/app_modules/investasi/_view/transaksi/view_metode_pembayaran.tsx
+++ b/src/app_modules/investasi/_view/transaksi/view_metode_pembayaran.tsx
@@ -1,27 +1,28 @@
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
-import { Button, Paper, Radio, Stack, Text, Title } from "@mantine/core";
-import { useLocalStorage } from "@mantine/hooks";
-import { useRouter } from "next/navigation";
-import { useState } from "react";
-import { MODEL_MASTER_BANK } from "../../_lib/interface";
-import { investasi_funCreateInvoice } from "../../_fun/create/fun_create_invoice";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import { data } from "autoprefixer";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
+import { notifikasiToAdmin_funCreate } from "@/app_modules/notifikasi/fun";
+import { IRealtimeData } from "@/lib/global_state";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
+import { clientLogger } from "@/util/clientLogger";
+import { Button, Paper, Radio, Stack, Title } from "@mantine/core";
+import { useLocalStorage, useShallowEffect } from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import { WibuRealtime } from "wibu-pkg";
+import { investasi_funCreateInvoice } from "../../_fun/create/fun_create_invoice";
+import { MODEL_MASTER_BANK } from "../../_lib/interface";
+import { apiGetMasterBank } from "@/app_modules/_global/lib/api_fetch_master";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export function Investasi_ViewMetodePembayaran({
- listBank,
- investasiId,
-}: {
- listBank: MODEL_MASTER_BANK[];
- investasiId: string;
-}) {
+export function Investasi_ViewMetodePembayaran() {
+ // id = investasiId
+ const param = useParams<{ id: string }>();
const router = useRouter();
- const [bank, setBank] = useState(listBank);
+ const [bank, setBank] = useState([]);
const [pilihBank, setPilihBank] = useState("");
const [isLoading, setLoading] = useState(false);
const [total, setTotal] = useLocalStorage({
@@ -33,21 +34,76 @@ export function Investasi_ViewMetodePembayaran({
defaultValue: 0,
});
- async function onProses() {
- const res = await investasi_funCreateInvoice({
- data: {
- total: total,
- pilihBank: pilihBank,
- investasiId: investasiId,
- jumlah: jumlah,
- },
- });
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
- if (res.status !== 201)
- return ComponentGlobal_NotifikasiPeringatan(res.message);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- setLoading(true);
- router.push(NEW_RouterInvestasi.invoice + res.data?.id, { scroll: false });
+ async function onLoadData() {
+ try {
+ const response = await apiGetMasterBank();
+
+ if (response.success) {
+ setBank(response.data);
+ } else {
+ setBank([]);
+ }
+ } catch (error) {
+ console.error("Error get investasi", error);
+ setBank([]);
+ }
+ }
+
+ async function onProses() {
+ try {
+ setLoading(true);
+ const res = await investasi_funCreateInvoice({
+ data: {
+ total: total,
+ pilihBank: pilihBank,
+ investasiId: param.id,
+ jumlah: jumlah,
+ },
+ });
+
+ if (res.status != 201) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiPeringatan(res.message);
+ return;
+ }
+
+ const dataNotifikasi: IRealtimeData = {
+ appId: param.id,
+ status: "Menunggu",
+ userId: res.data?.authorId as string,
+ pesan: "Menunggu transfer",
+ kategoriApp: "INVESTASI",
+ title: "Transaksi baru",
+ };
+
+ const notif = await notifikasiToAdmin_funCreate({
+ data: dataNotifikasi as any,
+ });
+
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "ADMIN",
+ dataMessage: dataNotifikasi,
+ });
+
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ router.push(NEW_RouterInvestasi.invoice + res.data?.id, {
+ scroll: false,
+ });
+ }
+ } catch (error) {
+ clientLogger.error("Error create invoice:", error);
+ setLoading(false);
+ }
+ }
+
+ if (bank.length === 0) {
+ return ;
}
return (
@@ -68,7 +124,7 @@ export function Investasi_ViewMetodePembayaran({
padding: "15px",
cursor: "pointer",
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
marginBottom: "15px",
}}
>
@@ -76,11 +132,12 @@ export function Investasi_ViewMetodePembayaran({
styles={{
radio: {
color: "yellow",
+ backgroundColor: MainColor.white,
},
}}
value={e.id}
label={
-
+
{e.namaBank}
}
diff --git a/src/app_modules/investasi/_view/transaksi/view_proses_pembelian.tsx b/src/app_modules/investasi/_view/transaksi/view_proses_pembelian.tsx
index c84522bb..0db4c9df 100644
--- a/src/app_modules/investasi/_view/transaksi/view_proses_pembelian.tsx
+++ b/src/app_modules/investasi/_view/transaksi/view_proses_pembelian.tsx
@@ -11,23 +11,24 @@ import {
NumberInput,
Text,
} from "@mantine/core";
-import { useFocusTrap, useLocalStorage } from "@mantine/hooks";
-import { useAtom } from "jotai";
-import { useRouter } from "next/navigation";
+import {
+ useFocusTrap,
+ useLocalStorage,
+ useShallowEffect,
+} from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
-import { NEW_RouterInvestasi } from "../../../../app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "../../../../lib/router_hipmi/router_investasi";
+import { apiNewGetOneInvestasiById } from "../../_lib/api_fetch_new_investasi";
import { MODEL_INVESTASI } from "../../_lib/interface";
-import { gs_investas_menu } from "../../g_state";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export function Investasi_ViewProsesPembelian({
- dataInvestasi,
-}: {
- dataInvestasi: MODEL_INVESTASI;
-}) {
+export function Investasi_ViewProsesPembelian() {
+ const param = useParams<{ id: string }>();
const router = useRouter();
const focusTrapRef = useFocusTrap();
- const [data, setData] = useState(dataInvestasi);
- const [maxPembelian, setMaxPembelian] = useState(Number(data.sisaLembar));
+ const [data, setData] = useState(null);
+ const [maxPembelian, setMaxPembelian] = useState(0);
const [total, setTotal] = useLocalStorage({
key: "total_investasi",
defaultValue: 0,
@@ -38,6 +39,32 @@ export function Investasi_ViewProsesPembelian({
});
const [isLoading, setIsLoading] = useState(false);
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiNewGetOneInvestasiById({ id: param.id });
+
+ if (response.success) {
+ setData(response.data);
+ setMaxPembelian(Number(response.data.sisaLembar));
+ } else {
+ setData(null);
+ setMaxPembelian(0);
+ }
+ } catch (error) {
+ console.error("Error get investasi", error);
+ setData(null);
+ setMaxPembelian(0);
+ }
+ };
+
+ if (!data) {
+ return ;
+ }
+
return (
<>
{/* Sisa Lembar Saham */}
- Sisa Lembar Saham
-
+ Sisa Lembar Saham
+
{new Intl.NumberFormat("id-ID", {
maximumFractionDigits: 10,
}).format(+data.sisaLembar)}{" "}
@@ -62,8 +89,8 @@ export function Investasi_ViewProsesPembelian({
{/* Harga perlembar saham */}
- Harga Perlembar
-
+ Harga Perlembar
+
Rp.{" "}
{new Intl.NumberFormat("id-ID", {
maximumFractionDigits: 10,
@@ -74,12 +101,13 @@ export function Investasi_ViewProsesPembelian({
{/* Lembar saham */}
- Jumlah Pembelian
+ Jumlah Pembelian
minimal pembelian 10 lembar
-
+
- Total Harga
+ Total Harga
-
+
Rp.{" "}
{new Intl.NumberFormat("id-ID", {
maximumFractionDigits: 10,
@@ -119,7 +147,7 @@ export function Investasi_ViewProsesPembelian({
router.push(NEW_RouterInvestasi.metode_pembayaran + data.id, {
scroll: false,
});
- setIsLoading(true)
+ setIsLoading(true);
}}
bg={MainColor.yellow}
color="yellow"
diff --git a/src/app_modules/investasi/_view/transaksi/view_proses_transaksi.tsx b/src/app_modules/investasi/_view/transaksi/view_proses_transaksi.tsx
index 267cea6d..118166a8 100644
--- a/src/app_modules/investasi/_view/transaksi/view_proses_transaksi.tsx
+++ b/src/app_modules/investasi/_view/transaksi/view_proses_transaksi.tsx
@@ -1,4 +1,4 @@
-import { Warna } from "@/app/lib/warna";
+import { Warna } from "@/lib/warna";
import {
AccentColor,
MainColor,
@@ -14,12 +14,34 @@ import {
} from "@mantine/core";
import { IconBrandWhatsapp } from "@tabler/icons-react";
import Link from "next/link";
+import { useState } from "react";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetAdminContact } from "@/app_modules/_global/lib/api_fetch_master";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export function Investasi_ViewProsesTransaksi({
- nomorAdmin,
-}: {
- nomorAdmin: any;
-}) {
+export function Investasi_ViewProsesTransaksi() {
+ const [nomorAdmin, setNomorAdmin] = useState(undefined);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const data = await apiGetAdminContact();
+ if (data.success) {
+ setNomorAdmin(data.data.nomor);
+ } else {
+ console.error("Error get admin contact", data.message);
+ setNomorAdmin(undefined);
+ }
+ } catch (error) {
+ console.error("Error get admin contact", error);
+ setNomorAdmin(undefined);
+ }
+ }
+
+ if (!nomorAdmin) return ;
return (
<>
@@ -30,7 +52,7 @@ export function Investasi_ViewProsesTransaksi({
padding: "15px",
cursor: "pointer",
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
}}
>
@@ -41,13 +63,19 @@ export function Investasi_ViewProsesTransaksi({
padding: "15px",
cursor: "pointer",
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
}}
>
Admin sedang memproses transaksimu
-
+
@@ -73,7 +101,7 @@ export function Investasi_ViewProsesTransaksi({
padding: "15px",
cursor: "pointer",
borderRadius: "10px",
- color: "white",
+ color: MainColor.white,
}}
>
@@ -92,9 +120,9 @@ export function Investasi_ViewProsesTransaksi({
textDecoration: "none",
}}
target="_blank"
- href={`https://wa.me/+${nomorAdmin.nomor}?text=Hallo Admin , Saya ada kendala dalam proses transfer investasi !`}
+ href={`https://wa.me/+${nomorAdmin}?text=Hallo Admin , Saya ada kendala dalam proses transfer investasi !`}
>
-
+
diff --git a/src/app_modules/investasi/berita/view.tsx b/src/app_modules/investasi/berita/view.tsx
index 424d62eb..b6e85680 100644
--- a/src/app_modules/investasi/berita/view.tsx
+++ b/src/app_modules/investasi/berita/view.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import {
AspectRatio,
Box,
@@ -22,6 +22,8 @@ import _ from "lodash";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+
+ // -- DELETE SOON -- //
export default function BeritaInvestasi({
dataInvestasi,
}: {
diff --git a/src/app_modules/investasi/component/detail/card_status.tsx b/src/app_modules/investasi/component/detail/card_status.tsx
index 85b79514..ae51d47a 100644
--- a/src/app_modules/investasi/component/detail/card_status.tsx
+++ b/src/app_modules/investasi/component/detail/card_status.tsx
@@ -1,9 +1,9 @@
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { Paper, Grid, Stack, AspectRatio, Text, Image } from "@mantine/core";
import _ from "lodash";
import { MODEL_INVESTASI } from "../../_lib/interface";
-import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
import { useRouter } from "next/navigation";
export function ComponentInvestasi_CardStatus({
@@ -23,7 +23,7 @@ export function ComponentInvestasi_CardStatus({
backgroundColor: AccentColor.darkblue,
borderRadius: "10px",
border: `2px solid ${AccentColor.blue}`,
- color: "white",
+ color: MainColor.white,
marginBottom: "15px",
}}
>
diff --git a/src/app_modules/investasi/create/layout.tsx b/src/app_modules/investasi/create/layout.tsx
index 259f07b2..1db228b2 100644
--- a/src/app_modules/investasi/create/layout.tsx
+++ b/src/app_modules/investasi/create/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function InvestasiCreateLayout({
@@ -11,11 +14,18 @@ export default function InvestasiCreateLayout({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/investasi/create/view.tsx b/src/app_modules/investasi/create/view.tsx
deleted file mode 100644
index 057162b4..00000000
--- a/src/app_modules/investasi/create/view.tsx
+++ /dev/null
@@ -1,396 +0,0 @@
-"use client";
-
-import { MainColor } from "@/app_modules/_global/color/color_pallet";
-import {
- ComponentGlobal_BoxInformation,
- ComponentGlobal_BoxUploadImage,
- ComponentGlobal_CardStyles,
-} from "@/app_modules/_global/component";
-import { MODEL_DEFAULT_MASTER_OLD } from "@/app_modules/model_global/model_default_master";
-import {
- AspectRatio,
- Box,
- Button,
- Center,
- FileButton,
- Grid,
- Group,
- Image,
- Select,
- Stack,
- Text,
- TextInput,
-} from "@mantine/core";
-import {
- IconCamera,
- IconCircleCheck,
- IconFileTypePdf,
- IconPdf,
- IconUpload,
-} from "@tabler/icons-react";
-import _ from "lodash";
-import { useState } from "react";
-import { Investasi_ComponentButtonCreateNewInvestasi } from "../_component";
-
-export default function InvestasiCreate({
- pencarianInvestor,
- periodeDeviden,
- pembagianDeviden,
-}: {
- pencarianInvestor: MODEL_DEFAULT_MASTER_OLD[];
- periodeDeviden: MODEL_DEFAULT_MASTER_OLD[];
- pembagianDeviden: MODEL_DEFAULT_MASTER_OLD[];
-}) {
- const [fileImage, setFileImage] = useState(null);
- const [img, setImg] = useState();
- const [filePdf, setFilePdf] = useState(null);
- const [fPdf, setFPdf] = useState(null);
- const [totalLembar, setTotalLembar] = useState(0);
-
- const [value, setValue] = useState({
- title: "",
- targetDana: 0,
- hargaLembar: 0,
- roi: 0,
- pencarianInvestorId: "",
- periodeDevidenId: "",
- pembagianDevidenId: "",
- });
- const [target, setTarget] = useState("");
- const [harga, setHarga] = useState("");
-
- async function onTotalLembar({
- target,
- harga,
- }: {
- target?: number | any;
- harga?: number | any;
- }) {
- if (target !== 0 && harga !== 0) {
- const hasil: any = target / harga;
- setTotalLembar(_.floor(hasil === Infinity ? 0 : hasil));
- }
- }
-
- return (
- <>
-
- {/* Upload Image */}
-
-
-
-
-
- {img ? (
-
-
-
- ) : (
-
-
-
- Upload Gambar
-
-
- )}
-
-
- {/* Upload Foto */}
-
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
-
- setImg(buffer);
- setFileImage(files);
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
- }
- radius={50}
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload Gambar
-
- )}
-
-
-
-
- {/* Upload File */}
-
-
-
- {!filePdf ? (
-
- Upload File Prospektus
-
- ) : (
-
-
-
-
- {filePdf.name}
-
-
-
-
-
-
-
-
- )}
-
-
-
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
- setFPdf(buffer);
- setFilePdf(files);
- } catch (error) {
- console.log(error);
- }
- }}
- >
- {(props) => (
- }
- {...props}
- radius={"xl"}
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload File
-
- )}
-
-
-
-
-
- {
- setValue({
- ...value,
- title: val.target.value,
- });
- }}
- />
-
- Rp.}
- min={0}
- withAsterisk
- label="Dana Dibutuhkan"
- placeholder="0"
- value={target}
- onChange={(val) => {
- // console.log(typeof val)
- const match = val.currentTarget.value
- .replace(/\./g, "")
- .match(/^[0-9]+$/);
-
- if (val.currentTarget.value === "") return setTarget(0 + "");
- if (!match?.[0]) return null;
-
- const nilai = val.currentTarget.value.replace(/\./g, "");
- const targetNilai = Intl.NumberFormat("id-ID").format(+nilai);
-
- onTotalLembar({
- target: +nilai,
- harga: +value.hargaLembar,
- });
-
- setTarget(targetNilai);
- setValue({
- ...value,
- targetDana: +nilai,
- });
- }}
- />
-
- Rp.}
- min={0}
- withAsterisk
- label="Harga Per Lembar"
- placeholder="0"
- value={harga}
- onChange={(val) => {
- try {
- // console.log(typeof +val.currentTarget.value);
-
- const match = val.currentTarget.value
- .replace(/\./g, "")
- .match(/^[0-9]+$/);
-
- if (val.currentTarget.value === "") return setHarga(0 + "");
-
- if (!match?.[0]) return null;
-
- const nilai = val.currentTarget.value.replace(/\./g, "");
- const targetNilai = Intl.NumberFormat("id-ID").format(+nilai);
-
- onTotalLembar({
- harga: +nilai,
- target: +value.targetDana,
- });
-
- setHarga(targetNilai);
- setValue({
- ...value,
- hargaLembar: +nilai,
- });
- } catch (error) {
- console.log(error);
- }
- }}
- />
-
-
-
-
- %
-
- }
- withAsterisk
- type="number"
- label={"Rasio Keuntungan / ROI %"}
- placeholder="Masukan rasio keuntungan"
- onChange={(val) => {
- setValue({
- ...value,
- roi: _.toNumber(val.target.value),
- });
- }}
- />
-
- ({
- value: e.id,
- label: e.name + " " + "hari",
- }))}
- onChange={(val) => {
- setValue({
- ...(value as any),
- pencarianInvestorId: val,
- });
- }}
- />
-
- ({ value: e.id, label: e.name }))}
- onChange={(val) => {
- setValue({
- ...(value as any),
- periodeDevidenId: val,
- });
- }}
- />
-
- ({
- value: e.id,
- label: e.name + " " + "bulan",
- }))}
- onChange={(val) => {
- setValue({
- ...(value as any),
- pembagianDevidenId: val,
- });
- }}
- />
-
-
-
-
- >
- );
-}
diff --git a/src/app_modules/investasi/create/view_new.tsx b/src/app_modules/investasi/create/view_new.tsx
new file mode 100644
index 00000000..65c19c47
--- /dev/null
+++ b/src/app_modules/investasi/create/view_new.tsx
@@ -0,0 +1,494 @@
+"use client";
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import {
+ ComponentGlobal_BoxInformation,
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
+ ComponentGlobal_CardStyles,
+} from "@/app_modules/_global/component";
+import {
+ AspectRatio,
+ Box,
+ Center,
+ Grid,
+ Image,
+ Loader,
+ Select,
+ Stack,
+ Text,
+ TextInput,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import {
+ IconCircleCheck,
+ IconFileTypePdf,
+ IconPhoto,
+} from "@tabler/icons-react";
+import _ from "lodash";
+import { useState } from "react";
+import { Investasi_ComponentButtonCreateNewInvestasi } from "../_component";
+import { Investasi_ComponentButtonUploadFile } from "../_component/button/comp_button_upload_file_prospektus";
+import { apiGetMasterInvestasi } from "../_lib/api_interface";
+
+export default function InvestasiCreateNew() {
+ const [loadingMasterInvestor, setLoadingMasterInvestor] = useState(true);
+ const [loadingMasterPeriodeDeviden, setLoadingMasterPeriodeDeviden] =
+ useState(true);
+ const [loadingMasterPembagianDeviden, setLoadingMasterPembagianDeviden] =
+ useState(true);
+ const [periodeDeviden, setPeriodeDeviden] = useState([]);
+ const [pembagianDeviden, setPembagianDeviden] = useState([]);
+ const [pencarianInvestor, setPencarianInvestor] = useState([]);
+ const [fileImage, setFileImage] = useState(null);
+ const [img, setImg] = useState();
+ const [filePdf, setFilePdf] = useState(null);
+ const [fPdf, setFPdf] = useState(null);
+ const [totalLembar, setTotalLembar] = useState(0);
+ const [value, setValue] = useState({
+ title: "",
+ targetDana: 0,
+ hargaLembar: 0,
+ roi: 0,
+ pencarianInvestorId: "",
+ periodeDevidenId: "",
+ pembagianDevidenId: "",
+ });
+ const [target, setTarget] = useState("");
+ const [harga, setHarga] = useState("");
+
+ const [isLoadingImg, setIsLoadingImg] = useState(false);
+ const [isLoadingPdf, setIsLoadingPdf] = useState(false);
+ const [isMinimalTarget, setMinimalTarget] = useState(false);
+
+ async function onTotalLembar({
+ target,
+ harga,
+ }: {
+ target?: number | any;
+ harga?: number | any;
+ }) {
+ if (target !== 0 && harga !== 0) {
+ const hasil: any = target / harga;
+ setTotalLembar(_.floor(hasil === Infinity ? 0 : hasil));
+ }
+ }
+
+ async function onGetMasterInvestor() {
+ try {
+ setLoadingMasterInvestor(true);
+ const response = await apiGetMasterInvestasi("?cat=pencarian-investor");
+ if (response.success) {
+ setPencarianInvestor(response.data);
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setLoadingMasterInvestor(false);
+ }
+ }
+
+ async function onGetMasterPeriodeDeviden() {
+ try {
+ setLoadingMasterPeriodeDeviden(true);
+ const response = await apiGetMasterInvestasi("?cat=periode-deviden");
+ if (response.success) {
+ setPeriodeDeviden(response.data);
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setLoadingMasterPeriodeDeviden(false);
+ }
+ }
+
+ async function onGetMasterPembagianDeviden() {
+ try {
+ setLoadingMasterPembagianDeviden(true);
+ const response = await apiGetMasterInvestasi("?cat=pembagian-deviden");
+ if (response.success) {
+ setPembagianDeviden(response.data);
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ setLoadingMasterPembagianDeviden(false);
+ }
+ }
+
+ useShallowEffect(() => {
+ onGetMasterInvestor();
+ onGetMasterPeriodeDeviden();
+ onGetMasterPembagianDeviden();
+ }, []);
+
+ return (
+ <>
+
+ {/* Upload Image */}
+
+
+
+
+
+ {isLoadingImg ? (
+
+
+
+ ) : img ? (
+
+
+
+ ) : (
+
+
+
+ )}
+
+
+ {/* Upload Foto */}
+
+
+
+
+
+ {/* Upload File */}
+
+
+
+ {isLoadingPdf ? (
+
+
+
+ ) : !filePdf ? (
+
+
+
+ ) : (
+
+
+
+
+
+
+ {filePdf.name}
+
+
+
+
+
+
+
+
+
+
+ )}
+
+
+
+ }
+ />
+
+
+
+
+ {
+ setValue({
+ ...value,
+ title: val.target.value,
+ });
+ }}
+ />
+
+
+ Rp.}
+ min={0}
+ withAsterisk
+ label="Dana Dibutuhkan"
+ placeholder="0"
+ value={target}
+ error={isMinimalTarget ? "Minimal target 10.000.000" : ""}
+ onChange={(val) => {
+ // console.log(typeof val)
+ const match = val.currentTarget.value
+ .replace(/\./g, "")
+ .match(/^[0-9]+$/);
+
+ if (val.currentTarget.value === "") return setTarget(0 + "");
+ if (!match?.[0]) return null;
+
+ const nilai = val.currentTarget.value.replace(/\./g, "");
+ const targetNilai = Intl.NumberFormat("id-ID").format(+nilai);
+
+ // console.log("type nilai", typeof nilai);
+ // console.log("nilai", nilai);
+ // console.log("targetNilai", targetNilai);
+ // console.log("type targetNilai", typeof targetNilai);
+
+ if (+nilai < 10000000) {
+ setMinimalTarget(true);
+ } else {
+ setMinimalTarget(false);
+ }
+
+ onTotalLembar({
+ target: +nilai,
+ harga: +value.hargaLembar,
+ });
+
+ setTarget(targetNilai);
+ setValue({
+ ...value,
+ targetDana: +nilai,
+ });
+ }}
+ />
+
+
+ Rp.}
+ min={0}
+ withAsterisk
+ label="Harga Per Lembar"
+ placeholder="0"
+ value={harga}
+ onChange={(val) => {
+ try {
+ // console.log(typeof +val.currentTarget.value);
+
+ const match = val.currentTarget.value
+ .replace(/\./g, "")
+ .match(/^[0-9]+$/);
+
+ if (val.currentTarget.value === "") return setHarga(0 + "");
+
+ if (!match?.[0]) return null;
+
+ const nilai = val.currentTarget.value.replace(/\./g, "");
+ const targetNilai = Intl.NumberFormat("id-ID").format(+nilai);
+
+ onTotalLembar({
+ harga: +nilai,
+ target: +value.targetDana,
+ });
+
+ setHarga(targetNilai);
+ setValue({
+ ...value,
+ hargaLembar: +nilai,
+ });
+ } catch (error) {
+ console.log(error);
+ }
+ }}
+ />
+
+
+
+
+ %
+
+ }
+ withAsterisk
+ type="number"
+ label={"Rasio Keuntungan / ROI %"}
+ placeholder="Masukan rasio keuntungan"
+ onChange={(val) => {
+ setValue({
+ ...value,
+ roi: _.toNumber(val.target.value),
+ });
+ }}
+ />
+
+ ({
+ value: e.id,
+ label: e.name + " " + "hari",
+ }))}
+ onChange={(val) => {
+ setValue({
+ ...(value as any),
+ pencarianInvestorId: val,
+ });
+ }}
+ />
+
+ ({ value: e.id, label: e.name }))}
+ onChange={(val) => {
+ setValue({
+ ...(value as any),
+ periodeDevidenId: val,
+ });
+ }}
+ />
+
+ ({
+ value: e.id,
+ label: e.name + " " + "bulan",
+ }))}
+ onChange={(val) => {
+ setValue({
+ ...(value as any),
+ pembagianDevidenId: val,
+ });
+ }}
+ />
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/investasi/create_berita/view.tsx b/src/app_modules/investasi/create_berita/view.tsx
index 5d03d21f..0695eea8 100644
--- a/src/app_modules/investasi/create_berita/view.tsx
+++ b/src/app_modules/investasi/create_berita/view.tsx
@@ -1,6 +1,6 @@
"use client";
-import { Warna } from "@/app/lib/warna";
+import { Warna } from "@/lib/warna";
import {
AspectRatio,
Button,
diff --git a/src/app_modules/investasi/detail/view.tsx b/src/app_modules/investasi/detail/view.tsx
index f1b30de4..6f2f2d5b 100644
--- a/src/app_modules/investasi/detail/view.tsx
+++ b/src/app_modules/investasi/detail/view.tsx
@@ -3,7 +3,7 @@
import {
NEW_RouterInvestasi,
RouterInvestasi_OLD,
-} from "@/app/lib/router_hipmi/router_investasi";
+} from "@/lib/router_hipmi/router_investasi";
import {
AccentColor,
MainColor,
diff --git a/src/app_modules/investasi/detail_berita/view.tsx b/src/app_modules/investasi/detail_berita/view.tsx
index e72720f9..723ff77a 100644
--- a/src/app_modules/investasi/detail_berita/view.tsx
+++ b/src/app_modules/investasi/detail_berita/view.tsx
@@ -3,7 +3,7 @@
import { AspectRatio, Group, Image, Stack, Text, Title } from "@mantine/core";
import { Model_Berita_Investasi } from "../_lib/interface";
import { useState } from "react";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import moment from "moment";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import { useShallowEffect } from "@mantine/hooks";
diff --git a/src/app_modules/investasi/detail_dokumen/view.tsx b/src/app_modules/investasi/detail_dokumen/view.tsx
index c72f6a24..5de5a969 100644
--- a/src/app_modules/investasi/detail_dokumen/view.tsx
+++ b/src/app_modules/investasi/detail_dokumen/view.tsx
@@ -12,7 +12,7 @@ import {
MainColor,
} from "@/app_modules/_global/color/color_pallet";
import { useRouter } from "next/navigation";
-import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
+import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
export default function DetailDokumenInvestasi({
dataInvestasi,
diff --git a/src/app_modules/investasi/detail_portofolio/draft/index.tsx b/src/app_modules/investasi/detail_portofolio/draft/index.tsx
index 846ce4ae..fa939447 100644
--- a/src/app_modules/investasi/detail_portofolio/draft/index.tsx
+++ b/src/app_modules/investasi/detail_portofolio/draft/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
@@ -18,6 +18,7 @@ import { ComponentInvestasi_DetailDataNonPublish } from "../../component/detail/
import { investasi_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
import { gs_investasi_status } from "../../g_state";
import { MODEL_INVESTASI } from "../../_lib/interface";
+import { clientLogger } from "@/util/clientLogger";
export default function DetailDraftInvestasi({
dataInvestasi,
}: {
@@ -33,37 +34,43 @@ export default function DetailDraftInvestasi({
statusId: "2",
});
- if (res.status === 200) {
- const dataNotif = {
- appId: res.data?.id,
- userId: res.data?.authorId,
- pesan: res.data?.title,
- status: res.data?.MasterStatusInvestasi?.name,
- kategoriApp: "INVESTASI",
- title: "Mengajukan review",
- };
+ try {
+ setIsLoading(true);
+ if (res.status === 200) {
+ const dataNotif = {
+ appId: res.data?.id,
+ userId: res.data?.authorId,
+ pesan: res.data?.title,
+ status: res.data?.MasterStatusInvestasi?.name,
+ kategoriApp: "INVESTASI",
+ title: "Mengajukan review",
+ };
- const notif = await notifikasiToAdmin_funCreate({
- data: dataNotif as any,
- });
+ const notif = await notifikasiToAdmin_funCreate({
+ data: dataNotif as any,
+ });
- if (notif.status === 201) {
- mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
+ if (notif.status === 201) {
+ mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
- setIsLoading(true);
- ComponentGlobal_NotifikasiBerhasil("Review Berhasil Diajukan");
- router.push(RouterInvestasi_OLD.portofolio);
- setActiveTab("Review");
+ ComponentGlobal_NotifikasiBerhasil("Review Berhasil Diajukan");
+ router.push(RouterInvestasi_OLD.portofolio);
+ setActiveTab("Review");
+ }
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
}
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ } catch (error) {
+ setIsLoading(false);
+ clientLogger.error("Error ajukan review", error);
}
}
return (
<>
- {dataInvestasi.catatan && }
+ {dataInvestasi.catatan && }
{
- if (res.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(res.message);
- setOpenModal(false);
- router.push(RouterInvestasi_OLD.portofolio);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ try {
+ setLoading2(true);
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ setOpenModal1(false);
+ router.push(RouterInvestasi_OLD.portofolio);
+ } else {
+ setLoading2(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ setLoading2(false);
+ clientLogger.error("Error delete investasi", error);
}
});
// setActiveTab("Reject");
@@ -59,20 +77,48 @@ export default function DetailRejectInvestasi({
setOpenModal(false)}
+ opened={openModal1}
+ close={() => setOpenModal1(false)}
buttonKiri={
- setOpenModal(false)}>
+ setOpenModal1(false)}>
Batal
}
buttonKanan={
- onDelete()}>
+ onDelete()}>
Hapus
}
/>
+ setOpenModal2(false)}
+ buttonKiri={
+ setOpenModal2(false)}>
+ Batal
+
+ }
+ buttonKanan={
+ onAjukan()}>
+ Ajukan
+
+ }
+ />
+
{/* Alasan */}
onAjukan()}
+ onClick={() => setOpenModal2(true)}
>
Edit Kembali
+
{/* Tombol Hapus */}
setOpenModal(true)}
+ onClick={() => setOpenModal1(true)}
>
Hapus
diff --git a/src/app_modules/investasi/detail_portofolio/review/index.tsx b/src/app_modules/investasi/detail_portofolio/review/index.tsx
index 0e1769e2..f987097f 100644
--- a/src/app_modules/investasi/detail_portofolio/review/index.tsx
+++ b/src/app_modules/investasi/detail_portofolio/review/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { Button, Stack } from "@mantine/core";
import { useAtom } from "jotai";
import { useRouter } from "next/navigation";
diff --git a/src/app_modules/investasi/detail_prospektus/view.tsx b/src/app_modules/investasi/detail_prospektus/view.tsx
index 73018c4a..5f667132 100644
--- a/src/app_modules/investasi/detail_prospektus/view.tsx
+++ b/src/app_modules/investasi/detail_prospektus/view.tsx
@@ -3,7 +3,7 @@
import {
NEW_RouterInvestasi,
RouterInvestasi_OLD,
-} from "@/app/lib/router_hipmi/router_investasi";
+} from "@/lib/router_hipmi/router_investasi";
import {
AccentColor,
MainColor,
@@ -24,8 +24,8 @@ import { IconChevronRight, IconFileTypePdf } from "@tabler/icons-react";
import Link from "next/link";
import { useState } from "react";
import { MODEL_INVESTASI } from "../_lib/interface";
-import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
-import { RouterAdminInvestasi_OLD } from "@/app/lib/router_hipmi/router_admin";
+import { RouterAdminInvestasi } from "@/lib/router_admin/router_admin_investasi";
+import { RouterAdminInvestasi_OLD } from "@/lib/router_hipmi/router_admin";
import { useRouter } from "next/navigation";
// import DocViewer, { DocViewerRenderers } from "@cyntler/react-doc-viewer";
// import "@cyntler/react-doc-viewer/dist/index.css";
diff --git a/src/app_modules/investasi/dialog_page/create/layout.tsx b/src/app_modules/investasi/dialog_page/create/layout.tsx
index 9bd1fb8c..348552d0 100644
--- a/src/app_modules/investasi/dialog_page/create/layout.tsx
+++ b/src/app_modules/investasi/dialog_page/create/layout.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
import {
Footer,
diff --git a/src/app_modules/investasi/edit_berita/view.tsx b/src/app_modules/investasi/edit_berita/view.tsx
index 591a65dd..32edb823 100644
--- a/src/app_modules/investasi/edit_berita/view.tsx
+++ b/src/app_modules/investasi/edit_berita/view.tsx
@@ -1,7 +1,7 @@
"use client";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
-import { Warna } from "@/app/lib/warna";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
+import { Warna } from "@/lib/warna";
import {
AspectRatio,
Button,
diff --git a/src/app_modules/investasi/edit_dokumen/layout.tsx b/src/app_modules/investasi/edit_dokumen/layout.tsx
deleted file mode 100644
index 3d740136..00000000
--- a/src/app_modules/investasi/edit_dokumen/layout.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-"use client";
-
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
-import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import { ActionIcon } from "@mantine/core";
-import { IconDotsVertical, IconFilePlus } from "@tabler/icons-react";
-import { useRouter } from "next/navigation";
-import React from "react";
-
-export default function LayoutEditDokumenInvestasi({
- children,
- idInves,
-}: {
- children: React.ReactNode;
- idInves: string;
-}) {
- const router = useRouter();
- const [isOpenDrawer, setIsOpenDrawer] = React.useState(false);
-
- const listPage = [
- {
- id: "1",
- name: "Tambah Dokumen",
- icon: ,
- path: RouterInvestasi_OLD.upload_dokumen + `${idInves}`,
- },
- ];
-
- return (
- <>
- }
- // routerRight={RouterInvestasi.upload_dokumen + `${idInves}`}
- customButtonRight={
- setIsOpenDrawer(true)}
- >
-
-
- }
- />
- }
- >
- {children}
-
-
- setIsOpenDrawer(false)}
- component={listPage}
- />
- >
- );
-}
diff --git a/src/app_modules/investasi/edit_dokumen/view.tsx b/src/app_modules/investasi/edit_dokumen/view.tsx
deleted file mode 100644
index ad41b4fa..00000000
--- a/src/app_modules/investasi/edit_dokumen/view.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-"use client";
-
-import {
- AccentColor,
- MainColor,
-} from "@/app_modules/_global/color/color_pallet";
-import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import { ActionIcon, Group, Paper, Text } from "@mantine/core";
-import { IconFolderOpen, IconTrash, IconWorldShare } from "@tabler/icons-react";
-import _ from "lodash";
-import Link from "next/link";
-import { useState } from "react";
-import funDeleteDokumenInvestasi from "../fun/fun_delete_dokumen";
-import funLoadDataInvestasi from "../fun/fun_load_data";
-import { MODEL_INVESTASI } from "../_lib/interface";
-import { IconFile } from "@tabler/icons-react";
-import { IconFileTypePdf } from "@tabler/icons-react";
-
-export default function EditDokumenInvestasi({
- dataInvestasi,
-}: {
- dataInvestasi: MODEL_INVESTASI;
-}) {
- const [dokumen, setDokumen] = useState(dataInvestasi);
-
- async function onDelete(id: string) {
- await funDeleteDokumenInvestasi(id).then(async (res) => {
- if (res.status === 200) {
- ComponentGlobal_NotifikasiBerhasil(res.message);
-
- const load = await funLoadDataInvestasi(dokumen.id);
- setDokumen(load as any);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
- }
-
- return (
- <>
- {!_.isEmpty(dokumen.DokumenInvestasi) ? (
- dokumen.DokumenInvestasi.map((e) => (
-
-
- {e.title}
-
-
-
-
-
-
- {
- onDelete(e.id);
- }}
- >
-
-
-
-
-
- ))
- ) : (
-
- )}
-
- {/* */}
- >
- );
-}
diff --git a/src/app_modules/investasi/edit_intro/view.tsx b/src/app_modules/investasi/edit_intro/view.tsx
index d1b613f9..dff98772 100644
--- a/src/app_modules/investasi/edit_intro/view.tsx
+++ b/src/app_modules/investasi/edit_intro/view.tsx
@@ -18,7 +18,7 @@ import {
import { IconUpload } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import {
AccentColor,
MainColor,
diff --git a/src/app_modules/investasi/edit_propektus/layout.tsx b/src/app_modules/investasi/edit_propektus/layout.tsx
deleted file mode 100644
index eb70c31c..00000000
--- a/src/app_modules/investasi/edit_propektus/layout.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-"use client";
-
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import React from "react";
-import { MODEL_INVESTASI } from "../_lib/interface";
-
-export default function LayoutEditProspektusInvestasi({
- children,
- dataInvestasi,
-}: {
- children: React.ReactNode;
- dataInvestasi: MODEL_INVESTASI;
-}) {
- return (
- <>
- }
- // route2={RouterInvestasi.upload_prospektus + `${dataInvestasi.id}`}
- />
- }
- >
- {children}
-
- >
- );
-}
diff --git a/src/app_modules/investasi/edit_propektus/view.tsx b/src/app_modules/investasi/edit_propektus/view.tsx
deleted file mode 100644
index 276c1f05..00000000
--- a/src/app_modules/investasi/edit_propektus/view.tsx
+++ /dev/null
@@ -1,75 +0,0 @@
-"use client";
-
-import {
- Paper,
- Grid,
- Center,
- Title,
- Divider,
- Button,
- Text,
- Group,
- FileButton,
- FileInput,
- Image,
- AspectRatio,
- Flex,
- Stack,
- Box,
-} from "@mantine/core";
-import { IconChevronRight, IconFileTypePdf } from "@tabler/icons-react";
-import Link from "next/link";
-import { useState } from "react";
-import { MODEL_INVESTASI } from "../_lib/interface";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
-
-export default function EditProspektusInvestasi({
- dataInvestasi,
-}: {
- dataInvestasi: MODEL_INVESTASI;
-}) {
- const [prospek, setProspek] = useState(dataInvestasi);
-
- return (
- <>
- {/* {JSON.stringify(prospek, null, 2)} */}
-
-
- {prospek.ProspektusInvestasi != null ? (
-
-
- ""}
- >
-
-
- {/* */}
- Prospektus_{prospek.title}
-
-
-
-
-
-
-
-
-
-
- ) : (
-
- Tidak ada file
-
- )}
- {/* */}
-
- >
- );
-}
diff --git a/src/app_modules/investasi/fun/edit/fun_edit_status_by_id.ts b/src/app_modules/investasi/fun/edit/fun_edit_status_by_id.ts
index e591443f..924779f0 100644
--- a/src/app_modules/investasi/fun/edit/fun_edit_status_by_id.ts
+++ b/src/app_modules/investasi/fun/edit/fun_edit_status_by_id.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import prisma from "@/lib/prisma";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { revalidatePath } from "next/cache";
export async function investasi_funEditStatusById({
diff --git a/src/app_modules/investasi/fun/fun_countdown_investasi.ts b/src/app_modules/investasi/fun/fun_countdown_investasi.ts
index f5afefd9..4c1ff5ff 100644
--- a/src/app_modules/investasi/fun/fun_countdown_investasi.ts
+++ b/src/app_modules/investasi/fun/fun_countdown_investasi.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import moment from "moment";
import funGantiStatusTransaksi_Investasi from "./fun_ganti_status_transaksi";
import { MODEL_Transaksi_Investasi } from "../_lib/interface";
diff --git a/src/app_modules/investasi/fun/fun_create_berita.ts b/src/app_modules/investasi/fun/fun_create_berita.ts
index a6285e2e..39fa0e4e 100644
--- a/src/app_modules/investasi/fun/fun_create_berita.ts
+++ b/src/app_modules/investasi/fun/fun_create_berita.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import prisma from "@/lib/prisma";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import fs from "fs";
import _ from "lodash";
import { revalidatePath } from "next/cache";
diff --git a/src/app_modules/investasi/fun/fun_create_transaksi.ts b/src/app_modules/investasi/fun/fun_create_transaksi.ts
index f722d357..89b8ee3e 100644
--- a/src/app_modules/investasi/fun/fun_create_transaksi.ts
+++ b/src/app_modules/investasi/fun/fun_create_transaksi.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_Transaksi_Investasi } from "../_lib/interface";
export default async function funCreateTransaksiInvestasi(
diff --git a/src/app_modules/investasi/fun/fun_delete_berita.ts b/src/app_modules/investasi/fun/fun_delete_berita.ts
index 91245bc6..0775a10d 100644
--- a/src/app_modules/investasi/fun/fun_delete_berita.ts
+++ b/src/app_modules/investasi/fun/fun_delete_berita.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function funDeleteBeritaInvestasi(id: string) {
const res = await prisma.beritaInvestasi.delete({
diff --git a/src/app_modules/investasi/fun/fun_delete_dokumen.ts b/src/app_modules/investasi/fun/fun_delete_dokumen.ts
index 3263051f..b2fc9f89 100644
--- a/src/app_modules/investasi/fun/fun_delete_dokumen.ts
+++ b/src/app_modules/investasi/fun/fun_delete_dokumen.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function funDeleteDokumenInvestasi(idDokumen: string) {
const res = await prisma.dokumenInvestasi.delete({
diff --git a/src/app_modules/investasi/fun/fun_delete_donasi.ts b/src/app_modules/investasi/fun/fun_delete_donasi.ts
new file mode 100644
index 00000000..df03c198
--- /dev/null
+++ b/src/app_modules/investasi/fun/fun_delete_donasi.ts
@@ -0,0 +1,22 @@
+'use server';
+
+import { prisma } from "@/lib";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
+import { revalidatePath } from "next/cache";
+
+export default async function funDeleteDonasi(id: string) {
+ const res = await prisma.donasi.delete({
+ where: {
+ id: id,
+ },
+ });
+
+ if (!res) return { status: 400, message: "Gagal Hapus Data" };
+
+ revalidatePath(RouterDonasi.status_galang_dana({ id: "3" }));
+ revalidatePath(RouterDonasi.status_galang_dana({ id: "4" }));
+ return {
+ status: 200,
+ message: "Berhasil Hapus",
+ };
+}
diff --git a/src/app_modules/investasi/fun/fun_delete_investasi.ts b/src/app_modules/investasi/fun/fun_delete_investasi.ts
index 95c211d9..193f2cb4 100644
--- a/src/app_modules/investasi/fun/fun_delete_investasi.ts
+++ b/src/app_modules/investasi/fun/fun_delete_investasi.ts
@@ -1,9 +1,9 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import {
NEW_RouterInvestasi
-} from "@/app/lib/router_hipmi/router_investasi";
+} from "@/lib/router_hipmi/router_investasi";
import { revalidatePath } from "next/cache";
export default async function funDeleteInvestasi(id: string) {
diff --git a/src/app_modules/investasi/fun/fun_edit_berita.ts b/src/app_modules/investasi/fun/fun_edit_berita.ts
index c31199d7..a7b834fe 100644
--- a/src/app_modules/investasi/fun/fun_edit_berita.ts
+++ b/src/app_modules/investasi/fun/fun_edit_berita.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { Model_Berita_Investasi } from "../_lib/interface";
import _ from "lodash";
import { v4 } from "uuid";
diff --git a/src/app_modules/investasi/fun/fun_edit_investasi.ts b/src/app_modules/investasi/fun/fun_edit_investasi.ts
index a2234c5b..5af717cc 100644
--- a/src/app_modules/investasi/fun/fun_edit_investasi.ts
+++ b/src/app_modules/investasi/fun/fun_edit_investasi.ts
@@ -1,12 +1,12 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_INVESTASI } from "../_lib/interface";
import _ from "lodash";
import { v4 } from "uuid";
import fs from "fs";
import { revalidatePath } from "next/cache";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
export default async function funEditInvestasi(
formData: FormData,
diff --git a/src/app_modules/investasi/fun/fun_ganti_status.ts b/src/app_modules/investasi/fun/fun_ganti_status.ts
index 045fde45..7b2280d9 100644
--- a/src/app_modules/investasi/fun/fun_ganti_status.ts
+++ b/src/app_modules/investasi/fun/fun_ganti_status.ts
@@ -1,8 +1,8 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterAdminInvestasi_OLD } from "@/app/lib/router_hipmi/router_admin";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import prisma from "@/lib/prisma";
+import { RouterAdminInvestasi_OLD } from "@/lib/router_hipmi/router_admin";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import moment from "moment";
import { revalidatePath } from "next/cache";
diff --git a/src/app_modules/investasi/fun/fun_ganti_status_transaksi.ts b/src/app_modules/investasi/fun/fun_ganti_status_transaksi.ts
index d06a2609..06ab3987 100644
--- a/src/app_modules/investasi/fun/fun_ganti_status_transaksi.ts
+++ b/src/app_modules/investasi/fun/fun_ganti_status_transaksi.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import prisma from "@/lib/prisma";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { revalidatePath } from "next/cache";
export default async function funGantiStatusTransaksi_Investasi(
diff --git a/src/app_modules/investasi/fun/fun_load_data.ts b/src/app_modules/investasi/fun/fun_load_data.ts
index a822eebd..df7bacf0 100644
--- a/src/app_modules/investasi/fun/fun_load_data.ts
+++ b/src/app_modules/investasi/fun/fun_load_data.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import prisma from "@/lib/prisma";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { revalidatePath } from "next/cache";
export default async function funLoadDataInvestasi(id: string) {
diff --git a/src/app_modules/investasi/fun/fun_total_investor_by_id.ts b/src/app_modules/investasi/fun/fun_total_investor_by_id.ts
index 486223ee..fc8b5bbf 100644
--- a/src/app_modules/investasi/fun/fun_total_investor_by_id.ts
+++ b/src/app_modules/investasi/fun/fun_total_investor_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function funTotalInvestorByIdInvestasi(id: any) {
// console.log(id)
diff --git a/src/app_modules/investasi/fun/fun_update_investasi.ts b/src/app_modules/investasi/fun/fun_update_investasi.ts
index 14a3a352..9557524b 100644
--- a/src/app_modules/investasi/fun/fun_update_investasi.ts
+++ b/src/app_modules/investasi/fun/fun_update_investasi.ts
@@ -1,9 +1,9 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_INVESTASI } from "../_lib/interface";
import { revalidatePath } from "next/cache";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
export default async function funUpdateInvestasi(
dataLembarSaham: MODEL_INVESTASI,
diff --git a/src/app_modules/investasi/fun/fun_update_payment.ts b/src/app_modules/investasi/fun/fun_update_payment.ts
index 31d34665..a8275f84 100644
--- a/src/app_modules/investasi/fun/fun_update_payment.ts
+++ b/src/app_modules/investasi/fun/fun_update_payment.ts
@@ -1,9 +1,9 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_INVESTASI } from "../_lib/interface";
import { revalidatePath } from "next/cache";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
export interface Model_Midtrans_Success {
status_code: string;
diff --git a/src/app_modules/investasi/fun/fun_update_progres_persen.ts b/src/app_modules/investasi/fun/fun_update_progres_persen.ts
index 34a35179..9350d76b 100644
--- a/src/app_modules/investasi/fun/fun_update_progres_persen.ts
+++ b/src/app_modules/investasi/fun/fun_update_progres_persen.ts
@@ -1,7 +1,7 @@
"use server";
import { MODEL_INVESTASI } from "../_lib/interface";
import moment from "moment";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function funUpadteProgresPersenInvestasi(data: MODEL_INVESTASI) {
// console.log(data)
diff --git a/src/app_modules/investasi/fun/fun_update_progres_waktu.ts b/src/app_modules/investasi/fun/fun_update_progres_waktu.ts
index 0cd6e683..5850a759 100644
--- a/src/app_modules/investasi/fun/fun_update_progres_waktu.ts
+++ b/src/app_modules/investasi/fun/fun_update_progres_waktu.ts
@@ -1,7 +1,7 @@
"use server";
import { MODEL_INVESTASI } from "../_lib/interface";
import moment from "moment";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function funUpadteProgresWaktuInvestasi(data: MODEL_INVESTASI) {
diff --git a/src/app_modules/investasi/fun/fun_upload_dokumen.ts b/src/app_modules/investasi/fun/fun_upload_dokumen.ts
index 87cd99aa..3b2eeccd 100644
--- a/src/app_modules/investasi/fun/fun_upload_dokumen.ts
+++ b/src/app_modules/investasi/fun/fun_upload_dokumen.ts
@@ -1,11 +1,11 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _ from "lodash";
import { v4 } from "uuid";
import fs from "fs";
import { revalidatePath } from "next/cache";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
export default async function funUploadDokumenInvestasi(
formData: FormData,
diff --git a/src/app_modules/investasi/fun/fun_upload_prospek.ts b/src/app_modules/investasi/fun/fun_upload_prospek.ts
index 2914bcba..c8180602 100644
--- a/src/app_modules/investasi/fun/fun_upload_prospek.ts
+++ b/src/app_modules/investasi/fun/fun_upload_prospek.ts
@@ -1,11 +1,11 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _ from "lodash";
import { v4 } from "uuid";
import fs from "fs";
import { revalidatePath } from "next/cache";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
export default async function funUploadProspektusInvestasi(
formData: FormData,
diff --git a/src/app_modules/investasi/fun/get_all_investasi.ts b/src/app_modules/investasi/fun/get_all_investasi.ts
index f0a822c4..59c44eac 100644
--- a/src/app_modules/investasi/fun/get_all_investasi.ts
+++ b/src/app_modules/investasi/fun/get_all_investasi.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import moment from "moment";
export async function investasi_funGetAllPublish({ page }: { page: number }) {
diff --git a/src/app_modules/investasi/fun/get_investasi_by_id.ts b/src/app_modules/investasi/fun/get_investasi_by_id.ts
index 576eb31e..275ec2df 100644
--- a/src/app_modules/investasi/fun/get_investasi_by_id.ts
+++ b/src/app_modules/investasi/fun/get_investasi_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function getInvestasiByStatusId(
id: string,
diff --git a/src/app_modules/investasi/fun/get_list_all_publish.ts b/src/app_modules/investasi/fun/get_list_all_publish.ts
index be61ac54..0271d88a 100644
--- a/src/app_modules/investasi/fun/get_list_all_publish.ts
+++ b/src/app_modules/investasi/fun/get_list_all_publish.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
/**
*
* @param status progres > 1 - 3
diff --git a/src/app_modules/investasi/fun/get_list_all_transaksi_by_id.ts b/src/app_modules/investasi/fun/get_list_all_transaksi_by_id.ts
index 9a50fe74..aa889160 100644
--- a/src/app_modules/investasi/fun/get_list_all_transaksi_by_id.ts
+++ b/src/app_modules/investasi/fun/get_list_all_transaksi_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import moment from "moment";
import { MODEL_Transaksi_Investasi } from "../_lib/interface";
import funGantiStatusTransaksi_Investasi from "./fun_ganti_status_transaksi";
diff --git a/src/app_modules/investasi/fun/get_list_transaksi_berhasil_by_id.ts b/src/app_modules/investasi/fun/get_list_transaksi_berhasil_by_id.ts
index 14c8def1..c39e544f 100644
--- a/src/app_modules/investasi/fun/get_list_transaksi_berhasil_by_id.ts
+++ b/src/app_modules/investasi/fun/get_list_transaksi_berhasil_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function getListTransaksiBerhasilInvestasi(
idAuthor: string
diff --git a/src/app_modules/investasi/fun/get_norek.ts b/src/app_modules/investasi/fun/get_norek.ts
index 0911dba6..676023f6 100644
--- a/src/app_modules/investasi/fun/get_norek.ts
+++ b/src/app_modules/investasi/fun/get_norek.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function getNorekInvestasi(id: string) {
const res = await prisma.masterBank.findUnique({
diff --git a/src/app_modules/investasi/fun/get_one_berita_by_id.ts b/src/app_modules/investasi/fun/get_one_berita_by_id.ts
index f08fc120..24b0ea5a 100644
--- a/src/app_modules/investasi/fun/get_one_berita_by_id.ts
+++ b/src/app_modules/investasi/fun/get_one_berita_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function getOneBeritaInvestasiById(id: string) {
const res = await prisma.beritaInvestasi.findUnique({
diff --git a/src/app_modules/investasi/fun/get_one_investasi_by_id.ts b/src/app_modules/investasi/fun/get_one_investasi_by_id.ts
index b5070f83..cd764cb5 100644
--- a/src/app_modules/investasi/fun/get_one_investasi_by_id.ts
+++ b/src/app_modules/investasi/fun/get_one_investasi_by_id.ts
@@ -1,5 +1,5 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function getOneInvestasiById(id: string) {
const data = await prisma.investasi.findUnique({
diff --git a/src/app_modules/investasi/fun/get_one_transaksi_by_id.ts b/src/app_modules/investasi/fun/get_one_transaksi_by_id.ts
index d8672613..72d4ab11 100644
--- a/src/app_modules/investasi/fun/get_one_transaksi_by_id.ts
+++ b/src/app_modules/investasi/fun/get_one_transaksi_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function getOneTransaksiBerhasilByIdInvestasi(
idTransaksi: string
diff --git a/src/app_modules/investasi/fun/get_porto_status_by_id.ts b/src/app_modules/investasi/fun/get_porto_status_by_id.ts
index 778207ce..259f105b 100644
--- a/src/app_modules/investasi/fun/get_porto_status_by_id.ts
+++ b/src/app_modules/investasi/fun/get_porto_status_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function getPortoByStatusId(id: string, statusId: number) {
// Draft
diff --git a/src/app_modules/investasi/fun/get_token_transaksi.js b/src/app_modules/investasi/fun/get_token_transaksi.js
index bea592a7..51ac74a4 100644
--- a/src/app_modules/investasi/fun/get_token_transaksi.js
+++ b/src/app_modules/investasi/fun/get_token_transaksi.js
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import MidTrans from "midtrans-client";
const snap = new MidTrans.Snap({
diff --git a/src/app_modules/investasi/fun/get_transaksi_investasi.ts b/src/app_modules/investasi/fun/get_transaksi_investasi.ts
index e78e602b..cf6be800 100644
--- a/src/app_modules/investasi/fun/get_transaksi_investasi.ts
+++ b/src/app_modules/investasi/fun/get_transaksi_investasi.ts
@@ -1,6 +1,6 @@
"use server"
-import prisma from "@/app/lib/prisma"
+import prisma from "@/lib/prisma"
export default async function getTransaksiByIdInvestasi(id: string) {
const data = await prisma.transaksiInvestasi.findUnique({
diff --git a/src/app_modules/investasi/fun/master/get_nama_bank.ts b/src/app_modules/investasi/fun/master/get_nama_bank.ts
index beec67b3..5a41ae4c 100644
--- a/src/app_modules/investasi/fun/master/get_nama_bank.ts
+++ b/src/app_modules/investasi/fun/master/get_nama_bank.ts
@@ -1,6 +1,6 @@
"use server"
-import prisma from "@/app/lib/prisma"
+import prisma from "@/lib/prisma"
export default async function getMaster_NamaBank() {
const data = await prisma.masterBank.findMany()
diff --git a/src/app_modules/investasi/fun/master/get_pembagian_deviden.ts b/src/app_modules/investasi/fun/master/get_pembagian_deviden.ts
index 752b5b48..ea3fbd4d 100644
--- a/src/app_modules/investasi/fun/master/get_pembagian_deviden.ts
+++ b/src/app_modules/investasi/fun/master/get_pembagian_deviden.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function getPembagianDeviden() {
const data = await prisma.masterPembagianDeviden.findMany({
diff --git a/src/app_modules/investasi/fun/master/get_pencarian_investor.ts b/src/app_modules/investasi/fun/master/get_pencarian_investor.ts
index 30049e86..c3e9d1bf 100644
--- a/src/app_modules/investasi/fun/master/get_pencarian_investor.ts
+++ b/src/app_modules/investasi/fun/master/get_pencarian_investor.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function getPencarianInvestor() {
const data = await prisma.masterPencarianInvestor.findMany({
diff --git a/src/app_modules/investasi/fun/master/get_periode_deviden.ts b/src/app_modules/investasi/fun/master/get_periode_deviden.ts
index 47d3f5bb..15ee5f99 100644
--- a/src/app_modules/investasi/fun/master/get_periode_deviden.ts
+++ b/src/app_modules/investasi/fun/master/get_periode_deviden.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function getPeriodeDeviden() {
const data = await prisma.masterPeriodeDeviden.findMany({
diff --git a/src/app_modules/investasi/fun/master/get_status_investasi.ts b/src/app_modules/investasi/fun/master/get_status_investasi.ts
index fce65241..7e4ef90f 100644
--- a/src/app_modules/investasi/fun/master/get_status_investasi.ts
+++ b/src/app_modules/investasi/fun/master/get_status_investasi.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function getStatusInvestasi() {
const data = await prisma.masterStatusInvestasi.findMany({
diff --git a/src/app_modules/investasi/fun/master/get_status_transaksi.ts b/src/app_modules/investasi/fun/master/get_status_transaksi.ts
index 2f59b37f..060e6cd3 100644
--- a/src/app_modules/investasi/fun/master/get_status_transaksi.ts
+++ b/src/app_modules/investasi/fun/master/get_status_transaksi.ts
@@ -1,6 +1,6 @@
"use server"
-import prisma from "@/app/lib/prisma"
+import prisma from "@/lib/prisma"
export default async function getMaster_StatusTransaksiInvestasi() {
const data = await prisma.masterStatusTransaksiInvestasi.findMany()
diff --git a/src/app_modules/investasi/index.ts b/src/app_modules/investasi/index.ts
index 1f35fe6e..d7849c4f 100644
--- a/src/app_modules/investasi/index.ts
+++ b/src/app_modules/investasi/index.ts
@@ -1,4 +1,4 @@
-import InvestasiCreate from "./create/view";
+import InvestasiCreateNew from "./create/view_new";
import InvestasiCreateLayout from "./create/layout";
import DetailInvestasi from "./detail/view";
import LayoutDetailInvestasi from "./detail/layout";
@@ -6,10 +6,6 @@ import PortofolioInvestasi from "./portofolio/view";
import LayoutPortofolioInvestasi from "./portofolio/layout";
import EditIntroInvestasi from "./edit_intro/view";
import LayoutEditIntroInvestasi from "./edit_intro/layout";
-import EditProspektusInvestasi from "./edit_propektus/view";
-import LayoutEditProspektusInvestasi from "./edit_propektus/layout";
-import EditDokumenInvestasi from "./edit_dokumen/view";
-import LayoutEditDokumenInvestasi from "./edit_dokumen/layout";
import EditBeritaInvestasi from "./edit_berita/view";
import LayoutEditBeritaInvestasi from "./edit_berita/layout";
import DetailPropektus from "./detail_prospektus/view";
@@ -49,7 +45,6 @@ import StatusPesananInvetsatsi from "./status_pesanan/view";
import LayoutStatusPesananInvestasi from "./status_pesanan/layout";
export {
- InvestasiCreate,
InvestasiCreateLayout,
DetailInvestasi,
LayoutDetailInvestasi,
@@ -57,10 +52,6 @@ export {
LayoutPortofolioInvestasi,
EditIntroInvestasi,
LayoutEditIntroInvestasi,
- EditProspektusInvestasi,
- LayoutEditProspektusInvestasi,
- EditDokumenInvestasi,
- LayoutEditDokumenInvestasi,
EditBeritaInvestasi,
LayoutEditBeritaInvestasi,
DetailPropektus,
@@ -98,4 +89,5 @@ export {
LayoutProsesTransaksiInvestasi,
StatusPesananInvetsatsi,
LayoutStatusPesananInvestasi,
+ InvestasiCreateNew
};
diff --git a/src/app_modules/investasi/list_edit_berita/layout.tsx b/src/app_modules/investasi/list_edit_berita/layout.tsx
index 2ad871f5..6be5e0de 100644
--- a/src/app_modules/investasi/list_edit_berita/layout.tsx
+++ b/src/app_modules/investasi/list_edit_berita/layout.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
diff --git a/src/app_modules/investasi/list_edit_berita/view.tsx b/src/app_modules/investasi/list_edit_berita/view.tsx
index c8d28bd8..40bb72c8 100644
--- a/src/app_modules/investasi/list_edit_berita/view.tsx
+++ b/src/app_modules/investasi/list_edit_berita/view.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
diff --git a/src/app_modules/investasi/portofolio/draft.tsx b/src/app_modules/investasi/portofolio/draft.tsx
index c9ab3741..850485ee 100644
--- a/src/app_modules/investasi/portofolio/draft.tsx
+++ b/src/app_modules/investasi/portofolio/draft.tsx
@@ -1,4 +1,4 @@
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { Box } from "@mantine/core";
import _ from "lodash";
diff --git a/src/app_modules/investasi/portofolio/publish.tsx b/src/app_modules/investasi/portofolio/publish.tsx
index 3bc61aa2..95fa7031 100644
--- a/src/app_modules/investasi/portofolio/publish.tsx
+++ b/src/app_modules/investasi/portofolio/publish.tsx
@@ -1,4 +1,4 @@
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import {
AspectRatio,
Box,
@@ -18,7 +18,7 @@ import { useState } from "react";
import ComponentInvestasi_IsEmptyData from "../component/is_empty_data";
import { MODEL_INVESTASI } from "../_lib/interface";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
export default function Publish({ data }: { data: MODEL_INVESTASI[] }) {
const router = useRouter();
@@ -39,7 +39,7 @@ export default function Publish({ data }: { data: MODEL_INVESTASI[] }) {
backgroundColor: AccentColor.darkblue,
borderRadius: "10px",
border: `2px solid ${AccentColor.blue}`,
- color: "white",
+ color: MainColor.white,
marginBottom: "15px",
}}
>
diff --git a/src/app_modules/investasi/portofolio/reject.tsx b/src/app_modules/investasi/portofolio/reject.tsx
index 78deea19..63570f0d 100644
--- a/src/app_modules/investasi/portofolio/reject.tsx
+++ b/src/app_modules/investasi/portofolio/reject.tsx
@@ -1,4 +1,4 @@
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { Box } from "@mantine/core";
import _ from "lodash";
diff --git a/src/app_modules/investasi/portofolio/review.tsx b/src/app_modules/investasi/portofolio/review.tsx
index aa8f9eb7..d00c4228 100644
--- a/src/app_modules/investasi/portofolio/review.tsx
+++ b/src/app_modules/investasi/portofolio/review.tsx
@@ -1,4 +1,4 @@
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { Box } from "@mantine/core";
import _ from "lodash";
diff --git a/src/app_modules/investasi/portofolio/view.tsx b/src/app_modules/investasi/portofolio/view.tsx
index ec4043d7..bf991ad7 100644
--- a/src/app_modules/investasi/portofolio/view.tsx
+++ b/src/app_modules/investasi/portofolio/view.tsx
@@ -64,12 +64,13 @@ export default function PortofolioInvestasi({
c={"black"}
style={{
transition: "0.5s",
- backgroundColor:
- activeTab === e.name ? MainColor.yellow : "white",
- border:
- activeTab === e.name
- ? `1px solid ${AccentColor.yellow}`
- : `1px solid white`,
+ color: activeTab === e.id ? MainColor.darkblue : MainColor.black,
+ // backgroundColor:
+ // activeTab === e.name ? MainColor.yellow : AccentColor.white,
+ // border:
+ // activeTab === e.name
+ // ? `1px solid ${AccentColor.yellow}`
+ // : `1px solid white`,
}}
>
{e.name}
diff --git a/src/app_modules/investasi/proses_transaksi/view.jsx b/src/app_modules/investasi/proses_transaksi/view.jsx
index 96a274bd..0408a8c1 100644
--- a/src/app_modules/investasi/proses_transaksi/view.jsx
+++ b/src/app_modules/investasi/proses_transaksi/view.jsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import {
AccentColor,
MainColor,
diff --git a/src/app_modules/investasi/saham_saya/saham_saya.tsx b/src/app_modules/investasi/saham_saya/saham_saya.tsx
index be5bf147..b400a8e1 100644
--- a/src/app_modules/investasi/saham_saya/saham_saya.tsx
+++ b/src/app_modules/investasi/saham_saya/saham_saya.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import {
diff --git a/src/app_modules/investasi/status_pesanan/view.tsx b/src/app_modules/investasi/status_pesanan/view.tsx
index f4b09627..4a7e162c 100644
--- a/src/app_modules/investasi/status_pesanan/view.tsx
+++ b/src/app_modules/investasi/status_pesanan/view.tsx
@@ -4,7 +4,7 @@ import { useState } from "react";
import { MODEL_Transaksi_Investasi } from "../_lib/interface";
import { Button, Group, Paper, Stack, Text } from "@mantine/core";
import { useRouter } from "next/navigation";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import {
AccentColor,
MainColor,
diff --git a/src/app_modules/investasi/status_transaksi/gagal/layout.tsx b/src/app_modules/investasi/status_transaksi/gagal/layout.tsx
index 9e8126dc..c1b863cf 100644
--- a/src/app_modules/investasi/status_transaksi/gagal/layout.tsx
+++ b/src/app_modules/investasi/status_transaksi/gagal/layout.tsx
@@ -1,7 +1,7 @@
"use client";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
-import { Warna } from "@/app/lib/warna";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
+import { Warna } from "@/lib/warna";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import {
ActionIcon,
diff --git a/src/app_modules/investasi/transaksi/view.tsx b/src/app_modules/investasi/transaksi/view.tsx
index 2a4d4543..aa1bc529 100644
--- a/src/app_modules/investasi/transaksi/view.tsx
+++ b/src/app_modules/investasi/transaksi/view.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { Box, Group, Paper, Stack, Text, Title } from "@mantine/core";
diff --git a/src/app_modules/job/_ui/ui_not_user_view_job.tsx b/src/app_modules/job/_ui/ui_not_user_view_job.tsx
index f7435e4e..bf89beed 100644
--- a/src/app_modules/job/_ui/ui_not_user_view_job.tsx
+++ b/src/app_modules/job/_ui/ui_not_user_view_job.tsx
@@ -1,21 +1,24 @@
"use client";
-import {
- UIGlobal_LayoutHeaderTamplate,
- UIGlobal_LayoutTamplate,
-} from "@/app_modules/_global/ui";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { Job_ViewNotUserJobVacany } from "../_view";
-export function Job_UiNotUserView({ data }: { data: any }) {
+export function Job_UiNotUserView() {
return (
<>
-
- }
- >
-
-
+
+
+
+
+
+
+
+
+
>
);
}
diff --git a/src/app_modules/job/_view/view_not_user_view_job.tsx b/src/app_modules/job/_view/view_not_user_view_job.tsx
index 75908f27..4cd6139d 100644
--- a/src/app_modules/job/_view/view_not_user_view_job.tsx
+++ b/src/app_modules/job/_view/view_not_user_view_job.tsx
@@ -2,9 +2,29 @@ import {
ComponentGlobal_CardStyles,
ComponentGlobal_NotUserLoadImage,
} from "@/app_modules/_global/component";
-import { Center, Stack, Text, Title } from "@mantine/core";
+import { apiGetNotUserForJob } from "@/app_modules/_global/lib/api_fetch_not_user";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Center, Stack, Text } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+
+export function Job_ViewNotUserJobVacany() {
+ const { id } = useParams();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ const fetchData = async () => {
+ try {
+ const data = await apiGetNotUserForJob({ id: id as string });
+ setData(data);
+ } catch (error) {
+ console.error("Error fetching job data:", error);
+ }
+ };
+ fetchData();
+ }, []);
-export function Job_ViewNotUserJobVacany({ data }: { data: any }) {
return (
<>
{data ? (
@@ -32,13 +52,7 @@ export function Job_ViewNotUserJobVacany({ data }: { data: any }) {
) : (
-
-
-
- Data Not Found
-
-
-
+
)}
>
);
diff --git a/src/app_modules/job/component/beranda/card_view.tsx b/src/app_modules/job/component/beranda/card_view.tsx
index 1b74a517..1e3a2774 100644
--- a/src/app_modules/job/component/beranda/card_view.tsx
+++ b/src/app_modules/job/component/beranda/card_view.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
import {
ComponentGlobal_AvatarAndUsername,
ComponentGlobal_CardLoadingOverlay,
diff --git a/src/app_modules/job/component/button/comp_button_save_create.tsx b/src/app_modules/job/component/button/comp_button_save_create.tsx
index 00a5e2e2..aab19fe7 100644
--- a/src/app_modules/job/component/button/comp_button_save_create.tsx
+++ b/src/app_modules/job/component/button/comp_button_save_create.tsx
@@ -1,8 +1,5 @@
"use client";
-import { DIRECTORY_ID } from "@/app/lib";
-import { IRealtimeData } from "@/app/lib/global_state";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
import {
@@ -11,6 +8,10 @@ import {
ComponentGlobal_NotifikasiPeringatan,
} from "@/app_modules/_global/notif_global";
import { notifikasiToAdmin_funCreate } from "@/app_modules/notifikasi/fun";
+import { DIRECTORY_ID } from "@/lib";
+import { IRealtimeData } from "@/lib/global_state";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
+import { clientLogger } from "@/util/clientLogger";
import { Button } from "@mantine/core";
import { useAtom } from "jotai";
import { useRouter } from "next/navigation";
@@ -19,110 +20,235 @@ import { WibuRealtime } from "wibu-pkg";
import { job_funCreateNoFile, job_funCreateWithFile } from "../../fun";
import { gs_job_hot_menu } from "../../global_state";
import { MODEL_JOB } from "../../model/interface";
-import { envs } from "@/lib/envs";
function Job_ComponentButtonSaveCreate({
value,
file,
+ userLoginId,
}: {
value: MODEL_JOB;
file: File;
+ userLoginId: string | null;
}) {
const router = useRouter();
const [isLoading, setIsLoading] = useState(false);
const [hotMenu, setHotMenu] = useAtom(gs_job_hot_menu);
async function onCreate() {
- if (file === null) {
- const createNoFile = await job_funCreateNoFile({
- data: value,
- });
+ if (!userLoginId) {
+ ComponentGlobal_NotifikasiGagal("User tidak ditemukan");
+ return;
+ }
- if (createNoFile.status === 201) {
- const dataNotifikasi: IRealtimeData = {
- appId: createNoFile.data?.id as any,
- status: createNoFile.data?.MasterStatus?.name as any,
- userId: createNoFile.data?.authorId as any,
- pesan: createNoFile.data?.title as any,
- kategoriApp: "JOB",
- title: "Job baru",
- };
-
- const notif = await notifikasiToAdmin_funCreate({
- data: dataNotifikasi as any,
+ try {
+ setIsLoading(true);
+ if (file === null) {
+ const createNoFile = await job_funCreateNoFile({
+ data: value,
});
- if (notif.status === 201) {
- WibuRealtime.setData({
- type: "notification",
- pushNotificationTo: "ADMIN",
+ if (createNoFile.status === 201) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: createNoFile.data?.id as any,
+ status: createNoFile.data?.MasterStatus?.name as any,
+ userId: createNoFile.data?.authorId as any,
+ pesan: createNoFile.data?.title as any,
+ kategoriApp: "JOB",
+ title: "Job baru",
+ };
+
+ const notif = await notifikasiToAdmin_funCreate({
+ data: dataNotifikasi as any,
});
- WibuRealtime.setData({
- type: "trigger",
- pushNotificationTo: "ADMIN",
- dataMessage: dataNotifikasi,
- });
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "ADMIN",
+ });
- setHotMenu(2);
- router.replace(RouterJob.status({ id: "2" }));
- setIsLoading(true);
- ComponentGlobal_NotifikasiBerhasil(createNoFile.message);
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "ADMIN",
+ dataMessage: dataNotifikasi,
+ });
+
+ setHotMenu(2);
+ router.replace(RouterJob.status({ id: "2" }));
+ ComponentGlobal_NotifikasiBerhasil(createNoFile.message);
+ }
+ } else {
+ setIsLoading(false);
+
+ ComponentGlobal_NotifikasiGagal(createNoFile.message);
}
} else {
- ComponentGlobal_NotifikasiGagal(createNoFile.message);
- }
- } else {
- const uploadFile = await funGlobal_UploadToStorage({
- file: file,
- dirId: DIRECTORY_ID.job_image,
- });
-
- if (!uploadFile.success)
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
-
- const createWithFile = await job_funCreateWithFile({
- data: value,
- fileId: uploadFile.data.id,
- });
-
- if (createWithFile.status === 201) {
- const dataNotifikasi: IRealtimeData = {
- appId: createWithFile.data?.id as any,
- status: createWithFile.data?.MasterStatus?.name as any,
- userId: createWithFile.data?.authorId as any,
- pesan: createWithFile.data?.title as any,
- kategoriApp: "JOB",
- title: "Job baru",
- };
-
- const notif = await notifikasiToAdmin_funCreate({
- data: dataNotifikasi as any,
+ const uploadFile = await funGlobal_UploadToStorage({
+ file: file,
+ dirId: DIRECTORY_ID.job_image,
});
- if (notif.status === 201) {
- WibuRealtime.setData({
- type: "notification",
- pushNotificationTo: "ADMIN",
- });
-
- WibuRealtime.setData({
- type: "trigger",
- pushNotificationTo: "ADMIN",
- dataMessage: dataNotifikasi,
- });
-
- setHotMenu(2);
- router.replace(RouterJob.status({ id: "2" }));
- setIsLoading(true);
- ComponentGlobal_NotifikasiBerhasil(createWithFile.message);
+ if (!uploadFile.success) {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ return;
+ }
+
+ const createWithFile = await job_funCreateWithFile({
+ data: value,
+ fileId: uploadFile.data.id,
+ });
+
+ if (createWithFile.status === 201) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: createWithFile.data?.id as any,
+ status: createWithFile.data?.MasterStatus?.name as any,
+ userId: createWithFile.data?.authorId as any,
+ pesan: createWithFile.data?.title as any,
+ kategoriApp: "JOB",
+ title: "Job baru",
+ };
+
+ const notif = await notifikasiToAdmin_funCreate({
+ data: dataNotifikasi as any,
+ });
+
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "ADMIN",
+ });
+
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "ADMIN",
+ dataMessage: dataNotifikasi,
+ });
+
+ setHotMenu(2);
+ router.replace(RouterJob.status({ id: "2" }));
+ ComponentGlobal_NotifikasiBerhasil(createWithFile.message);
+ }
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(createWithFile.message);
}
- } else {
- ComponentGlobal_NotifikasiGagal(createWithFile.message);
}
+ } catch (error) {
+ setIsLoading(false);
+ clientLogger.error("Error create job", error);
}
}
+ // async function handleCreated() {
+ // try {
+ // let fixData;
+ // setIsLoading(true);
+
+ // if (file === null) {
+ // fixData = {
+ // ...value,
+ // authorId: userLoginId,
+ // };
+ // const responseNoFile = await apiCreatedJob({
+ // data: fixData,
+ // });
+
+ // if (responseNoFile) {
+ // const dataNotifikasi: IRealtimeData = {
+ // appId: responseNoFile.data?.id as any,
+ // status: responseNoFile.data?.MasterStatus?.name as any,
+ // userId: responseNoFile.data?.authorId as any,
+ // pesan: responseNoFile.data?.title as any,
+ // kategoriApp: "JOB",
+ // title: "Job baru",
+ // };
+
+ // const responseNotification = await apiCreatedNotificationToAdmin({
+ // data: dataNotifikasi,
+ // });
+
+ // if (responseNotification) {
+ // WibuRealtime.setData({
+ // type: "notification",
+ // pushNotificationTo: "ADMIN",
+ // });
+
+ // WibuRealtime.setData({
+ // type: "trigger",
+ // pushNotificationTo: "ADMIN",
+ // dataMessage: dataNotifikasi,
+ // });
+
+ // setHotMenu(2);
+ // router.replace(RouterJob.status({ id: "2" }));
+ // ComponentGlobal_NotifikasiBerhasil(responseNoFile.message);
+ // }
+ // }
+ // // else {
+ // // setIsLoading(false);
+ // // ComponentGlobal_NotifikasiGagal(responseNoFile.message);
+ // // }
+ // } else {
+ // const uploadFile = await funGlobal_UploadToStorage({
+ // file: file,
+ // dirId: DIRECTORY_ID.job_image,
+ // });
+
+ // if (!uploadFile.success) {
+ // setIsLoading(false);
+ // ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ // return;
+ // }
+
+ // fixData = {
+ // ...value,
+ // authorId: userLoginId,
+ // imageId: uploadFile.data.id,
+ // };
+
+ // const responseWithFile = await apiCreatedJob({
+ // data: fixData,
+ // });
+
+ // if (responseWithFile.status === 201) {
+ // const dataNotifikasi: IRealtimeData = {
+ // appId: responseWithFile.data?.id as any,
+ // status: responseWithFile.data?.MasterStatus?.name as any,
+ // userId: responseWithFile.data?.authorId as any,
+ // pesan: responseWithFile.data?.title as any,
+ // kategoriApp: "JOB",
+ // title: "Job baru",
+ // };
+
+ // const notif = await notifikasiToAdmin_funCreate({
+ // data: dataNotifikasi as any,
+ // });
+
+ // if (notif.status === 201) {
+ // WibuRealtime.setData({
+ // type: "notification",
+ // pushNotificationTo: "ADMIN",
+ // });
+
+ // WibuRealtime.setData({
+ // type: "trigger",
+ // pushNotificationTo: "ADMIN",
+ // dataMessage: dataNotifikasi,
+ // });
+
+ // setHotMenu(2);
+ // router.replace(RouterJob.status({ id: "2" }));
+ // ComponentGlobal_NotifikasiBerhasil(responseWithFile.message);
+ // }
+ // }
+ // }
+ // } catch (error) {
+ // setIsLoading(false);
+ // clientLogger.error("Error create job", error);
+ // }
+ // }
+
return (
<>
{
- onCreate();
- }}
+ onClick={onCreate}
>
Simpan
diff --git a/src/app_modules/job/component/button/comp_button_update_data.tsx b/src/app_modules/job/component/button/comp_button_update_data.tsx
index 919b2470..9aa0bb4f 100644
--- a/src/app_modules/job/component/button/comp_button_update_data.tsx
+++ b/src/app_modules/job/component/button/comp_button_update_data.tsx
@@ -1,4 +1,4 @@
-import { DIRECTORY_ID } from "@/app/lib";
+import { DIRECTORY_ID } from "@/lib";
import { AccentColor, MainColor } from "@/app_modules/_global/color";
import {
funGlobal_DeleteFileById,
@@ -17,6 +17,7 @@ import { useState } from "react";
import { job_EditById } from "../../fun/edit/fun_edit_by_id";
import { gs_job_hot_menu } from "../../global_state";
import { MODEL_JOB } from "../../model/interface";
+import { clientLogger } from "@/util/clientLogger";
export function Job_ComponentButtonUpdateData({
value,
@@ -32,41 +33,56 @@ export function Job_ComponentButtonUpdateData({
const [opened, { open, close }] = useDisclosure(false);
async function onUpdate() {
- if (file === null) {
- const update = await job_EditById({
- data: value,
- });
- if (update.status !== 200)
- return ComponentGlobal_NotifikasiGagal(update.message);
- } else {
- const uploadFile = await funGlobal_UploadToStorage({
- file: file,
- dirId: DIRECTORY_ID.job_image,
- });
+ try {
+ setIsLoading(true);
- if (!uploadFile.success)
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
-
- if (value.imageId !== null) {
- const delFile = await funGlobal_DeleteFileById({
- fileId: value.imageId,
+ if (file === null) {
+ const update = await job_EditById({
+ data: value,
});
- if (!delFile.success)
- ComponentGlobal_NotifikasiPeringatan("Gagal hapus gambar lama");
+ if (update.status !== 200)
+ return ComponentGlobal_NotifikasiGagal(update.message);
+ } else {
+ const uploadFile = await funGlobal_UploadToStorage({
+ file: file,
+ dirId: DIRECTORY_ID.job_image,
+ });
+
+ if (!uploadFile.success) {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ return;
+ }
+
+ if (value.imageId !== null) {
+ const delFile = await funGlobal_DeleteFileById({
+ fileId: value.imageId,
+ });
+ if (!delFile.success) {
+ clientLogger.error("Error delete file:", delFile.message);
+ }
+ }
+
+ const updateWithFile = await job_EditById({
+ data: value,
+ fileId: uploadFile.data.id,
+ });
+
+ if (updateWithFile.status !== 200) {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(updateWithFile.message);
+ return;
+ }
}
- const updateWithFile = await job_EditById({
- data: value,
- fileId: uploadFile.data.id,
- });
- if (updateWithFile.status !== 200)
- return ComponentGlobal_NotifikasiGagal(updateWithFile.message);
+ setHotMenu(2);
+ ComponentGlobal_NotifikasiBerhasil("Berhasil Update");
+ router.back();
+ } catch (error) {
+ setIsLoading(false);
+ clientLogger.error("Error update job:", error);
+ ComponentGlobal_NotifikasiGagal("Gagal update job");
}
-
- setHotMenu(2);
- setIsLoading(true);
- router.back();
- return ComponentGlobal_NotifikasiBerhasil("Berhasil Update");
}
return (
diff --git a/src/app_modules/job/component/card_preview.tsx b/src/app_modules/job/component/card_preview.tsx
index 0d719196..bd1ed739 100644
--- a/src/app_modules/job/component/card_preview.tsx
+++ b/src/app_modules/job/component/card_preview.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
import { Card, Center, Grid, Image, Text } from "@mantine/core";
import { useRouter } from "next/navigation";
diff --git a/src/app_modules/job/component/detail/detail_data.tsx b/src/app_modules/job/component/detail/detail_data.tsx
index 5d831286..fced4484 100644
--- a/src/app_modules/job/component/detail/detail_data.tsx
+++ b/src/app_modules/job/component/detail/detail_data.tsx
@@ -4,14 +4,11 @@ import {
ComponentGlobal_CardStyles,
ComponentGlobal_LoadImage,
} from "@/app_modules/_global/component";
-import { Box, Center, Skeleton, Stack, Text } from "@mantine/core";
+import { Center, Stack, Text } from "@mantine/core";
import { MODEL_JOB } from "../../model/interface";
+import { Job_SkeletonDetailJob } from "../skeleton/comp_skeleton_beranda";
-export default function ComponentJob_DetailData({
- data,
-}: {
- data?: MODEL_JOB;
-}) {
+export default function ComponentJob_DetailData({ data }: { data: MODEL_JOB }) {
return (
<>
{data ? (
@@ -39,24 +36,7 @@ export default function ComponentJob_DetailData({
) : (
-
-
-
-
-
-
-
- {Array.from(new Array(2)).map((e, i) => (
-
-
-
- {Array.from({ length: 3 }).map((_, ii) => (
-
- ))}
-
- ))}
-
-
+
)}
>
);
diff --git a/src/app_modules/job/component/index.ts b/src/app_modules/job/component/index.ts
index 810f60b3..5794e982 100644
--- a/src/app_modules/job/component/index.ts
+++ b/src/app_modules/job/component/index.ts
@@ -2,8 +2,10 @@ import Job_ComponentButtonSaveCreate from "./button/comp_button_save_create";
import { Job_ComponentButtonUpdateBeranda } from "./button/comp_button_update_beranda";
import { Job_ComponentButtonUpdateData } from "./button/comp_button_update_data";
import { Job_ComponentBoxUploadImage } from "./detail/comp_box_upload_image";
+import { Job_ComponentSkeletonBeranda } from "./skeleton/comp_skeleton_beranda";
export { Job_ComponentButtonSaveCreate };
export { Job_ComponentBoxUploadImage };
export { Job_ComponentButtonUpdateData as Job_ComponentButtonUpdate };
export { Job_ComponentButtonUpdateBeranda };
+export { Job_ComponentSkeletonBeranda };
diff --git a/src/app_modules/job/component/new_footer.tsx b/src/app_modules/job/component/new_footer.tsx
new file mode 100644
index 00000000..c2d8816e
--- /dev/null
+++ b/src/app_modules/job/component/new_footer.tsx
@@ -0,0 +1,68 @@
+import { MainColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
+import { SimpleGrid, Stack, ActionIcon, Text } from "@mantine/core";
+import { useDisclosure } from "@mantine/hooks";
+import { IconHome, IconReservedLine, IconHistory } from "@tabler/icons-react";
+import { useAtom } from "jotai";
+import { useState } from "react";
+import { gs_job_hot_menu } from "../global_state";
+import { useRouter } from "next/navigation";
+
+export function NewFooter() {
+ const router = useRouter();
+ const [hotMenuId, setHotMenuId] = useAtom(gs_job_hot_menu);
+ const [isLoading, setLoading] = useState(false);
+ const [opened, handlers] = useDisclosure(false);
+
+ const listFooter = [
+ {
+ id: 1,
+ name: "Beranda",
+ path: RouterJob.beranda,
+ icon: ,
+ },
+
+ {
+ id: 2,
+ name: "Status",
+ path: RouterJob.status({ id: "1" }),
+ icon: ,
+ },
+ {
+ id: 3,
+ name: "Arsip",
+ path: RouterJob.arsip,
+ icon: ,
+ },
+ ];
+ return (
+ <>
+
+ {listFooter.map((e, i) => (
+
+
+ e.path === ""
+ ? ComponentGlobal_NotifikasiPeringatan("Cooming Soon")
+ : (router.replace(e.path), setHotMenuId(e.id))
+ }
+ >
+ {e.icon}
+
+
+ {e.name}
+
+
+ ))}
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/job/component/skeleton/comp_skeleton_beranda.tsx b/src/app_modules/job/component/skeleton/comp_skeleton_beranda.tsx
new file mode 100644
index 00000000..2f40f2df
--- /dev/null
+++ b/src/app_modules/job/component/skeleton/comp_skeleton_beranda.tsx
@@ -0,0 +1,72 @@
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Box, Center, Group, Stack } from "@mantine/core";
+
+export {
+ Job_ComponentSkeletonBeranda,
+ Job_SkeletonDetailJob,
+ Job_SkeletonEdit
+};
+
+function Job_ComponentSkeletonBeranda() {
+ return (
+ <>
+
+ {Array.from(new Array(3)).map((e, i) => (
+
+
+
+
+
+
+
+
+
+
+
+
+ ))}
+
+ >
+ );
+}
+
+function Job_SkeletonDetailJob() {
+ return (
+ <>
+
+
+
+
+
+
+
+ {Array.from(new Array(2)).map((e, i) => (
+
+
+
+ {Array.from({ length: 3 }).map((_, ii) => (
+
+ ))}
+
+ ))}
+
+
+ >
+ );
+}
+
+function Job_SkeletonEdit() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/job/create/layout.tsx b/src/app_modules/job/create/layout.tsx
index 23240109..3de5f9d8 100644
--- a/src/app_modules/job/create/layout.tsx
+++ b/src/app_modules/job/create/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutJob_Create({
@@ -11,11 +14,18 @@ export default function LayoutJob_Create({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/job/create/view.tsx b/src/app_modules/job/create/view.tsx
index 9b836c0f..b7536f94 100644
--- a/src/app_modules/job/create/view.tsx
+++ b/src/app_modules/job/create/view.tsx
@@ -2,15 +2,13 @@
import {
AspectRatio,
- Button,
Center,
- FileButton,
Image,
Stack,
Text,
TextInput,
} from "@mantine/core";
-import { IconCamera, IconUpload } from "@tabler/icons-react";
+import { IconPhoto } from "@tabler/icons-react";
import dynamic from "next/dynamic";
import { useState } from "react";
import "react-quill/dist/quill.snow.css";
@@ -21,17 +19,16 @@ const ReactQuill = dynamic(
{ ssr: false }
);
-import {
- AccentColor,
- MainColor,
-} from "@/app_modules/_global/color/color_pallet";
-
import {
ComponentGlobal_BoxInformation,
ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
ComponentGlobal_CardStyles,
ComponentGlobal_InputCountDown,
} from "@/app_modules/_global/component";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { useShallowEffect } from "@mantine/hooks";
import { Job_ComponentButtonSaveCreate } from "../component";
import { defaultDeskripsi, defaultSyarat } from "../component/default_value";
@@ -43,16 +40,34 @@ export default function Job_Create() {
});
const [file, setFile] = useState(null);
const [img, setImg] = useState();
+ const [userLoginId, setUserLoginId] = useState(null);
- // useShallowEffect(() => {
- // if (window && window.document) setReload(true);
- // }, []);
+ useShallowEffect(() => {
+ handleGetUserLoginId();
+ }, []);
+
+ async function handleGetUserLoginId() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ } else {
+ setUserLoginId(null);
+ }
+ } catch (error) {
+ setUserLoginId(null);
+ }
+ }
+
+ if (!userLoginId) {
+ return ;
+ }
return (
-
+
{img ? (
@@ -65,43 +80,16 @@ export default function Job_Create() {
) : (
-
-
- Upload Gambar
-
+
)}
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
- setImg(buffer);
- setFile(files);
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
-
-
-
- )}
-
+
@@ -207,7 +195,11 @@ export default function Job_Create() {
-
+
);
}
diff --git a/src/app_modules/job/detail/arsip/layout.tsx b/src/app_modules/job/detail/arsip/layout.tsx
index 2b03dbb8..6c58d091 100644
--- a/src/app_modules/job/detail/arsip/layout.tsx
+++ b/src/app_modules/job/detail/arsip/layout.tsx
@@ -1,7 +1,7 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, { UI_NewChildren, UI_NewHeader } from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutJob_DetailArsip({
@@ -11,11 +11,18 @@ export default function LayoutJob_DetailArsip({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/job/detail/arsip/view.tsx b/src/app_modules/job/detail/arsip/view.tsx
index bdf07d5f..1fcdde35 100644
--- a/src/app_modules/job/detail/arsip/view.tsx
+++ b/src/app_modules/job/detail/arsip/view.tsx
@@ -1,25 +1,59 @@
"use client";
-import { Button, Stack } from "@mantine/core";
+import { Button, Center, Stack } from "@mantine/core";
import ComponentJob_DetailData from "../../component/detail/detail_data";
import { MODEL_JOB } from "../../model/interface";
-import { useRouter } from "next/navigation";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { useParams, useRouter } from "next/navigation";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { useAtom } from "jotai";
import { Job_funEditArsipById } from "../../fun/edit/fun_edit_arsip_by_id";
import { gs_job_hot_menu } from "../../global_state";
import { useState } from "react";
-import { useDisclosure } from "@mantine/hooks";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
+import { clientLogger } from "@/util/clientLogger";
+import { apiGetJobById } from "../../lib/api_fetch_job";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+
+export default function Job_DetailArsip() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetJobById({
+ id: param.id,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data job", error);
+ setData(null);
+ }
+ };
-export default function Job_DetailArsip({ dataJob }: { dataJob: MODEL_JOB }) {
return (
<>
-
-
+
+
+ {!data ? (
+
+
+
+ ) : (
+
+ )}
>
);
@@ -74,18 +108,21 @@ function ButtonAction({ jobId }: { jobId: string }) {
}
/>
- {
- open();
- }}
- >
- Publish Lagi
-
+
+ {
+ open();
+ }}
+ >
+ Publish Lagi
+
+
>
);
}
diff --git a/src/app_modules/job/detail/draft/layout.tsx b/src/app_modules/job/detail/draft/layout.tsx
index f1f4e02d..72ff3262 100644
--- a/src/app_modules/job/detail/draft/layout.tsx
+++ b/src/app_modules/job/detail/draft/layout.tsx
@@ -1,23 +1,24 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import {
- ActionIcon
-} from "@mantine/core";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
+import { ActionIcon } from "@mantine/core";
import { useDisclosure } from "@mantine/hooks";
import { IconDotsVertical, IconEdit } from "@tabler/icons-react";
+import { useParams } from "next/navigation";
import React from "react";
export default function LayoutJob_DetailDraft({
children,
- jobId,
}: {
children: React.ReactNode;
- jobId: string;
}) {
+ const { id } = useParams();
const [opened, { open, close }] = useDisclosure();
const listComponent = [
@@ -25,27 +26,25 @@ export default function LayoutJob_DetailDraft({
id: "1",
name: "Edit Job",
icon: ,
- path: RouterJob.edit + jobId,
+ path: RouterJob.edit + id,
},
];
return (
<>
-
+
+ open()}>
}
- // routerRight={}
/>
- }
- >
- {children}
-
+
+ {children}
+
(dataJob);
+export default function Job_DetailDraft() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
useShallowEffect(() => {
- onLoadData({
- loadData(val) {
- setData(val);
- },
- });
- }, [setData]);
+ handleLoadData();
+ }, []);
- async function onLoadData({ loadData }: { loadData: (val: any) => void }) {
- const dataJob = await job_getOneById(jobId);
- loadData(dataJob as any);
- }
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetJobById({
+ id: param.id,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data job", error);
+ setData(null);
+ }
+ };
return (
<>
- {data?.catatan ? (
+ {!data ? (
+
+ ) : data?.catatan ? (
-
+
+ {!data ? (
+
+
+
+
+ ) : (
+
+ )}
>
);
diff --git a/src/app_modules/job/detail/main/layout.tsx b/src/app_modules/job/detail/main/layout.tsx
index 50f83045..156d3d3e 100644
--- a/src/app_modules/job/detail/main/layout.tsx
+++ b/src/app_modules/job/detail/main/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutJob_MainDetail({
@@ -11,11 +14,18 @@ export default function LayoutJob_MainDetail({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/job/detail/main/view.tsx b/src/app_modules/job/detail/main/view.tsx
index c159fc61..9d315e5a 100644
--- a/src/app_modules/job/detail/main/view.tsx
+++ b/src/app_modules/job/detail/main/view.tsx
@@ -1,20 +1,56 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
+import { clientLogger } from "@/util/clientLogger";
import { Button, Center, Stack } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { IconBrandWhatsapp } from "@tabler/icons-react";
import Link from "next/link";
+import { useParams } from "next/navigation";
import { useState } from "react";
+import { apiGetJobById } from "../../lib/api_fetch_job";
import ComponentJob_DetailData from "../../component/detail/detail_data";
import { MODEL_JOB } from "../../model/interface";
-export default function Job_MainDetail({ dataJob }: { dataJob: MODEL_JOB }) {
+export default function Job_MainDetail() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetJobById({
+ id: param.id,
+ });
+
+ if (response.success) {
+
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data job", error);
+ setData(null);
+ }
+ };
+
return (
<>
-
-
+
+
+ {!data ? (
+
+
+
+ ) : (
+
+ )}
>
);
@@ -24,17 +60,10 @@ function ButtonAction({ jobId }: { jobId: string }) {
const [origin, setOrigin] = useState("");
useShallowEffect(() => {
- onLoadOrigin(setOrigin);
- // if (typeof window !== "undefined") {
- // setOrigin(window.location.origin);
- // }
- }, [setOrigin]);
-
- async function onLoadOrigin(setOrigin: any) {
- const res = await fetch("/api/zz-makuro");
- const result = await res.json();
- setOrigin(result.origin);
- }
+ if (typeof window !== "undefined") {
+ setOrigin(window.location.origin);
+ }
+ }, []);
return (
<>
diff --git a/src/app_modules/job/detail/publish/layout.tsx b/src/app_modules/job/detail/publish/layout.tsx
index a117c885..45f215a6 100644
--- a/src/app_modules/job/detail/publish/layout.tsx
+++ b/src/app_modules/job/detail/publish/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutJob_DetailPublish({
@@ -11,11 +14,18 @@ export default function LayoutJob_DetailPublish({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/job/detail/publish/view.tsx b/src/app_modules/job/detail/publish/view.tsx
index c6ce14d8..96d121f6 100644
--- a/src/app_modules/job/detail/publish/view.tsx
+++ b/src/app_modules/job/detail/publish/view.tsx
@@ -1,29 +1,62 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
-import {
- AccentColor,
- MainColor,
-} from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import { Button, Group, Modal, Paper, Stack, Title } from "@mantine/core";
-import { useDisclosure } from "@mantine/hooks";
+import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ Button,
+ Center,
+ Stack
+} from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
import { useAtom } from "jotai";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import { apiGetJobById } from "../../lib/api_fetch_job";
import ComponentJob_DetailData from "../../component/detail/detail_data";
import { Job_funEditArsipById } from "../../fun/edit/fun_edit_arsip_by_id";
-import { gs_job_hot_menu, } from "../../global_state";
+import { gs_job_hot_menu } from "../../global_state";
import { MODEL_JOB } from "../../model/interface";
-import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
-export default function Job_DetailPublish({ dataJob }: { dataJob: MODEL_JOB }) {
+export default function Job_DetailPublish() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetJobById({
+ id: param.id,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data job", error);
+ setData(null);
+ }
+ };
+
return (
<>
-
-
+
+ {!data ? (
+
+
+
+ ) : (
+
+ )}
>
);
@@ -34,13 +67,11 @@ function ButtonAction({ jobId }: { jobId: string }) {
const [isLoading, setLoading] = useState(false);
const [opened, { open, close }] = useDisclosure();
-
const [hotMenu, setHotMenu] = useAtom(gs_job_hot_menu);
async function onArsipkan() {
await Job_funEditArsipById(jobId, true).then((res) => {
if (res.status === 200) {
-
setHotMenu(3);
ComponentGlobal_NotifikasiBerhasil("Berhasil Diarsipkan");
setLoading(true);
@@ -52,47 +83,6 @@ function ButtonAction({ jobId }: { jobId: string }) {
}
return (
<>
- {/*
-
-
- Mengarsipkan akan menghilangkan info lowongan kerja dari beranda,
- anda yakin ?
-
-
- {
- close();
- }}
- >
- Batal
-
- {
- onArsipkan();
- }}
- >
- Arsip
-
-
-
- */}
-
close()}
@@ -122,16 +112,19 @@ function ButtonAction({ jobId }: { jobId: string }) {
}
/>
- {
- open();
- }}
- >
- Arsipkan
-
+
+ {
+ open();
+ }}
+ >
+ Arsipkan
+
+
>
);
}
diff --git a/src/app_modules/job/detail/reject/layout.tsx b/src/app_modules/job/detail/reject/layout.tsx
index 3c5d5fbd..1ae3d1b7 100644
--- a/src/app_modules/job/detail/reject/layout.tsx
+++ b/src/app_modules/job/detail/reject/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutJob_DetailReject({
@@ -11,11 +14,18 @@ export default function LayoutJob_DetailReject({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/job/detail/reject/view.tsx b/src/app_modules/job/detail/reject/view.tsx
index 35537ae5..15774317 100644
--- a/src/app_modules/job/detail/reject/view.tsx
+++ b/src/app_modules/job/detail/reject/view.tsx
@@ -1,34 +1,73 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { Button, Group, Stack } from "@mantine/core";
-
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
import { funGlobal_DeleteFileById } from "@/app_modules/_global/fun";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
-import { useDisclosure } from "@mantine/hooks";
-import { useRouter } from "next/navigation";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import ComponentJob_DetailData from "../../component/detail/detail_data";
import { Job_funDeleteById } from "../../fun/delete/fun_delete_by_id";
import { Job_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_status_id";
import { MODEL_JOB } from "../../model/interface";
+import { clientLogger } from "@/util/clientLogger";
+import { apiGetJobById } from "../../lib/api_fetch_job";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export default function Job_DetailReject({ dataJob }: { dataJob: MODEL_JOB }) {
- const [data, setData] = useState(dataJob);
+export default function Job_DetailReject() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetJobById({
+ id: param.id,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data job", error);
+ setData(null);
+ }
+ };
return (
<>
-
-
-
+ {!data ? (
+
+ ) : (
+
+ )}
+
+
+ {!data ? (
+
+
+
+
+ ) : (
+
+ )}
>
);
diff --git a/src/app_modules/job/detail/review/layout.tsx b/src/app_modules/job/detail/review/layout.tsx
index 480a5495..10c267a0 100644
--- a/src/app_modules/job/detail/review/layout.tsx
+++ b/src/app_modules/job/detail/review/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutJob_DetailReview({
@@ -11,11 +14,18 @@ export default function LayoutJob_DetailReview({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/job/detail/review/view.tsx b/src/app_modules/job/detail/review/view.tsx
index 670f6f77..c358dfcd 100644
--- a/src/app_modules/job/detail/review/view.tsx
+++ b/src/app_modules/job/detail/review/view.tsx
@@ -1,25 +1,58 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
import mqtt_client from "@/util/mqtt_client";
-import { Button, Stack } from "@mantine/core";
-import { useDisclosure } from "@mantine/hooks";
-import { useRouter } from "next/navigation";
+import { Button, Center, Stack } from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import ComponentJob_DetailData from "../../component/detail/detail_data";
import { Job_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_status_id";
import { MODEL_JOB } from "../../model/interface";
+import { clientLogger } from "@/util/clientLogger";
+import { apiGetJobById } from "../../lib/api_fetch_job";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+
+export default function Job_DetailReview() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetJobById({
+ id: param.id,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data job", error);
+ setData(null);
+ }
+ };
-export default function Job_DetailReview({ dataJob }: { dataJob: MODEL_JOB }) {
return (
<>
-
-
+
+ {!data ? (
+
+
+
+ ) : (
+
+ )}
>
);
@@ -92,16 +125,19 @@ function ButtonAction({ jobId }: { jobId: string }) {
}
/>
- {
- setOpen(true);
- }}
- >
- Batalkan Review
-
+
+ {
+ setOpen(true);
+ }}
+ >
+ Batalkan Review
+
+
>
);
}
diff --git a/src/app_modules/job/edit/layout.tsx b/src/app_modules/job/edit/layout.tsx
index 2e9cb44b..b22e1c02 100644
--- a/src/app_modules/job/edit/layout.tsx
+++ b/src/app_modules/job/edit/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutJob_Edit({
@@ -11,12 +14,18 @@ export default function LayoutJob_Edit({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/job/edit/view.tsx b/src/app_modules/job/edit/view.tsx
index 04c9ca2e..2e16b729 100644
--- a/src/app_modules/job/edit/view.tsx
+++ b/src/app_modules/job/edit/view.tsx
@@ -2,36 +2,31 @@
import {
AspectRatio,
- Button,
Center,
- FileButton,
Image,
Stack,
Text,
TextInput,
} from "@mantine/core";
-import { IconCamera, IconUpload } from "@tabler/icons-react";
import { useState } from "react";
import { MODEL_JOB } from "../model/interface";
-import { APIs } from "@/app/lib";
-import {
- AccentColor,
- MainColor,
-} from "@/app_modules/_global/color/color_pallet";
import {
ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
ComponentGlobal_CardStyles,
ComponentGlobal_LoadImage,
- ComponentGlobal_LoadImageCustom,
} from "@/app_modules/_global/component";
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import { IconPhoto } from "@tabler/icons-react";
import dynamic from "next/dynamic";
import "react-quill/dist/quill.snow.css";
-import {
- Job_ComponentBoxUploadImage,
- Job_ComponentButtonUpdate,
-} from "../component";
+import { Job_ComponentButtonUpdate } from "../component";
+import { clientLogger } from "@/util/clientLogger";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import { apiGetJobById } from "../lib/api_fetch_job";
+import { Job_SkeletonEdit } from "../component/skeleton/comp_skeleton_beranda";
const ReactQuill = dynamic(
() => {
return import("react-quill");
@@ -39,19 +34,40 @@ const ReactQuill = dynamic(
{ ssr: false }
);
-export default function Job_Edit({ dataJob }: { dataJob: MODEL_JOB }) {
- const [data, setData] = useState(dataJob);
+export default function Job_Edit() {
const [file, setFile] = useState(null);
const [img, setImg] = useState();
- // useShallowEffect(() => {
- // if (window && window.document) setReload(true);
- // }, []);
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetJobById({
+ id: param.id,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data job", error);
+ setData(null);
+ }
+ };
+
+ if (!data) return ;
return (
<>
-
+
{img ? (
@@ -66,44 +82,16 @@ export default function Job_Edit({ dataJob }: { dataJob: MODEL_JOB }) {
) : (
-
-
- Upload Gambar
-
+
)}
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
-
- setImg(buffer);
- setFile(files);
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
-
-
-
- )}
-
+
diff --git a/src/app_modules/job/fun/create/fun_create_no_file.ts b/src/app_modules/job/fun/create/fun_create_no_file.ts
index 0f38af09..6017a440 100644
--- a/src/app_modules/job/fun/create/fun_create_no_file.ts
+++ b/src/app_modules/job/fun/create/fun_create_no_file.ts
@@ -1,37 +1,44 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { revalidatePath } from "next/cache";
import { MODEL_JOB } from "../../model/interface";
export async function job_funCreateNoFile({ data }: { data: MODEL_JOB }) {
- const authorId = await funGetUserIdByToken();
+ try {
+ const authorId = await funGetUserIdByToken();
- const createNoImage = await prisma.job.create({
- data: {
- title: data.title,
- content: data.content,
- deskripsi: data.deskripsi,
- authorId: authorId,
- },
- select: {
- id: true,
- authorId: true,
- MasterStatus: {
- select: {
- name: true,
- },
+ const createNoImage = await prisma.job.create({
+ data: {
+ title: data.title,
+ content: data.content,
+ deskripsi: data.deskripsi,
+ authorId: authorId,
},
- title: true,
- },
- });
+ select: {
+ id: true,
+ authorId: true,
+ MasterStatus: {
+ select: {
+ name: true,
+ },
+ },
+ title: true,
+ },
+ });
- if (!createNoImage) return { status: 400, message: "Gagal Disimpan" };
- revalidatePath("/dev/job/main/status/2");
- return {
- status: 201,
- message: "Berhasil Disimpan",
- data: createNoImage,
- };
+ if (!createNoImage) return { status: 400, message: "Gagal Disimpan" };
+ revalidatePath("/dev/job/main/status/2");
+ return {
+ status: 201,
+ message: "Berhasil Disimpan",
+ data: createNoImage,
+ };
+ } catch (error) {
+ return {
+ status: 500,
+ message: "Error create job",
+ };
+ }
}
diff --git a/src/app_modules/job/fun/create/fun_create_with_file.ts b/src/app_modules/job/fun/create/fun_create_with_file.ts
index 8b5133dd..708a9fa6 100644
--- a/src/app_modules/job/fun/create/fun_create_with_file.ts
+++ b/src/app_modules/job/fun/create/fun_create_with_file.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { revalidatePath } from "next/cache";
import { MODEL_JOB } from "../../model/interface";
diff --git a/src/app_modules/job/fun/delete/fun_delete_by_id.ts b/src/app_modules/job/fun/delete/fun_delete_by_id.ts
index 2a5cd960..fd2ce17d 100644
--- a/src/app_modules/job/fun/delete/fun_delete_by_id.ts
+++ b/src/app_modules/job/fun/delete/fun_delete_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function Job_funDeleteById(jobId: string) {
diff --git a/src/app_modules/job/fun/edit/fun_edit_arsip_by_id.ts b/src/app_modules/job/fun/edit/fun_edit_arsip_by_id.ts
index d8b637f7..5a2040fe 100644
--- a/src/app_modules/job/fun/edit/fun_edit_arsip_by_id.ts
+++ b/src/app_modules/job/fun/edit/fun_edit_arsip_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function Job_funEditArsipById(jobId: string, aktifasi: boolean) {
diff --git a/src/app_modules/job/fun/edit/fun_edit_by_id.ts b/src/app_modules/job/fun/edit/fun_edit_by_id.ts
index 960b6436..7adec77b 100644
--- a/src/app_modules/job/fun/edit/fun_edit_by_id.ts
+++ b/src/app_modules/job/fun/edit/fun_edit_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
import { MODEL_JOB } from "../../model/interface";
@@ -11,42 +11,46 @@ export async function job_EditById({
data: MODEL_JOB;
fileId?: string;
}) {
- if (fileId == undefined) {
- const updt = await prisma.job.update({
- where: {
- id: data.id,
- },
- data: {
- title: data.title,
- content: data.content,
- deskripsi: data.deskripsi,
- },
- });
- if (!updt) return { status: 400, message: "Gagal Update" };
- revalidatePath("/dev/job/detail/draft");
+ try {
+ if (fileId == undefined) {
+ const updt = await prisma.job.update({
+ where: {
+ id: data.id,
+ },
+ data: {
+ title: data.title,
+ content: data.content,
+ deskripsi: data.deskripsi,
+ },
+ });
+ if (!updt) return { status: 400, message: "Gagal Update" };
+ revalidatePath("/dev/job/detail/draft");
- return {
- status: 200,
- message: "Berhasil Update",
- };
- } else {
- const updtWithFile = await prisma.job.update({
- where: {
- id: data.id,
- },
- data: {
- title: data.title,
- content: data.content,
- deskripsi: data.deskripsi,
- imageId: fileId,
- },
- });
- if (!updtWithFile) return { status: 400, message: "Gagal Update" };
- revalidatePath("/dev/job/detail/draft");
+ return {
+ status: 200,
+ message: "Berhasil Update",
+ };
+ } else {
+ const updtWithFile = await prisma.job.update({
+ where: {
+ id: data.id,
+ },
+ data: {
+ title: data.title,
+ content: data.content,
+ deskripsi: data.deskripsi,
+ imageId: fileId,
+ },
+ });
+ if (!updtWithFile) return { status: 400, message: "Gagal Update" };
+ revalidatePath("/dev/job/detail/draft");
- return {
- status: 200,
- message: "Berhasil Update",
- };
+ return {
+ status: 200,
+ message: "Berhasil Update",
+ };
+ }
+ } catch (error) {
+ return { status: 500, message: "Error Update" };
}
}
diff --git a/src/app_modules/job/fun/edit/fun_edit_status_by_status_id.ts b/src/app_modules/job/fun/edit/fun_edit_status_by_status_id.ts
index 4da9cff1..65299c50 100644
--- a/src/app_modules/job/fun/edit/fun_edit_status_by_status_id.ts
+++ b/src/app_modules/job/fun/edit/fun_edit_status_by_status_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function Job_funEditStatusByStatusId(
diff --git a/src/app_modules/job/fun/get/get_all_arsip.ts b/src/app_modules/job/fun/get/get_all_arsip.ts
index 95cd954a..4181a126 100644
--- a/src/app_modules/job/fun/get/get_all_arsip.ts
+++ b/src/app_modules/job/fun/get/get_all_arsip.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function job_getAllArsipById({ page }: { page: number }) {
diff --git a/src/app_modules/job/fun/get/get_all_publish.ts b/src/app_modules/job/fun/get/get_all_publish.ts
index 47667297..9a956247 100644
--- a/src/app_modules/job/fun/get/get_all_publish.ts
+++ b/src/app_modules/job/fun/get/get_all_publish.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function job_getAllListPublish({
page,
diff --git a/src/app_modules/job/fun/get/get_master_status.ts b/src/app_modules/job/fun/get/get_master_status.ts
index 7572992c..68d5721c 100644
--- a/src/app_modules/job/fun/get/get_master_status.ts
+++ b/src/app_modules/job/fun/get/get_master_status.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
export async function job_funGetMasterStatus() {
const data = await prisma.masterStatus.findMany({});
diff --git a/src/app_modules/job/fun/get/get_one_by_id.ts b/src/app_modules/job/fun/get/get_one_by_id.ts
index bc15833b..082c13a0 100644
--- a/src/app_modules/job/fun/get/get_one_by_id.ts
+++ b/src/app_modules/job/fun/get/get_one_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function job_getOneById(jobId: any) {
const get = await prisma.job.findFirst({
diff --git a/src/app_modules/job/fun/get/get_two_for_home_view.ts b/src/app_modules/job/fun/get/get_two_for_home_view.ts
index fe9db5d6..22ca4f18 100644
--- a/src/app_modules/job/fun/get/get_two_for_home_view.ts
+++ b/src/app_modules/job/fun/get/get_two_for_home_view.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function job_getTwoForHomeView() {
const get = await prisma.job.findMany({
diff --git a/src/app_modules/job/fun/get/status/get_all_by_status_id.ts b/src/app_modules/job/fun/get/status/get_all_by_status_id.ts
index 4c3cd2f6..eb6a8f86 100644
--- a/src/app_modules/job/fun/get/status/get_all_by_status_id.ts
+++ b/src/app_modules/job/fun/get/status/get_all_by_status_id.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function job_funGetAllByStatusId({
diff --git a/src/app_modules/job/fun/get/status/get_list_draft.ts b/src/app_modules/job/fun/get/status/get_list_draft.ts
index 6038e1ee..60ac184f 100644
--- a/src/app_modules/job/fun/get/status/get_list_draft.ts
+++ b/src/app_modules/job/fun/get/status/get_list_draft.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export default async function job_getAllStatusDraft({
diff --git a/src/app_modules/job/fun/get/status/get_list_publish.ts b/src/app_modules/job/fun/get/status/get_list_publish.ts
index afc96bd9..53c9e46f 100644
--- a/src/app_modules/job/fun/get/status/get_list_publish.ts
+++ b/src/app_modules/job/fun/get/status/get_list_publish.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export default async function job_getAllStatusPublish({
diff --git a/src/app_modules/job/fun/get/status/get_list_reject.ts b/src/app_modules/job/fun/get/status/get_list_reject.ts
index 85210d6a..fb9458fc 100644
--- a/src/app_modules/job/fun/get/status/get_list_reject.ts
+++ b/src/app_modules/job/fun/get/status/get_list_reject.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export default async function job_getAllStatusReject({
diff --git a/src/app_modules/job/fun/get/status/get_list_review.ts b/src/app_modules/job/fun/get/status/get_list_review.ts
index 292805ca..0f77af42 100644
--- a/src/app_modules/job/fun/get/status/get_list_review.ts
+++ b/src/app_modules/job/fun/get/status/get_list_review.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export default async function job_getAllStatusReview({
diff --git a/src/app_modules/job/index.ts b/src/app_modules/job/index.ts
index 6bfefbb0..cb9a7bac 100644
--- a/src/app_modules/job/index.ts
+++ b/src/app_modules/job/index.ts
@@ -1,7 +1,7 @@
import Job_ViewBeranda from "./main/beranda/view_beranda";
import LayoutJob_Main from "./main/layout";
import Job_ViewSplash from "./splash/view_splash";
-import Job_ViewStatus from "./main/status/view_status";
+import Job_UiStatus from "./main/status/ui_status";
import Job_ViewArsip from "./main/arsip/view_arsip";
import Job_Create from "./create/view";
import LayoutJob_Create from "./create/layout";
@@ -26,7 +26,7 @@ export {
Job_ViewBeranda,
LayoutJob_Main,
Job_ViewSplash,
- Job_ViewStatus as Job_Status,
+ Job_UiStatus as Job_Status,
Job_ViewArsip as Job_Arsip,
Job_Create,
LayoutJob_Create,
diff --git a/src/app_modules/job/lib/api_fetch_admin_job.ts b/src/app_modules/job/lib/api_fetch_admin_job.ts
new file mode 100644
index 00000000..ba61c164
--- /dev/null
+++ b/src/app_modules/job/lib/api_fetch_admin_job.ts
@@ -0,0 +1,30 @@
+const apiGetJobStatuCountDashboard = async ({ name }: { name: "Publish" | "Review" | "Reject" }) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/job/dashboard/${name}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ })
+ return await response.json().catch(() => null)
+}
+const apiGetJobStatusCountArsip = async () => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/admin/job/dashboard/arsip`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ })
+ return await response.json().catch(() => null);
+}
\ No newline at end of file
diff --git a/src/app_modules/job/lib/api_fetch_job.ts b/src/app_modules/job/lib/api_fetch_job.ts
new file mode 100644
index 00000000..8e4e61fb
--- /dev/null
+++ b/src/app_modules/job/lib/api_fetch_job.ts
@@ -0,0 +1,207 @@
+export {
+ apiGetJob,
+ apiGetJobArsip,
+ apiGetJobById,
+ apiGetJobByStatus,
+ apiCreatedJob,
+};
+
+const apiGetJobByStatus = async ({
+ status,
+ page,
+}: {
+ status?: string;
+ page: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ // Send PUT request to update portfolio logo
+ const isPage = `?page=${page}`;
+ const response = await fetch(`/api/job/status/${status}${isPage}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error respone data job:",
+ errorData?.message || "Unknown error"
+ );
+
+ return null;
+ }
+
+ return await response.json();
+ } catch (error) {
+ console.error("Error get data job:", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiGetJob = async ({
+ page,
+ search,
+}: {
+ page: string;
+ search?: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ // Send PUT request to update portfolio logo
+ const isPage = `?page=${page}`;
+ const isSearch = search ? `&search=${search}` : "";
+ const response = await fetch(`/api/job${isPage}${isSearch}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error respone data job:",
+ errorData?.message || "Unknown error"
+ );
+
+ return null;
+ }
+
+ return await response.json();
+ } catch (error) {
+ console.error("Error get data job:", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiGetJobArsip = async ({ page }: { page: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ // Send PUT request to update portfolio logo
+ const isPage = `?page=${page}`;
+ const response = await fetch(`/api/job/arsip${isPage}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error respone data arsip job:",
+ errorData?.message || "Unknown error"
+ );
+
+ return null;
+ }
+
+ const result = await response.json();
+
+ return result;
+ } catch (error) {
+ console.error("Error get data arsip job:", (error as Error).message);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiGetJobById = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ // Send PUT request to update portfolio logo
+ const response = await fetch(`/api/job/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Error get data job:",
+ errorData?.message || "Unknown error"
+ );
+
+ return null;
+ }
+
+ return await response.json();
+ } catch (error) {
+ console.error("Error get data job:", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+
+const apiCreatedJob = async ({ data }: { data: any }) => {
+ try {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/job`, {
+ method: "POST",
+ body: JSON.stringify({ data }),
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed created job", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed created job");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error created job", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
diff --git a/src/app_modules/job/main/arsip/ui_arsip.tsx b/src/app_modules/job/main/arsip/ui_arsip.tsx
deleted file mode 100644
index d1285ad6..00000000
--- a/src/app_modules/job/main/arsip/ui_arsip.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-"use client";
-
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
-import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import { Box, Center, Loader } from "@mantine/core";
-import _ from "lodash";
-import { ScrollOnly } from "next-scroll-loader";
-import { useState } from "react";
-import ComponentJob_CardStatus from "../../component/card/card_view";
-import { job_getAllArsipById } from "../../fun/get/get_all_arsip";
-import { MODEL_JOB } from "../../model/interface";
-
-export function Job_UI_Arsip({ listData }: { listData: MODEL_JOB[] }) {
- const [data, setData] = useState(listData);
- const [activePage, setActivePage] = useState(1);
-
- return (
- <>
- {_.isEmpty(data) ? (
-
- ) : (
- // --- Main component --- //
-
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await job_getAllArsipById({
- page: activePage + 1,
- });
-
- setActivePage((val) => val + 1);
-
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
-
- )}
- >
- );
-}
diff --git a/src/app_modules/job/main/arsip/view_arsip.tsx b/src/app_modules/job/main/arsip/view_arsip.tsx
index e7a958f6..773a444a 100644
--- a/src/app_modules/job/main/arsip/view_arsip.tsx
+++ b/src/app_modules/job/main/arsip/view_arsip.tsx
@@ -1,11 +1,110 @@
-import { Box } from "@mantine/core";
-import { MODEL_JOB } from "../../model/interface";
-import { Job_UI_Arsip } from "./ui_arsip";
+"use client";
+
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Center, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useState } from "react";
+import { apiGetJob, apiGetJobArsip } from "../../lib/api_fetch_job";
+import ComponentJob_CardStatus from "../../component/card/card_view";
+import { MODEL_JOB } from "../../model/interface";
+
+export default function Job_ViewArsip() {
+ const [data, setData] = useState([]);
+ const [activePage, setActivePage] = useState(1);
+ const [hasMore, setHasMore] = useState(true);
+ const [isLoading, setIsLoading] = useState(false);
+
+ useShallowEffect(() => {
+ onLoadNewData();
+ }, []);
+
+ async function onLoadNewData() {
+ try {
+ setIsLoading(true);
+ const response = await apiGetJobArsip({
+ page: `${activePage}`,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ setActivePage(1);
+ setHasMore(response.data.length > 0);
+ } else {
+ setData([]);
+ setHasMore(false);
+ }
+ } catch (error) {
+ clientLogger.error("Error get job", error);
+ setData([]);
+ setHasMore(false);
+ } finally {
+ setIsLoading(false);
+ }
+ }
+
+ const handleMoreData = async () => {
+ if (!hasMore || isLoading) return null;
+
+ try {
+ const nextPage = activePage + 1;
+
+ const response = await apiGetJob({
+ page: `${nextPage}`,
+ });
+
+ if (response?.data && response.data.length > 0) {
+ setActivePage(nextPage);
+ setHasMore(response.data.length > 0);
+ return response.data;
+ } else {
+ setHasMore(false);
+ return null;
+ }
+ } catch (error) {
+ clientLogger.error("Error get job", error);
+ setHasMore(false);
+ return null;
+ }
+ };
-export default function Job_ViewArsip({ dataJob }: { dataJob: MODEL_JOB[] }) {
return (
<>
- ;
+ {!data?.length && isLoading ? (
+
+
+
+
+ ) : _.isEmpty(data) ? (
+
+ ) : (
+ // --- Main component --- //
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData}
+ moreData={handleMoreData}
+ >
+ {(item) => (
+
+ )}
+
+
+ )}
>
);
}
diff --git a/src/app_modules/job/main/beranda/ui_beranda.tsx b/src/app_modules/job/main/beranda/view.back.txt
similarity index 50%
rename from src/app_modules/job/main/beranda/ui_beranda.tsx
rename to src/app_modules/job/main/beranda/view.back.txt
index 6b0a8505..184d2495 100644
--- a/src/app_modules/job/main/beranda/ui_beranda.tsx
+++ b/src/app_modules/job/main/beranda/view.back.txt
@@ -1,7 +1,7 @@
"use client";
-import { gs_jobTiggerBeranda } from "@/app/lib/global_state";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { gs_jobTiggerBeranda } from "@/lib/global_state";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { Center, Loader, Stack, TextInput } from "@mantine/core";
@@ -10,58 +10,104 @@ import { IconSearch } from "@tabler/icons-react";
import { useAtom } from "jotai";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
-import { useEffect, useState } from "react";
+import { useState } from "react";
+import {
+ Job_ComponentButtonUpdateBeranda,
+ Job_ComponentSkeletonBeranda,
+} from "../../component";
import ComponentJob_BerandaCardView from "../../component/beranda/card_view";
-import { job_getAllListPublish } from "../../fun/get/get_all_publish";
import { MODEL_JOB } from "../../model/interface";
-import { Job_ComponentButtonUpdateBeranda } from "../../component";
+import { apiGetJob } from "../../component/api_fetch_job";
+import { clientLogger } from "@/util/clientLogger";
-export function Job_UiBeranda({ listData }: { listData: MODEL_JOB[] }) {
- const [data, setData] = useState(listData);
+export default function Job_ViewBeranda() {
+ const [data, setData] = useState([]);
const [activePage, setActivePage] = useState(1);
const [isSearch, setIsSearch] = useState("");
+ const [hasMore, setHasMore] = useState(true);
+ const [isLoading, setIsLoading] = useState(false);
// Notifikasi
const [isShowUpdate, setIsShowUpdate] = useState(false);
const [isTriggerJob, setIsTriggerJob] = useAtom(gs_jobTiggerBeranda);
useShallowEffect(() => {
- onLoadNewData({
- onLoad(val) {
- setData(val);
- },
- });
- }, [setData]);
+ if (isTriggerJob == true) {
+ setIsShowUpdate(true);
+ }
+ }, [isTriggerJob]);
useShallowEffect(() => {
- if (isTriggerJob) {
- setIsShowUpdate(true);
- // setIsTriggerJob(false);
- }
- }, [isTriggerJob, setIsShowUpdate]);
+ setIsTriggerJob(false);
+ setIsShowUpdate(false);
+ onLoadNewData();
+ }, [isSearch]);
async function onSearch(text: string) {
setIsSearch(text);
- const loadData = await job_getAllListPublish({
- page: activePage,
- search: text,
- });
- setData(loadData as any);
setActivePage(1);
+ setHasMore(true);
}
- async function onLoadNewData({ onLoad }: { onLoad: (val: any) => void }) {
- const loadData = await job_getAllListPublish({ page: 1 });
- onLoad(loadData);
+ async function onLoadNewData() {
+ try {
+ setIsLoading(true);
+ const response = await apiGetJob({
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ setActivePage(1);
+ setHasMore(response.data.length > 0);
+ } else {
+ setData([]);
+ setHasMore(false);
+ }
+ } catch (error) {
+ clientLogger.error("Error get job", error);
+ setData([]);
+ setHasMore(false);
+ } finally {
+ setIsLoading(false);
+ }
}
+ const handleMoreData = async () => {
+ if (!hasMore || isLoading) return null;
+
+ try {
+ const nextPage = activePage + 1;
+
+ const response = await apiGetJob({
+ page: `${nextPage}`,
+ search: isSearch,
+ });
+
+ if (response?.data && response.data.length > 0) {
+ setActivePage(nextPage);
+ setHasMore(response.data.length > 0);
+ return response.data;
+ } else {
+ setHasMore(false);
+ return null;
+ }
+ } catch (error) {
+ clientLogger.error("Error get job", error);
+ setHasMore(false);
+ return null;
+ }
+ };
+
return (
<>
-
+
{isShowUpdate && (
{
setIsShowUpdate(val);
+ setIsTriggerJob(val);
}}
onSetData={(val: any[]) => {
setData(val);
@@ -85,7 +131,9 @@ export function Job_UiBeranda({ listData }: { listData: MODEL_JOB[] }) {
}}
/>
- {_.isEmpty(data) ? (
+ {!data?.length && isLoading ? (
+
+ ) : _.isEmpty(data) ? (
) : (
// --- Main component --- //
@@ -97,17 +145,8 @@ export function Job_UiBeranda({ listData }: { listData: MODEL_JOB[] }) {
)}
data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await job_getAllListPublish({
- page: activePage + 1,
- search: isSearch,
- });
-
- setActivePage((val) => val + 1);
-
- return loadData;
- }}
+ setData={setData as any}
+ moreData={handleMoreData}
>
{(item) => }
diff --git a/src/app_modules/job/main/beranda/view_beranda.tsx b/src/app_modules/job/main/beranda/view_beranda.tsx
index c56f1feb..2b9bc61c 100644
--- a/src/app_modules/job/main/beranda/view_beranda.tsx
+++ b/src/app_modules/job/main/beranda/view_beranda.tsx
@@ -1,10 +1,165 @@
-import { MODEL_JOB } from "../../model/interface";
-import { Job_UiBeranda } from "./ui_beranda";
+"use client";
+
+import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { gs_jobTiggerBeranda } from "@/lib/global_state";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Center, Loader, Stack, TextInput } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconSearch } from "@tabler/icons-react";
+import { useAtom } from "jotai";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useState } from "react";
+import {
+ Job_ComponentButtonUpdateBeranda,
+ Job_ComponentSkeletonBeranda,
+} from "../../component";
+import { apiGetJob } from "../../lib/api_fetch_job";
+import ComponentJob_BerandaCardView from "../../component/beranda/card_view";
+import { MODEL_JOB } from "../../model/interface";
+
+export default function Job_ViewBeranda() {
+ const [data, setData] = useState([]);
+ const [activePage, setActivePage] = useState(1);
+ const [isSearch, setIsSearch] = useState("");
+ const [hasMore, setHasMore] = useState(true);
+ const [isLoading, setIsLoading] = useState(false);
+
+ // Notifikasi
+ const [isShowUpdate, setIsShowUpdate] = useState(false);
+ const [isTriggerJob, setIsTriggerJob] = useAtom(gs_jobTiggerBeranda);
+
+ useShallowEffect(() => {
+ if (isTriggerJob == true) {
+ setIsShowUpdate(true);
+ }
+ }, [isTriggerJob]);
+
+ useShallowEffect(() => {
+ setIsTriggerJob(false);
+ setIsShowUpdate(false);
+ onLoadNewData();
+ }, [isSearch]);
+
+ async function onSearch(text: string) {
+ setIsSearch(text);
+ setActivePage(1);
+ setHasMore(true);
+ }
+
+ async function onLoadNewData() {
+ try {
+ setIsLoading(true);
+ const response = await apiGetJob({
+ page: `${activePage}`,
+ search: isSearch,
+ });
+
+ if (response.success) {
+ setData(response.data);
+ setActivePage(1);
+ setHasMore(response.data.length > 0);
+ } else {
+ setData([]);
+ setHasMore(false);
+ }
+ } catch (error) {
+ clientLogger.error("Error get job", error);
+ setData([]);
+ setHasMore(false);
+ } finally {
+ setIsLoading(false);
+ }
+ }
+
+ const handleMoreData = async () => {
+ if (!hasMore || isLoading) return null;
+
+ try {
+ const nextPage = activePage + 1;
+
+ const response = await apiGetJob({
+ page: `${nextPage}`,
+ search: isSearch,
+ });
+
+ if (response?.data && response.data.length > 0) {
+ setActivePage(nextPage);
+ setHasMore(response.data.length > 0);
+ return response.data;
+ } else {
+ setHasMore(false);
+ return null;
+ }
+ } catch (error) {
+ clientLogger.error("Error get job", error);
+ setHasMore(false);
+ return null;
+ }
+ };
-export default function Job_ViewBeranda({ listJob }: { listJob: MODEL_JOB[] }) {
return (
<>
-
+
+ {isShowUpdate && (
+ {
+ setIsShowUpdate(val);
+ setIsTriggerJob(val);
+ }}
+ onSetData={(val: any[]) => {
+ setData(val);
+ }}
+ />
+ )}
+
+ {/* */}
+
+
+
+ }
+ placeholder="Pekerjaan apa yang anda cari ni?"
+ onChange={(val) => {
+ onSearch(val.currentTarget.value);
+ }}
+ />
+
+ {/*
+
+ */}
+
+
+ {!data?.length && isLoading ? (
+
+ ) : _.isEmpty(data) ? (
+
+ ) : (
+ // --- Main component --- //
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={handleMoreData}
+ >
+ {(item) => }
+
+ )}
+
+
>
);
}
diff --git a/src/app_modules/job/main/layout.tsx b/src/app_modules/job/main/layout.tsx
index c417945d..62402962 100644
--- a/src/app_modules/job/main/layout.tsx
+++ b/src/app_modules/job/main/layout.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
@@ -11,7 +11,7 @@ import { useAtom } from "jotai";
import { useRouter } from "next/navigation";
import React, { useState } from "react";
import { gs_job_hot_menu } from "../global_state";
-import { RouterHome } from "@/app/lib/router_hipmi/router_home";
+import { RouterHome } from "@/lib/router_hipmi/router_home";
export default function LayoutJob_Main({
children,
diff --git a/src/app_modules/job/main/new_layout.tsx b/src/app_modules/job/main/new_layout.tsx
new file mode 100644
index 00000000..0c8d8c46
--- /dev/null
+++ b/src/app_modules/job/main/new_layout.tsx
@@ -0,0 +1,31 @@
+"use client";
+
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewFooter,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { RouterHome } from "@/lib/router_hipmi/router_home";
+import React from "react";
+import { NewFooter } from "../component/new_footer";
+
+export default function NewLayoutJob_Main({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+
+
+
+
+ {children}
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/job/main/status/draft.tsx b/src/app_modules/job/main/status/draft.tsx
index 7e869f70..e8115d43 100644
--- a/src/app_modules/job/main/status/draft.tsx
+++ b/src/app_modules/job/main/status/draft.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { Center, Loader } from "@mantine/core";
import _ from "lodash";
diff --git a/src/app_modules/job/main/status/publish.tsx b/src/app_modules/job/main/status/publish.tsx
index 8d639096..ae95154c 100644
--- a/src/app_modules/job/main/status/publish.tsx
+++ b/src/app_modules/job/main/status/publish.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { Center, Loader } from "@mantine/core";
import _ from "lodash";
@@ -8,43 +8,58 @@ import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
import ComponentJob_CardStatus from "../../component/card/card_view";
import job_getAllStatusPublish from "../../fun/get/status/get_list_publish";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetJobByStatus } from "../../lib/api_fetch_job";
-export default function Job_Publish({ listPublish }: { listPublish: any }) {
- const [data, setData] = useState(listPublish);
+export default function Job_Publish({ nameStatus }: { nameStatus: string }) {
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ // const response = await apiGetJobByStatus({ status: nameStatus });
+ // if (response.success) {
+ // console.log(response.data);
+ // }
+ } catch (error) {}
+ };
+
return (
<>
{_.isEmpty(data) ? (
) : (
- // --- Main component --- //
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await job_getAllStatusPublish({
- page: activePage + 1,
- });
+ "Publish"
+ // (
+ //
+ //
+ //
+ // )}
+ // data={data}
+ // setData={setData}
+ // moreData={async () => {
+ // const loadData = await job_getAllStatusPublish({
+ // page: activePage + 1,
+ // });
- setActivePage((val) => val + 1);
+ // setActivePage((val) => val + 1);
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
+ // return loadData;
+ // }}
+ // >
+ // {(item) => (
+ //
+ // )}
+ //
)}
>
);
diff --git a/src/app_modules/job/main/status/reject.tsx b/src/app_modules/job/main/status/reject.tsx
index 82f71c29..963cf2eb 100644
--- a/src/app_modules/job/main/status/reject.tsx
+++ b/src/app_modules/job/main/status/reject.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { Center, Loader } from "@mantine/core";
import _ from "lodash";
diff --git a/src/app_modules/job/main/status/review.tsx b/src/app_modules/job/main/status/review.tsx
index ec78378a..d3647ffc 100644
--- a/src/app_modules/job/main/status/review.tsx
+++ b/src/app_modules/job/main/status/review.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { Center, Loader } from "@mantine/core";
import _ from "lodash";
@@ -8,43 +8,58 @@ import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
import ComponentJob_CardStatus from "../../component/card/card_view";
import job_getAllStatusReview from "../../fun/get/status/get_list_review";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetJobByStatus } from "../../lib/api_fetch_job";
-export default function Job_Review({ listReview }: { listReview: any[] }) {
- const [data, setData] = useState(listReview);
+export default function Job_Review({ nameStatus }: { nameStatus: string }) {
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ // const response = await apiGetJobByStatus({ status: nameStatus });
+ // if (response.success) {
+ // console.log(response.data);
+ // }
+ } catch (error) {}
+ };
+
return (
<>
{_.isEmpty(data) ? (
) : (
- // --- Main component --- //
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await job_getAllStatusReview({
- page: activePage + 1,
- });
+ "Review"
+ // (
+ //
+ //
+ //
+ // )}
+ // data={data}
+ // setData={setData}
+ // moreData={async () => {
+ // const loadData = await job_getAllStatusReview({
+ // page: activePage + 1,
+ // });
- setActivePage((val) => val + 1);
+ // setActivePage((val) => val + 1);
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
+ // return loadData;
+ // }}
+ // >
+ // {(item) => (
+ //
+ // )}
+ //
)}
>
);
diff --git a/src/app_modules/job/main/status/ui_status.tsx b/src/app_modules/job/main/status/ui_status.tsx
new file mode 100644
index 00000000..4c6058f4
--- /dev/null
+++ b/src/app_modules/job/main/status/ui_status.tsx
@@ -0,0 +1,73 @@
+"use client";
+
+import { MainColor } from "@/app_modules/_global/color";
+import { globalStatusApp } from "@/app_modules/_global/lib";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
+import { Stack, Tabs } from "@mantine/core";
+import { useParams, useRouter } from "next/navigation";
+import Job_NewViewStatus from "./view_status";
+
+export default function Job_UiStatus() {
+ const router = useRouter();
+ const param = useParams<{ id: string }>();
+ const statusId = param.id;
+
+ // const [changeStatus, setChangeStatus] = useState(statusId);
+ // const [nameStatus, setNameStatus] = useState("");
+
+ // async function onChangeStatus({ statusId }: { statusId: string }) {
+ // router.replace(RouterJob.status({ id: statusId }));
+ // const cek = globalStatusApp.find((e) => e.id === statusId);
+
+ // setNameStatus(cek?.name);
+ // }
+
+ return (
+ <>
+ {
+ router.replace(RouterJob.status({ id: val }));
+ }}
+ styles={{
+ tabsList: {
+ backgroundColor: MainColor.darkblue,
+ position: "sticky",
+ top: 0,
+ zIndex: 99,
+ },
+ panel: {
+ paddingTop: 10,
+ },
+ }}
+ >
+
+
+ {globalStatusApp.map((e) => (
+
+ {e.name}
+
+ ))}
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/job/main/status/view_status.tsx b/src/app_modules/job/main/status/view_status.tsx
index 7506a219..6c290fd9 100644
--- a/src/app_modules/job/main/status/view_status.tsx
+++ b/src/app_modules/job/main/status/view_status.tsx
@@ -1,107 +1,104 @@
"use client";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
-import { AccentColor, MainColor } from "@/app_modules/_global/color";
-import { MODEL_NEW_DEFAULT_MASTER } from "@/app_modules/model_global/interface";
-import { Stack, Tabs } from "@mantine/core";
-import { useRouter } from "next/navigation";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { globalStatusApp } from "@/app_modules/_global/lib";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
+import { clientLogger } from "@/util/clientLogger";
+import { Center, Loader, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useParams } from "next/navigation";
import { useState } from "react";
-import Job_Draft from "./draft";
-import Job_Publish from "./publish";
-import Job_Reject from "./reject";
-import Job_Review from "./review";
+import { apiGetJobByStatus } from "../../lib/api_fetch_job";
+import ComponentJob_CardStatus from "../../component/card/card_view";
-export default function Job_ViewStatus({
- statusId,
- dataJob,
- listStatus,
-}: {
- statusId: string;
- dataJob: any[];
- listStatus: MODEL_NEW_DEFAULT_MASTER[];
-}) {
- const router = useRouter();
- const [changeStatus, setChangeStatus] = useState(statusId);
+export default function Job_NewViewStatus() {
+ const param = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [activePage, setActivePage] = useState(1);
- // const listTabs = [
- // {
- // id: 1,
- // path: ,
- // value: "Publish",
- // },
- // {
- // id: 2,
- // path: ,
- // value: "Review",
- // },
- // {
- // id: 3,
- // path: ,
- // value: "Draft",
- // },
- // {
- // id: 4,
- // path: ,
- // value: "Reject",
- // },
- // ];
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
- async function onChangeStatus({ statusId }: { statusId: string }) {
- router.replace(RouterJob.status({ id: statusId }));
- }
+ const handleLoadData = async () => {
+ try {
+ const cek = globalStatusApp.find((e) => e.id === param.id);
+ const response = await apiGetJobByStatus({
+ status: cek?.name,
+ page: `${activePage}`,
+ });
+ if (response.success) {
+ setData(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get job", error);
+ }
+ };
+
+ const hanldeMoreData = async () => {
+ try {
+ const cek = globalStatusApp.find((e) => e.id === param.id);
+ const nextPage = activePage + 1;
+ const response = await apiGetJobByStatus({
+ status: cek?.name,
+ page: `${nextPage}`,
+ });
+ if (response.success) {
+ setActivePage(nextPage);
+ return response.data;
+ }
+ } catch (error) {
+ clientLogger.error("Error get job", error);
+ }
+ };
+
+ if (!data)
+ return (
+ <>
+
+
+
+
+ >
+ );
return (
<>
- {
- setChangeStatus(val);
- onChangeStatus({ statusId: val });
- }}
- styles={{
- tabsList: {
- backgroundColor: MainColor.darkblue,
- position: "sticky",
- top: 0,
- zIndex: 99,
- },
- panel: {
- paddingTop: 10,
- },
- }}
- >
-
-
- {listStatus.map((e) => (
-
- {e.name}
-
- ))}
-
- {statusId === "1" && }
- {statusId === "2" && }
- {statusId === "3" && }
- {statusId === "4" && }
-
-
+ {_.isEmpty(data) ? (
+
+ ) : (
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={hanldeMoreData}
+ >
+ {(item) => (
+
+ )}
+
+ )}
>
);
}
diff --git a/src/app_modules/job/splash/ui_splash.tsx b/src/app_modules/job/splash/ui_splash.tsx
index bdb2ab6c..5129b278 100644
--- a/src/app_modules/job/splash/ui_splash.tsx
+++ b/src/app_modules/job/splash/ui_splash.tsx
@@ -5,7 +5,7 @@ import { useShallowEffect } from "@mantine/hooks";
import { IconBriefcase } from "@tabler/icons-react";
import { useAtom } from "jotai";
-import { RouterJob } from "@/app/lib/router_hipmi/router_job";
+import { RouterJob } from "@/lib/router_hipmi/router_job";
import { useRouter } from "next/navigation";
import { gs_job_hot_menu } from "../global_state";
diff --git a/src/app_modules/katalog/component/button_header_right.tsx b/src/app_modules/katalog/component/button_header_right.tsx
index 02e90181..9c53d7b3 100644
--- a/src/app_modules/katalog/component/button_header_right.tsx
+++ b/src/app_modules/katalog/component/button_header_right.tsx
@@ -11,10 +11,12 @@ export function ComponentKatalog_ButtonHeaderRight({
profileId,
userLoginId,
authorId,
+ userRoleId,
}: {
profileId: string;
userLoginId: string;
authorId: string;
+ userRoleId: string
}) {
const [opened, { open, close }] = useDisclosure();
@@ -33,6 +35,7 @@ export function ComponentKatalog_ButtonHeaderRight({
close={() => close()}
profileId={profileId}
userId={userLoginId}
+ userRoleId={userRoleId}
/>
>
);
diff --git a/src/app_modules/katalog/component/drawer_katalog.tsx b/src/app_modules/katalog/component/drawer_katalog.tsx
index 38be491d..2a75e292 100644
--- a/src/app_modules/katalog/component/drawer_katalog.tsx
+++ b/src/app_modules/katalog/component/drawer_katalog.tsx
@@ -1,7 +1,8 @@
+import { RouterAdminDashboard } from "@/lib/router_hipmi/router_admin";
import {
RouterPortofolio,
RouterProfile,
-} from "@/app/lib/router_hipmi/router_katalog";
+} from "@/lib/router_hipmi/router_katalog";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import Component_ButtonLogout from "@/app_modules/auth/logout/view";
@@ -14,6 +15,7 @@ import {
Text,
} from "@mantine/core";
import {
+ IconDashboard,
IconEdit,
IconPencilPlus,
IconPhotoEdit,
@@ -27,16 +29,19 @@ export function ComponentKatalog_DrawerKatalog({
opened,
close,
profileId,
- userId
+ userId,
+ userRoleId
}: {
opened: boolean;
close: () => void;
profileId: string;
userId: string
+ userRoleId: string
}) {
const router = useRouter();
const [pageId, setPageId] = useState("");
const [isLoading, setIsLoading] = useState(false);
+ const [isLoadingAdmin, setIsLoadingAdmin] = useState(false);
const listPage = [
{
@@ -125,6 +130,27 @@ export function ComponentKatalog_DrawerKatalog({
))}
+ {userRoleId != "1" && (
+
+ {
+ router.push(RouterAdminDashboard.main_admin, { scroll: false });
+ setIsLoadingAdmin(true);
+ }}
+ >
+ {isLoadingAdmin ? (
+
+ ) : (
+
+ )}
+
+
+ Dashboard Admin
+
+
+ )}
diff --git a/src/app_modules/katalog/component/drawer_katalog_new.tsx b/src/app_modules/katalog/component/drawer_katalog_new.tsx
new file mode 100644
index 00000000..d99487cd
--- /dev/null
+++ b/src/app_modules/katalog/component/drawer_katalog_new.tsx
@@ -0,0 +1,151 @@
+import { RouterAdminDashboard } from "@/lib/router_hipmi/router_admin";
+import {
+ RouterPortofolio,
+ RouterProfile,
+} from "@/lib/router_hipmi/router_katalog";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import {
+ gs_admin_navbar_menu,
+ gs_admin_navbar_subMenu,
+} from "@/app_modules/admin/_admin_global/new_global_state";
+import Component_ButtonLogout from "@/app_modules/auth/logout/view";
+import {
+ ActionIcon,
+ Drawer,
+ Group,
+ SimpleGrid,
+ Stack,
+ Text,
+} from "@mantine/core";
+import { IconDashboard } from "@tabler/icons-react";
+import {
+ IconEdit,
+ IconPencilPlus,
+ IconPhotoEdit,
+ IconPolaroid,
+ IconX,
+} from "@tabler/icons-react";
+import { useAtom } from "jotai";
+import { useParams, useRouter } from "next/navigation";
+
+export default function DrawerKatalogNew({
+ opened,
+ close,
+ userRoleId,
+ userId,
+}: {
+ opened: boolean;
+ close: () => void;
+ userRoleId: string;
+ userId: string;
+}) {
+ const param = useParams<{ id: string }>();
+ const router = useRouter();
+ const [activeId, setActiveId] = useAtom(gs_admin_navbar_menu);
+ const [activeChildId, setActiveChildId] = useAtom(gs_admin_navbar_subMenu);
+
+ const listPage = [
+ {
+ id: "1",
+ name: "Edit profile",
+ icon: ,
+ path: RouterProfile.edit + param.id,
+ },
+ {
+ id: "2",
+ name: "Ubah foto profile",
+ icon: ,
+ path: RouterProfile.update_foto_profile + param.id,
+ },
+ {
+ id: "3",
+ name: "Ubah latar belakang",
+ icon: ,
+ path: RouterProfile.update_foto_background + param.id,
+ },
+ {
+ id: "4",
+ name: "Tambah portofolio",
+ icon: ,
+ path: RouterPortofolio.create + param.id,
+ },
+ ];
+
+ return (
+ <>
+ close()}
+ position={"bottom"}
+ size={"auto"}
+ withCloseButton={false}
+ styles={{
+ content: {
+ padding: 0,
+ position: "absolute",
+ margin: "auto",
+ backgroundColor: "transparent",
+ left: 0,
+ right: 0,
+ width: 500,
+ },
+ body: {
+ backgroundColor: AccentColor.darkblue,
+ borderTop: `2px solid ${AccentColor.blue}`,
+ borderRight: `1px solid ${AccentColor.blue}`,
+ borderLeft: `1px solid ${AccentColor.blue}`,
+ borderRadius: "20px 20px 0px 0px",
+ color: MainColor.white,
+ paddingBottom: "5%",
+ },
+ }}
+ >
+
+
+
+
+
+
+
+ {listPage.map((e, i) => (
+ {
+ router.push(e.path, { scroll: false });
+ }}
+ >
+
+ {e.icon}
+
+
+ {e.name}
+
+
+ ))}
+
+
+ {userRoleId != "1" && userRoleId != "" && (
+
+ {
+ setActiveId("Main");
+ setActiveChildId("");
+ router.push(RouterAdminDashboard.main_admin, {
+ scroll: false,
+ });
+ }}
+ >
+
+
+
+ Dashboard Admin
+
+
+ )}
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/katalog/component/regular_expressions.ts b/src/app_modules/katalog/component/regular_expressions.ts
index 526ff127..e4e9d38b 100644
--- a/src/app_modules/katalog/component/regular_expressions.ts
+++ b/src/app_modules/katalog/component/regular_expressions.ts
@@ -1,2 +1,3 @@
export var validRegex =
/^([a-zA-Z0-9\.!#$%&'*+/=?^_`{|}~-]+)@([a-zA-Z0-9])+.([a-z]+)(.[a-z]+)?$/;
+export const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
\ No newline at end of file
diff --git a/src/app_modules/katalog/index.ts b/src/app_modules/katalog/index.ts
index 9892f2b6..165c1ec3 100644
--- a/src/app_modules/katalog/index.ts
+++ b/src/app_modules/katalog/index.ts
@@ -1,2 +1,4 @@
+import ViewKatalogNew from "./view_katalog_new";
export { Katalog_MainView } from "./view_katalog";
+export { ViewKatalogNew }
diff --git a/src/app_modules/katalog/main/index.ts b/src/app_modules/katalog/main/index.ts
index 793e49ee..127d7b75 100644
--- a/src/app_modules/katalog/main/index.ts
+++ b/src/app_modules/katalog/main/index.ts
@@ -1,3 +1,5 @@
import KatalogLayout from "./layout";
+import LayoutKatalogNew from "./layout_new";
export { KatalogLayout };
+export { LayoutKatalogNew }
diff --git a/src/app_modules/katalog/main/layout.tsx b/src/app_modules/katalog/main/layout.tsx
index 5ef20553..e84d845c 100644
--- a/src/app_modules/katalog/main/layout.tsx
+++ b/src/app_modules/katalog/main/layout.tsx
@@ -9,11 +9,13 @@ export default function KatalogLayout({
profileId,
userLoginId,
authorId,
+ userRoleId,
}: {
children: any;
profileId: any;
userLoginId: string;
authorId: string;
+ userRoleId: string
}) {
return (
<>
@@ -26,6 +28,7 @@ export default function KatalogLayout({
profileId={profileId}
userLoginId={userLoginId}
authorId={authorId as any}
+ userRoleId={userRoleId}
/>
}
/>
diff --git a/src/app_modules/katalog/main/layout_new.tsx b/src/app_modules/katalog/main/layout_new.tsx
new file mode 100644
index 00000000..a21833fa
--- /dev/null
+++ b/src/app_modules/katalog/main/layout_new.tsx
@@ -0,0 +1,87 @@
+"use client";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { apiGetUserProfile } from "@/app_modules/user";
+import { ActionIcon } from "@mantine/core";
+import { useDisclosure, useShallowEffect } from "@mantine/hooks";
+import { IconDotsVertical } from "@tabler/icons-react";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import DrawerKatalogNew from "../component/drawer_katalog_new";
+
+export default function LayoutKatalogNew({ children }: { children: any }) {
+ const param = useParams<{ id: string }>();
+ const [authorId, setAuthorId] = useState("");
+ const [userRoleId, setUserRoleId] = useState("");
+ const [opened, { open, close }] = useDisclosure();
+ const [loading, setLoading] = useState(true);
+ const [userLoginId, setUserLoginId] = useState("");
+
+ async function handleLoadDataUser() {
+ try {
+ setLoading(true);
+
+ const reponseUser = await apiNewGetUserIdByToken();
+ if (reponseUser.success) {
+ setUserLoginId(reponseUser.userId);
+ }
+
+ const response = await apiGetUserProfile(`?profile=${param.id}`);
+
+ if (response) {
+ setAuthorId(response.data.id);
+ setUserRoleId(response.data.masterUserRoleId);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ useShallowEffect(() => {
+ handleLoadDataUser();
+ }, []);
+
+ return (
+ <>
+
+
+
+
+
+ ) : authorId == userLoginId ? (
+ open()}
+ >
+
+
+ ) : (
+
+ )
+ }
+ />
+
+ {children}
+
+
+ close()}
+ userRoleId={userRoleId}
+ userId={userLoginId}
+ />
+ >
+ );
+}
diff --git a/src/app_modules/katalog/portofolio/component/api_fetch_portofolio.ts b/src/app_modules/katalog/portofolio/component/api_fetch_portofolio.ts
new file mode 100644
index 00000000..17da9eac
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/component/api_fetch_portofolio.ts
@@ -0,0 +1,166 @@
+export {
+ apiCreatePortofolio,
+ apiGetPortofolioById,
+ apiUpdatePortofolioById,
+ apiUpdateLogoPortofolioById,
+ apiUpdateMedsosPortofolioById,
+};
+
+const apiCreatePortofolio = async ({
+ profileId,
+ data,
+}: {
+ profileId: string;
+ data: any;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const res = await fetch(`/api/portofolio/${profileId}`, {
+ method: "POST",
+ body: JSON.stringify({ data }),
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await res.json().catch(() => null);
+};
+
+const apiGetPortofolioById = async ({ id }: { id: string }) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const res = await fetch(`/api/portofolio/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await res.json().catch(() => null);
+};
+
+const apiUpdatePortofolioById = async ({
+ id,
+ data,
+}: {
+ id: string;
+ data: any;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const respone = await fetch(`/api/portofolio/${id}`, {
+ method: "PUT",
+ body: JSON.stringify({ data }),
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!respone.ok) {
+ console.error("Failed to send logs:", respone.statusText);
+ return null;
+ }
+
+ return await respone.json();
+};
+
+const apiUpdateLogoPortofolioById = async ({
+ id,
+ data,
+}: {
+ id: string;
+ data: any;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ // Send PUT request to update portfolio logo
+ const response = await fetch(`/api/portofolio/logo/${id}`, {
+ method: "PUT",
+ body: JSON.stringify({ data }),
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to update portfolio logo:",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to update portfolio logo");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error updating portfolio logo:", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
+
+const apiUpdateMedsosPortofolioById = async ({
+ id,
+ data,
+}: {
+ id: string;
+ data: any;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ // Send PUT request to update portfolio logo
+ const response = await fetch(`/api/portofolio/medsos/${id}`, {
+ method: "PUT",
+ body: JSON.stringify({ data }),
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to update portfolio medsos:",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to update portfolio medsos"
+ );
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error updating portfolio medsos:", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
diff --git a/src/app_modules/katalog/portofolio/component/button/comp_button_edit_logo_bisnis.tsx b/src/app_modules/katalog/portofolio/component/button/comp_button_edit_logo_bisnis.tsx
index a5600ad7..2fef0d60 100644
--- a/src/app_modules/katalog/portofolio/component/button/comp_button_edit_logo_bisnis.tsx
+++ b/src/app_modules/katalog/portofolio/component/button/comp_button_edit_logo_bisnis.tsx
@@ -1,55 +1,93 @@
"use client";
-import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { MainColor } from "@/app_modules/_global/color";
import {
ComponentGlobal_NotifikasiBerhasil,
ComponentGlobal_NotifikasiGagal,
ComponentGlobal_NotifikasiPeringatan,
} from "@/app_modules/_global/notif_global";
-import { Button } from "@mantine/core";
+import { Box, Button } from "@mantine/core";
+import {
+ funGlobal_DeleteFileById,
+ funGlobal_UploadToStorage,
+} from "@/app_modules/_global/fun";
+import { DIRECTORY_ID } from "@/lib";
+import { clientLogger } from "@/util/clientLogger";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
-import { DIRECTORY_ID } from "@/app/lib";
-import { portofolio_funEditLogoBisnisById } from "../../fun";
+import { apiUpdateLogoPortofolioById } from "../api_fetch_portofolio";
export function ComponentPortofolio_ButtonEditLogoBisnis({
file,
portofolioId,
+ fileRemoveId,
}: {
file: File;
portofolioId: string;
+ fileRemoveId: string;
}) {
const router = useRouter();
const [loading, setLoading] = useState(false);
+
async function onUpdate() {
- const uploadFileToStorage = await funGlobal_UploadToStorage({
- file: file,
- dirId: DIRECTORY_ID.portofolio_logo,
- });
-
- if (!uploadFileToStorage.success)
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
-
- const res = await portofolio_funEditLogoBisnisById({
- portofolioId: portofolioId,
- logoId: uploadFileToStorage.data.id,
- });
- if (res.status === 200) {
+ try {
setLoading(true);
- ComponentGlobal_NotifikasiBerhasil(res.message);
+
+ const uploadFileToStorage = await funGlobal_UploadToStorage({
+ file: file,
+ dirId: DIRECTORY_ID.portofolio_logo,
+ });
+
+ if (!uploadFileToStorage.success) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ return;
+ }
+
+ const deleteLogo = await funGlobal_DeleteFileById({
+ fileId: fileRemoveId,
+ dirId: DIRECTORY_ID.portofolio_logo,
+ });
+
+ if (!deleteLogo.success) {
+ setLoading(false);
+ clientLogger.error("Error delete logo", deleteLogo.message);
+ }
+
+ const logoId = uploadFileToStorage.data.id;
+
+ const response = await apiUpdateLogoPortofolioById({
+ id: portofolioId,
+ data: logoId,
+ });
+
+ if (!response) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal("Gagal update logo");
+ return;
+ }
+
+ ComponentGlobal_NotifikasiBerhasil("Berhasil mengubah Logo Bisnis!");
router.back();
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error update logo", error);
}
}
+
return (
<>
- {file ? (
+
onUpdate()}
bg={MainColor.yellow}
@@ -57,16 +95,14 @@ export function ComponentPortofolio_ButtonEditLogoBisnis({
c={"black"}
style={{
transition: "0.5s",
- border: `1px solid ${AccentColor.yellow}`,
+ position: "absolute",
+ bottom: 20,
+ width: 300,
}}
>
Simpan
- ) : (
-
- Simpan
-
- )}
+
>
);
}
diff --git a/src/app_modules/katalog/portofolio/component/button/comp_button_selanjutnya.tsx b/src/app_modules/katalog/portofolio/component/button/comp_button_selanjutnya.tsx
index c7e3fcd5..8a6f4c50 100644
--- a/src/app_modules/katalog/portofolio/component/button/comp_button_selanjutnya.tsx
+++ b/src/app_modules/katalog/portofolio/component/button/comp_button_selanjutnya.tsx
@@ -1,4 +1,4 @@
-import { RouterMap } from "@/app/lib/router_hipmi/router_map";
+import { RouterMap } from "@/lib/router_hipmi/router_map";
import { MainColor } from "@/app_modules/_global/color";
import {
ComponentGlobal_NotifikasiBerhasil,
@@ -9,67 +9,138 @@ import { MODEL_PORTOFOLIO_OLD } from "@/app_modules/model_global/portofolio";
import { Button } from "@mantine/core";
import _ from "lodash";
+import { DIRECTORY_ID } from "@/lib";
+import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
+import { clientLogger } from "@/util/clientLogger";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import funCreatePortofolio from "../../fun/fun_create_portofolio";
-import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
-import { DIRECTORY_ID } from "@/app/lib";
+import { apiCreatePortofolio } from "../api_fetch_portofolio";
+
+
+type SubBidang = {
+ id: string;
+};
+interface ICreatePortofolio {
+ namaBisnis: string;
+ masterBidangBisnisId: string;
+ alamatKantor: string;
+ tlpn: string;
+ deskripsi: string;
+ fileId: string;
+ facebook: string;
+ twitter: string;
+ instagram: string;
+ tiktok: string;
+ youtube: string;
+ subBidang: SubBidang[];
+}
+
+
export function Portofolio_ComponentButtonSelanjutnya({
profileId,
dataPortofolio,
- file,
dataMedsos,
+ file,
+ listSubBidangSelected,
}: {
profileId: string;
dataPortofolio: MODEL_PORTOFOLIO_OLD;
- file: File;
dataMedsos: any;
+ file: File;
+ listSubBidangSelected?: SubBidang[];
}) {
const router = useRouter();
const [loading, setLoading] = useState(false);
- async function onSubmit() {
- const porto = {
+ const validateData = () => {
+ if (_.includes(_.values(dataPortofolio), "")) {
+ ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
+ return false;
+ }
+
+ if (dataPortofolio.tlpn.length < 10) {
+ ComponentGlobal_NotifikasiPeringatan("Nomor telepon minimal 10 angka");
+ return false;
+ }
+
+ return true;
+ };
+
+ const handleCreatePortofolio = async (fileId: string) => {
+ const newData: ICreatePortofolio = {
namaBisnis: dataPortofolio.namaBisnis,
masterBidangBisnisId: dataPortofolio.masterBidangBisnisId,
+ // masterSubBidangBisnisId: dataPortofolio.masterSubBidangBisnisId as string,
alamatKantor: dataPortofolio.alamatKantor,
tlpn: dataPortofolio.tlpn,
deskripsi: dataPortofolio.deskripsi,
+ facebook: dataMedsos.facebook,
+ twitter: dataMedsos.twitter,
+ instagram: dataMedsos.instagram,
+ tiktok: dataMedsos.tiktok,
+ youtube: dataMedsos.youtube,
+ fileId: fileId,
+ subBidang: listSubBidangSelected || []
};
- if (_.values(porto).includes(""))
- return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
-
- const uploadFileToStorage = await funGlobal_UploadToStorage({
- file: file,
- dirId: DIRECTORY_ID.portofolio_logo,
- });
-
- if (!uploadFileToStorage.success)
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
-
- const res = await funCreatePortofolio({
+ const response = await apiCreatePortofolio({
profileId: profileId,
- data: dataPortofolio as any,
- medsos: dataMedsos,
- fileId: uploadFileToStorage.data.id,
+ data: newData,
});
- if (res.status === 201) {
- setLoading(true);
+
+ if (response.success) {
ComponentGlobal_NotifikasiBerhasil("Berhasil disimpan");
- router.replace(RouterMap.create + res.id, { scroll: false });
+ router.replace(RouterMap.create + response.data.id, { scroll: false });
} else {
- ComponentGlobal_NotifikasiGagal("Gagal disimpan");
+ setLoading(false);
+ throw new Error("Failed to create portfolio");
}
- }
+ };
+
+ const onSubmit = async () => {
+ if (!validateData()) return;
+
+ try {
+ setLoading(true);
+
+
+ const uploadFile = await funGlobal_UploadToStorage({
+ file: file,
+ dirId: DIRECTORY_ID.portofolio_logo,
+ });
+
+ if (!uploadFile.success) {
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ return;
+ }
+
+ await handleCreatePortofolio(uploadFile.data.id);
+ } catch (error) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal("Gagal disimpan");
+ console.error("Error create portofolio", error);
+ }
+ };
+
return (
<>
+ {/*
+ {JSON.stringify(dataPortofolio, null, 2)}
+
+
+ {JSON.stringify(listSubBidangSelected, null, 2)}
+ */}
+
!item.id)
+ }
mt={"md"}
radius={50}
- loading={loading ? true : false}
+ loading={loading}
loaderPosition="center"
onClick={() => {
onSubmit();
diff --git a/src/app_modules/katalog/portofolio/component/button_delete_new.tsx b/src/app_modules/katalog/portofolio/component/button_delete_new.tsx
new file mode 100644
index 00000000..2b0f3a4c
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/component/button_delete_new.tsx
@@ -0,0 +1,101 @@
+import { MainColor } from "@/app_modules/_global/color";
+import {
+ ComponentGlobal_NotifikasiBerhasil,
+ ComponentGlobal_NotifikasiGagal,
+} from "@/app_modules/_global/notif_global";
+import { UIGlobal_Modal } from "@/app_modules/_global/ui";
+import { clientLogger } from "@/util/clientLogger";
+import { Button } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconTrash } from "@tabler/icons-react";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import {
+ apiDeletePortofolio,
+ apiGetOnePortofolioById,
+} from "../lib/api_portofolio";
+import { IDetailPortofolioBisnis } from "../lib/type_portofolio";
+
+export default function ComponentPortofolio_ButtonDeleteNew({
+ userLoginId,
+}: {
+ userLoginId: string;
+}) {
+ const param = useParams<{ id: string }>();
+ const [openModal, setModal] = useState(false);
+ const [loadingDel, setLoadingDel] = useState(false);
+ const [dataPorto, setDataPorto] = useState();
+ const router = useRouter();
+
+ async function onDelete() {
+ try {
+ setLoadingDel(true);
+ const response = await apiDeletePortofolio(param.id);
+ if (response) {
+ ComponentGlobal_NotifikasiBerhasil(response.message);
+ router.back();
+ } else {
+ setLoadingDel(false);
+ ComponentGlobal_NotifikasiGagal(response?.message);
+ }
+ } catch (error) {
+ setLoadingDel(false);
+ clientLogger.error("Error delete portofolio", error);
+ ComponentGlobal_NotifikasiGagal("Gagal menghapus portofolio");
+ }
+ }
+
+ async function funGetPortofolio() {
+ try {
+ const response = await apiGetOnePortofolioById(param.id, "bisnis");
+ if (response) {
+ setDataPorto(response.data);
+ }
+ } catch (error) {
+ console.error("Error get data button delete:", error);
+ }
+ }
+
+ useShallowEffect(() => {
+ funGetPortofolio();
+ }, []);
+
+ return (
+ <>
+ {userLoginId === dataPorto?.authorId && (
+ {
+ setModal(true);
+ }}
+ >
+
+
+ )}
+
+ setModal(false)}
+ buttonKiri={
+ setModal(false)}>
+ Batal
+
+ }
+ buttonKanan={
+ onDelete()}
+ >
+ Hapus
+
+ }
+ />
+ >
+ );
+}
diff --git a/src/app_modules/katalog/portofolio/component/button_more.tsx b/src/app_modules/katalog/portofolio/component/button_more.tsx
index 766b2482..f55e06f8 100644
--- a/src/app_modules/katalog/portofolio/component/button_more.tsx
+++ b/src/app_modules/katalog/portofolio/component/button_more.tsx
@@ -1,7 +1,7 @@
"use client";
-import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog";
-import { RouterMap } from "@/app/lib/router_hipmi/router_map";
+import { RouterPortofolio } from "@/lib/router_hipmi/router_katalog";
+import { RouterMap } from "@/lib/router_hipmi/router_map";
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
import { ActionIcon } from "@mantine/core";
import {
diff --git a/src/app_modules/katalog/portofolio/component/button_more_new.tsx b/src/app_modules/katalog/portofolio/component/button_more_new.tsx
new file mode 100644
index 00000000..dd641880
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/component/button_more_new.tsx
@@ -0,0 +1,136 @@
+import { RouterPortofolio } from "@/lib/router_hipmi/router_katalog";
+import { RouterMap } from "@/lib/router_hipmi/router_map";
+import { UIGlobal_Drawer } from "@/app_modules/_global/ui";
+import { ActionIcon } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import {
+ IconEdit,
+ IconPhotoEdit,
+ IconId,
+ IconMapPin2,
+ IconMapPin,
+ IconDotsVertical,
+} from "@tabler/icons-react";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { apiGetOnePortofolioById } from "../lib/api_portofolio";
+import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import { MainColor } from "@/app_modules/_global/color";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+
+export default function ComponentPortofolio_ButtonMoreNew({
+ userLoginId,
+}: {
+ userLoginId: string;
+}) {
+ const param = useParams<{ id: string }>();
+ const [authorId, setAuthorId] = useState("");
+ const [mapId, setMapId] = useState(true);
+ const [openDrawer, setOpenDrawer] = useState(false);
+
+ const listPage = [
+ {
+ id: "1",
+ name: "Edit detail ",
+ icon: ,
+ path: RouterPortofolio.edit_data_bisnis + `${param.id}`,
+ },
+ {
+ id: "2",
+ name: "Edit logo ",
+ icon: ,
+ path: RouterPortofolio.edit_logo_bisnis + `${param.id}`,
+ },
+ {
+ id: "3",
+ name: "Edit sosial media",
+ icon: ,
+ path: RouterPortofolio.edit_medsos_bisnis + `${param.id}`,
+ },
+ {
+ id: "4",
+ name: "Edit data map",
+ icon: ,
+ path: RouterMap.edit + `${param.id}`,
+ },
+ {
+ id: "5",
+ name: "Custom pin map",
+ icon: ,
+ path: RouterMap.custom_pin + `${param.id}`,
+ },
+ ];
+
+ const listPage2 = [
+ {
+ id: "1",
+ name: "Edit detail ",
+ icon: ,
+ path: RouterPortofolio.edit_data_bisnis + `${param.id}`,
+ },
+ {
+ id: "2",
+ name: "Edit logo ",
+ icon: ,
+ path: RouterPortofolio.edit_logo_bisnis + `${param.id}`,
+ },
+ {
+ id: "3",
+ name: "Edit sosial media",
+ icon: ,
+ path: RouterPortofolio.edit_medsos_bisnis + `${param.id}`,
+ },
+ {
+ id: "4",
+ name: "Edit data map",
+ icon: ,
+ path: RouterMap.create + `${param.id}`,
+ },
+ {
+ id: "5",
+ name: "Custom pin map",
+ icon: ,
+ path: RouterMap.custom_pin + `${param.id}`,
+ },
+ ];
+
+ async function funGetPortofolio() {
+ try {
+ const response = await apiGetOnePortofolioById(param.id, "bisnis");
+ const response3 = await apiGetOnePortofolioById(param.id, "lokasi");
+
+ if (response) {
+ setAuthorId(response.data.authorId);
+ setMapId(
+ response3 !== null && response3.data?.mapId !== undefined
+ ? true
+ : false
+ );
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+
+ useShallowEffect(() => {
+ funGetPortofolio();
+ }, []);
+
+ return (
+ <>
+ {userLoginId === authorId ? (
+ setOpenDrawer(true)}>
+
+
+ ) : (
+
+ )}
+
+ setOpenDrawer(false)}
+ component={mapId ? listPage : listPage2}
+ />
+ >
+ );
+}
diff --git a/src/app_modules/katalog/portofolio/component/card_view_daftar.tsx b/src/app_modules/katalog/portofolio/component/card_view_daftar.tsx
index 671b0ee6..a7aaf240 100644
--- a/src/app_modules/katalog/portofolio/component/card_view_daftar.tsx
+++ b/src/app_modules/katalog/portofolio/component/card_view_daftar.tsx
@@ -5,7 +5,7 @@ import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { IconCaretRight } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog";
+import { RouterPortofolio } from "@/lib/router_hipmi/router_katalog";
export function ComponentPortofolio_DaftarBoxView({
data,
@@ -34,7 +34,7 @@ export function ComponentPortofolio_DaftarBoxView({
>
-
+
{data?.namaBisnis}
@@ -43,11 +43,16 @@ export function ComponentPortofolio_DaftarBoxView({
- {isLoading ? (
+ {/* PAKE LOADING */}
+ {/* {isLoading ? (
) : (
- )}
+ )} */}
+
+
+ {/* GA PAKE LOADING */}
+
diff --git a/src/app_modules/katalog/portofolio/component/skeleton_view.tsx b/src/app_modules/katalog/portofolio/component/skeleton_view.tsx
new file mode 100644
index 00000000..387f7a90
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/component/skeleton_view.tsx
@@ -0,0 +1,28 @@
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Stack } from "@mantine/core";
+
+export { Portofolio_SkeletonEditDataBisnis, Portofolio_SkeletonEditLogoBisnis };
+
+function Portofolio_SkeletonEditDataBisnis() {
+ return (
+ <>
+
+ {Array.from({ length: 4 }).map((_, i) => (
+
+ ))}
+
+
+
+ >
+ );
+}
+
+function Portofolio_SkeletonEditLogoBisnis() {
+ return (
+ <>
+
+
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/katalog/portofolio/create/layout.tsx b/src/app_modules/katalog/portofolio/create/layout.tsx
index c9054145..5f640732 100644
--- a/src/app_modules/katalog/portofolio/create/layout.tsx
+++ b/src/app_modules/katalog/portofolio/create/layout.tsx
@@ -1,22 +1,24 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
export default function CreatePortofolioLayout({
children,
- profileId,
}: {
children: any;
- profileId: any;
}) {
return (
<>
- }
- >
- {children}
-
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/katalog/portofolio/create/new_create.tsx b/src/app_modules/katalog/portofolio/create/new_create.tsx
new file mode 100644
index 00000000..37ee476b
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/create/new_create.tsx
@@ -0,0 +1,503 @@
+"use client";
+
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import {
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
+} from "@/app_modules/_global/component";
+import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
+import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import { apiGetMasterBidangBisnis } from "@/app_modules/_global/lib/api_fetch_master";
+import { ISUB_BIDANG_BISNIS } from "@/app_modules/model_global/portofolio";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ AspectRatio,
+ Box,
+ Button,
+ Center,
+ Group,
+ Image,
+ Select,
+ Stack,
+ Styles,
+ Text,
+ TextInput,
+ Textarea,
+} from "@mantine/core";
+import { BaseSelectStylesNames } from "@mantine/core/lib/Select/types";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconMinus, IconPhoto, IconPlus } from "@tabler/icons-react";
+import _ from "lodash";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { PhoneInput } from "react-international-phone";
+import "react-international-phone/style.css";
+import { Portofolio_ComponentButtonSelanjutnya } from "../component";
+import { apiGetSubBidangBisnis } from "../lib/api_portofolio";
+import { MODEL_PORTOFOLIO_BIDANG_BISNIS } from "../model/interface";
+
+
+export default function Portofolio_V3_Create() {
+ const params = useParams<{ id: string }>();
+ const profileId = params.id;
+
+ const [dataPortofolio, setDataPortofolio] = useState({
+ namaBisnis: "",
+ masterBidangBisnisId: "",
+ // masterSubBidangBisnisId: "",
+ alamatKantor: "",
+ tlpn: "",
+ deskripsi: "",
+ });
+
+ const [dataMedsos, setDataMedsos] = useState({
+ facebook: "",
+ twitter: "",
+ instagram: "",
+ youtube: "",
+ tiktok: "",
+ });
+
+ const [file, setFile] = useState(null);
+ const [img, setImg] = useState(null);
+ const [listBidangBisnis, setListBidangBisnis] = useState<
+ MODEL_PORTOFOLIO_BIDANG_BISNIS[] | null
+ >(null);
+
+ const [listSubBidang, setListSubBidang] = useState<
+ ISUB_BIDANG_BISNIS[] | null
+ >(null);
+
+ const [selectedSubBidang, setSelectedSubBidang] = useState<
+ ISUB_BIDANG_BISNIS[] | null
+ >(null);
+ const [listSubBidangSelected, setListSubBidangSelected] = useState([
+ {
+ id: "",
+ },
+ ]);
+
+ useShallowEffect(() => {
+ onLoadMasterBidangBisnis();
+ onLoadMasterSubBidangBisnis();
+ }, []);
+
+ async function onLoadMasterBidangBisnis() {
+ try {
+ const respone = await apiGetMasterBidangBisnis();
+
+ if (respone.success) {
+ setListBidangBisnis(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error on load master bidang bisnis", error);
+ }
+ }
+
+ async function onLoadMasterSubBidangBisnis() {
+ try {
+ const response = await apiGetSubBidangBisnis({});
+
+ if (response.success) {
+ setListSubBidang(response.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error on load master sub bidang bisnis", error);
+ }
+ }
+
+ const handlerSelectedSubBidang = ({ id }: { id: string }) => {
+ const selectedList = listSubBidang?.filter(
+ (item) => item.masterBidangBisnisId === id
+ );
+ setSelectedSubBidang(selectedList as ISUB_BIDANG_BISNIS[]);
+ };
+
+ const baseStyles: Styles> = {
+ label: {
+ color: MainColor.white,
+ },
+ input: {
+ backgroundColor: MainColor.white,
+ },
+ };
+
+ return (
+ <>
+
+
+
+
+ {
+ setDataPortofolio({
+ ...dataPortofolio,
+ namaBisnis: _.startCase(val.target.value),
+ });
+ }}
+ />
+
+ ({
+ value: e.id,
+ label: e.name,
+ }))}
+ onChange={(val: any) => {
+ const isSameBidang = dataPortofolio.masterBidangBisnisId === val;
+
+ // Update data portofolio
+ setDataPortofolio({
+ ...dataPortofolio,
+ masterBidangBisnisId: val,
+ });
+
+ // Jika berbeda bidang, reset sub bidang ke satu input kosong
+ if (!isSameBidang) {
+ setListSubBidangSelected([{ id: "" }]);
+ }
+
+ // Panggil handler sub bidang berdasarkan bidang bisnis terpilih
+ handlerSelectedSubBidang({ id: val });
+ }}
+ />
+
+
+ {listSubBidangSelected.map((e, index) => (
+
+ {
+ const selectedValues = listSubBidangSelected.map(
+ (s) => s.id
+ );
+ return (
+ option.id === e.id || // biarkan tetap muncul kalau ini valuenya sendiri
+ !selectedValues.includes(option.id)
+ );
+ })
+ .map((e: any) => ({
+ value: e.id,
+ label: e.name,
+ }))}
+ value={e.id}
+ onChange={(val) => {
+ const list = _.clone(listSubBidangSelected);
+ list[index].id = val as any;
+ setListSubBidangSelected(list);
+ }}
+ error={
+ listSubBidangSelected.length > 1 && !e.id
+ ? "Wajib dipilih / kurangi list"
+ : undefined
+ }
+ />
+
+ ))}
+
+
+
+ }
+ onClick={() => {
+ setListSubBidangSelected([
+ ...listSubBidangSelected,
+ { id: "" },
+ ]);
+ }}
+ compact
+ bg={MainColor.yellow}
+ color="yellow"
+ c="black"
+ >
+ Tambah List
+
+
+ }
+ onClick={() => {
+ setListSubBidangSelected(listSubBidangSelected.slice(0, -1));
+ }}
+ compact
+ bg={MainColor.yellow}
+ color="yellow"
+ c="black"
+ >
+ Kurangi List
+
+
+
+ {/*
+ {JSON.stringify(dataPortofolio, null, 2)}
+
+
+ {JSON.stringify(listSubBidangSelected, null, 2)}
+ */}
+
+ {/* ({
+ value: e.id,
+ label: e.name,
+ }))}
+ onChange={(val) => {
+ setDataPortofolio({
+ ...dataPortofolio,
+ masterSubBidangBisnisId: val as any,
+ });
+ }}
+ /> */}
+
+ {
+ setDataPortofolio({
+ ...dataPortofolio,
+ alamatKantor: val.target.value,
+ });
+ }}
+ />
+
+
+
+ Nomor Telepon{" "}
+
+ *
+
+
+
+ {
+ const valPhone = val.substring(1);
+ setDataPortofolio({
+ ...dataPortofolio,
+
+ tlpn: valPhone,
+ });
+ }}
+ />
+
+
+
+ {
+ setDataPortofolio({
+ ...dataPortofolio,
+ deskripsi: val.target.value,
+ });
+ }}
+ />
+
+
+
+
+
+
+
+ {img ? (
+
+
+
+ ) : (
+
+
+
+ )}
+
+
+
+
+
+
+
+
+
+ {
+ setDataMedsos({
+ ...dataMedsos,
+ facebook: val.target.value,
+ });
+ }}
+ />
+ {
+ setDataMedsos({
+ ...dataMedsos,
+ instagram: val.target.value,
+ });
+ }}
+ />
+ {
+ setDataMedsos({
+ ...dataMedsos,
+ tiktok: val.target.value,
+ });
+ }}
+ />
+ {
+ setDataMedsos({
+ ...dataMedsos,
+ twitter: val.target.value,
+ });
+ }}
+ />
+ {
+ setDataMedsos({
+ ...dataMedsos,
+ youtube: val.target.value,
+ });
+ }}
+ />
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/katalog/portofolio/create/view.tsx b/src/app_modules/katalog/portofolio/create/view.tsx
index 97b009ab..2587979c 100644
--- a/src/app_modules/katalog/portofolio/create/view.tsx
+++ b/src/app_modules/katalog/portofolio/create/view.tsx
@@ -1,9 +1,20 @@
"use client";
+import { DIRECTORY_ID } from "@/lib";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
-import { ComponentGlobal_BoxUploadImage } from "@/app_modules/_global/component";
+import {
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
+} from "@/app_modules/_global/component";
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import {
+ funGlobal_DeleteFileById,
+ funGlobal_UploadToStorage,
+} from "@/app_modules/_global/fun";
+import { MAX_SIZE } from "@/app_modules/_global/lib";
+import { maxInputLength, PemberitahuanMaksimalFile } from "@/app_modules/_global/lib/maximal_setting";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
import { BIDANG_BISNIS_OLD } from "@/app_modules/model_global/portofolio";
import {
AspectRatio,
@@ -18,18 +29,22 @@ import {
Textarea,
Title,
} from "@mantine/core";
-import { IconCamera } from "@tabler/icons-react";
+import { IconCamera, IconPhoto } from "@tabler/icons-react";
import _ from "lodash";
import { useState } from "react";
+import { PhoneInput } from "react-international-phone";
+import "react-international-phone/style.css";
import { Portofolio_ComponentButtonSelanjutnya } from "../component";
+import { useParams } from "next/navigation";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetMasterBidangBisnis } from "@/app_modules/_global/lib/api_fetch_master";
+import { MODEL_PORTOFOLIO_BIDANG_BISNIS } from "../model/interface";
+import { clientLogger } from "@/util/clientLogger";
+
+export default function CreatePortofolio() {
+ const params = useParams<{ id: string }>();
+ const profileId = params.id;
-export default function CreatePortofolio({
- bidangBisnis,
- profileId,
-}: {
- bidangBisnis: BIDANG_BISNIS_OLD;
- profileId: any;
-}) {
const [dataPortofolio, setDataPortofolio] = useState({
namaBisnis: "",
masterBidangBisnisId: "",
@@ -46,20 +61,44 @@ export default function CreatePortofolio({
tiktok: "",
});
- const [file, setFile] = useState(null);
+ const [file, setFile] = useState(null);
const [img, setImg] = useState(null);
+ const [imageId, setImageId] = useState("");
+ const [listBidangBisnis, setListBidangBisnis] = useState<
+ MODEL_PORTOFOLIO_BIDANG_BISNIS[] | null
+ >(null);
+
+ useShallowEffect(() => {
+ onLoadMaster();
+ }, []);
+
+ async function onLoadMaster() {
+ try {
+ const respone = await apiGetMasterBidangBisnis();
+
+ if (respone.success) {
+ setListBidangBisnis(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error on load master bidang bisnis", error);
+ }
+ }
return (
<>
- {/* {JSON.stringify(profileId)} */}
-
-
+
+
({
+ placeholder={
+ listBidangBisnis ? "Pilih bidang bisnis" : "Loading..."
+ }
+ data={_.map(listBidangBisnis as any).map((e: any) => ({
value: e.id,
label: e.name,
}))}
@@ -93,10 +144,17 @@ export default function CreatePortofolio({
});
}}
/>
+
- {
- setDataPortofolio({
- ...dataPortofolio,
- tlpn: val.target.value,
- });
- }}
- />
+
+
+
+ Nomor Telepon{" "}
+
+ *
+
+
+
+ {
+ const valPhone = val.substring(1);
+ setDataPortofolio({
+ ...dataPortofolio,
+
+ tlpn: valPhone,
+ });
+ }}
+ />
+
+
-
+
{img ? (
@@ -169,23 +245,81 @@ export default function CreatePortofolio({
) : (
- Upload Logo Bisnis
-
- Masukan logo bisnis anda untuk ditampilkan dalam portofolio
-
+
)}
+
+
+
+ {/*
{
try {
const buffer = URL.createObjectURL(
new Blob([new Uint8Array(await files.arrayBuffer())])
);
- setImg(buffer);
- setFile(files);
+
+ if (files.size > MAX_SIZE) {
+ setImg(null);
+ ComponentGlobal_NotifikasiPeringatan(
+ PemberitahuanMaksimalFile
+ );
+
+ return;
+ }
+
+ // if (files.size > MAX_SIZE) {
+ // setImg(null);
+ // setFile(null);
+ // ComponentGlobal_NotifikasiPeringatan(
+ // PemberitahuanMaksimalFile
+ // );
+ // } else {
+ // setImg(buffer);
+ // setFile(files);
+ // }
+
+ if (imageId != "") {
+ const deletePhoto = await funGlobal_DeleteFileById({
+ fileId: imageId,
+ });
+
+ if (deletePhoto.success) {
+ setImageId("");
+
+ const uploadPhoto = await funGlobal_UploadToStorage({
+ file: files,
+ dirId: DIRECTORY_ID.portofolio_logo,
+ });
+
+ if (uploadPhoto.success) {
+ setImageId(uploadPhoto.data.id);
+ setImg(buffer);
+ } else {
+ ComponentGlobal_NotifikasiPeringatan(
+ "Gagal upload foto"
+ );
+ }
+ }
+ } else {
+ const uploadPhoto = await funGlobal_UploadToStorage({
+ file: files,
+ dirId: DIRECTORY_ID.portofolio_logo,
+ });
+
+ if (uploadPhoto.success) {
+ setImageId(uploadPhoto.data.id);
+ setImg(buffer);
+ } else {
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload foto");
+ }
+ }
} catch (error) {
console.log(error);
}
@@ -205,7 +339,7 @@ export default function CreatePortofolio({
)}
-
+ */}
@@ -213,7 +347,10 @@ export default function CreatePortofolio({
-
- {/* {JSON.stringify(bidangBisnis, null, 2)} */}
>
);
}
diff --git a/src/app_modules/katalog/portofolio/edit/data/layout.tsx b/src/app_modules/katalog/portofolio/edit/data/layout.tsx
index 1452efc1..e5c9f194 100644
--- a/src/app_modules/katalog/portofolio/edit/data/layout.tsx
+++ b/src/app_modules/katalog/portofolio/edit/data/layout.tsx
@@ -1,10 +1,12 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
-
export default function LayoutPortofolio_EditDataBisnis({
children,
}: {
@@ -12,11 +14,19 @@ export default function LayoutPortofolio_EditDataBisnis({
}) {
return (
<>
- }
>
{children}
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/katalog/portofolio/edit/data/ui_edit_data.tsx b/src/app_modules/katalog/portofolio/edit/data/ui_edit_data.tsx
index b5bfb78f..a13f0674 100644
--- a/src/app_modules/katalog/portofolio/edit/data/ui_edit_data.tsx
+++ b/src/app_modules/katalog/portofolio/edit/data/ui_edit_data.tsx
@@ -1,60 +1,179 @@
"use client";
-import {
- MainColor
-} from "@/app_modules/_global/color/color_pallet";
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import { apiGetMasterBidangBisnis } from "@/app_modules/_global/lib/api_fetch_master";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import { Button, Select, Stack, TextInput, Textarea } from "@mantine/core";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ Button,
+ Select,
+ Stack,
+ Text,
+ TextInput,
+ Textarea,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
-import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
-import { Portofolio_funEditDataBisnis } from "../../fun/edit/fun_edit_data_bisnis_by_id";
+import { PhoneInput } from "react-international-phone";
+import {
+ apiGetPortofolioById,
+ apiUpdatePortofolioById,
+} from "../../component/api_fetch_portofolio";
+import { Portofolio_SkeletonEditDataBisnis } from "../../component/skeleton_view";
import {
MODEL_PORTOFOLIO,
MODEL_PORTOFOLIO_BIDANG_BISNIS,
} from "../../model/interface";
-export default function Portofolio_EditDataBisnis({
- dataPorto,
- listBidang,
-}: {
- dataPorto: MODEL_PORTOFOLIO;
- listBidang: MODEL_PORTOFOLIO_BIDANG_BISNIS[];
-}) {
+interface IUpdatePortofoli {
+ namaBisnis: string;
+ alamatKantor: string;
+ tlpn: string;
+ deskripsi: string;
+ masterBidangBisnisId: string;
+}
+
+export default function Portofolio_EditDataBisnis() {
const router = useRouter();
- const [value, setValue] = useState(dataPorto);
const [loading, setLoading] = useState(false);
+ const params = useParams<{ id: string }>();
+ const portofolioId = params.id;
+ const [data, setData] = useState(null);
+ const [listBidang, setListBidang] = useState<
+ MODEL_PORTOFOLIO_BIDANG_BISNIS[]
+ >([]);
+
+ useShallowEffect(() => {
+ onLoadBidang();
+ onLoadData();
+ }, []);
+
+ const onLoadData = async () => {
+ try {
+ const respone = await apiGetPortofolioById({
+ id: portofolioId,
+ });
+
+ if (respone.success) {
+ setData(respone.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data portofolio", error);
+ }
+ };
+
+ const onLoadBidang = async () => {
+ try {
+ const respone = await apiGetMasterBidangBisnis();
+ if (respone.success) {
+ setListBidang(respone.data);
+ } else {
+ setListBidang([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data master bidang bisnis", error);
+ }
+ };
+
+ const validateData = async (data: any) => {
+ if (_.values(data).includes("")) {
+ // VALIDASI NOMOR TELEPON
+ return "Lengkapi data";
+ }
+
+ if (data?.tlpn.length < 8) {
+ return "Nomor telepon minimal 8 digit";
+ }
+ };
+
+ const hanldeUpadteData = async (data: any) => {
+ try {
+ const newData: IUpdatePortofoli = {
+ namaBisnis: data?.namaBisnis,
+ alamatKantor: data?.alamatKantor,
+ tlpn: data?.tlpn,
+ deskripsi: data?.deskripsi,
+ masterBidangBisnisId: data?.MasterBidangBisnis.id,
+ };
+
+ const respone = await apiUpdatePortofolioById({
+ data: newData,
+ id: portofolioId,
+ });
+
+ return respone;
+ } catch (error) {
+ console.error("Error update data portofolio", error);
+ return null;
+ }
+ };
+
+ const submitUpdate = async () => {
+ const validate = await validateData(data);
+ if (validate) {
+ ComponentGlobal_NotifikasiPeringatan(validate);
+ return;
+ }
+
+ try {
+ setLoading(true);
+ const updateData = await hanldeUpadteData(data);
+
+ if (updateData.success) {
+ ComponentGlobal_NotifikasiBerhasil(updateData.message);
+ router.back();
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(updateData.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error update data portofolio", error);
+ }
+ };
+
+ if (!data) return ;
+
return (
<>
- {/* {JSON.stringify(porto, null, 2)} */}
) : (
""
)
}
onChange={(val) => {
- setValue({
- ...value,
+ setData({
+ ...data,
namaBisnis: val.target.value,
});
}}
@@ -62,11 +181,17 @@ export default function Portofolio_EditDataBisnis({
({
@@ -74,8 +199,8 @@ export default function Portofolio_EditDataBisnis({
label: e.name,
}))}
onChange={(val) => {
- setValue({
- ...(value as any),
+ setData({
+ ...(data as any),
MasterBidangBisnis: {
id: val,
},
@@ -85,96 +210,145 @@ export default function Portofolio_EditDataBisnis({
) : (
""
)
}
onChange={(val) => {
- setValue({
- ...value,
+ setData({
+ ...data,
alamatKantor: val.target.value,
});
}}
/>
-
) : (
""
)
}
onChange={(val) => {
- setValue({
- ...value,
+ setData({
+ ...data,
tlpn: val.target.value,
});
}}
- />
+ /> */}
+
+
+
+ Nomor Telepon{" "}
+
+ *
+
+
+
+ {
+ const valPhone = val.substring(1);
+ setData({
+ ...data,
+ tlpn: valPhone,
+ });
+ }}
+ />
+
+
) : (
""
)
}
onChange={(val) => {
- setValue({
- ...value,
+ setData({
+ ...data,
deskripsi: val.target.value,
});
}}
/>
+
{
- onUpdate(router, value as any, setLoading);
+ submitUpdate();
}}
bg={MainColor.yellow}
color={"yellow"}
@@ -189,27 +363,3 @@ export default function Portofolio_EditDataBisnis({
>
);
}
-
-async function onUpdate(
- router: AppRouterInstance,
- data: MODEL_PORTOFOLIO,
- setLoading: any
-) {
- if (_.values(data).includes("")) {
- return null;
- }
-
- // if (data.namaBisnis.length > 100) return null;
- // if (data.alamatKantor.length > 100) return null;
- // if (data.deskripsi.length > 150) return null;
-
- await Portofolio_funEditDataBisnis(data).then((res) => {
- if (res.status === 200) {
- setLoading(true);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- router.back();
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
-}
diff --git a/src/app_modules/katalog/portofolio/edit/data/ui_new_edit_data.tsx b/src/app_modules/katalog/portofolio/edit/data/ui_new_edit_data.tsx
new file mode 100644
index 00000000..47a178e5
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/edit/data/ui_new_edit_data.tsx
@@ -0,0 +1,610 @@
+"use client";
+
+import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
+import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import { apiGetMasterBidangBisnis } from "@/app_modules/_global/lib/api_fetch_master";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import { clientLogger } from "@/util/clientLogger";
+import {
+ ActionIcon,
+ Box,
+ Button,
+ Center,
+ Grid,
+ Select,
+ Stack,
+ Styles,
+ Text,
+ TextInput,
+ Textarea,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { useParams, useRouter } from "next/navigation";
+import { useState, useEffect } from "react";
+import { PhoneInput } from "react-international-phone";
+import {
+ apiGetPortofolioById,
+ apiUpdatePortofolioById,
+} from "../../component/api_fetch_portofolio";
+import { Portofolio_SkeletonEditDataBisnis } from "../../component/skeleton_view";
+import {
+ MODEL_PORTOFOLIO,
+ MODEL_PORTOFOLIO_BIDANG_BISNIS,
+} from "../../model/interface";
+import { ISUB_BIDANG_BISNIS } from "@/app_modules/model_global/portofolio";
+import { apiGetSubBidangBisnis } from "../../lib/api_portofolio";
+import { BaseSelectStylesNames } from "@mantine/core/lib/Select/types";
+import { IconPlus, IconRowRemove, IconTrash } from "@tabler/icons-react";
+import Component_V3_Label_TextInput from "@/app_modules/_global/component/new/comp_V3_label_text_input";
+
+interface SubBidangSelected {
+ id: string;
+ MasterSubBidangBisnis: {
+ id: string;
+ name: string;
+ };
+}
+
+interface IUpdatePortofoli {
+ namaBisnis: string;
+ alamatKantor: string;
+ tlpn: string;
+ deskripsi: string;
+ masterBidangBisnisId: string;
+ subBidang: SubBidangSelected[];
+}
+
+export default function Portofolio_EditDataBisnis() {
+ const router = useRouter();
+ const [loading, setLoading] = useState(false);
+
+ const params = useParams<{ id: string }>();
+ const portofolioId = params.id;
+ const [data, setData] = useState(null);
+ const [listBidang, setListBidang] = useState<
+ MODEL_PORTOFOLIO_BIDANG_BISNIS[]
+ >([]);
+
+ const [listSubBidang, setListSubBidang] = useState<
+ ISUB_BIDANG_BISNIS[] | null
+ >(null);
+
+ const [selectedSubBidang, setSelectedSubBidang] = useState<
+ ISUB_BIDANG_BISNIS[] | null
+ >(null);
+
+ const [listSubBidangSelected, setListSubBidangSelected] = useState<
+ SubBidangSelected[]
+ >([
+ {
+ id: "",
+ MasterSubBidangBisnis: {
+ id: "",
+ name: "",
+ },
+ },
+ ]);
+
+ useShallowEffect(() => {
+ onLoadData();
+ onLoadBidang();
+ onLoadMasterSubBidangBisnis();
+ }, []);
+
+ const onLoadData = async () => {
+ try {
+ const respone = await apiGetPortofolioById({
+ id: portofolioId,
+ });
+
+ if (respone.success) {
+ setData(respone.data);
+
+ // Cek apakah ada sub bidang bisnis yang terpilih
+ const subBidangData = respone.data.Portofolio_BidangDanSubBidangBisnis;
+
+ // Jika ada sub bidang, gunakan data tersebut
+ if (subBidangData && subBidangData.length > 0) {
+ setListSubBidangSelected(subBidangData);
+ } else {
+ // Jika tidak ada sub bidang yang terpilih sebelumnya, tetap inisialisasi dengan array kosong
+ setListSubBidangSelected([
+ {
+ id: "",
+ MasterSubBidangBisnis: {
+ id: "",
+ name: "",
+ },
+ },
+ ]);
+ }
+
+ const bisnisId = respone.data.MasterBidangBisnis.id;
+ if (bisnisId) {
+ handlerLoadSelectedSubBidang({ id: bisnisId });
+ }
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data portofolio", error);
+ }
+ };
+
+ const onLoadBidang = async () => {
+ try {
+ const respone = await apiGetMasterBidangBisnis();
+
+ if (respone.success) {
+ setListBidang(respone.data);
+ } else {
+ setListBidang([]);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data master bidang bisnis", error);
+ }
+ };
+
+ async function onLoadMasterSubBidangBisnis() {
+ try {
+ const response = await apiGetSubBidangBisnis({});
+
+ if (response.success) {
+ setListSubBidang(response.data);
+ }
+ } catch (error) {
+ console.error("Error on load master sub bidang bisnis", error);
+ }
+ }
+
+ const validateData = async (data: any) => {
+ if (_.values(data).includes("")) {
+ return "Lengkapi data";
+ }
+
+ if (data?.tlpn?.length < 8) {
+ return "Nomor telepon minimal 8 digit";
+ }
+
+ // Validasi sub bidang bisnis yang dipilih
+ // Pastikan setidaknya satu sub bidang dipilih
+ const validSubBidangCount = listSubBidangSelected.filter(
+ (item) => item.MasterSubBidangBisnis.id
+ ).length;
+
+ if (validSubBidangCount === 0) {
+ return "Pilih minimal satu sub bidang bisnis";
+ }
+
+ return null;
+ };
+
+ const hanldeUpadteData = async (data: any) => {
+ try {
+ // Filter list sub bidang yang dipilih (hanya ambil yang memiliki id)
+ const validSubBidang = listSubBidangSelected.filter(
+ (item) => item.MasterSubBidangBisnis.id
+ );
+
+ const newData: IUpdatePortofoli = {
+ namaBisnis: data?.namaBisnis,
+ alamatKantor: data?.alamatKantor,
+ tlpn: data?.tlpn,
+ deskripsi: data?.deskripsi,
+ masterBidangBisnisId: data?.MasterBidangBisnis.id,
+ subBidang: validSubBidang, // Hanya kirim sub bidang yang valid
+ };
+
+ const respone = await apiUpdatePortofolioById({
+ data: newData,
+ id: portofolioId,
+ });
+
+ return respone;
+ } catch (error) {
+ console.error("Error update data portofolio", error);
+ return null;
+ }
+ };
+
+ const submitUpdate = async () => {
+ const validate = await validateData(data);
+ if (validate) {
+ ComponentGlobal_NotifikasiPeringatan(validate);
+ return;
+ }
+
+ try {
+ setLoading(true);
+ const updateData = await hanldeUpadteData(data);
+
+ if (updateData.success) {
+ ComponentGlobal_NotifikasiBerhasil(updateData.message);
+ router.back();
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(updateData.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ console.error("Error update data portofolio", error);
+ }
+ };
+
+ const baseStyles: Styles> = {
+ label: {
+ color: MainColor.white,
+ },
+ input: {
+ backgroundColor: MainColor.white,
+ },
+ };
+
+ // Handler untuk perubahan bidang bisnis
+ const handleBidangBisnisChange = (val: string) => {
+ const isSameBidang = data?.MasterBidangBisnis?.id === val;
+
+ setData({
+ ...(data as any),
+ MasterBidangBisnis: {
+ id: val,
+ },
+ });
+
+ // Reset sub bidang jika ganti bidang
+ if (!isSameBidang) {
+ setListSubBidangSelected([
+ {
+ id: "",
+ MasterSubBidangBisnis: { id: "", name: "" },
+ },
+ ]);
+ }
+
+ handlerLoadSelectedSubBidang({ id: val });
+ };
+
+ // Handler untuk saat komponen pertama kali load
+ const handlerLoadSelectedSubBidang = ({ id }: { id: string }) => {
+ if (!listSubBidang) return;
+
+ const filteredSubBidang = listSubBidang.filter(
+ (item) => item.masterBidangBisnisId === id
+ );
+
+ setSelectedSubBidang(filteredSubBidang);
+ };
+
+ // Handler untuk menambah sub bidang bisnis
+ const handleAddSubBidang = () => {
+ setListSubBidangSelected([
+ ...listSubBidangSelected,
+ {
+ id: "",
+ MasterSubBidangBisnis: { id: "", name: "" },
+ },
+ ]);
+ };
+
+ // Handler untuk menghapus sub bidang bisnis
+ const handleRemoveSubBidang = (index: number) => {
+ if (listSubBidangSelected.length <= 1) return;
+
+ const updatedList = [...listSubBidangSelected];
+ updatedList.splice(index, 1);
+ setListSubBidangSelected(updatedList);
+ };
+
+ // Handler untuk update sub bidang
+ const handleSubBidangChange = (val: string, index: number) => {
+ const selected = selectedSubBidang?.find((s) => s.id === val);
+ const list = _.cloneDeep(listSubBidangSelected);
+
+ list[index] = {
+ id: "",
+ MasterSubBidangBisnis: selected || {
+ id: val,
+ name: "",
+ },
+ };
+
+ setListSubBidangSelected(list);
+ };
+
+ // Effect untuk mengupdate selectedSubBidang saat listSubBidang berubah
+ useShallowEffect(() => {
+ if (data?.MasterBidangBisnis?.id && listSubBidang) {
+ handlerLoadSelectedSubBidang({ id: data.MasterBidangBisnis.id });
+ }
+ }, [listSubBidang, data?.MasterBidangBisnis?.id]);
+
+ if (!data || !listBidang || !listSubBidang)
+ return ;
+
+ return (
+ <>
+
+
+
+ ) : (
+ ""
+ )
+ }
+ onChange={(val) => {
+ setData({
+ ...data,
+ namaBisnis: val.target.value,
+ });
+ }}
+ />
+
+ {/* Select Bidang dan Sub Bidang */}
+ ({
+ value: e.id,
+ label: e.name,
+ }))}
+ onChange={handleBidangBisnisChange}
+ />
+
+
+ {listSubBidangSelected.map((e, index) => {
+ // Filter data untuk select sub bidang, menghilangkan yang sudah dipilih kecuali untuk item ini sendiri
+ const selectedIds = listSubBidangSelected
+ .filter((_, i) => i !== index)
+ .map((s) => s.MasterSubBidangBisnis.id)
+ .filter((id) => id); // Filter hanya yang memiliki id (tidak kosong)
+
+ const availableSubBidangOptions = (selectedSubBidang || [])
+ .filter((sub) => {
+ // Tampilkan jika ini adalah opsi yang dipilih saat ini atau belum dipilih di sub bidang lainnya
+ return (
+ sub.id === e.MasterSubBidangBisnis.id ||
+ !selectedIds.includes(sub.id)
+ );
+ })
+ .map((sub) => ({
+ value: sub.id,
+ label: sub.name,
+ }));
+
+ return (
+
+
+
+
+
+ 0
+ ? "Pilih sub bidang bisnis"
+ : "Menunggu pilihan bidang bisnis"
+ }
+ value={e.MasterSubBidangBisnis.id}
+ data={availableSubBidangOptions}
+ onChange={(val) =>
+ handleSubBidangChange(val as any, index)
+ }
+ />
+
+
+
+ {index > 0 ? (
+ handleRemoveSubBidang(index)}
+ >
+
+
+ ) : (
+
+ )}
+
+
+
+
+ {listSubBidangSelected.length > 1 &&
+ e.MasterSubBidangBisnis.id === "" ? (
+
+ ) : undefined}
+
+
+
+ {/* Tombol untuk menghapus/menambah sub bidang bisnis */}
+
+ {index === listSubBidangSelected.length - 1 && (
+
+ }
+ color={"yellow"}
+ bg={MainColor.yellow}
+ onClick={handleAddSubBidang}
+ disabled={
+ // Hanya disable jika tidak ada bidang bisnis utama yang dipilih
+ !data?.MasterBidangBisnis?.id ||
+ // Atau jika tidak ada sub bidang yang tersedia untuk dipilih
+ (selectedSubBidang &&
+ selectedSubBidang.length === 0) ||
+ // Atau jika semua sub bidang yang tersedia sudah dipilih
+ availableSubBidangOptions.length === 0
+ }
+ style={{
+ alignSelf: "flex-end",
+ marginLeft: "auto",
+ transition: "0.5s",
+ }}
+ >
+ Tambah list
+
+
+ )}
+
+
+
+ );
+ })}
+
+ {/* Select Bidang dan Sub Bidang */}
+
+
+ ) : (
+ ""
+ )
+ }
+ onChange={(val) => {
+ setData({
+ ...data,
+ alamatKantor: val.target.value,
+ });
+ }}
+ />
+
+
+
+
+ {
+ const valPhone = val.substring(1);
+ setData({
+ ...data,
+ tlpn: valPhone,
+ });
+ }}
+ />
+
+ {data?.tlpn === "" ? (
+
+ ) : (
+ ""
+ )}
+
+
+
+
+ ) : (
+ ""
+ )
+ }
+ onChange={(val) => {
+ setData({
+ ...data,
+ deskripsi: val.target.value,
+ });
+ }}
+ />
+
+
+
+
+ item.MasterSubBidangBisnis.id !== ""
+ )
+ }
+ radius={"xl"}
+ loading={loading ? true : false}
+ loaderPosition="center"
+ onClick={() => {
+ submitUpdate();
+ }}
+ bg={MainColor.yellow}
+ color={"yellow"}
+ c={"black"}
+ style={{
+ transition: "0.5s",
+ }}
+ >
+ Update
+
+
+ >
+ );
+}
diff --git a/src/app_modules/katalog/portofolio/edit/logo/layout.tsx b/src/app_modules/katalog/portofolio/edit/logo/layout.tsx
index df132625..40532454 100644
--- a/src/app_modules/katalog/portofolio/edit/logo/layout.tsx
+++ b/src/app_modules/katalog/portofolio/edit/logo/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutPortofolio_EditLogoBisnis({
@@ -11,11 +14,18 @@ export default function LayoutPortofolio_EditLogoBisnis({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/katalog/portofolio/edit/logo/ui_edit_logo.tsx b/src/app_modules/katalog/portofolio/edit/logo/ui_edit_logo.tsx
index b90ec446..7917a134 100644
--- a/src/app_modules/katalog/portofolio/edit/logo/ui_edit_logo.tsx
+++ b/src/app_modules/katalog/portofolio/edit/logo/ui_edit_logo.tsx
@@ -1,79 +1,83 @@
"use client";
-import { APIs } from "@/app/lib";
+import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import {
- AccentColor,
- MainColor,
-} from "@/app_modules/_global/color/color_pallet";
-import { ComponentGlobal_LoadImage } from "@/app_modules/_global/component";
-import { Button, Center, FileButton, Image, Paper, Stack } from "@mantine/core";
-import { IconCamera } from "@tabler/icons-react";
+ ComponentGlobal_ButtonUploadFileImage,
+ ComponentGlobal_LoadImage,
+} from "@/app_modules/_global/component";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Center, Image, Paper, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
import { useState } from "react";
-import { MODEL_PORTOFOLIO } from "../../model/interface";
import { ComponentPortofolio_ButtonEditLogoBisnis } from "../../component";
+import { apiGetPortofolioById } from "../../component/api_fetch_portofolio";
+import { MODEL_PORTOFOLIO } from "../../model/interface";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Portofolio_SkeletonEditLogoBisnis } from "../../component/skeleton_view";
-export default function Portofolio_EditLogoBisnis({
- dataPorto,
-}: {
- dataPorto: MODEL_PORTOFOLIO;
-}) {
+export default function Portofolio_EditLogoBisnis() {
+ const params = useParams<{ id: string }>();
+ const portofolioId = params.id;
const [file, setFile] = useState(null);
const [img, setImg] = useState(null);
+ const [data, setData] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ const onLoadData = async () => {
+ try {
+ const respone = await apiGetPortofolioById({
+ id: portofolioId,
+ });
+
+ if (respone.success) {
+ setData(respone.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data portofolio", error);
+ }
+ };
+
+ if (!data) return ;
return (
<>
-
-
+
+
{img ? (
-
+
+
+
) : (
-
+
)}
-
-
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
- setImg(buffer);
- setFile(files);
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
- }
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload
-
- )}
-
-
-
-
+
+
+
+
+
>
diff --git a/src/app_modules/katalog/portofolio/edit/medsos/layout.tsx b/src/app_modules/katalog/portofolio/edit/medsos/layout.tsx
index 5fdcf02f..d20e67f2 100644
--- a/src/app_modules/katalog/portofolio/edit/medsos/layout.tsx
+++ b/src/app_modules/katalog/portofolio/edit/medsos/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutPortofolio_EditMedsosBisnis({
@@ -11,11 +14,18 @@ export default function LayoutPortofolio_EditMedsosBisnis({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/katalog/portofolio/edit/medsos/ui_edit_medsos.tsx b/src/app_modules/katalog/portofolio/edit/medsos/ui_edit_medsos.tsx
index 253149f9..1bb9b697 100644
--- a/src/app_modules/katalog/portofolio/edit/medsos/ui_edit_medsos.tsx
+++ b/src/app_modules/katalog/portofolio/edit/medsos/ui_edit_medsos.tsx
@@ -1,55 +1,120 @@
"use client";
-import ComponentKatalog_NotedBox from "@/app_modules/katalog/component/noted_box";
-import { Box, Button, Paper, Stack, TextInput } from "@mantine/core";
-import { useState } from "react";
-import { MODEL_PORTOFOLIO_MEDSOS } from "../../model/interface";
-import { Portofolio_funEditMedsosById } from "../../fun/edit/fun_edit_medsos_bisnis_by_id";
-import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
-import { useRouter } from "next/navigation";
-import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
-import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
+import { Button, Stack, TextInput } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import {
+ apiGetPortofolioById,
+ apiUpdateMedsosPortofolioById,
+} from "../../component/api_fetch_portofolio";
+import { MODEL_PORTOFOLIO_MEDSOS } from "../../model/interface";
+import { Profile_ComponentButtonUpdatePhotoProfile } from "@/app_modules/katalog/profile/_component";
-export default function Portofolio_EditMedsosBisnis({
- dataMedsos,
-}: {
- dataMedsos: MODEL_PORTOFOLIO_MEDSOS;
-}) {
+interface IUpdateMedson {
+ facebook: string;
+ instagram: string;
+ tiktok: string;
+ twitter: string;
+ youtube: string;
+}
+export default function Portofolio_EditMedsosBisnis() {
+ const params = useParams<{ id: string }>();
+ const portofolioId = params.id;
const router = useRouter();
- const [medsos, setMedsos] = useState(dataMedsos);
+ const [data, setData] = useState(null);
const [loading, setLoading] = useState(false);
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetPortofolioById({ id: portofolioId });
+ if (response.success) {
+ setData(response.data.Portofolio_MediaSosial);
+ }
+ } catch (error) {
+ clientLogger.error("Error Load Data Portofolio", error);
+ }
+ };
+
+ const hanldeUpdateData = async (data: any) => {
+ const newData: IUpdateMedson = {
+ facebook: data.facebook,
+ instagram: data.instagram,
+ tiktok: data.tiktok,
+ twitter: data.twitter,
+ youtube: data.youtube,
+ };
+
+ const response = await apiUpdateMedsosPortofolioById({
+ id: data.id,
+ data: newData,
+ });
+
+ return response;
+ };
+
+ async function submitUpdate() {
+ if (!data) {
+ ComponentGlobal_NotifikasiGagal("Data tidak valid");
+ return;
+ }
+
+ try {
+ setLoading(true);
+
+ const responseUpdate = await hanldeUpdateData(data);
+ if (responseUpdate.success) {
+ ComponentGlobal_NotifikasiBerhasil(responseUpdate.message);
+ router.back();
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(responseUpdate.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error Update Medsos", error);
+ ComponentGlobal_NotifikasiGagal("Error Update Medsos");
+ }
+ }
+
+ if (!data) return ;
+
return (
<>
{/* {JSON.stringify(dataMedsos, null, 2)} */}
-
+
{
- setMedsos({
- ...medsos,
+ setData({
+ ...data,
facebook: val.target.value,
});
}}
@@ -57,15 +122,21 @@ export default function Portofolio_EditMedsosBisnis({
{
- setMedsos({
- ...medsos,
+ setData({
+ ...data,
instagram: val.target.value,
});
}}
@@ -73,15 +144,21 @@ export default function Portofolio_EditMedsosBisnis({
{
- setMedsos({
- ...medsos,
+ setData({
+ ...data,
tiktok: val.target.value,
});
}}
@@ -89,15 +166,21 @@ export default function Portofolio_EditMedsosBisnis({
{
- setMedsos({
- ...medsos,
+ setData({
+ ...data,
twitter: val.target.value,
});
}}
@@ -105,15 +188,21 @@ export default function Portofolio_EditMedsosBisnis({
{
- setMedsos({
- ...medsos,
+ setData({
+ ...data,
youtube: val.target.value,
});
}}
@@ -124,7 +213,7 @@ export default function Portofolio_EditMedsosBisnis({
radius={"xl"}
loading={loading ? true : false}
loaderPosition="center"
- onClick={() => onUpdate(router, medsos, setLoading)}
+ onClick={() => submitUpdate()}
style={{
backgroundColor: MainColor.yellow,
border: `2px solid ${AccentColor.yellow}`,
@@ -134,24 +223,10 @@ export default function Portofolio_EditMedsosBisnis({
>
Update
+
+
-
+
>
);
}
-
-async function onUpdate(
- router: AppRouterInstance,
- medsos: MODEL_PORTOFOLIO_MEDSOS,
- setLoading: any
-) {
- await Portofolio_funEditMedsosById(medsos).then((res) => {
- if (res.status === 200) {
- setLoading(true);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- router.back();
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
-}
diff --git a/src/app_modules/katalog/portofolio/fun/delete/fun_delete_by_id.ts b/src/app_modules/katalog/portofolio/fun/delete/fun_delete_by_id.ts
index 533c3692..efb8690d 100644
--- a/src/app_modules/katalog/portofolio/fun/delete/fun_delete_by_id.ts
+++ b/src/app_modules/katalog/portofolio/fun/delete/fun_delete_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_PORTOFOLIO } from "../../model/interface";
import fs from "fs";
import { revalidatePath } from "next/cache";
diff --git a/src/app_modules/katalog/portofolio/fun/edit/fun_edit_data_bisnis_by_id.ts b/src/app_modules/katalog/portofolio/fun/edit/fun_edit_data_bisnis_by_id.ts
index fba7bfd5..a4aae079 100644
--- a/src/app_modules/katalog/portofolio/fun/edit/fun_edit_data_bisnis_by_id.ts
+++ b/src/app_modules/katalog/portofolio/fun/edit/fun_edit_data_bisnis_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_PORTOFOLIO } from "../../model/interface";
import { revalidatePath } from "next/cache";
diff --git a/src/app_modules/katalog/portofolio/fun/edit/fun_edit_logo_bisnis_by_id.ts b/src/app_modules/katalog/portofolio/fun/edit/fun_edit_logo_bisnis_by_id.ts
index 5ed431af..04fbeccc 100644
--- a/src/app_modules/katalog/portofolio/fun/edit/fun_edit_logo_bisnis_by_id.ts
+++ b/src/app_modules/katalog/portofolio/fun/edit/fun_edit_logo_bisnis_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function portofolio_funEditLogoBisnisById({
diff --git a/src/app_modules/katalog/portofolio/fun/edit/fun_edit_medsos_bisnis_by_id.ts b/src/app_modules/katalog/portofolio/fun/edit/fun_edit_medsos_bisnis_by_id.ts
index fa474129..8923951f 100644
--- a/src/app_modules/katalog/portofolio/fun/edit/fun_edit_medsos_bisnis_by_id.ts
+++ b/src/app_modules/katalog/portofolio/fun/edit/fun_edit_medsos_bisnis_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_PORTOFOLIO_MEDSOS } from "../../model/interface";
import { revalidatePath } from "next/cache";
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 5414bc61..76d9932d 100644
--- a/src/app_modules/katalog/portofolio/fun/fun_create_portofolio.ts
+++ b/src/app_modules/katalog/portofolio/fun/fun_create_portofolio.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_PORTOFOLIO_OLD } from "@/app_modules/model_global/portofolio";
import { revalidatePath } from "next/cache";
import { MODEL_PORTOFOLIO, MODEL_PORTOFOLIO_MEDSOS } from "../model/interface";
diff --git a/src/app_modules/katalog/portofolio/fun/get/get_all_portofolio.tsx b/src/app_modules/katalog/portofolio/fun/get/get_all_portofolio.tsx
index 2dac6c2f..6859f6cb 100644
--- a/src/app_modules/katalog/portofolio/fun/get/get_all_portofolio.tsx
+++ b/src/app_modules/katalog/portofolio/fun/get/get_all_portofolio.tsx
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function portofolio_funGetAllDaftarByid({
profileId,
diff --git a/src/app_modules/katalog/portofolio/fun/get/get_list_portofolio.ts b/src/app_modules/katalog/portofolio/fun/get/get_list_portofolio.ts
index 9afa5443..5e680edf 100644
--- a/src/app_modules/katalog/portofolio/fun/get/get_list_portofolio.ts
+++ b/src/app_modules/katalog/portofolio/fun/get/get_list_portofolio.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function funGetListPortofolio(profileId: any) {
const data = await prisma.portofolio.findMany({
diff --git a/src/app_modules/katalog/portofolio/fun/get/get_one_medsos_by_id.ts b/src/app_modules/katalog/portofolio/fun/get/get_one_medsos_by_id.ts
index 6a455296..b9ce099a 100644
--- a/src/app_modules/katalog/portofolio/fun/get/get_one_medsos_by_id.ts
+++ b/src/app_modules/katalog/portofolio/fun/get/get_one_medsos_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Portofolio_geOnetMedsosById(portoId: string) {
const data = await prisma.portofolio_MediaSosial.findFirst({
diff --git a/src/app_modules/katalog/portofolio/fun/get/get_one_portofolio.ts b/src/app_modules/katalog/portofolio/fun/get/get_one_portofolio.ts
index edc40140..7c8dff31 100644
--- a/src/app_modules/katalog/portofolio/fun/get/get_one_portofolio.ts
+++ b/src/app_modules/katalog/portofolio/fun/get/get_one_portofolio.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function portofolio_getOneById(portoId: string) {
// console.log(id)
diff --git a/src/app_modules/katalog/portofolio/fun/master/get_bidang_bisnis.ts b/src/app_modules/katalog/portofolio/fun/master/get_bidang_bisnis.ts
index 19b9db36..b1f97bc4 100644
--- a/src/app_modules/katalog/portofolio/fun/master/get_bidang_bisnis.ts
+++ b/src/app_modules/katalog/portofolio/fun/master/get_bidang_bisnis.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Portofolio_getMasterBidangBisnis() {
const data = await prisma.masterBidangBisnis.findMany({
diff --git a/src/app_modules/katalog/portofolio/index.ts b/src/app_modules/katalog/portofolio/index.ts
index 062117f7..e123bbff 100644
--- a/src/app_modules/katalog/portofolio/index.ts
+++ b/src/app_modules/katalog/portofolio/index.ts
@@ -1,3 +1,5 @@
+import { IListPortofolio } from './lib/type_portofolio';
+import { apiGetPortofolioByProfile } from './lib/api_portofolio';
import CreatePortofolio from "./create/view";
import CreatePortofolioLayout from "./create/layout";
import PortofolioLayout from "./ui/ui_layout";
@@ -8,6 +10,9 @@ import Portofolio_EditMedsosBisnis from "./edit/medsos/ui_edit_medsos";
import LayoutPortofolio_EditDataBisnis from "./edit/data/layout";
import LayoutPortofolio_EditLogoBisnis from "./edit/logo/layout";
import LayoutPortofolio_EditMedsosBisnis from "./edit/medsos/layout";
+import ListDetailPortofolioNew from './view/list_detail_portofolio_new';
+import Portofolio_UiDetailNew from './ui/ui_detail_portofolio_new';
+import PortofolioLayoutNew from './ui/ui_layout_new';
export {
CreatePortofolio,
@@ -20,6 +25,11 @@ export {
LayoutPortofolio_EditDataBisnis,
LayoutPortofolio_EditLogoBisnis,
LayoutPortofolio_EditMedsosBisnis,
+ apiGetPortofolioByProfile,
};
+export type { IListPortofolio };
export { Portofolio_ViewListDetail } from "./view/view_list_detail_portofolio";
+export { ListDetailPortofolioNew }
+export { Portofolio_UiDetailNew }
+export { PortofolioLayoutNew }
diff --git a/src/app_modules/katalog/portofolio/lib/api_portofolio.ts b/src/app_modules/katalog/portofolio/lib/api_portofolio.ts
new file mode 100644
index 00000000..321149b2
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/lib/api_portofolio.ts
@@ -0,0 +1,93 @@
+export const apiGetPortofolioByProfile = async (path?: string) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/new/portofolio${path ? path : ""}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) return null;
+ const data: Record = await response.json();
+ return data;
+};
+
+export const apiGetOnePortofolioById = async (path: string, cat: string) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/new/portofolio/${path}?cat=${cat}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) return null;
+ const data: Record = await response.json();
+ return data;
+};
+
+export const apiDeletePortofolio = async (path: string) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/new/portofolio/${path}`, {
+ method: "DELETE",
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
+
+
+export const apiGetSubBidangBisnis = async ({id}: {id?: string}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) =>
+ res.json()
+ );
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const bidangBisnisId = id ? `/${id}` : "";
+ const response = await fetch(`/api/master/sub-bidang-bisnis${bidangBisnisId}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to get all forum:",
+ response.statusText,
+ errorData
+ );
+ throw new Error(errorData?.message || "Failed to get all forum");
+ }
+
+ // Return the JSON response
+ const result = await response.json();
+ return result;
+ } catch (error) {
+ console.error("Error get all forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+
+}
\ No newline at end of file
diff --git a/src/app_modules/katalog/portofolio/lib/type_portofolio.ts b/src/app_modules/katalog/portofolio/lib/type_portofolio.ts
new file mode 100644
index 00000000..9d86dc9f
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/lib/type_portofolio.ts
@@ -0,0 +1,36 @@
+export interface IListPortofolio {
+ id: string
+ id_Portofolio: string
+ profileId: string
+ namaBisnis: string
+}
+
+export interface IDetailPortofolioBisnis {
+ id_Portofolio: string
+ namaBisnis: string
+ alamatKantor: string
+ tlpn: string
+ deskripsi: string
+ logoId: string
+ bidangBisnis: string
+ subBidangBisnis: string[]
+ authorId: string
+}
+
+export interface IDetailPortofolioLokasi {
+ mapId: string
+ logoId: string
+ namePin: string
+ latitude: string
+ longitude: string
+ imageId: string
+ pinId: string
+}
+
+export interface IDetailPortofolioSosmed {
+ facebook: string
+ twitter: string
+ instagram: string
+ tiktok: string
+ youtube: string
+}
\ No newline at end of file
diff --git a/src/app_modules/katalog/portofolio/model/interface.ts b/src/app_modules/katalog/portofolio/model/interface.ts
index cc922099..404a6f07 100644
--- a/src/app_modules/katalog/portofolio/model/interface.ts
+++ b/src/app_modules/katalog/portofolio/model/interface.ts
@@ -2,6 +2,8 @@ import { MODEL_USER } from "@/app_modules/home/model/interface";
import { MODEL_IMAGES } from "@/app_modules/model_global/interface";
import { MODEL_PROFILE } from "../../profile/model/interface";
import { MODEL_MAP } from "@/app_modules/map/lib/interface";
+import { ISUB_BIDANG_BISNIS } from "@/app_modules/model_global/portofolio";
+import { Prisma } from "@prisma/client";
export interface MODEL_PORTOFOLIO {
id: string;
@@ -12,6 +14,7 @@ export interface MODEL_PORTOFOLIO {
active: boolean;
MasterBidangBisnis: MODEL_PORTOFOLIO_BIDANG_BISNIS;
masterBidangBisnisId: string;
+ Portofolio_BidangDanSubBidangBisnis: Portofolio_BidangDanSubBidangBisnis;
profileId: string;
Logo: MODEL_LOGO;
logoId: string;
@@ -34,6 +37,7 @@ export interface MODEL_PORTOFOLIO_BIDANG_BISNIS {
id: string;
name: string;
active: boolean;
+ slug: string;
}
export interface MODEL_PORTOFOLIO_MEDSOS {
@@ -48,3 +52,29 @@ export interface MODEL_PORTOFOLIO_MEDSOS {
updatedAt: Date;
portofolioId: string;
}
+
+export type Portofolio_BidangDanSubBidangBisnis =
+ Prisma.Portofolio_BidangDanSubBidangBisnisGetPayload<{
+ select: {
+ id: true,
+ masterBidangBisnisId?: true,
+ masterSubBidangBisnisId?: true,
+ isActive: true
+ MasterBidangBisnis: {
+ select: {
+ id?: true;
+ name?: true;
+ };
+ };
+ MasterSubBidangBisnis: {
+ select: {
+ id?: true;
+ name?: true;
+ };
+ };
+
+ };
+ // include: {
+
+ // };
+ }>;
diff --git a/src/app_modules/katalog/portofolio/ui/ui_detail_data.tsx b/src/app_modules/katalog/portofolio/ui/ui_detail_data.tsx
index 67347372..4eca63ed 100644
--- a/src/app_modules/katalog/portofolio/ui/ui_detail_data.tsx
+++ b/src/app_modules/katalog/portofolio/ui/ui_detail_data.tsx
@@ -1,4 +1,4 @@
-import { APIs } from "@/app/lib";
+import { APIs } from "@/lib";
import {
AccentColor,
MainColor,
diff --git a/src/app_modules/katalog/portofolio/ui/ui_detail_data_new.tsx b/src/app_modules/katalog/portofolio/ui/ui_detail_data_new.tsx
new file mode 100644
index 00000000..3fb93555
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/ui/ui_detail_data_new.tsx
@@ -0,0 +1,218 @@
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_LoadImage } from "@/app_modules/_global/component";
+import {
+ Box,
+ Button,
+ Center,
+ Divider,
+ Grid,
+ Group,
+ Paper,
+ SimpleGrid,
+ Stack,
+ Text,
+ Title,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import {
+ IconBuildingSkyscraper,
+ IconCaretRightFilled,
+ IconListDetails,
+ IconMapPin,
+ IconPhoneCall,
+ IconPinned,
+} from "@tabler/icons-react";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { apiGetOnePortofolioById } from "../lib/api_portofolio";
+import { IDetailPortofolioBisnis } from "../lib/type_portofolio";
+import SkeletonDetailBisnis from "./ui_skeleton_detail_bisnis";
+import { UIGlobal_Modal } from "@/app_modules/_global/ui";
+import Link from "next/link";
+
+export default function Portofolio_UiDetailDataNew() {
+ const [loading, setLoading] = useState(true);
+ const param = useParams<{ id: string }>();
+ const [dataPorto, setDataPorto] = useState();
+ const [openModal, setOpenModal] = useState(false);
+
+ async function funGetPortofolio() {
+ try {
+ setLoading(true);
+ const response = await apiGetOnePortofolioById(param.id, "bisnis");
+ if (response) {
+ setDataPorto(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ useShallowEffect(() => {
+ funGetPortofolio();
+ }, []);
+
+ return (
+ <>
+
+ {loading ? (
+
+ ) : (
+
+
+ Data Bisnis
+
+ id: {" "}
+
+ #{dataPorto?.id_Portofolio}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {dataPorto?.namaBisnis}
+
+
+
+ {/*
+
+
+
+
+ {dataPorto?.subBidangBisnis}
+
+ */}
+
+
+
+
+
+
+ {
+ setOpenModal(true);
+ }}
+ >
+ + {dataPorto?.tlpn}
+
+
+
+
+
+
+
+
+ {dataPorto?.alamatKantor}
+
+
+
+
+
+
+
+
+ {dataPorto?.bidangBisnis}
+
+
+ {dataPorto?.subBidangBisnis.map((item, index) => (
+
+
+
+
+
+ {item}
+
+
+ ))}
+
+
+
+
+
+
+
+
+
+
+ Tentang Kami
+
+
+ {dataPorto?.deskripsi}
+
+
+ )}
+
+
+ {
+ setOpenModal(false);
+ }}
+ buttonKanan={
+
+
+ Lanjutkan
+
+
+ }
+ buttonKiri={
+ setOpenModal(false)}>
+ Batal
+
+ }
+ />
+ >
+ );
+}
diff --git a/src/app_modules/katalog/portofolio/ui/ui_detail_logo.tsx b/src/app_modules/katalog/portofolio/ui/ui_detail_logo.tsx
index 1df83a0f..1095a0fa 100644
--- a/src/app_modules/katalog/portofolio/ui/ui_detail_logo.tsx
+++ b/src/app_modules/katalog/portofolio/ui/ui_detail_logo.tsx
@@ -1,8 +1,8 @@
-import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog";
+import { RouterPortofolio } from "@/lib/router_hipmi/router_katalog";
import { Paper, Title, AspectRatio, Image } from "@mantine/core";
import { MODEL_PORTOFOLIO } from "../model/interface";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
-import { APIs } from "@/app/lib";
+import { APIs } from "@/lib";
import { Profile_ComponentLoadBackgroundImage } from "../../profile/_component";
export function Portofolio_UiDetailLogo({
diff --git a/src/app_modules/katalog/portofolio/ui/ui_detail_map.tsx b/src/app_modules/katalog/portofolio/ui/ui_detail_map.tsx
index 8d0aaa43..5a1e4465 100644
--- a/src/app_modules/katalog/portofolio/ui/ui_detail_map.tsx
+++ b/src/app_modules/katalog/portofolio/ui/ui_detail_map.tsx
@@ -1,6 +1,6 @@
"use client";
-import { APIs } from "@/app/lib";
+import { APIs } from "@/lib";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import {
ComponentMap_DetailData,
@@ -102,8 +102,8 @@ function MapView({
()
+ const [dataPorto, setDataPorto] = useState()
+ const [openDrawer, setOpenDrawer] = useState(false)
+
+ async function funGetPortofolio() {
+ try {
+ setLoading(true)
+ const response = await apiGetOnePortofolioById(param.id, "lokasi");
+ if (response) {
+ setDataPorto(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false)
+ }
+ }
+
+ useShallowEffect(() => {
+ funGetPortofolio()
+ }, []);
+
+
+ return (
+ <>
+
+
+
+ Lokasi Bisnis
+
+ {
+ loading ?
+
+ :
+ dataPorto?.mapId === null || dataPorto?.mapId === undefined ?
+
+ :
+
+ {
+ setOpenDrawer(true);
+ }}
+ pitchAlignment="auto"
+ >
+
+
+
+
+
+
+
+
+
+
+ }
+
+
+
+ setOpenDrawer(false)}
+ mapId={String(dataPorto?.mapId)}
+ component={}
+ />
+
+ >
+ )
+}
\ No newline at end of file
diff --git a/src/app_modules/katalog/portofolio/ui/ui_detail_media_new.tsx b/src/app_modules/katalog/portofolio/ui/ui_detail_media_new.tsx
new file mode 100644
index 00000000..b763c836
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/ui/ui_detail_media_new.tsx
@@ -0,0 +1,132 @@
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Box, Grid, Paper, Stack, Text, Title } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconBrandFacebook, IconBrandInstagram, IconBrandTiktok, IconBrandTwitter, IconBrandYoutube } from "@tabler/icons-react";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { apiGetOnePortofolioById } from "../lib/api_portofolio";
+import { IDetailPortofolioSosmed } from "../lib/type_portofolio";
+
+export default function Portofolio_UiSosialMediaNew() {
+ const [loading, setLoading] = useState(true)
+ const param = useParams<{ id: string }>()
+ const [dataPorto, setDataPorto] = useState();
+
+ async function funGetPortofolio() {
+ try {
+ setLoading(true)
+ const response = await apiGetOnePortofolioById(param.id, "sosmed");
+ if (response) {
+ setDataPorto(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false)
+ }
+ }
+
+ useShallowEffect(() => {
+ funGetPortofolio()
+ }, []);
+
+
+ return (
+ <>
+
+ Media Sosial Bisnis
+ {
+ loading ?
+
+ {[...Array(4)].map((_, index) => (
+
+
+
+
+
+
+
+
+
+
+ ))}
+
+ :
+
+
+
+
+
+
+ {dataPorto?.facebook ? (
+ {dataPorto?.facebook}
+ ) : (
+ "-"
+ )}
+
+
+
+
+
+
+
+ {dataPorto?.instagram ? (
+ {dataPorto?.instagram}
+ ) : (
+ "-"
+ )}
+
+
+
+
+
+
+
+ {dataPorto?.tiktok ? (
+ {dataPorto?.tiktok}
+ ) : (
+ "-"
+ )}
+
+
+
+
+
+
+
+ {dataPorto?.twitter ? (
+ {dataPorto?.twitter}
+ ) : (
+ "-"
+ )}
+
+
+
+
+
+
+
+ {dataPorto?.youtube ? (
+ {dataPorto?.youtube}
+ ) : (
+ "-"
+ )}
+
+
+
+
+ }
+
+ >
+ )
+}
\ No newline at end of file
diff --git a/src/app_modules/katalog/portofolio/ui/ui_detail_portofolio_new.tsx b/src/app_modules/katalog/portofolio/ui/ui_detail_portofolio_new.tsx
new file mode 100644
index 00000000..d19e2409
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/ui/ui_detail_portofolio_new.tsx
@@ -0,0 +1,46 @@
+"use client";
+import { Stack } from "@mantine/core";
+import Portofolio_UiDetailDataNew from "./ui_detail_data_new";
+import Portofolio_UiMapNew from "./ui_detail_map_new";
+import Portofolio_UiSosialMediaNew from "./ui_detail_media_new";
+import ComponentPortofolio_ButtonDeleteNew from "../component/button_delete_new";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+import { useShallowEffect } from "@mantine/hooks";
+import { useState } from "react";
+
+export default function Portofolio_UiDetailNew({
+ mapboxToken,
+}: {
+ mapboxToken: string;
+}) {
+ const [userLoginId, setUserLoginId] = useState("");
+
+ useShallowEffect(() => {
+ onLoadDataUser();
+ }, []);
+
+ async function onLoadDataUser() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ } else {
+ console.error("Error get user id", response.message);
+ setUserLoginId("");
+ }
+ } catch (error) {
+ console.error("Error get user id", error);
+ setUserLoginId("");
+ }
+ }
+ return (
+ <>
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/katalog/portofolio/ui/ui_layout_new.tsx b/src/app_modules/katalog/portofolio/ui/ui_layout_new.tsx
new file mode 100644
index 00000000..0cd68eb5
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/ui/ui_layout_new.tsx
@@ -0,0 +1,53 @@
+"use client";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import ComponentPortofolio_ButtonMoreNew from "../component/button_more_new";
+import { useState } from "react";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+
+export default function PortofolioLayoutNew({
+ children,
+}: {
+ children: any;
+}) {
+ const [userLoginId, setUserLoginId] = useState("");
+
+ useShallowEffect(() => {
+ onLoadDataUser();
+ }, []);
+
+ async function onLoadDataUser() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ setUserLoginId(response.userId);
+ } else {
+ console.error("Error get user id", response.message);
+ setUserLoginId("");
+ }
+ } catch (error) {
+ console.error("Error get user id", error);
+ setUserLoginId("");
+ }
+ }
+
+ return (
+ <>
+
+
+
+ }
+ />
+
+ {children}
+
+ >
+ );
+}
diff --git a/src/app_modules/katalog/portofolio/ui/ui_list_detail_portofolio_new.tsx b/src/app_modules/katalog/portofolio/ui/ui_list_detail_portofolio_new.tsx
new file mode 100644
index 00000000..85e580f3
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/ui/ui_list_detail_portofolio_new.tsx
@@ -0,0 +1,84 @@
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { Box, Center, Group, Skeleton, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { ScrollOnly } from "next-scroll-loader";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { ComponentPortofolio_DaftarBoxView } from "../component/card_view_daftar";
+import { apiGetPortofolioByProfile } from "../lib/api_portofolio";
+import { MODEL_PORTOFOLIO } from "../model/interface";
+import _ from "lodash";
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+
+export default function Portofolio_UiListDetailNew() {
+ const param = useParams<{ id: string }>();
+ const profileId = param.id;
+ const [data, setData] = useState(null);
+ const [activePage, setActivePage] = useState(1);
+
+ async function getPortofolio() {
+ try {
+ const response = await apiGetPortofolioByProfile(
+ `?profile=${param.id}&cat=portofolio&page=1`
+ );
+ if (response) {
+ setData(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }
+
+ useShallowEffect(() => {
+ getPortofolio();
+ }, []);
+
+ if (_.isNull(data))
+ return (
+ <>
+
+
+
+
+ >
+ );
+
+ return (
+ <>
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={async () => {
+ // const loadData = await portofolio_funGetAllDaftarByid({
+ // profileId,
+ // page: activePage + 1,
+ // });
+
+ try {
+ const response = await apiGetPortofolioByProfile(
+ `?profile=${param.id}&cat=portofolio&page=${activePage + 1}`
+ );
+ if (response) {
+ setActivePage((val) => val + 1);
+
+ return response.data;
+ }
+ } catch (error) {
+ console.error(error);
+ }
+ }}
+ >
+ {(item) => }
+
+
+ >
+ );
+}
diff --git a/src/app_modules/katalog/portofolio/ui/ui_skeleton_detail_bisnis.tsx b/src/app_modules/katalog/portofolio/ui/ui_skeleton_detail_bisnis.tsx
new file mode 100644
index 00000000..e89728f7
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/ui/ui_skeleton_detail_bisnis.tsx
@@ -0,0 +1,44 @@
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Box, Grid, Group, Skeleton, Stack } from "@mantine/core";
+
+export default function SkeletonDetailBisnis() {
+ return <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {[...Array(4)].map((_, index) => (
+
+
+
+
+
+
+
+
+
+
+ ))}
+
+
+
+
+
+
+
+
+
+
+ >;
+}
\ No newline at end of file
diff --git a/src/app_modules/katalog/portofolio/view/list_detail_portofolio_new.tsx b/src/app_modules/katalog/portofolio/view/list_detail_portofolio_new.tsx
new file mode 100644
index 00000000..7232a387
--- /dev/null
+++ b/src/app_modules/katalog/portofolio/view/list_detail_portofolio_new.tsx
@@ -0,0 +1,28 @@
+"use client";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import Portofolio_UiListDetailNew from "../ui/ui_list_detail_portofolio_new";
+
+export default function ListDetailPortofolioNew() {
+ return (
+ <>
+ {/* }
+ >
+
+ */}
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/katalog/profile/_component/button/comp_button_update_background_profile.tsx b/src/app_modules/katalog/profile/_component/button/comp_button_update_background_profile.tsx
index 92f369cf..f8c918ae 100644
--- a/src/app_modules/katalog/profile/_component/button/comp_button_update_background_profile.tsx
+++ b/src/app_modules/katalog/profile/_component/button/comp_button_update_background_profile.tsx
@@ -1,47 +1,73 @@
+import { DIRECTORY_ID } from "@/lib";
import { MainColor } from "@/app_modules/_global/color";
+import {
+ funGlobal_DeleteFileById,
+ funGlobal_UploadToStorage,
+} from "@/app_modules/_global/fun";
import {
ComponentGlobal_NotifikasiBerhasil,
ComponentGlobal_NotifikasiGagal,
ComponentGlobal_NotifikasiPeringatan,
} from "@/app_modules/_global/notif_global";
+import { clientLogger } from "@/util/clientLogger";
import { Box, Button } from "@mantine/core";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { profile_funUpdateBackground } from "../../fun/update/fun_update_background";
-import { DIRECTORY_ID } from "@/app/lib";
-import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
export function Profile_ComponentButtonUpdateBackgroundProfile({
- profileId,
file,
+ profileId,
+ fileId,
}: {
- profileId: string;
file: File;
+ profileId: string;
+ fileId: string;
}) {
const router = useRouter();
const [loading, setLoading] = useState(false);
async function onUpdate() {
- setLoading(true);
- const uploadFile = await funGlobal_UploadToStorage({
- file: file,
- dirId: DIRECTORY_ID.profile_background,
- });
- if (!uploadFile.success) {
- setLoading(false);
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload foto profile");
- }
-
- const res = await profile_funUpdateBackground({
- profileId: profileId,
- fileId: uploadFile.data.id,
- });
- if (res.status === 200) {
+ try {
setLoading(true);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- router.back();
- } else {
+
+ // Upload gambar baru
+ const uploadFile = await funGlobal_UploadToStorage({
+ file: file,
+ dirId: DIRECTORY_ID.profile_background,
+ });
+
+ if (!uploadFile.success) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload background");
+ return;
+ }
+
+ // Hapus gambar lama
+ const deletePhoto = await funGlobal_DeleteFileById({
+ fileId: fileId,
+ dirId: DIRECTORY_ID.profile_background,
+ });
+
+ if (!deletePhoto.success) {
+ setLoading(false);
+ clientLogger.error("Error delete background", deletePhoto.message);
+ }
+
+ const res = await profile_funUpdateBackground({
+ profileId: profileId,
+ fileId: uploadFile.data.id,
+ });
+
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ router.back();
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
setLoading(false);
- ComponentGlobal_NotifikasiGagal(res.message);
+ clientLogger.error("Error upload background", error);
}
}
diff --git a/src/app_modules/katalog/profile/_component/button/comp_button_update_photo_profile.tsx b/src/app_modules/katalog/profile/_component/button/comp_button_update_photo_profile.tsx
index ab09104b..34eae3fc 100644
--- a/src/app_modules/katalog/profile/_component/button/comp_button_update_photo_profile.tsx
+++ b/src/app_modules/katalog/profile/_component/button/comp_button_update_photo_profile.tsx
@@ -1,49 +1,75 @@
"use client";
+import { DIRECTORY_ID } from "@/lib";
import { MainColor } from "@/app_modules/_global/color";
+import {
+ funGlobal_DeleteFileById,
+ funGlobal_UploadToStorage,
+} from "@/app_modules/_global/fun";
import {
ComponentGlobal_NotifikasiBerhasil,
ComponentGlobal_NotifikasiGagal,
ComponentGlobal_NotifikasiPeringatan,
} from "@/app_modules/_global/notif_global";
-import { Box, Button, Center } from "@mantine/core";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Button } from "@mantine/core";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { profile_funUpdatePhoto } from "../../fun";
-import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
-import { DIRECTORY_ID } from "@/app/lib";
export function Profile_ComponentButtonUpdatePhotoProfile({
file,
profileId,
+ fileId,
}: {
file: File;
profileId: string;
+ fileId: string;
}) {
const router = useRouter();
const [isLoading, setLoading] = useState(false);
async function onUpdate() {
- setLoading(true);
- const uploadPhoto = await funGlobal_UploadToStorage({
- file: file,
- dirId: DIRECTORY_ID.profile_foto,
- });
- if (!uploadPhoto.success) {
- setLoading(false);
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload foto profile");
- }
-
- const res = await profile_funUpdatePhoto({
- fileId: uploadPhoto.data.id,
- profileId: profileId,
- });
- if (res.status === 200) {
+ try {
setLoading(true);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- router.back();
- } else {
+
+ // Upload foto baru
+ const uploadPhoto = await funGlobal_UploadToStorage({
+ file: file,
+ dirId: DIRECTORY_ID.profile_foto,
+ });
+
+ if (!uploadPhoto.success) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload foto profile");
+ return;
+ }
+
+ // Hapus gambar lama
+ const deletePhoto = await funGlobal_DeleteFileById({
+ fileId: fileId,
+ dirId: DIRECTORY_ID.profile_foto,
+ });
+
+ if (!deletePhoto.success) {
+ setLoading(false);
+ clientLogger.error("Error delete logo", deletePhoto.message);
+ }
+
+ const res = await profile_funUpdatePhoto({
+ fileId: uploadPhoto.data.id,
+ profileId: profileId,
+ });
+
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ router.back();
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
setLoading(false);
- ComponentGlobal_NotifikasiGagal(res.message);
+ clientLogger.error("Error update photo profile", error);
}
}
return (
diff --git a/src/app_modules/katalog/profile/_component/button/comp_create_new_profile.tsx b/src/app_modules/katalog/profile/_component/button/comp_create_new_profile.tsx
index 02bd0b77..4c91f2c0 100644
--- a/src/app_modules/katalog/profile/_component/button/comp_create_new_profile.tsx
+++ b/src/app_modules/katalog/profile/_component/button/comp_create_new_profile.tsx
@@ -1,7 +1,7 @@
"use client";
-import { DIRECTORY_ID } from "@/app/lib";
-import { RouterHome } from "@/app/lib/router_hipmi/router_home";
+import { DIRECTORY_ID } from "@/lib";
+import { RouterHome } from "@/lib/router_hipmi/router_home";
import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
import {
@@ -9,92 +9,224 @@ import {
ComponentGlobal_NotifikasiGagal,
ComponentGlobal_NotifikasiPeringatan,
} from "@/app_modules/_global/notif_global";
+import { emailRegex } from "@/app_modules/katalog/component/regular_expressions";
+import { clientLogger } from "@/util/clientLogger";
import { Button } from "@mantine/core";
import _ from "lodash";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import funCreateNewProfile from "../../fun/fun_create_profile";
+import { apiCreateProfile } from "../../lib/api_fetch_profile";
import { MODEL_PROFILE } from "../../model/interface";
-import { validRegex } from "@/app_modules/katalog/component";
+import funCreateNewProfile from "../../fun/fun_create_profile";
+
+interface CreateProfileData {
+ name: string;
+ email: string;
+ alamat: string;
+ jenisKelamin: string;
+ imageId: string;
+ imageBackgroundId: string;
+}
+
+interface ProfileComponentProps {
+ value: MODEL_PROFILE;
+ filePP: File | null;
+ fileBG: File | null;
+}
export function Profile_ComponentCreateNewProfile({
value,
filePP,
fileBG,
-}: {
- value: MODEL_PROFILE;
- filePP: File;
- fileBG: File;
-}) {
+}: ProfileComponentProps) {
const router = useRouter();
const [loading, setLoading] = useState(false);
- async function onSubmit() {
- const newData = {
- name: value.name,
- email: value.email,
- alamat: value.alamat,
- jenisKelamin: value.jenisKelamin,
- };
- if (_.values(newData).includes(""))
- return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
- if (!newData.email.match(validRegex)) return null;
-
- if (filePP == null)
- return ComponentGlobal_NotifikasiPeringatan("Lengkapi foto profile");
- if (fileBG == null)
- return ComponentGlobal_NotifikasiPeringatan(
- "Lengkapi background profile"
- );
-
- setLoading(true);
+ const validateData = (): string | null => {
+ if (_.values(value).some((val) => !val)) {
+ return "Lengkapi Data";
+ }
+ if (!emailRegex.test(value.email)) {
+ return "Format email salah";
+ }
+ if (!filePP) {
+ return "Lengkapi foto profile";
+ }
+ if (!fileBG) {
+ return "Lengkapi background profile";
+ }
+ return null;
+ };
+ const uploadImages = async (): Promise<{
+ photoId: string;
+ backgroundId: string;
+ } | null> => {
const uploadPhoto = await funGlobal_UploadToStorage({
- file: filePP,
+ file: filePP!,
dirId: DIRECTORY_ID.profile_foto,
});
+
if (!uploadPhoto.success) {
- setLoading(false);
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload foto profile");
+ throw new Error("Gagal upload foto profile");
}
const uploadBackground = await funGlobal_UploadToStorage({
- file: fileBG,
+ file: fileBG!,
dirId: DIRECTORY_ID.profile_background,
});
+
if (!uploadBackground.success) {
- setLoading(false);
- return ComponentGlobal_NotifikasiPeringatan(
- "Gagal upload background profile"
+ throw new Error("Gagal upload background profile");
+ }
+
+ return {
+ photoId: uploadPhoto.data.id,
+ backgroundId: uploadBackground.data.id,
+ };
+ };
+
+
+ const handleSubmit = async () => {
+ try {
+ const validationError = validateData();
+ if (validationError) {
+ ComponentGlobal_NotifikasiPeringatan(validationError);
+ return;
+ }
+
+ setLoading(true);
+
+ const uploadedImages = await uploadImages();
+ if (!uploadedImages) {
+ return;
+ }
+
+ const profileData: CreateProfileData = {
+ name: value.name,
+ email: value.email,
+ alamat: value.alamat,
+ jenisKelamin: value.jenisKelamin,
+ imageId: uploadedImages.photoId,
+ imageBackgroundId: uploadedImages.backgroundId,
+ };
+
+ const response = await apiCreateProfile({ data: profileData as any});
+
+ if (response.success) {
+ ComponentGlobal_NotifikasiBerhasil("Berhasil membuat profile", 3000);
+ router.replace(RouterHome.main_home, { scroll: false });
+ } else {
+ ComponentGlobal_NotifikasiPeringatan(response.message);
+ }
+ } catch (error) {
+ clientLogger.error("Error create new profile:", error);
+ ComponentGlobal_NotifikasiGagal(
+ error instanceof Error
+ ? error.message
+ : "Terjadi kesalahan saat membuat profile"
);
- }
-
- const create = await funCreateNewProfile({
- data: newData as any,
- imageId: uploadPhoto.data.id,
- imageBackgroundId: uploadBackground.data.id,
- });
-
- if (create.status === 201) {
- ComponentGlobal_NotifikasiBerhasil("Berhasil membuat profile", 3000);
- router.push(RouterHome.main_home, { scroll: false });
- } else {
- ComponentGlobal_NotifikasiGagal(create.message);
+ } finally {
setLoading(false);
}
- }
+ };
+
+ // async function onSubmit() {
+ // if (_.values(value).includes(""))
+ // return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
+ // if (!value.email.match(emailRegex))
+ // return ComponentGlobal_NotifikasiPeringatan("Format email salah");
+
+ // if (filePP == null)
+ // return ComponentGlobal_NotifikasiPeringatan("Lengkapi foto profile");
+ // if (fileBG == null)
+ // return ComponentGlobal_NotifikasiPeringatan(
+ // "Lengkapi background profile"
+ // );
+
+ // try {
+ // setLoading(true);
+
+ // const uploadPhoto = await funGlobal_UploadToStorage({
+ // file: filePP,
+ // dirId: DIRECTORY_ID.profile_foto,
+ // });
+ // if (!uploadPhoto.success) {
+ // setLoading(false);
+ // ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ // return;
+ // }
+
+ // const uploadBackground = await funGlobal_UploadToStorage({
+ // file: fileBG,
+ // dirId: DIRECTORY_ID.profile_background,
+ // });
+ // if (!uploadBackground.success) {
+ // setLoading(false);
+ // ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ // return;
+ // }
+
+ // const newData: CreateProfileData = {
+ // name: value.name,
+ // email: value.email,
+ // alamat: value.alamat,
+ // jenisKelamin: value.jenisKelamin,
+ // imageId: uploadPhoto.data.id,
+ // imageBackgroundId: uploadBackground.data.id,
+ // };
+
+ // const respone = await apiCreateProfile({
+ // data: newData as any,
+ // });
+
+ // if (respone && respone.success) {
+ // console.log(respone.data);
+ // ComponentGlobal_NotifikasiBerhasil("Berhasil membuat profile", 3000);
+ // router.replace(RouterHome.main_home, { scroll: false });
+ // } else {
+ // setLoading(false);
+ // ComponentGlobal_NotifikasiPeringatan(respone.message);
+ // }
+
+ // // const create = await funCreateNewProfile({
+ // // data: fixData as any,
+ // // imageId: uploadPhoto.data.id,
+ // // imageBackgroundId: uploadBackground.data.id,
+ // // });
+
+ // // if (create.status === 201) {
+ // // ComponentGlobal_NotifikasiBerhasil("Berhasil membuat profile", 3000);
+ // // router.replace(RouterHome.main_home, { scroll: false });
+ // // }
+
+ // // if (create.status === 400) {
+ // // setLoading(false);
+ // // ComponentGlobal_NotifikasiGagal(create.message);
+ // // }
+
+ // // if (create.status === 500) {
+ // // setLoading(false);
+ // // ComponentGlobal_NotifikasiGagal(create.message);
+ // // }
+ // } catch (error) {
+ // setLoading(false);
+ // clientLogger.error("Error create new profile:", error);
+ // }
+ // }
return (
<>
{
- onSubmit();
+ // onSubmit();
+ handleSubmit();
}}
style={{
border: `2px solid ${AccentColor.yellow}`,
diff --git a/src/app_modules/katalog/profile/_component/comp_load_avatar.tsx b/src/app_modules/katalog/profile/_component/comp_load_avatar.tsx
index 225a9adc..a7a1bcd5 100644
--- a/src/app_modules/katalog/profile/_component/comp_load_avatar.tsx
+++ b/src/app_modules/katalog/profile/_component/comp_load_avatar.tsx
@@ -1,8 +1,8 @@
"use client";
-import { APIs } from "@/app/lib";
-import { pathAssetImage } from "@/app/lib";
-import { RouterImagePreview } from "@/app/lib/router_hipmi/router_image_preview";
+import { APIs } from "@/lib";
+import { pathAssetImage } from "@/lib";
+import { RouterImagePreview } from "@/lib/router_hipmi/router_image_preview";
import { AccentColor } from "@/app_modules/_global/color";
import { Avatar, Center, Image, Skeleton } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
diff --git a/src/app_modules/katalog/profile/_component/comp_load_background.tsx b/src/app_modules/katalog/profile/_component/comp_load_background.tsx
index bf09c029..2775ae33 100644
--- a/src/app_modules/katalog/profile/_component/comp_load_background.tsx
+++ b/src/app_modules/katalog/profile/_component/comp_load_background.tsx
@@ -1,22 +1,25 @@
"use client";
-import { APIs } from "@/app/lib";
-import { pathAssetImage } from "@/app/lib/path_asset_image";
-import { RouterImagePreview } from "@/app/lib";
+import { APIs } from "@/lib";
+import { pathAssetImage } from "@/lib/path_asset_image";
+import { RouterImagePreview } from "@/lib";
import { Center, Image, Skeleton } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { MainColor } from "@/app_modules/_global/color";
export function Profile_ComponentLoadBackgroundImage({
fileId,
+ size
}: {
fileId: string;
+ size?: number
}) {
const router = useRouter();
const [isImage, setIsImage] = useState(null);
const [isLoading, setLoading] = useState(false);
- const url = APIs.GET({ fileId: fileId });
+ const url = APIs.GET({ fileId: fileId,size: size ? size.toString() : "200" });
useShallowEffect(() => {
onLoadImage();
@@ -39,7 +42,7 @@ export function Profile_ComponentLoadBackgroundImage({
if (!isImage)
return (
<>
-
+
+
+ {Array.from({ length: 4 }).map((_, i) => (
+
+ ))}
+
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/katalog/profile/create/layout.tsx b/src/app_modules/katalog/profile/create/layout.tsx
index bf4ef676..72b23f59 100644
--- a/src/app_modules/katalog/profile/create/layout.tsx
+++ b/src/app_modules/katalog/profile/create/layout.tsx
@@ -1,15 +1,24 @@
-
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
export default function ProfileLayout({ children }: { children: any }) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/katalog/profile/create/view.tsx b/src/app_modules/katalog/profile/create/view.tsx
index 0ae5e658..1a85928f 100644
--- a/src/app_modules/katalog/profile/create/view.tsx
+++ b/src/app_modules/katalog/profile/create/view.tsx
@@ -3,27 +3,19 @@
import { MainColor } from "@/app_modules/_global/color";
import {
ComponentGlobal_BoxInformation,
- ComponentGlobal_BoxUploadImage,
ComponentGlobal_ErrorInput,
} from "@/app_modules/_global/component";
-import {
- AspectRatio,
- Avatar,
- Box,
- Button,
- Center,
- FileButton,
- Image,
- Paper,
- Select,
- Stack,
- Text,
- TextInput,
-} from "@mantine/core";
-import { IconAt, IconCamera, IconUpload } from "@tabler/icons-react";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+import { apiGetUserById } from "@/app_modules/_global/lib/api_user";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Select, Stack, TextInput } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconAt } from "@tabler/icons-react";
import { useState } from "react";
-import { validRegex } from "../../component";
+import { emailRegex } from "../../component/regular_expressions";
import { Profile_ComponentCreateNewProfile } from "../_component";
+import Profile_ViewUploadBackground from "./view_upload_background";
+import Profile_ViewUploadFoto from "./view_upload_foto";
export default function CreateProfile() {
const [filePP, setFilePP] = useState(null);
@@ -38,212 +30,149 @@ export default function CreateProfile() {
jenisKelamin: "",
});
+ const [userLoginId, setUserLoginId] = useState();
+ const [dataProfile, setDataProfile] = useState();
+ // const router = useRouter();
+
+ useShallowEffect(() => {
+ handleGetUserLoginId();
+ }, []);
+
+ async function handleGetUserLoginId() {
+ try {
+ const response = await apiNewGetUserIdByToken();
+ if (response.success) {
+ // console.log("response", response);
+ setUserLoginId(response.userId);
+ const responseProfile = await apiGetUserById({
+ id: response.userId,
+ });
+ // console.log("responseProfile", responseProfile?.data);
+ if (responseProfile?.success) {
+ setDataProfile(responseProfile?.data);
+ }
+ }
+ } catch (error) {
+ console.log("Error get user login id", error);
+ }
+ }
+
+ // console.log("userLoginId", userLoginId);
+ // console.log("dataProfile", dataProfile);
+
+ if (!dataProfile) return ;
+
return (
<>
-
-
-
-
-
- {imgPP ? (
-
-
-
- ) : (
-
-
-
- )}
-
+ {dataProfile?.Profile ? (
+
+ ) : (
+
+
-
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
- setImgPP(buffer);
- setFilePP(files);
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
- }
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload
-
- )}
-
-
+
+
+
+ {
+ setValue({
+ ...value,
+ name: val.target.value,
+ });
+ }}
+ />
+ }
+ label="Email"
+ maxLength={100}
+ placeholder="Contoh: User@gmail.com"
+ error={
+ value.email.length > 0 && !value.email.match(emailRegex) ? (
+
+ ) : (
+ ""
+ )
+ }
+ onChange={(val) => {
+ setValue({
+ ...value,
+ email: val.target.value,
+ });
+ }}
+ />
+ {
+ setValue({
+ ...value,
+ alamat: val.target.value,
+ });
+ }}
+ />
+
+ {
+ setValue({
+ ...value,
+ jenisKelamin: val as string,
+ });
+ }}
+ />
+
+
-
-
-
-
-
-
- {imgBG ? (
-
-
-
- ) : (
-
-
-
- Upload Background
-
-
- )}
-
-
-
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
- setImgBG(buffer);
- setFileBG(files);
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
- }
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload
-
- )}
-
-
-
-
-
-
- {
- setValue({
- ...value,
- name: val.target.value,
- });
- }}
- />
- }
- label="Email"
- maxLength={100}
- placeholder="Contoh: User@gmail.com"
- error={
- value.email.length > 0 && !value.email.match(validRegex) ? (
-
- ) : (
- ""
- )
- }
- onChange={(val) => {
- setValue({
- ...value,
- email: val.target.value,
- });
- }}
- />
- {
- setValue({
- ...value,
- alamat: val.target.value,
- });
- }}
- />
-
- {
- setValue({
- ...value,
- jenisKelamin: val as string,
- });
- }}
- />
-
-
-
+ )}
>
);
}
diff --git a/src/app_modules/katalog/profile/create/view_upload_background.tsx b/src/app_modules/katalog/profile/create/view_upload_background.tsx
new file mode 100644
index 00000000..2c81de88
--- /dev/null
+++ b/src/app_modules/katalog/profile/create/view_upload_background.tsx
@@ -0,0 +1,61 @@
+import {
+ ComponentGlobal_BoxInformation,
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
+} from "@/app_modules/_global/component";
+import {
+ AspectRatio,
+ Box,
+ Center,
+ Image,
+ Stack
+} from "@mantine/core";
+import { IconPhoto } from "@tabler/icons-react";
+import { useState } from "react";
+
+export default function Profile_ViewUploadBackground({
+ imgBG,
+ onSetImgBG,
+ fileBG,
+ onSetFileBG,
+}: {
+ imgBG: string;
+ onSetImgBG: (img: string | null) => void;
+ fileBG: File | null;
+ onSetFileBG: (file: File | null) => void;
+}) {
+ const [isLoading, setLoading] = useState(false);
+
+ return (
+ <>
+
+
+
+
+ {imgBG ? (
+
+
+
+ ) : (
+
+
+
+ )}
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/katalog/profile/create/view_upload_foto.tsx b/src/app_modules/katalog/profile/create/view_upload_foto.tsx
new file mode 100644
index 00000000..2163dd53
--- /dev/null
+++ b/src/app_modules/katalog/profile/create/view_upload_foto.tsx
@@ -0,0 +1,69 @@
+import { MainColor } from "@/app_modules/_global/color";
+import {
+ ComponentGlobal_BoxInformation,
+ ComponentGlobal_ButtonUploadFileImage,
+} from "@/app_modules/_global/component";
+import { Avatar, Box, Center, Paper, Stack } from "@mantine/core";
+import { useState } from "react";
+
+export default function Profile_ViewUploadFoto({
+ imgPP,
+ onSetImgPP,
+ filePP,
+ onSetFilePP,
+}: {
+ imgPP: string | null | undefined;
+ onSetImgPP: (img: string | null) => void;
+ filePP: File | null;
+ onSetFilePP: (file: File | null) => void;
+}) {
+ const [isLoading, setLoading] = useState(false);
+
+ return (
+ <>
+
+
+
+
+ {imgPP != undefined || imgPP != null ? (
+
+
+
+ ) : (
+
+
+
+ )}
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/katalog/profile/edit/layout.tsx b/src/app_modules/katalog/profile/edit/layout.tsx
index 3c6f4ca1..a4090bf3 100644
--- a/src/app_modules/katalog/profile/edit/layout.tsx
+++ b/src/app_modules/katalog/profile/edit/layout.tsx
@@ -1,14 +1,24 @@
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
export default function EditProfileLayout({ children }: { children: any }) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/katalog/profile/edit/view.tsx b/src/app_modules/katalog/profile/edit/view.tsx
index 8a907706..08f98dc2 100644
--- a/src/app_modules/katalog/profile/edit/view.tsx
+++ b/src/app_modules/katalog/profile/edit/view.tsx
@@ -1,58 +1,83 @@
"use client";
-import { Button, Loader, Select, Stack, TextInput } from "@mantine/core";
-import _ from "lodash";
-import { useRouter } from "next/navigation";
-import { useState } from "react";
-
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
-import { validRegex } from "../../component/regular_expressions";
-import { Profile_funEditById } from "../fun/update/fun_edit_profile_by_id";
+import { clientLogger } from "@/util/clientLogger";
+import { Button, Select, Stack, TextInput } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import { emailRegex } from "../../component/regular_expressions";
+import { Profile_SkeletonViewEdit } from "../_component/skeleton_view";
+import {
+ apiGetOneProfileById,
+ apiUpdateProfile,
+} from "../lib/api_fetch_profile";
import { MODEL_PROFILE } from "../model/interface";
+import { masterJenisKelamin } from "@/app_modules/_global/lib/master_jenis_kelamin";
-export default function EditProfile({ data }: { data: MODEL_PROFILE }) {
+export default function EditProfile() {
const router = useRouter();
+ const params = useParams<{ id: string }>();
+ const profileId = params.id;
//Get data profile
- const [dataProfile, setDataProfile] = useState(data);
+ const [data, setData] = useState(null);
const [loading, setLoading] = useState(false);
- async function onUpdate() {
- const body = dataProfile;
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
- // console.log(body)
- if (_.values(body).includes("")) return null;
- if (!body.email.match(validRegex)) return null;
+ async function onLoadData() {
+ try {
+ const respone = await apiGetOneProfileById({ id: profileId });
- await Profile_funEditById(body).then((res) => {
- if (res.status === 200) {
- setLoading(true);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- setTimeout(() => router.back(), 1000);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ if (respone) {
+ setData(respone.data);
}
- });
+ } catch (error) {
+ clientLogger.error("Error get data profile", error);
+ }
}
- if (!dataProfile)
- return (
- <>
-
- >
- );
+ async function onUpdate() {
+ // console.log(body)
+ if (_.values(data).includes(""))
+ return ComponentGlobal_NotifikasiPeringatan("Lengkapi data");
+ if (!data?.email.match(emailRegex))
+ return ComponentGlobal_NotifikasiPeringatan("Format email salah");
+
+ try {
+ setLoading(true);
+ const respone = await apiUpdateProfile({ data: data });
+
+ if (respone && respone.success == true) {
+ ComponentGlobal_NotifikasiBerhasil(respone.message);
+ router.back();
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(respone.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error client update profile", error);
+ }
+ }
+
+ if (!data) return ;
return (
<>
- {/* {JSON.stringify(dataProfile, null, 2)} */}
-
+ /> */}
) : (
""
)
}
- value={dataProfile?.name}
+ value={data?.name}
onChange={(val) => {
- setDataProfile({
- ...dataProfile,
+ setData({
+ ...data,
name: val.target.value,
});
}}
@@ -116,26 +144,28 @@ export default function EditProfile({ data }: { data: MODEL_PROFILE }) {
- ) : dataProfile?.email?.length > 0 &&
- !dataProfile?.email.match(validRegex) ? (
+ ) : data?.email?.length > 0 && !data?.email.match(emailRegex) ? (
) : (
""
)
}
- value={dataProfile?.email}
+ value={data?.email}
onChange={(val) => {
- setDataProfile({
- ...dataProfile,
+ setData({
+ ...data,
email: val.target.value,
});
}}
@@ -144,24 +174,27 @@ export default function EditProfile({ data }: { data: MODEL_PROFILE }) {
) : (
""
)
}
onChange={(val) => {
- setDataProfile({
- ...dataProfile,
+ setData({
+ ...data,
alamat: val.target.value,
});
}}
@@ -170,19 +203,22 @@ export default function EditProfile({ data }: { data: MODEL_PROFILE }) {
{
- setDataProfile({
- ...dataProfile,
+ setData({
+ ...data,
jenisKelamin: val,
});
}}
@@ -194,15 +230,13 @@ export default function EditProfile({ data }: { data: MODEL_PROFILE }) {
bg={MainColor.yellow}
color="yellow"
c={"black"}
- loading={loading ? true : false}
+ loading={loading}
loaderPosition="center"
onClick={() => onUpdate()}
>
Update
-
- {/* {JSON.stringify(dataProfile, null, 2)} */}
>
);
}
diff --git a/src/app_modules/katalog/profile/fun/fun_create_profile.ts b/src/app_modules/katalog/profile/fun/fun_create_profile.ts
index eb49f756..7821c3c3 100644
--- a/src/app_modules/katalog/profile/fun/fun_create_profile.ts
+++ b/src/app_modules/katalog/profile/fun/fun_create_profile.ts
@@ -1,14 +1,11 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { MODEL_PROFILE } from "../model/interface";
-import _ from "lodash";
-import { v4 } from "uuid";
-import fs from "fs";
-import { revalidatePath } from "next/cache";
-import { RouterHome } from "@/app/lib/router_hipmi/router_home";
-import { Prisma } from "@prisma/client";
+import prisma from "@/lib/prisma";
+import { RouterHome } from "@/lib/router_hipmi/router_home";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
+import backendLogger from "@/util/backendLogger";
+import { Prisma } from "@prisma/client";
+import { revalidatePath } from "next/cache";
export default async function funCreateNewProfile({
data,
@@ -19,33 +16,55 @@ export default async function funCreateNewProfile({
imageId: string;
imageBackgroundId: string;
}) {
- const userLoginId = await funGetUserIdByToken();
+ try {
+ const userLoginId = await funGetUserIdByToken();
- const findEmail = await prisma.profile.findUnique({
- where: {
- email: data.email,
- },
- });
+ if (!userLoginId) {
+ backendLogger.error("User tidak terautentikasi");
+ return { status: 400, message: "User tidak terautentikasi" }; // Validasi user login
+ }
- if (findEmail) return { status: 400, message: "Email telah digunakan" };
+ const findEmail = await prisma.profile.findUnique({
+ where: {
+ email: data.email,
+ },
+ });
- const createProfile = await prisma.profile.create({
- data: {
- userId: userLoginId,
- name: data.name,
- email: data.email,
- alamat: data.alamat,
- jenisKelamin: data.jenisKelamin,
- imageId: imageId,
- imageBackgroundId: imageBackgroundId,
- },
- });
+ if (findEmail) {
+ return { status: 400, message: "Email telah digunakan" };
+ }
- if (!createProfile) return { status: 400, message: "Gagal membuat profile" };
- revalidatePath(RouterHome.main_home);
+ const createProfile = await prisma.profile.create({
+ data: {
+ userId: userLoginId,
+ name: data.name,
+ email: data.email,
+ alamat: data.alamat,
+ jenisKelamin: data.jenisKelamin,
+ imageId: imageId,
+ imageBackgroundId: imageBackgroundId,
+ },
+ });
- return {
- status: 201,
- message: "Berhasil",
- };
+ if (!createProfile) {
+ backendLogger.error("Gagal membuat profile");
+ return { status: 400, message: "Gagal membuat profile" };
+ }
+
+ // Revalidate cache halaman home
+ try {
+ revalidatePath(RouterHome.main_home);
+ } catch (cacheError) {
+ console.error("Cache revalidation failed:", cacheError);
+ // Tidak membuat fungsi gagal, cukup log error cache
+ }
+
+ return {
+ status: 201,
+ message: "Berhasil",
+ };
+ } catch (error) {
+ backendLogger.error("Terjadi kesalahan pada server", error);
+ return { status: 500, message: "Terjadi kesalahan pada server" };
+ }
}
diff --git a/src/app_modules/katalog/profile/fun/fun_edit_profile.ts b/src/app_modules/katalog/profile/fun/fun_edit_profile.ts
index 64facc0f..a0bf3673 100644
--- a/src/app_modules/katalog/profile/fun/fun_edit_profile.ts
+++ b/src/app_modules/katalog/profile/fun/fun_edit_profile.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_PROFILE_OLD } from "@/app_modules/home/model/user_profile";
export default async function funEditProfile(data: MODEL_PROFILE_OLD) {
diff --git a/src/app_modules/katalog/profile/fun/get/get_one_profile.ts b/src/app_modules/katalog/profile/fun/get/get_one_profile.ts
index 7eb1d3f2..1cace2aa 100644
--- a/src/app_modules/katalog/profile/fun/get/get_one_profile.ts
+++ b/src/app_modules/katalog/profile/fun/get/get_one_profile.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Profile_getOneById(profileId: string) {
const data = await prisma.profile.findFirst({
@@ -9,6 +9,5 @@ export async function Profile_getOneById(profileId: string) {
},
});
-
return data;
}
diff --git a/src/app_modules/katalog/profile/fun/get/get_one_user_profile.ts b/src/app_modules/katalog/profile/fun/get/get_one_user_profile.ts
deleted file mode 100644
index af986a3e..00000000
--- a/src/app_modules/katalog/profile/fun/get/get_one_user_profile.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-"use server";
-
-import prisma from "@/app/lib/prisma";
-
-export async function Profile_getOneProfileAndUserById(profileId: string) {
- const data = await prisma.profile.findFirst({
- where: {
- id: profileId,
- },
- include: {
- User: true,
- },
- });
- // console.log(data)
- return data;
-}
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 5118eae1..04f52be4 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
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_PROFILE } from "../../model/interface";
import { revalidatePath } from "next/cache";
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 55fe194f..b4200273 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
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function profile_funUpdateBackground({
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 0d4d58a5..3df27663 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
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function profile_funUpdatePhoto({
diff --git a/src/app_modules/katalog/profile/lib/api_fetch_profile.ts b/src/app_modules/katalog/profile/lib/api_fetch_profile.ts
new file mode 100644
index 00000000..1be15166
--- /dev/null
+++ b/src/app_modules/katalog/profile/lib/api_fetch_profile.ts
@@ -0,0 +1,57 @@
+import { MODEL_PROFILE } from "../model/interface";
+
+export { apiUpdateProfile, apiGetOneProfileById, apiCreateProfile };
+
+const apiCreateProfile = async ({ data }: { data: MODEL_PROFILE }) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const res = await fetch(`/api/profile`, {
+ method: "POST",
+ body: JSON.stringify({ data }),
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await res.json().catch(() => null);
+}
+
+const apiGetOneProfileById = async ({ id }: { id: string }) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const res = await fetch(`/api/profile/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await res.json().catch(() => null);
+};
+
+const apiUpdateProfile = async ({ data }: { data: MODEL_PROFILE }) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const res = await fetch(`/api/profile/${data.id}`, {
+ method: "PUT",
+ body: JSON.stringify({ data }),
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await res.json().catch(() => null);
+};
+
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 12d03b46..2a7ee62e 100644
--- a/src/app_modules/katalog/profile/upload/foto_background/index.tsx
+++ b/src/app_modules/katalog/profile/upload/foto_background/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { APIs } from "@/app/lib";
+import { APIs } from "@/lib";
import {
ComponentGlobal_BoxUploadImage,
ComponentGlobal_ButtonUploadFileImage,
@@ -9,16 +9,39 @@ import { AspectRatio, Center, Image, Stack } from "@mantine/core";
import { useState } from "react";
import { Profile_ComponentButtonUpdateBackgroundProfile } from "../../_component";
import { MODEL_PROFILE } from "../../model/interface";
+import { useShallowEffect } from "@mantine/hooks";
+import { apiGetOneProfileById } from "../../lib/api_fetch_profile";
+import { useParams } from "next/navigation";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
-export default function Profile_UpdateFotoBackground({
- dataProfile,
-}: {
- dataProfile: MODEL_PROFILE;
-}) {
- const [profile, setProfile] = useState(dataProfile);
+export default function Profile_UpdateFotoBackground() {
+ const param = useParams<{ id: string }>();
+ const profileId = param.id;
+ const [profile, setProfile] = useState(null);
const [file, setFile] = useState(null);
const [image, setImage] = useState(null);
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetOneProfileById({ id: profileId });
+ if (response && response.success) {
+ setProfile(response.data);
+ } else {
+ setProfile(null);
+ }
+ } catch (error) {
+ console.log("Error get profile", error);
+ setProfile(null);
+ }
+ };
+
+ if (!profile)
+ return ;
+
return (
<>
@@ -30,7 +53,10 @@ export default function Profile_UpdateFotoBackground({
src={
image
? image
- : APIs.GET({ fileId: profile.imageBackgroundId as any })
+ : APIs.GET({
+ fileId: profile.imageBackgroundId as any,
+ size: "400",
+ })
}
/>
@@ -45,6 +71,7 @@ export default function Profile_UpdateFotoBackground({
>
diff --git a/src/app_modules/katalog/profile/upload/foto_background/layout.tsx b/src/app_modules/katalog/profile/upload/foto_background/layout.tsx
index eb14b5ab..db3ed9c0 100644
--- a/src/app_modules/katalog/profile/upload/foto_background/layout.tsx
+++ b/src/app_modules/katalog/profile/upload/foto_background/layout.tsx
@@ -1,5 +1,8 @@
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
export default function LayoutProfile_UpdateFotoBackground({
children,
@@ -8,11 +11,18 @@ export default function LayoutProfile_UpdateFotoBackground({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/katalog/profile/upload/foto_profile/index.tsx b/src/app_modules/katalog/profile/upload/foto_profile/index.tsx
index 6e49f09f..85c5bff9 100644
--- a/src/app_modules/katalog/profile/upload/foto_profile/index.tsx
+++ b/src/app_modules/katalog/profile/upload/foto_profile/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { APIs } from "@/app/lib";
+import { APIs } from "@/lib";
import {
ComponentGlobal_BoxUploadImage,
ComponentGlobal_ButtonUploadFileImage,
@@ -9,16 +9,39 @@ import { AspectRatio, Center, Image, Stack } from "@mantine/core";
import { useState } from "react";
import { Profile_ComponentButtonUpdatePhotoProfile } from "../../_component";
import { MODEL_PROFILE } from "../../model/interface";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import { apiGetOneProfileById } from "../../lib/api_fetch_profile";
-export default function UploadFotoProfile({
- dataProfile,
-}: {
- dataProfile: MODEL_PROFILE;
-}) {
- const [profile, setProfile] = useState(dataProfile);
+export default function UploadFotoProfile() {
+ const param = useParams<{ id: string }>();
+ const profileId = param.id;
+ const [profile, setProfile] = useState(null);
const [file, setFile] = useState(null);
const [image, setImage] = useState(null);
+ useShallowEffect(() => {
+ handleLoadData();
+ }, []);
+
+ const handleLoadData = async () => {
+ try {
+ const response = await apiGetOneProfileById({ id: profileId });
+ if (response && response.success) {
+ setProfile(response.data);
+ } else {
+ setProfile(null);
+ }
+ } catch (error) {
+ console.log("Error get profile", error);
+ setProfile(null);
+ }
+ };
+
+ if (!profile)
+ return ;
+
return (
<>
@@ -27,7 +50,11 @@ export default function UploadFotoProfile({
@@ -37,9 +64,11 @@ export default function UploadFotoProfile({
onSetImage={setImage}
/>
+
>
diff --git a/src/app_modules/katalog/profile/upload/foto_profile/layout.tsx b/src/app_modules/katalog/profile/upload/foto_profile/layout.tsx
index a2d18621..faa7aa7b 100644
--- a/src/app_modules/katalog/profile/upload/foto_profile/layout.tsx
+++ b/src/app_modules/katalog/profile/upload/foto_profile/layout.tsx
@@ -1,20 +1,28 @@
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
export default function UploadFotoProfileLayout({
children,
}: {
children: any;
}) {
-
-
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/katalog/ui/list_portolio_new.tsx b/src/app_modules/katalog/ui/list_portolio_new.tsx
new file mode 100644
index 00000000..7fc186a6
--- /dev/null
+++ b/src/app_modules/katalog/ui/list_portolio_new.tsx
@@ -0,0 +1,140 @@
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { Box, Center, Group, Paper, Skeleton, Stack, Text, Title } from "@mantine/core";
+import { apiGetPortofolioByProfile, IListPortofolio } from "../portofolio";
+import { useState } from "react";
+import { useParams, useRouter } from "next/navigation";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { RouterPortofolio } from "@/lib/router_hipmi/router_katalog";
+import { IconCaretRight } from "@tabler/icons-react";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+
+export default function ListPortofolioProfileNew() {
+ const router = useRouter();
+ const param = useParams<{ id: string }>()
+ const [loading, setLoading] = useState(true)
+ const [dataPortofolio, setDataPortofolio] = useState([])
+
+ async function getPortofolio() {
+ try {
+ setLoading(true)
+ const response = await apiGetPortofolioByProfile(`?profile=${param.id}&cat=profile`)
+ if (response) {
+ setDataPortofolio(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false)
+ }
+ }
+
+
+ useShallowEffect(() => {
+ getPortofolio()
+ }, []);
+
+
+ return (
+ <>
+
+
+
+ Portofolio
+
+
+
+ {
+ loading ?
+ <>
+
+
+ >
+ :
+
+ _.isEmpty(dataPortofolio) ? (
+
+
+ - Belum Ada Portofolio -
+
+
+ ) : (
+
+ {dataPortofolio.map((e, i) => (
+ {
+ router.push(RouterPortofolio.main_detail + e?.id);
+ }}
+ style={{
+ backgroundColor: MainColor.darkblue,
+ border: `2px solid ${AccentColor.blue}`,
+ borderRadius: "10px ",
+ padding: "15px",
+ color: MainColor.white,
+ }}
+ >
+
+
+
+ {e?.namaBisnis}
+
+
+ #{e.id_Portofolio}
+
+
+
+
+
+
+
+ ))}
+
+ )
+ }
+
+ {
+ loading ? <>>
+ :
+ _.isEmpty(dataPortofolio) ? (
+ ""
+ ) : (
+
+
+ router.push(
+ RouterPortofolio.daftar_portofolio + param.id,
+ { scroll: false }
+ )
+ }
+ fw={"bold"}
+ fz={"sm"}
+ >
+ Lihat semua
+
+
+ )
+ }
+
+
+
+ >
+ )
+}
\ No newline at end of file
diff --git a/src/app_modules/katalog/ui/profile_detail.tsx b/src/app_modules/katalog/ui/profile_detail.tsx
new file mode 100644
index 00000000..417be218
--- /dev/null
+++ b/src/app_modules/katalog/ui/profile_detail.tsx
@@ -0,0 +1,193 @@
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { apiGetUserProfile, IUserProfile } from "@/app_modules/user";
+import {
+ Box,
+ Button,
+ Center,
+ Group,
+ Stack,
+ Text,
+ ThemeIcon,
+} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import {
+ IconBrandGmail,
+ IconGenderFemale,
+ IconGenderMale,
+ IconHome,
+ IconPhone,
+} from "@tabler/icons-react";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import {
+ Profile_ComponentAvatarProfile,
+ Profile_ComponentLoadBackgroundImage,
+} from "../profile/_component";
+import SkeletonProfile from "./skeleton_profile";
+import { UIGlobal_Modal } from "@/app_modules/_global/ui";
+import Link from "next/link";
+
+export default function ProfileDetail() {
+ const param = useParams<{ id: string }>();
+ const [loading, setLoading] = useState(true);
+ const [dataProfile, setDataProfile] = useState();
+ const [openModal, setOpenModal] = useState(false);
+
+ const listInformation = [
+ {
+ icon: ,
+ value: (
+ setOpenModal(true)}>
+ {"+" + dataProfile?.nomor}
+
+ ),
+ },
+ {
+ icon: ,
+ value: dataProfile?.email,
+ },
+ {
+ icon: ,
+ value: dataProfile?.alamat,
+ },
+ {
+ icon:
+ dataProfile?.jenisKelamin === "Laki-laki" ? (
+
+ ) : (
+
+ ),
+ value: dataProfile?.jenisKelamin,
+ },
+ ];
+
+ async function getProfile() {
+ try {
+ setLoading(true);
+ const response = await apiGetUserProfile(`?profile=${param.id}`);
+ if (response) {
+ setDataProfile(response.data);
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ useShallowEffect(() => {
+ getProfile();
+ }, []);
+
+ return (
+ <>
+
+ {loading ? (
+
+ ) : (
+ <>
+
+
+
+
+
+
+
+
+
+ {dataProfile?.name}
+
+
+ @{dataProfile?.username}
+
+
+
+
+
+
+ {listInformation.map((e, i) => (
+
+
+ {e.icon}
+
+
+
+ {e?.value}
+
+
+
+ ))}
+
+
+ >
+ )}
+
+
+ {
+ setOpenModal(false);
+ }}
+ buttonKanan={
+
+
+ Lanjutkan
+
+
+ }
+ buttonKiri={
+ setOpenModal(false)}>
+ Batal
+
+ }
+ />
+ >
+ );
+}
diff --git a/src/app_modules/katalog/ui/skeleton_profile.tsx b/src/app_modules/katalog/ui/skeleton_profile.tsx
new file mode 100644
index 00000000..3ed49780
--- /dev/null
+++ b/src/app_modules/katalog/ui/skeleton_profile.tsx
@@ -0,0 +1,89 @@
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Box, Center, Grid, Skeleton, Stack } from "@mantine/core";
+
+export default function SkeletonProfile() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {[...Array(4)].map((_, index) => (
+
+
+
+
+
+
+
+
+
+
+ ))}
+
+
+
+ >
+ );
+}
+// import { Avatar, Box, Center, Grid, Skeleton, Stack } from "@mantine/core";
+
+// export default function SkeletonProfile() {
+// return (
+// <>
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+
+//
+//
+// {[...Array(4)].map((_, index) => (
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+// ))}
+//
+//
+//
+// >
+// )
+// }
\ No newline at end of file
diff --git a/src/app_modules/katalog/ui/ui_list_portofolio.tsx b/src/app_modules/katalog/ui/ui_list_portofolio.tsx
index 7e237b67..83634141 100644
--- a/src/app_modules/katalog/ui/ui_list_portofolio.tsx
+++ b/src/app_modules/katalog/ui/ui_list_portofolio.tsx
@@ -1,6 +1,6 @@
"use cleint";
-import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog";
+import { RouterPortofolio } from "@/lib/router_hipmi/router_katalog";
import {
AccentColor,
MainColor,
diff --git a/src/app_modules/katalog/ui/ui_profile.tsx b/src/app_modules/katalog/ui/ui_profile.tsx
index bc0be610..d844d433 100644
--- a/src/app_modules/katalog/ui/ui_profile.tsx
+++ b/src/app_modules/katalog/ui/ui_profile.tsx
@@ -68,6 +68,7 @@ export function Profile_UiView({
+
+
+
+
+ >
+ )
+}
\ No newline at end of file
diff --git a/src/app_modules/map/_component/api_fetch_map.ts b/src/app_modules/map/_component/api_fetch_map.ts
new file mode 100644
index 00000000..6f15ce14
--- /dev/null
+++ b/src/app_modules/map/_component/api_fetch_map.ts
@@ -0,0 +1,25 @@
+export { apiCreatePinMap };
+
+const apiCreatePinMap = async ({
+ portofolioId,
+ data,
+}: {
+ portofolioId: string;
+ data: any;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const respone = await fetch(`/api/map/${portofolioId}`, {
+ method: "POST",
+ body: JSON.stringify({ data }),
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await respone.json().catch(() => null);
+};
diff --git a/src/app_modules/map/_component/button/comp_button_save_pin.tsx b/src/app_modules/map/_component/button/comp_button_save_pin.tsx
index 8af85a08..4df5466b 100644
--- a/src/app_modules/map/_component/button/comp_button_save_pin.tsx
+++ b/src/app_modules/map/_component/button/comp_button_save_pin.tsx
@@ -8,10 +8,20 @@ import {
} from "@/app_modules/_global/notif_global";
import { Button } from "@mantine/core";
import { useRouter } from "next/navigation";
+import { useState } from "react";
import { map_funCreatePin } from "../../fun/create/fun_create_pin";
-import { DIRECTORY_ID } from "@/app/lib";
import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
+import { DIRECTORY_ID } from "@/lib";
+import { clientLogger } from "@/util/clientLogger";
+import { data } from "autoprefixer";
+import { apiCreatePinMap } from "../api_fetch_map";
+interface ICreatePinMAp {
+ latitude: string;
+ longitude: string;
+ namePin: string;
+ imageId: string;
+}
export function ComponentMap_ButtonSavePin({
namePin,
lat,
@@ -26,38 +36,82 @@ export function ComponentMap_ButtonSavePin({
file: File;
}) {
const router = useRouter();
- async function onSavePin() {
- const uploadFileToStorage = await funGlobal_UploadToStorage({
+ const [loading, setLoading] = useState(false);
+
+ const handleUploadImage = async () => {
+ const uploadResult = await funGlobal_UploadToStorage({
file: file,
dirId: DIRECTORY_ID.map_image,
});
- if (!uploadFileToStorage.success)
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ if (!uploadResult.success) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ }
- const res = await map_funCreatePin({
- data: {
- latitude: lat as any,
- longitude: long as any,
- namePin: namePin as any,
- imageId: uploadFileToStorage.data.id,
- Portofolio: {
- create: { id: portofolioId } as any,
- },
- },
+ return uploadResult.data.id;
+ };
+
+ const handleCreatePin = async (imageId: string) => {
+ const newData: ICreatePinMAp = {
+ latitude: lat,
+ longitude: long,
+ namePin: namePin,
+ imageId: imageId,
+ };
+
+ const respone = await apiCreatePinMap({
+ portofolioId: portofolioId,
+ data: newData,
});
- res.status === 200
- ? (ComponentGlobal_NotifikasiBerhasil(res.message), router.back())
- : ComponentGlobal_NotifikasiGagal(res.message);
- }
+
+ if (respone && respone.success) {
+ ComponentGlobal_NotifikasiBerhasil(respone.message);
+ router.back();
+ }
+
+ return respone;
+ };
+
+ const validateInput = () => {
+ if (!namePin || !file) {
+ ComponentGlobal_NotifikasiPeringatan(
+ "Nama pin dan file gambar harus diisi"
+ );
+ return false;
+ }
+ return true;
+ };
+
+ const onSavePin = async () => {
+ if (!validateInput()) return;
+
+ try {
+ setLoading(true);
+
+ const imageId = await handleUploadImage();
+ const createPinResult = await handleCreatePin(imageId);
+
+ if (!createPinResult.success) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal membuat pin");
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error create pin", (error as Error).message);
+ ComponentGlobal_NotifikasiGagal("Terjadi kesalahan saat menyimpan pin");
+ }
+ };
return (
<>
(null);
- const url = APIs.GET({ fileId: fileId, size: size });
+ const url = APIs.GET({ fileId: fileId, size: size ? size : "400" });
useShallowEffect(() => {
onLoadImage();
diff --git a/src/app_modules/map/_component/detail_data.tsx b/src/app_modules/map/_component/detail_data.tsx
index d76b7b5c..2e1f1602 100644
--- a/src/app_modules/map/_component/detail_data.tsx
+++ b/src/app_modules/map/_component/detail_data.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog";
+import { RouterPortofolio } from "@/lib/router_hipmi/router_katalog";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_AvatarAndUsername } from "@/app_modules/_global/component";
import { MODEL_USER } from "@/app_modules/home/model/interface";
@@ -18,6 +18,8 @@ import { map_funGetOneById } from "../fun/get/fun_get_one_by_id";
import { MODEL_MAP } from "../lib/interface";
import { ComponentMap_LoadImageMap } from "./comp_load_image_map";
import { ComponentMap_SkeletonDrawerDetailData } from "./skeleton_detail_data";
+import { UIGlobal_Modal } from "@/app_modules/_global/ui";
+import Link from "next/link";
export function ComponentMap_DetailData({
mapId,
@@ -30,12 +32,13 @@ export function ComponentMap_DetailData({
const [data, setData] = useState();
const [dataUser, setDataUser] = useState();
const [isLoading, setIsLoading] = useState(false);
+ const [openModal, setOpenModal] = useState(false);
useShallowEffect(() => {
- onLoadData(setData, setDataUser);
- }, [setData, setDataUser]);
+ onLoadData();
+ }, []);
- async function onLoadData(setData: any, setDataUser: any) {
+ async function onLoadData() {
const res: any = await map_funGetOneById({ mapId: mapId });
setData(res);
setDataUser(res.Author);
@@ -46,9 +49,7 @@ export function ComponentMap_DetailData({
return (
<>
-
+
@@ -74,7 +75,13 @@ export function ComponentMap_DetailData({
- +{data?.Portofolio.tlpn}
+ {
+ setOpenModal(true);
+ }}
+ >
+ + {data?.Portofolio.tlpn}
+
@@ -127,6 +134,36 @@ export function ComponentMap_DetailData({
+
+ {
+ setOpenModal(false);
+ }}
+ buttonKanan={
+
+
+ Lanjutkan
+
+
+ }
+ buttonKiri={
+ setOpenModal(false)}>
+ Batal
+
+ }
+ />
>
);
}
diff --git a/src/app_modules/map/_component/drawer_new.tsx b/src/app_modules/map/_component/drawer_new.tsx
new file mode 100644
index 00000000..62ceaebe
--- /dev/null
+++ b/src/app_modules/map/_component/drawer_new.tsx
@@ -0,0 +1,206 @@
+import { RouterPortofolio } from "@/lib/router_hipmi/router_katalog";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
+import { ActionIcon, Box, Button, Drawer, Grid, Group, Skeleton, Stack, Text, Title } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { IconBuildingSkyscraper, IconListDetails, IconMapPin, IconPhoneCall, IconX } from "@tabler/icons-react";
+import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { apiGetOneMapById } from "../lib/api_map";
+import { IDataMap, IDataMapDetailAuthor, IDataMapDetailBisnis } from "../lib/type_map";
+import { ComponentMap_LoadImageMap } from "./comp_load_image_map";
+import { ComponentMap_SkeletonDrawerDetailData } from "./skeleton_detail_data";
+
+
+
+
+
+// SALAHHHHHHHH ---- HARUS ULANGG
+export function ComponentMap_DrawerDetailDataNew({ opened, close, mapId, }: { opened: boolean; close: () => void; mapId: string }) {
+ const router = useRouter();
+ const [dataLokasi, setDataLokasi] = useState()
+ const [dataAuthor, setDataAuthor] = useState()
+ const [dataBisnis, setDataBisnis] = useState()
+ const [loading, setLoading] = useState(false)
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ setLoading(true)
+ const response = await apiGetOneMapById(mapId)
+ if (response.success) {
+ setDataLokasi(response.dataLokasi)
+ setDataAuthor(response.dataAuthor)
+ setDataBisnis(response.dataBisnis)
+ }
+ } catch (error) {
+ console.error(error)
+ } finally {
+ setLoading(false)
+ }
+ }
+
+ return (
+ <>
+ close()}
+ position={"bottom"}
+ size={"auto"}
+ withCloseButton={false}
+ styles={{
+ content: {
+ padding: 0,
+ position: "absolute",
+ margin: "auto",
+ backgroundColor: "transparent",
+ left: 0,
+ right: 0,
+ width: 500,
+ },
+ body: {
+ backgroundColor: AccentColor.darkblue,
+ borderTop: `2px solid ${AccentColor.blue}`,
+ borderRight: `1px solid ${AccentColor.blue}`,
+ borderLeft: `1px solid ${AccentColor.blue}`,
+ borderRadius: "20px 20px 0px 0px",
+ color: "white",
+ paddingBottom: "5%",
+ },
+ }}
+ >
+
+
+
+ {dataLokasi?.namePin ? (
+ dataLokasi?.namePin
+ ) : (
+
+ )}
+
+
+
+
+
+
+
+
+
+
+ {
+ loading ?
+ :
+
+
+
+ onCheckProfile()}
+ >
+
+
+
+
+
+ onCheckProfile()}
+ >
+ {dataAuthor?.name}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {dataBisnis?.namaBisnis}
+
+
+
+
+
+
+
+ {dataBisnis?.bidangBisnis}
+
+
+
+
+
+
+
+ +{dataBisnis?.tlpn}
+
+
+
+
+
+
+
+ {dataBisnis?.alamatKantor}
+
+
+
+
+
+ {
+ router.push(
+ RouterPortofolio.main_detail + dataBisnis?.id, { scroll: false, }
+ );
+ }}
+ loaderPosition="center"
+ radius={"xl"}
+ bg={MainColor.yellow}
+ color="yellow"
+ c={"black"}
+ >
+ Detail
+
+
+ {
+ window.open(
+ `https://maps.google.com?q=${dataLokasi?.latitude},${dataLokasi?.longitude}`,
+ "_blank",
+ "width=800,height=600,noopener,noreferrer"
+ );
+ }}
+ >
+ Buka Maps
+
+
+
+ }
+
+
+
+
+
+
+
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/map/_component/header.tsx b/src/app_modules/map/_component/header.tsx
index ea6f9539..433e5d3a 100644
--- a/src/app_modules/map/_component/header.tsx
+++ b/src/app_modules/map/_component/header.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterMap } from "@/app/lib/router_hipmi/router_map";
+import { RouterMap } from "@/lib/router_hipmi/router_map";
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import { ActionIcon } from "@mantine/core";
diff --git a/src/app_modules/map/fun/create/fun_create_pin.ts b/src/app_modules/map/fun/create/fun_create_pin.ts
index 95b942a4..513f6ae6 100644
--- a/src/app_modules/map/fun/create/fun_create_pin.ts
+++ b/src/app_modules/map/fun/create/fun_create_pin.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterMap } from "@/app/lib/router_hipmi/router_map";
+import prisma from "@/lib/prisma";
+import { RouterMap } from "@/lib/router_hipmi/router_map";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { Prisma } from "@prisma/client";
import { revalidatePath } from "next/cache";
diff --git a/src/app_modules/map/fun/edit/fun_custom_pin_map.ts b/src/app_modules/map/fun/edit/fun_custom_pin_map.ts
index bc97b941..e652a2b8 100644
--- a/src/app_modules/map/fun/edit/fun_custom_pin_map.ts
+++ b/src/app_modules/map/fun/edit/fun_custom_pin_map.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog";
+import prisma from "@/lib/prisma";
+import { RouterPortofolio } from "@/lib/router_hipmi/router_katalog";
import { revalidatePath } from "next/cache";
export async function map_funCustomPinMap({
diff --git a/src/app_modules/map/fun/edit/fun_edit_map.ts b/src/app_modules/map/fun/edit/fun_edit_map.ts
index c0f25526..dff621f0 100644
--- a/src/app_modules/map/fun/edit/fun_edit_map.ts
+++ b/src/app_modules/map/fun/edit/fun_edit_map.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog";
+import prisma from "@/lib/prisma";
+import { RouterPortofolio } from "@/lib/router_hipmi/router_katalog";
import { revalidatePath } from "next/cache";
import { MODEL_MAP } from "../../lib/interface";
diff --git a/src/app_modules/map/fun/get/fun_get_all_map.ts b/src/app_modules/map/fun/get/fun_get_all_map.ts
index fcf777c2..989edd0a 100644
--- a/src/app_modules/map/fun/get/fun_get_all_map.ts
+++ b/src/app_modules/map/fun/get/fun_get_all_map.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function map_funGetAllMap() {
const data = await prisma.businessMaps.findMany({
diff --git a/src/app_modules/map/fun/get/fun_get_one_by_id.ts b/src/app_modules/map/fun/get/fun_get_one_by_id.ts
index bc7923e8..392f38b2 100644
--- a/src/app_modules/map/fun/get/fun_get_one_by_id.ts
+++ b/src/app_modules/map/fun/get/fun_get_one_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function map_funGetOneById({ mapId }: { mapId: string }) {
const data = await prisma.businessMaps.findFirst({
diff --git a/src/app_modules/map/fun/get/fun_get_one_by_portofolio_id.ts b/src/app_modules/map/fun/get/fun_get_one_by_portofolio_id.ts
index 81355a48..ef8ffbdd 100644
--- a/src/app_modules/map/fun/get/fun_get_one_by_portofolio_id.ts
+++ b/src/app_modules/map/fun/get/fun_get_one_by_portofolio_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function map_funGetOneBusinessMapByPortofolioId({
portofolioId,
diff --git a/src/app_modules/map/lib/api_map.ts b/src/app_modules/map/lib/api_map.ts
new file mode 100644
index 00000000..c2c388c9
--- /dev/null
+++ b/src/app_modules/map/lib/api_map.ts
@@ -0,0 +1,63 @@
+export const apiGetAllMap = async (path?: string) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const response = await fetch(`/api/new/map${path ? path : ""}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ return await response.json().catch(() => null);
+};
+
+export const apiGetOneMapById = async (path: string) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+
+ const response = await fetch(`/api/new/map/${path}`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ return await response.json().catch(() => null);
+};
+
+export const apiGetOneMapByPortofolioId = async ({ id }: { id: string }) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/map/${id}/portofolio`, {
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "Access-Control-Allow-Origin": "*",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get one map by portofolio id", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get one map by portofolio id");
+ }
+
+ // Return the JSON response
+ const data = await response.json();
+ return data;
+ } catch (error) {
+ console.error("Error get one map by portofolio id", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
\ No newline at end of file
diff --git a/src/app_modules/map/lib/type_map.ts b/src/app_modules/map/lib/type_map.ts
new file mode 100644
index 00000000..f4b21aa6
--- /dev/null
+++ b/src/app_modules/map/lib/type_map.ts
@@ -0,0 +1,24 @@
+export interface IDataMap {
+ id: string
+ namePin: string
+ latitude: string
+ longitude: string
+ pinId: string
+ logoId: string
+ imageId: string
+}
+
+export interface IDataMapDetailAuthor {
+ id: string
+ name: string
+ imageId: string
+}
+
+export interface IDataMapDetailBisnis {
+ id: string
+ alamatKantor: string
+ tlpn: string
+ deskripsi: string
+ namaBisnis: string
+ bidangBisnis: string
+}
\ No newline at end of file
diff --git a/src/app_modules/map/ui/ui_create_pin.tsx b/src/app_modules/map/ui/ui_create_pin.tsx
index db5e656c..c02436f0 100644
--- a/src/app_modules/map/ui/ui_create_pin.tsx
+++ b/src/app_modules/map/ui/ui_create_pin.tsx
@@ -4,22 +4,22 @@ import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
-import { ComponentGlobal_BoxUploadImage } from "@/app_modules/_global/component";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
+import {
+ ComponentGlobal_BoxInformation,
+ ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
+} from "@/app_modules/_global/component";
import {
AspectRatio,
- Button,
Center,
- FileButton,
Image,
Paper,
Stack,
- Text,
- TextInput,
- Title
+ TextInput
} from "@mantine/core";
-import { IconCamera } from "@tabler/icons-react";
+import { IconPhoto } from "@tabler/icons-react";
import _ from "lodash";
+import { useParams } from "next/navigation";
import { useState } from "react";
import Map, {
AttributionControl,
@@ -30,89 +30,98 @@ import Map, {
import { ComponentMap_ButtonSavePin } from "../_component";
import { defaultLatLong, defaultMapZoom } from "../lib/default_lat_long";
-export function UiMap_CreatePin({
- mapboxToken,
- portofolioId,
-}: {
- mapboxToken: string;
- portofolioId: string;
-}) {
+export function UiMap_CreatePin({ mapboxToken }: { mapboxToken: string }) {
+ const params = useParams<{ id: string }>();
+ const portofolioId = params.id;
const [[lat, long], setLatLong] = useState([0, 0]);
const [isPin, setIsPin] = useState(false);
const [namePin, setNamePin] = useState("");
- const [file, setFile] = useState(null);
+ const [file, setFile] = useState(null);
const [img, setImg] = useState(null);
return (
<>
-
- {
- setLatLong([a.lngLat.lat, a.lngLat.lng]);
- setIsPin(true);
- }}
- attributionControl={false}
- >
-
+ {/* Map Pin */}
+
+
+ {
+ setLatLong([a.lngLat.lat, a.lngLat.lng]);
+ setIsPin(true);
+ }}
+ attributionControl={false}
>
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
- {
- setNamePin(_.startCase(val.currentTarget.value));
+
-
+ >
+ {
+ setNamePin(_.startCase(val.currentTarget.value));
+ }}
+ />
+
+
-
+
+
{img ? (
@@ -125,51 +134,16 @@ export function UiMap_CreatePin({
) : (
- Foto Lokasi Bisnis
-
- Upload foto lokasi bisnis anda untuk ditampilkan dalam detail
- map
-
+
)}
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
- if (files.size > 2000000) {
- ComponentGlobal_NotifikasiPeringatan(
- "Maaf, Ukuran file terlalu besar, maximum 2mb",
- 3000
- );
- } else {
- setImg(buffer);
- setFile(files);
- }
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
- }
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload
-
- )}
-
+
@@ -178,7 +152,7 @@ export function UiMap_CreatePin({
lat={lat as any}
long={long as any}
portofolioId={portofolioId}
- file={file}
+ file={file as File}
/>
>
diff --git a/src/app_modules/map/ui/ui_custom_pin.tsx b/src/app_modules/map/ui/ui_custom_pin.tsx
index 0b963d28..b1e3ad81 100644
--- a/src/app_modules/map/ui/ui_custom_pin.tsx
+++ b/src/app_modules/map/ui/ui_custom_pin.tsx
@@ -1,18 +1,22 @@
"use client";
-import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog";
-import { RouterMap } from "@/app/lib/router_hipmi/router_map";
+import { APIs, DIRECTORY_ID } from "@/lib";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
+import { ComponentGlobal_ButtonUploadFileImage } from "@/app_modules/_global/component";
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import {
+ funGlobal_DeleteFileById,
+ funGlobal_UploadToStorage,
+} from "@/app_modules/_global/fun";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
-import { Avatar, Button, Center, FileButton, Stack } from "@mantine/core";
-import { IconCamera } from "@tabler/icons-react";
+import { clientLogger } from "@/util/clientLogger";
+import { Avatar, Button, Center, Stack } from "@mantine/core";
import { useRouter } from "next/navigation";
import { useState } from "react";
import {
@@ -25,8 +29,6 @@ import {
import { map_funCustomPinMap } from "../fun";
import { defaultMapZoom } from "../lib/default_lat_long";
import { MODEL_MAP } from "../lib/interface";
-import { APIs, DIRECTORY_ID } from "@/app/lib";
-import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
export function UiMap_CustomPin({
dataMap,
@@ -49,7 +51,7 @@ export function UiMap_CustomPin({
@@ -72,8 +74,8 @@ export function UiMap_CustomPin({
radius={"100%"}
src={
data.pinId === null
- ? APIs.GET({ fileId: data.Portofolio.logoId })
- : APIs.GET({ fileId: data.pinId })
+ ? APIs.GET({ fileId: data.Portofolio.logoId, size: "300" })
+ : APIs.GET({ fileId: data.pinId, size: "300" })
}
style={{
border: `2px solid ${AccentColor.skyblue}`,
@@ -84,40 +86,10 @@ export function UiMap_CustomPin({
)}
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
- if (files.size > 2000000) {
- ComponentGlobal_NotifikasiPeringatan(
- "Maaf, Ukuran file terlalu besar, maximum 2mb",
- 3000
- );
- } else {
- setImgPin(buffer);
- setFilePin(files);
- }
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
- }
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload
-
- )}
-
+
@@ -155,8 +127,8 @@ export function UiMap_CustomPin({
imgPin
? imgPin
: data.pinId === null
- ? APIs.GET({ fileId: data.Portofolio.logoId })
- : APIs.GET({ fileId: data.pinId })
+ ? APIs.GET({ fileId: data.Portofolio.logoId, size: "300" })
+ : APIs.GET({ fileId: data.pinId, size: "300" })
}
style={{
border: `2px solid ${AccentColor.softblue}`,
@@ -170,34 +142,68 @@ export function UiMap_CustomPin({
-
+
>
);
}
-function ButtonSimpan({ mapId, filePin }: { mapId: string; filePin: File }) {
+function ButtonSimpan({
+ mapId,
+ filePin,
+ fileRemoveId,
+}: {
+ mapId: string;
+ filePin: File;
+ fileRemoveId: string;
+}) {
const router = useRouter();
const [isLoading, setLoading] = useState(false);
async function onCustom() {
- const uploadFileToStorage = await funGlobal_UploadToStorage({
- file: filePin,
- dirId: DIRECTORY_ID.map_pin,
- });
+ try {
+ setLoading(true);
- if (!uploadFileToStorage.success)
- return ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ const uploadFileToStorage = await funGlobal_UploadToStorage({
+ file: filePin,
+ dirId: DIRECTORY_ID.map_pin,
+ });
- const res = await map_funCustomPinMap({
- mapId: mapId,
- fileId: uploadFileToStorage.data.id,
- });
- res.status === 200
- ? (ComponentGlobal_NotifikasiBerhasil(res.message),
- setLoading(true),
- router.back())
- : ComponentGlobal_NotifikasiGagal(res.message);
+ if (!uploadFileToStorage.success) {
+ setLoading(false);
+ ComponentGlobal_NotifikasiPeringatan("Gagal upload gambar");
+ return;
+ }
+
+ const deletePin = await funGlobal_DeleteFileById({
+ fileId: fileRemoveId,
+ dirId: DIRECTORY_ID.map_pin,
+ });
+ if (!deletePin.success) {
+ setLoading(false);
+ clientLogger.error("Error delete logo", deletePin.message);
+ }
+
+ const res = await map_funCustomPinMap({
+ mapId: mapId,
+ fileId: uploadFileToStorage.data.id,
+ });
+
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ router.back();
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ setLoading(false);
+ clientLogger.error("Error custom pin", error);
+ }
}
return (
diff --git a/src/app_modules/map/ui/ui_edit_map.tsx b/src/app_modules/map/ui/ui_edit_map.tsx
index 9cabf547..7de7bed4 100644
--- a/src/app_modules/map/ui/ui_edit_map.tsx
+++ b/src/app_modules/map/ui/ui_edit_map.tsx
@@ -1,12 +1,13 @@
"use client";
-import { APIs } from "@/app/lib";
+import { APIs } from "@/lib";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
import {
ComponentGlobal_BoxUploadImage,
+ ComponentGlobal_ButtonUploadFileImage,
ComponentGlobal_LoadImage,
} from "@/app_modules/_global/component";
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
@@ -33,6 +34,8 @@ import Map, {
import { ComponentMap_ButtonUpdateDataMap } from "../_component";
import { defaultMapZoom } from "../lib/default_lat_long";
import { MODEL_MAP } from "../lib/interface";
+import { MAX_SIZE } from "@/app_modules/_global/lib";
+import { PemberitahuanMaksimalFile } from "@/app_modules/_global/lib/maximal_setting";
export function UiMap_EditMap({
mapboxToken,
@@ -47,89 +50,100 @@ export function UiMap_EditMap({
return (
<>
-
- {
- setData({
- ...data,
- latitude: a.lngLat.lat,
- longitude: a.lngLat.lng,
- });
- }}
- attributionControl={false}
- >
-
+
+
+
+
-
-
-
-
-
-
-
-
- {
+ style={{
+ cursor: "pointer",
+ width: "100%",
+ height: "60vh",
+ borderRadius: "10px",
+ }}
+ onClick={(a) => {
setData({
...data,
- namePin: val.currentTarget.value,
+ latitude: a.lngLat.lat,
+ longitude: a.lngLat.lng,
});
}}
- />
-
+ attributionControl={false}
+ >
+
+
+
+
+
+
+
+
+
+ {
+ setData({
+ ...data,
+ namePin: val.currentTarget.value,
+ });
+ }}
+ />
+
+
{/* Photo Usaha */}
-
+
{img ? (
@@ -141,79 +155,11 @@ export function UiMap_EditMap({
)}
- {/* {img ? (
-
-
-
-
-
- ) : (
-
-
-
-
-
- )} */}
-
- {
- try {
- const buffer = URL.createObjectURL(
- new Blob([new Uint8Array(await files.arrayBuffer())])
- );
- if (files.size > 2000000) {
- ComponentGlobal_NotifikasiPeringatan(
- "Maaf, Ukuran file terlalu besar, maximum 2mb",
- 3000
- );
- } else {
- setImg(buffer);
- setFile(files);
- }
- } catch (error) {
- console.log(error);
- }
- }}
- accept="image/png,image/jpeg"
- >
- {(props) => (
- }
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Upload
-
- )}
-
+
diff --git a/src/app_modules/map/ui/ui_map.tsx b/src/app_modules/map/ui/ui_map.tsx
index b84fe339..232f1f35 100644
--- a/src/app_modules/map/ui/ui_map.tsx
+++ b/src/app_modules/map/ui/ui_map.tsx
@@ -1,6 +1,6 @@
"use client";
-import { APIs } from "@/app/lib";
+import { APIs } from "@/lib";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import { Avatar, Stack } from "@mantine/core";
@@ -91,8 +91,8 @@ export function UiMap_MapBoxView({
}}
src={
e.pinId === null
- ? APIs.GET({ fileId: e.Portofolio.logoId })
- : APIs.GET({ fileId: e.pinId })
+ ? APIs.GET({ fileId: e.Portofolio.logoId, size: "300" })
+ : APIs.GET({ fileId: e.pinId, size: "300" })
}
/>
@@ -110,7 +110,7 @@ export function UiMap_MapBoxView({
opened={openDrawer}
close={() => setOpenDrawer(false)}
mapId={mapId}
- component={}
+ component={}
/>
>
);
diff --git a/src/app_modules/map/ui/ui_map_new.tsx b/src/app_modules/map/ui/ui_map_new.tsx
new file mode 100644
index 00000000..9857b9bc
--- /dev/null
+++ b/src/app_modules/map/ui/ui_map_new.tsx
@@ -0,0 +1,122 @@
+"use client";
+import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { APIs } from "@/lib";
+import { Avatar, Loader, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import "mapbox-gl/dist/mapbox-gl.css";
+import { useState } from "react";
+import Map, { AttributionControl, Marker, NavigationControl, ScaleControl, } from "react-map-gl";
+import { ComponentMap_DetailData, ComponentMap_DrawerDetailData } from "../_component";
+import { apiGetAllMap } from "../lib/api_map";
+import { defaultLatLong, defaultMapZoom } from "../lib/default_lat_long";
+import { IDataMap } from "../lib/type_map";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+
+export function UiMap_MapBoxViewNew({ mapboxToken, }: { mapboxToken: string }) {
+ const [mapId, setMapId] = useState("");
+ const [openDrawer, setOpenDrawer] = useState(false);
+ const [data, setData] = useState([]);
+ const [loading, setLoading] = useState(false);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ setLoading(true)
+ const response = await apiGetAllMap()
+ if (response) {
+ setData(response.data)
+ }
+ } catch (error) {
+ console.error(error)
+ } finally {
+ setLoading(false)
+ }
+ }
+
+ if (!mapboxToken)
+ return ;
+
+ return (
+ <>
+
+ {
+ loading ?
+
+ :
+
+ {data?.map((e, i) => (
+
+
+ {
+ setMapId(e.id);
+ setOpenDrawer(true);
+ }}
+ >
+
+
+
+
+ ))}
+
+
+
+
+
+ }
+
+
+ setOpenDrawer(false)}
+ mapId={mapId}
+ component={}
+ />
+
+ {/* setOpenDrawer(false)} mapId={mapId}/> */}
+ >
+ );
+}
diff --git a/src/app_modules/map/ui/ui_splash.tsx b/src/app_modules/map/ui/ui_splash.tsx
index d945b96c..a39ee6a5 100644
--- a/src/app_modules/map/ui/ui_splash.tsx
+++ b/src/app_modules/map/ui/ui_splash.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterMap } from "@/app/lib/router_hipmi/router_map";
+import { RouterMap } from "@/lib/router_hipmi/router_map";
import UIGlobal_SplashScreen from "@/app_modules/_global/ui/ui_splash";
import { useShallowEffect } from "@mantine/hooks";
import { IconMap2 } from "@tabler/icons-react";
@@ -11,7 +11,7 @@ export function UiMap_SplashView() {
useShallowEffect(() => {
setTimeout(() => {
- router.replace(RouterMap.main_view, { scroll: false }), 1000;
+ router.replace(RouterMap.main_view, { scroll: false }), 500;
});
}, []);
return (
diff --git a/src/app_modules/map/view/create.tsx b/src/app_modules/map/view/create.tsx
index 7912ae91..78934cfb 100644
--- a/src/app_modules/map/view/create.tsx
+++ b/src/app_modules/map/view/create.tsx
@@ -1,29 +1,36 @@
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import { UiMap_CreatePin } from "../ui/ui_create_pin";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, { UI_NewChildren, UI_NewHeader } from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { UiMap_CreatePin } from "../ui/ui_create_pin";
const mapboxToken = process.env.MAPBOX_TOKEN!;
-export async function Map_CreateNewPin({
- portofolioId,
-}: {
- portofolioId: string;
-}) {
- if (!mapboxToken)
- return ;
-
+export async function Map_CreateNewPin() {
return (
<>
-
}
>
-
-
+ {!mapboxToken ? (
+
+ ) : (
+
+ )}
+ */}
+
+
+
+
+
+
+ {!mapboxToken ? (
+
+ ) : (
+
+ )}
+
+
>
);
}
diff --git a/src/app_modules/map/view/custom_pin.tsx b/src/app_modules/map/view/custom_pin.tsx
index 367202c5..94a155fc 100644
--- a/src/app_modules/map/view/custom_pin.tsx
+++ b/src/app_modules/map/view/custom_pin.tsx
@@ -1,16 +1,55 @@
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import { UiMap_CustomPin } from "../ui";
+"use client";
-const mapboxToken = process.env.MAPBOX_TOKEN!;
-export async function Map_CustomPin({ dataMap }: { dataMap: any }) {
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { UiMap_CustomPin } from "../ui";
+import { apiGetOneMapByPortofolioId } from "../lib/api_map";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { useShallowEffect } from "@mantine/hooks";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { ComponentGlobal_BoxInformation } from "@/app_modules/_global/component";
+
+export function Map_CustomPin({ mapboxToken }: { mapboxToken: string }) {
+ const { id } = useParams();
+ const [data, setData] = useState();
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetOneMapByPortofolioId({ id: id as string });
+ if (response.success) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ setData(null);
+ console.error("Error get one map by portofolio id", error);
+ }
+ }
return (
<>
- }
- >
-
-
+
+
+
+
+
+ {data === undefined ? (
+
+ ) : !data ? (
+
+ ) : (
+
+ )}
+
+
>
);
}
diff --git a/src/app_modules/map/view/edit.tsx b/src/app_modules/map/view/edit.tsx
index 6de5083d..2a8070e0 100644
--- a/src/app_modules/map/view/edit.tsx
+++ b/src/app_modules/map/view/edit.tsx
@@ -1,27 +1,56 @@
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import { UiMap_CreatePin } from "../ui/ui_create_pin";
-import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+"use client";
+
+import { ComponentGlobal_BoxInformation } from "@/app_modules/_global/component";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { apiGetOneMapByPortofolioId } from "../lib/api_map";
import { UiMap_EditPin } from "../ui";
-const mapboxToken = process.env.MAPBOX_TOKEN!;
-export async function Map_EditPin({
- portofolioId,
- dataMap,
-}: {
- portofolioId: string;
- dataMap: any
-}) {
- if (!mapboxToken)
- return ;
+export function Map_EditPin({ mapboxToken }: { mapboxToken: string }) {
+ const { id } = useParams();
+ const [data, setData] = useState();
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetOneMapByPortofolioId({ id: id as string });
+ if (response.success) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ setData(null);
+ console.error("Error get one map by portofolio id", error);
+ }
+ }
return (
<>
- }
- >
-
-
+
+
+
+
+
+ {data === undefined ? (
+
+ ) : !data ? (
+
+ ) : (
+
+ )}
+
+
>
);
}
diff --git a/src/app_modules/map/view/main_view_new.tsx b/src/app_modules/map/view/main_view_new.tsx
new file mode 100644
index 00000000..d79dadd0
--- /dev/null
+++ b/src/app_modules/map/view/main_view_new.tsx
@@ -0,0 +1,25 @@
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { UiMap_MapBoxViewNew } from "../ui/ui_map_new";
+
+export async function Map_ViewNew({ mapboxToken }: { mapboxToken: string }) {
+ return (
+ <>
+ {/* }>
+
+ */}
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/model_global/interface.ts b/src/app_modules/model_global/interface.ts
index 2230df4e..abf8e23f 100644
--- a/src/app_modules/model_global/interface.ts
+++ b/src/app_modules/model_global/interface.ts
@@ -21,3 +21,11 @@ export interface MODEL_NEW_DEFAULT_MASTER {
updatedAt: Date;
}
+export interface IDefaultMaster {
+ id: string;
+ name: string;
+ isActive: boolean;
+ createdAt: Date;
+ updatedAt: Date;
+}
+
diff --git a/src/app_modules/model_global/portofolio.ts b/src/app_modules/model_global/portofolio.ts
index 55c6bddb..eaee2cf1 100644
--- a/src/app_modules/model_global/portofolio.ts
+++ b/src/app_modules/model_global/portofolio.ts
@@ -1,3 +1,5 @@
+import { Prisma } from "@prisma/client";
+
export interface MODEL_PORTOFOLIO_Lama {
id: string;
namaBisnis: string;
@@ -15,6 +17,21 @@ export interface BIDANG_BISNIS_OLD {
active: boolean;
}
+export interface MODAL_SUB_BIDANG_BISNIS {
+ id: string;
+ name: string;
+ isActive: boolean;
+}
+
+export type ISUB_BIDANG_BISNIS = Prisma.MasterSubBidangBisnisGetPayload<{
+ select: {
+ id: true;
+ name: true;
+ isActive: true;
+ masterBidangBisnisId: true;
+ };
+}>;
+
export interface MODEL_PORTOFOLIO_OLD {
id: string;
namaBisnis: string;
@@ -24,5 +41,7 @@ export interface MODEL_PORTOFOLIO_OLD {
active: boolean;
MasterBidangBisnis: BIDANG_BISNIS_OLD;
masterBidangBisnisId: string
+ MasterSubBidangBisnis: MODAL_SUB_BIDANG_BISNIS;
+ masterSubBidangBisnisId?: string
profileId: string,
}
diff --git a/src/app_modules/notifikasi/_ui/index.ts b/src/app_modules/notifikasi/_ui/index.ts
index 9123a834..b580054c 100644
--- a/src/app_modules/notifikasi/_ui/index.ts
+++ b/src/app_modules/notifikasi/_ui/index.ts
@@ -1,21 +1,4 @@
-import Notifikasi_UiAll from "./ui_all_notifikasi";
-import Notifikasi_UiCollaboration from "./ui_collaboration_notifikasi";
-import Notifikasi_UiDonasi from "./ui_donasi_notifikasi";
-import Notifikasi_UiEvent from "./ui_event_notifikasi";
-import Notifikasi_UiForum from "./ui_forum_notifikasi";
-import Notifikasi_UiInvestasi from "./ui_investasi_notifikasi";
-import Notifikasi_UiJob from "./ui_job_notifikasi";
import Notifikasi_UiNewLayout from "./ui_new_layout_notifikasi";
-import Notifikasi_UiNewMain from "./ui_new_notifikasi";
-import Notifikasi_UiVoting from "./ui_voting_notifikasi";
+import Notifikasi_UiMain from "./ui_notifikasi";
-export { Notifikasi_UiNewMain };
-export { Notifikasi_UiNewLayout };
-export { Notifikasi_UiAll };
-export { Notifikasi_UiJob };
-export { Notifikasi_UiEvent };
-export { Notifikasi_UiForum };
-export { Notifikasi_UiVoting };
-export { Notifikasi_UiDonasi };
-export { Notifikasi_UiInvestasi };
-export { Notifikasi_UiCollaboration };
+export { Notifikasi_UiMain, Notifikasi_UiNewLayout };
diff --git a/src/app_modules/notifikasi/_ui/ui_all_notifikasi.tsx b/src/app_modules/notifikasi/_ui/ui_all_notifikasi.tsx
deleted file mode 100644
index 02553505..00000000
--- a/src/app_modules/notifikasi/_ui/ui_all_notifikasi.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-"use client";
-
-import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
-import { Box, Center } from "@mantine/core";
-import _ from "lodash";
-import { ScrollOnly } from "next-scroll-loader";
-import { useState } from "react";
-import { ComponentNotifiaksi_CardView } from "../component";
-import notifikasi_getByUserId from "../fun/get/get_notifiaksi_by_id";
-import { MODEL_NOTIFIKASI } from "../model/interface";
-import { useAtom } from "jotai";
-import { gs_notifikasi_kategori_app } from "../lib";
-import { useShallowEffect } from "@mantine/hooks";
-
-export default function Notifikasi_UiAll({
- listNotifikasi,
-}: {
- listNotifikasi: any[];
-}) {
- const [data, setData] = useState(listNotifikasi);
- const [activePage, setActivePage] = useState(1);
- const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
-
- useShallowEffect(() => {
- onLoadData({
- onSetData(val: any) {
- setData(val);
- },
- });
- }, [setData]);
-
- async function onLoadData({ onSetData }: { onSetData: any }) {
- const loadData = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: "Semua",
- });
- onSetData(loadData);
- }
-
- return (
- <>
-
- {_.isEmpty(data) ? (
-
- ) : (
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await notifikasi_getByUserId({
- page: activePage + 1,
- kategoriApp: categoryPage as any,
- });
-
- setActivePage((val) => val + 1);
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
- )}
-
- >
- );
-}
diff --git a/src/app_modules/notifikasi/_ui/ui_collaboration_notifikasi.tsx b/src/app_modules/notifikasi/_ui/ui_collaboration_notifikasi.tsx
deleted file mode 100644
index 22429cb1..00000000
--- a/src/app_modules/notifikasi/_ui/ui_collaboration_notifikasi.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-"use client";
-
-import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
-import { Box, Center } from "@mantine/core";
-import { useAtom } from "jotai";
-import _ from "lodash";
-import { ScrollOnly } from "next-scroll-loader";
-import { useState } from "react";
-import { ComponentNotifiaksi_CardView } from "../component";
-import notifikasi_getByUserId from "../fun/get/get_notifiaksi_by_id";
-import { gs_notifikasi_kategori_app } from "../lib";
-import { MODEL_NOTIFIKASI } from "../model/interface";
-
-export default function Notifikasi_UiCollaboration({
- listNotifikasi,
-}: {
- listNotifikasi: any[];
-}) {
- const [data, setData] = useState(listNotifikasi);
- const [activePage, setActivePage] = useState(1);
- const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
-
- return (
- <>
-
- {_.isEmpty(data) ? (
-
- ) : (
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await notifikasi_getByUserId({
- page: activePage + 1,
- kategoriApp: categoryPage as any,
- });
-
- setActivePage((val) => val + 1);
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
- )}
-
- >
- );
-}
diff --git a/src/app_modules/notifikasi/_ui/ui_donasi_notifikasi.tsx b/src/app_modules/notifikasi/_ui/ui_donasi_notifikasi.tsx
deleted file mode 100644
index 9943d42f..00000000
--- a/src/app_modules/notifikasi/_ui/ui_donasi_notifikasi.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-"use client";
-
-import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
-import { Box, Center } from "@mantine/core";
-import { useAtom } from "jotai";
-import _ from "lodash";
-import { ScrollOnly } from "next-scroll-loader";
-import { useState } from "react";
-import { ComponentNotifiaksi_CardView } from "../component";
-import notifikasi_getByUserId from "../fun/get/get_notifiaksi_by_id";
-import { gs_notifikasi_kategori_app } from "../lib";
-import { MODEL_NOTIFIKASI } from "../model/interface";
-
-export default function Notifikasi_UiDonasi({
- listNotifikasi,
-}: {
- listNotifikasi: any[];
-}) {
- const [data, setData] = useState(listNotifikasi);
- const [activePage, setActivePage] = useState(1);
- const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
-
- return (
- <>
-
- {_.isEmpty(data) ? (
-
- ) : (
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await notifikasi_getByUserId({
- page: activePage + 1,
- kategoriApp: categoryPage as any,
- });
-
- setActivePage((val) => val + 1);
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
- )}
-
- >
- );
-}
diff --git a/src/app_modules/notifikasi/_ui/ui_event_notifikasi.tsx b/src/app_modules/notifikasi/_ui/ui_event_notifikasi.tsx
deleted file mode 100644
index d823a46e..00000000
--- a/src/app_modules/notifikasi/_ui/ui_event_notifikasi.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-"use client";
-
-import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
-import { Box, Center } from "@mantine/core";
-import { useAtom } from "jotai";
-import _ from "lodash";
-import { ScrollOnly } from "next-scroll-loader";
-import { useState } from "react";
-import { ComponentNotifiaksi_CardView } from "../component";
-import notifikasi_getByUserId from "../fun/get/get_notifiaksi_by_id";
-import { gs_notifikasi_kategori_app } from "../lib";
-import { MODEL_NOTIFIKASI } from "../model/interface";
-import { useShallowEffect } from "@mantine/hooks";
-
-export default function Notifikasi_UiEvent({
- listNotifikasi,
-}: {
- listNotifikasi: any[];
-}) {
- const [data, setData] = useState(listNotifikasi);
- const [activePage, setActivePage] = useState(1);
- const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
-
- useShallowEffect(() => {
- onLoadData(setData);
- }, [setData]);
-
- async function onLoadData(setData: any) {
- const listNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: "Event",
- });
- setData(listNotifikasi);
- }
-
- return (
- <>
-
- {_.isEmpty(data) ? (
-
- ) : (
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await notifikasi_getByUserId({
- page: activePage + 1,
- kategoriApp: categoryPage as any,
- });
-
- setActivePage((val) => val + 1);
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
- )}
-
- >
- );
-}
diff --git a/src/app_modules/notifikasi/_ui/ui_forum_notifikasi.tsx b/src/app_modules/notifikasi/_ui/ui_forum_notifikasi.tsx
deleted file mode 100644
index 57f55d09..00000000
--- a/src/app_modules/notifikasi/_ui/ui_forum_notifikasi.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-"use client";
-
-import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
-import { Box, Center } from "@mantine/core";
-import { useAtom } from "jotai";
-import _ from "lodash";
-import { ScrollOnly } from "next-scroll-loader";
-import { useState } from "react";
-import { ComponentNotifiaksi_CardView } from "../component";
-import notifikasi_getByUserId from "../fun/get/get_notifiaksi_by_id";
-import { gs_notifikasi_kategori_app } from "../lib";
-import { MODEL_NOTIFIKASI } from "../model/interface";
-
-export default function Notifikasi_UiForum({
- listNotifikasi,
-}: {
- listNotifikasi: any[];
-}) {
- const [data, setData] = useState(listNotifikasi);
- const [activePage, setActivePage] = useState(1);
- const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
-
- return (
- <>
-
- {_.isEmpty(data) ? (
-
- ) : (
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await notifikasi_getByUserId({
- page: activePage + 1,
- kategoriApp: categoryPage as any,
- });
-
- setActivePage((val) => val + 1);
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
- )}
-
- >
- );
-}
diff --git a/src/app_modules/notifikasi/_ui/ui_investasi_notifikasi.tsx b/src/app_modules/notifikasi/_ui/ui_investasi_notifikasi.tsx
deleted file mode 100644
index 5e87ef5d..00000000
--- a/src/app_modules/notifikasi/_ui/ui_investasi_notifikasi.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-"use client";
-
-import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
-import { Box, Center } from "@mantine/core";
-import { useAtom } from "jotai";
-import _ from "lodash";
-import { ScrollOnly } from "next-scroll-loader";
-import { useState } from "react";
-import { ComponentNotifiaksi_CardView } from "../component";
-import notifikasi_getByUserId from "../fun/get/get_notifiaksi_by_id";
-import { gs_notifikasi_kategori_app } from "../lib";
-import { MODEL_NOTIFIKASI } from "../model/interface";
-
-export default function Notifikasi_UiInvestasi({
- listNotifikasi,
-}: {
- listNotifikasi: any[];
-}) {
- const [data, setData] = useState(listNotifikasi);
- const [activePage, setActivePage] = useState(1);
- const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
-
- return (
- <>
-
- {_.isEmpty(data) ? (
-
- ) : (
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await notifikasi_getByUserId({
- page: activePage + 1,
- kategoriApp: categoryPage as any,
- });
-
- setActivePage((val) => val + 1);
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
- )}
-
- >
- );
-}
diff --git a/src/app_modules/notifikasi/_ui/ui_job_notifikasi.tsx b/src/app_modules/notifikasi/_ui/ui_job_notifikasi.tsx
deleted file mode 100644
index 8c19985f..00000000
--- a/src/app_modules/notifikasi/_ui/ui_job_notifikasi.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-"use client";
-
-import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
-import { Box, Center } from "@mantine/core";
-import { useAtom } from "jotai";
-import _ from "lodash";
-import { ScrollOnly } from "next-scroll-loader";
-import { useState } from "react";
-import { ComponentNotifiaksi_CardView } from "../component";
-import notifikasi_getByUserId from "../fun/get/get_notifiaksi_by_id";
-import { gs_notifikasi_kategori_app } from "../lib";
-import { MODEL_NOTIFIKASI } from "../model/interface";
-import { useShallowEffect } from "@mantine/hooks";
-
-export default function Notifikasi_UiJob({
- listNotifikasi,
-}: {
- listNotifikasi: any[];
-}) {
- const [data, setData] = useState(listNotifikasi);
- const [activePage, setActivePage] = useState(1);
- const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
-
- useShallowEffect(() => {
- onLoadData(setData);
- }, [setData]);
-
- async function onLoadData(setData: any) {
- const listNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: "Job",
- });
- setData(listNotifikasi);
- }
-
- return (
- <>
-
- {_.isEmpty(data) ? (
-
- ) : (
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await notifikasi_getByUserId({
- page: activePage + 1,
- kategoriApp: categoryPage as any,
- });
-
- setActivePage((val) => val + 1);
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
- )}
-
- >
- );
-}
diff --git a/src/app_modules/notifikasi/_ui/ui_new_layout_notifikasi.tsx b/src/app_modules/notifikasi/_ui/ui_new_layout_notifikasi.tsx
index 064e9f55..77d7e50a 100644
--- a/src/app_modules/notifikasi/_ui/ui_new_layout_notifikasi.tsx
+++ b/src/app_modules/notifikasi/_ui/ui_new_layout_notifikasi.tsx
@@ -1,29 +1,30 @@
"use client";
-import { RouterNotifikasi } from "@/app/lib/router_hipmi/router_notifikasi";
+import { RouterNotifikasi } from "@/lib/router_hipmi/router_notifikasi";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import {
- BackgroundImage,
- Box,
- Button,
- Container,
- Flex,
- rem,
+ BackgroundImage,
+ Box,
+ Button,
+ Container,
+ Flex,
+ rem,
+ Loader,
} from "@mantine/core";
import { useAtom } from "jotai";
import _ from "lodash";
import { useRouter } from "next/navigation";
import React, { useState } from "react";
import { gs_notifikasi_kategori_app } from "../lib/global_state";
+import { useShallowEffect } from "@mantine/hooks";
+import { API_RouteNotifikasi } from "@/lib/api_user_router/route_api_notifikasi";
export default function Notifikasi_UiNewLayout({
children,
header,
- masterKategori,
}: {
children: React.ReactNode;
header?: React.ReactNode;
- masterKategori: any[];
}) {
return (
<>
@@ -45,7 +46,7 @@ export default function Notifikasi_UiNewLayout({
>
- {children}
+ {children}
@@ -75,17 +76,77 @@ function UIHeader({ header }: { header: React.ReactNode }) {
);
}
-function UIChildren({
- children,
- masterKategori,
-}: {
- children: React.ReactNode;
- masterKategori: any[];
-}) {
+export function UIChildrenNotifikasi({ children }: { children: React.ReactNode }) {
const router = useRouter();
- const [mstrKategori, setMstrKategori] = useState(masterKategori);
+ const [mstrKategori, setMstrKategori] = useState(null);
const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
+ useShallowEffect(() => {
+ onLoadMaster();
+ }, []);
+
+ async function onLoadMaster() {
+ const res = await fetch(API_RouteNotifikasi.get_master_kategori());
+ const data = await res.json();
+ setMstrKategori(data.data);
+ }
+
+ return (
+ <>
+ {_.isNull(mstrKategori) ? (
+
+ ) : _.isEmpty(mstrKategori) ? (
+
+ Null
+
+ ) : (
+
+
+
+ {mstrKategori.map((e, i) => (
+ {
+ router.replace(
+ RouterNotifikasi.categoryApp({
+ name: _.lowerCase(e.name),
+ }),
+ {
+ scroll: false,
+ }
+ );
+ setCategoryPage(e.name);
+ }}
+ >
+ {e.name}
+
+ ))}
+
+
+ {children}
+
+ )}
+ >
+ );
+}
+
+function SkeletonButton() {
return (
<>
@@ -100,36 +161,25 @@ function UIChildren({
}}
>
- {mstrKategori.map((e, i) => (
+ {Array.from(new Array(10)).map((e, i) => (
{
- router.replace(
- RouterNotifikasi.categoryApp({ name: _.lowerCase(e.name) }),
- {
- scroll: false,
- }
- );
- setCategoryPage(e.name);
- // onLoadDataNotifikasi(e.name);
+ backgroundColor: "GrayText",
}}
+ onClick={() => {}}
>
- {e.name}
+
))}
- {children}
+ ;
>
);
}
diff --git a/src/app_modules/notifikasi/_ui/ui_new_notifikasi.tsx b/src/app_modules/notifikasi/_ui/ui_new_notifikasi.tsx
deleted file mode 100644
index 33cce613..00000000
--- a/src/app_modules/notifikasi/_ui/ui_new_notifikasi.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-"use client";
-
-import { Box, Button, Flex, Stack, Title } from "@mantine/core";
-import UIGlobal_LayoutHeaderTamplate from "../../_global/ui/ui_header_tamplate";
-import { Notifikasi_ViewNewMain } from "../_view";
-import { Notifikasi_UiLayout, Notifikasi_UiView } from "../ui";
-import { useState } from "react";
-import { MainColor } from "@/app_modules/_global/color";
-import { useRouter } from "next/navigation";
-import { RouterNotifikasi } from "@/app/lib/router_hipmi/router_notifikasi";
-import _ from "lodash";
-
-export default function Notifikasi_UiNewMain({
- listNotifikasi,
- masterKategori,
- categoryName,
-}: {
- listNotifikasi: any[];
- masterKategori: any[];
- categoryName: string;
-}) {
- const router = useRouter();
- const [mstrKategori, setMstrKategori] = useState(masterKategori);
- const [activeKategori, setActiveKategori] = useState(categoryName);
-
- return (
- <>
-
-
-
- {mstrKategori.map((e, i) => (
- {
- // router.replace(
- // RouterNotifikasi.main({ name: _.lowerCase(e.name) }),
- // {
- // scroll: false,
- // }
- // );
- setActiveKategori(_.lowerCase(e.name));
- // onLoadDataNotifikasi(e.name);
- }}
- >
- {e.name}
-
- ))}
-
-
-
- {activeKategori}
-
- {/* }
- >
-
- */}
- >
- );
-}
diff --git a/src/app_modules/notifikasi/_ui/ui_notifikasi.tsx b/src/app_modules/notifikasi/_ui/ui_notifikasi.tsx
new file mode 100644
index 00000000..fe1fc271
--- /dev/null
+++ b/src/app_modules/notifikasi/_ui/ui_notifikasi.tsx
@@ -0,0 +1,92 @@
+"use client";
+
+import { API_RouteNotifikasi } from "@/lib/api_user_router/route_api_notifikasi";
+import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Center } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import { useAtom } from "jotai";
+import _ from "lodash";
+import { ScrollOnly } from "next-scroll-loader";
+import { useState } from "react";
+import {
+ ComponentNotifiaksi_CardView,
+ Notifikasi_ComponentSkeletonView,
+} from "../component";
+import { gs_notifikasi_kategori_app } from "../lib";
+import { MODEL_NOTIFIKASI } from "../model/interface";
+import { apiGetAllNotifikasiByCategory } from "../lib/api_fetch_notifikasi";
+
+export default function Notifikasi_UiMain({
+ userLoginId,
+}: {
+ userLoginId?: string;
+}) {
+ const [data, setData] = useState(null);
+ const [activePage, setActivePage] = useState(1);
+ const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respon = await apiGetAllNotifikasiByCategory({
+ category: categoryPage as any,
+ page: 1,
+ });
+
+ if (respon.success) {
+ setData(respon.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get notifikasi", error);
+ }
+ }
+
+ return (
+ <>
+
+ {_.isNull(data) ? (
+
+ ) : _.isEmpty(data) ? (
+
+ ) : (
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={async () => {
+ try {
+ const respon = await apiGetAllNotifikasiByCategory({
+ category: categoryPage as any,
+ page: activePage + 1,
+ });
+
+ if (respon.success) {
+ setActivePage((val) => val + 1);
+ return respon.data;
+ }
+ } catch (error) {
+ clientLogger.error("Error get notifikasi", error);
+ }
+ }}
+ >
+ {(item) => (
+
+ )}
+
+ )}
+
+ >
+ );
+}
diff --git a/src/app_modules/notifikasi/_ui/ui_voting_notifikasi.tsx b/src/app_modules/notifikasi/_ui/ui_voting_notifikasi.tsx
deleted file mode 100644
index ebf8b0e3..00000000
--- a/src/app_modules/notifikasi/_ui/ui_voting_notifikasi.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-"use client";
-
-import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
-import { Box, Center } from "@mantine/core";
-import { useAtom } from "jotai";
-import _ from "lodash";
-import { ScrollOnly } from "next-scroll-loader";
-import { useState } from "react";
-import { ComponentNotifiaksi_CardView } from "../component";
-import notifikasi_getByUserId from "../fun/get/get_notifiaksi_by_id";
-import { gs_notifikasi_kategori_app } from "../lib";
-import { MODEL_NOTIFIKASI } from "../model/interface";
-
-export default function Notifikasi_UiVoting({
- listNotifikasi,
-}: {
- listNotifikasi: any[];
-}) {
- const [data, setData] = useState(listNotifikasi);
- const [activePage, setActivePage] = useState(1);
- const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
-
- return (
- <>
-
- {_.isEmpty(data) ? (
-
- ) : (
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await notifikasi_getByUserId({
- page: activePage + 1,
- kategoriApp: categoryPage as any,
- });
-
- setActivePage((val) => val + 1);
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
- )}
-
- >
- );
-}
diff --git a/src/app_modules/notifikasi/component/card_view.tsx b/src/app_modules/notifikasi/component/card_view.tsx
index d3f2b07f..64482989 100644
--- a/src/app_modules/notifikasi/component/card_view.tsx
+++ b/src/app_modules/notifikasi/component/card_view.tsx
@@ -1,43 +1,64 @@
"use client";
-import { gs_count_ntf } from "@/app/lib/global_state";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component";
+import { gs_donasi_hot_menu } from "@/app_modules/donasi/global_state";
import { gs_event_hotMenu } from "@/app_modules/event/global_state";
+import { gs_investas_menu } from "@/app_modules/investasi/g_state";
import { gs_job_hot_menu } from "@/app_modules/job/global_state";
+import { gs_vote_hotMenu } from "@/app_modules/vote/global_state";
+import { clientLogger } from "@/util/clientLogger";
import { Badge, Card, Divider, Group, Stack, Text } from "@mantine/core";
import { IconCheck, IconChecks } from "@tabler/icons-react";
import { useAtom } from "jotai";
+import moment from "moment";
+import "moment/locale/id";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { MODEL_NOTIFIKASI } from "../model/interface";
-import { notifikasi_eventCheckStatus } from "./path/event";
-import { notifikasi_jobCheckStatus } from "./path/job";
-import { gs_vote_hotMenu } from "@/app_modules/vote/global_state";
-import { notifikasi_votingCheckStatus } from "./path/voting";
import { redirectDonasiPage } from "./path/donasi";
-import { gs_donasi_hot_menu } from "@/app_modules/donasi/global_state";
+import { notifikasi_eventCheckStatus } from "./path/event";
+import { redirectDetailForumPage } from "./path/forum";
+import { redirectInvestasiPage } from "./path/investasi";
+import { notifikasi_jobCheckStatus } from "./path/job";
+import { notifikasi_votingCheckStatus } from "./path/voting";
+import { redirectDetailCollaborationPage } from "./path/collaboration";
+import { Comp_V3_SetInnerHTMLWithStiker } from "@/app_modules/_global/component/new/comp_V3_set_html_with_stiker";
+import { useShallowEffect } from "@mantine/hooks";
+import { Comp_SetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
export function ComponentNotifiaksi_CardView({
data,
- onLoadData,
- categoryPage,
}: {
data: MODEL_NOTIFIKASI;
- onLoadData: (val: any) => void;
- categoryPage: any;
}) {
const router = useRouter();
const [visible, setVisible] = useState(false);
- const [loadCountNtf, setLoadCountNtf] = useAtom(gs_count_ntf);
const [jobMenuId, setJobMenuId] = useAtom(gs_job_hot_menu);
const [eventMenuId, setEventMenuId] = useAtom(gs_event_hotMenu);
const [votingMenu, setVotingMenu] = useAtom(gs_vote_hotMenu);
const [donasiMenu, setDonasiMenu] = useAtom(gs_donasi_hot_menu);
+ const [investasiMenu, setInvestasiMenu] = useAtom(gs_investas_menu);
+
+ useShallowEffect(() => {
+ // Add custom style for stickers inside Quill editor
+ const style = document.createElement("style");
+ style.textContent = `
+ .chat-content img {
+ max-width: 70px !important;
+ max-height: 70px !important;
+ }
+ `;
+ document.head.appendChild(style);
+ return () => {
+ // Clean up when component unmounts
+ document.head.removeChild(style);
+ };
+ }, []);
return (
<>
@@ -54,130 +75,122 @@ export function ComponentNotifiaksi_CardView({
}}
my={"xs"}
onClick={async () => {
- // JOB
- if (data?.kategoriApp === "JOB") {
- await notifikasi_jobCheckStatus({
- appId: data.appId,
- dataId: data.id,
- categoryPage: categoryPage,
- router: router,
- onLoadDataJob(val) {
- onLoadData(val);
- },
- onSetJobMenuId(val) {
- setJobMenuId(val);
- },
- onSetVisible(val) {
- setVisible(val);
- },
- onLoadCountNtf(val) {
- setLoadCountNtf(val);
- },
- });
+ try {
+ setVisible(true);
+
+ // JOB
+ if (data?.kategoriApp === "JOB") {
+ await notifikasi_jobCheckStatus({
+ appId: data.appId,
+ dataId: data.id,
+ router: router,
+ onSetJobMenuId(val) {
+ setJobMenuId(val);
+ },
+ onSetVisible(val) {
+ setVisible(val);
+ },
+ });
+
+ return;
+ }
+
+ // EVENT
+ if (data?.kategoriApp === "EVENT") {
+ await notifikasi_eventCheckStatus({
+ appId: data.appId,
+ dataId: data.id,
+ router: router,
+ onSetVisible(val) {
+ setVisible(val);
+ },
+ onSetEventMenuId(val) {
+ setEventMenuId(val);
+ },
+ });
+
+ return;
+ }
+
+ // VOTING
+ if (data?.kategoriApp === "VOTING") {
+ await notifikasi_votingCheckStatus({
+ appId: data.appId,
+ dataId: data.id,
+ router: router,
+ onSetVisible(val) {
+ setVisible(val);
+ },
+ onSetMenuId(val) {
+ setVotingMenu(val);
+ },
+ });
+
+ return;
+ }
+
+ // DONASI
+ if (data?.kategoriApp === "DONASI") {
+ await redirectDonasiPage({
+ appId: data.appId,
+ dataId: data.id,
+ userId: data.userId,
+ router: router,
+ onSetVisible(val) {
+ setVisible(val);
+ },
+ onSetMenuId(val) {
+ setDonasiMenu(val);
+ },
+ });
+
+ return;
+ }
+
+ // INVESTASI
+ if (data?.kategoriApp === "INVESTASI") {
+ await redirectInvestasiPage({
+ appId: data.appId,
+ dataId: data.id,
+ router: router,
+ onSetVisible(val) {
+ setVisible(val);
+ },
+ onSetMenuId(val) {
+ setInvestasiMenu(val);
+ },
+ });
+
+ return;
+ }
+
+ if (data?.kategoriApp === "FORUM") {
+ await redirectDetailForumPage({
+ data: data,
+ router: router,
+ onSetVisible(val) {
+ setVisible(val);
+ },
+ });
+
+ return;
+ }
+
+ if (data?.kategoriApp === "COLLABORATION") {
+ await redirectDetailCollaborationPage({
+ data: data,
+ router: router,
+ onSetVisible(val) {
+ setVisible(val);
+ },
+ });
+
+ return;
+ }
+ } catch (error) {
+ setVisible(false);
+ clientLogger.error("Error redirect notification page", error);
}
-
- // EVENT
- if (data?.kategoriApp === "EVENT") {
- await notifikasi_eventCheckStatus({
- appId: data.appId,
- dataId: data.id,
- categoryPage: categoryPage,
- router: router,
- onLoadDataEvent(val) {
- onLoadData(val);
- },
- onSetVisible(val) {
- setVisible(val);
- },
- onSetEventMenuId(val) {
- setEventMenuId(val);
- },
- onLoadCountNtf(val) {
- setLoadCountNtf(val);
- },
- });
- }
-
- if (data?.kategoriApp === "VOTING") {
- await notifikasi_votingCheckStatus({
- appId: data.appId,
- dataId: data.id,
- categoryPage: categoryPage,
- router: router,
- onLoadDataEvent(val) {
- onLoadData(val);
- },
- onSetVisible(val) {
- setVisible(val);
- },
- onSetMenuId(val) {
- setVotingMenu(val);
- },
- onLoadCountNtf(val) {
- setLoadCountNtf(val);
- },
- });
- }
-
- if (data?.kategoriApp === "DONASI") {
- redirectDonasiPage({
- appId: data.appId,
- dataId: data.id,
- categoryPage: categoryPage,
- router: router,
- onLoadDataEvent(val) {
- onLoadData(val);
- },
- onSetVisible(val) {
- setVisible(val);
- },
- onSetMenuId(val) {
- setDonasiMenu(val);
- },
- onLoadCountNtf(val) {
- setLoadCountNtf(val);
- },
- });
- }
-
- // data?.kategoriApp === "FORUM" &&
- // redirectDetailForumPage({
- // data: data,
- // router: router,
- // });
-
- // data?.kategoriApp === "VOTING" &&
- // redirectVotingPage({
- // data: data,
- // router: router,
- // onSetPage(val) {
- // // onSetMenu(val);
- // },
- // });
-
- // data?.kategoriApp === "EVENT" &&
- // redirectEventPage({
- // data: data,
- // router: router,
- // onSetPage(val) {
- // // onSetMenu(val);
- // },
- // });
-
- // data?.kategoriApp === "COLLABORATION" &&
- // redirectDetailCollaborationPage({
- // data: data,
- // router: router,
- // });
-
- // data.kategoriApp === "INVESTASI" &&
- // redirectInvestasiPage({
- // data: data,
- // router: router,
- // onSetPage(val) {
- // // onSetMenu(val);
- // },
- // });
}}
>
{/* {JSON.stringify(e, null, 2)} */}
@@ -207,29 +220,25 @@ export function ComponentNotifiaksi_CardView({
{data?.title}
- {data.kategoriApp === "FORUM" ? (
-
+ {/* {data.kategoriApp === "FORUM" ? (
+
+
+
) : (
- {data?.pesan}
- )}
+
+
+
+ )} */}
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "long",
- }).format(data?.createdAt)}
-
-
- {", "}
- {new Intl.DateTimeFormat("id-ID", {
- timeStyle: "short",
- }).format(data?.createdAt)}
-
+ {moment(data.createdAt).format("LLL")}
{data?.isRead ? (
diff --git a/src/app_modules/notifikasi/component/index.ts b/src/app_modules/notifikasi/component/index.ts
index cf740b8c..9d4b1d74 100644
--- a/src/app_modules/notifikasi/component/index.ts
+++ b/src/app_modules/notifikasi/component/index.ts
@@ -1,5 +1,7 @@
import { ComponentNotifikasi_CardSkeleton } from "./card_skeleton";
import { ComponentNotifiaksi_CardView } from "./card_view";
+import Notifikasi_ComponentSkeletonView from "./skeleton_view";
export { ComponentNotifiaksi_CardView };
export { ComponentNotifikasi_CardSkeleton };
+export { Notifikasi_ComponentSkeletonView };
diff --git a/src/app_modules/notifikasi/component/path/collaboration.ts b/src/app_modules/notifikasi/component/path/collaboration.ts
index 163be61f..edf91e4b 100644
--- a/src/app_modules/notifikasi/component/path/collaboration.ts
+++ b/src/app_modules/notifikasi/component/path/collaboration.ts
@@ -1,26 +1,40 @@
-import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
+import { RouterColab } from "@/lib/router_hipmi/router_colab";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
import { MODEL_NOTIFIKASI } from "../../model/interface";
+import notifikasi_funUpdateIsReadById from "../../fun/update/fun_update_is_read_by_user_id";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
-export function redirectDetailCollaborationPage({
+export async function redirectDetailCollaborationPage({
data,
router,
+ onSetVisible,
}: {
data: MODEL_NOTIFIKASI;
router: AppRouterInstance;
+ onSetVisible(val: boolean): void;
}) {
- if (data.status === "Partisipan Project") {
- const path = RouterColab.main_detail + data.appId;
- router.push(path, { scroll: false });
+ try {
+ if (data.status === "Partisipan Project") {
+ const path = RouterColab.main_detail + data.appId;
+ router.push(path, { scroll: false });
+ }
+
+ if (data.status === "Collaboration Group") {
+ const path = RouterColab.grup_diskusi;
+ router.push(path, { scroll: false });
+ }
+
+ const updateReadNotifikasi = await notifikasi_funUpdateIsReadById({
+ notifId: data.id,
+ });
+
+ if (updateReadNotifikasi.status == 200) {
+ onSetVisible(true);
+ }
+ } catch (error) {
+ console.error("Error get all forum :", error);
+ ComponentGlobal_NotifikasiPeringatan("Status tidak ditemukan");
}
-
-
-
- if (data.status === "Collaboration Group") {
- const path = RouterColab.grup_diskusi;
- router.push(path, { scroll: false });
- }
-
// if (data.status === "Report Komentar") {
// const path = RouterForum.detail_report_komentar + data.appId;
// router.push(path, { scroll: false });
diff --git a/src/app_modules/notifikasi/component/path/donasi.ts b/src/app_modules/notifikasi/component/path/donasi.ts
index fbdc976c..1478be45 100644
--- a/src/app_modules/notifikasi/component/path/donasi.ts
+++ b/src/app_modules/notifikasi/component/path/donasi.ts
@@ -1,56 +1,73 @@
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
+import { RouterEvent } from "@/lib/router_hipmi/router_event";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
import { MODEL_NOTIFIKASI } from "../../model/interface";
-import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
+import { RouterDonasi } from "@/lib/router_hipmi/router_donasi";
import { notifikasi_funDonasiCheckStatus } from "../../fun/check/fun_check_donasi_status";
import notifikasi_getByUserId from "../../fun/get/get_notifiaksi_by_id";
import notifikasi_countUserNotifikasi from "../../fun/count/fun_count_by_id";
import notifikasi_funUpdateIsReadById from "../../fun/update/fun_update_is_read_by_user_id";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { notifikasi_checkAuthorDonasiById } from "../../fun/check/fun_check_author_donasi_by_id";
+import { apiNotifikasiDonasiCheckTransaksiById } from "../../lib/api_fetch_ntf_donasi";
+import { cookies } from "next/headers";
export async function redirectDonasiPage({
appId,
dataId,
- categoryPage,
+ userId,
router,
- onLoadDataEvent,
onSetMenuId,
onSetVisible,
- onLoadCountNtf,
}: {
appId: string;
dataId: string;
- categoryPage: string;
+ userId: string;
router: AppRouterInstance;
- onLoadDataEvent: (val: any) => void;
onSetMenuId(val: number): void;
onSetVisible(val: boolean): void;
- onLoadCountNtf(val: number): void;
}) {
const check = await notifikasi_funDonasiCheckStatus({ id: appId });
- if (check.status == 200) {
- const loadListNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: categoryPage as any,
- });
- onLoadDataEvent(loadListNotifikasi);
-
- const loadCountNotifikasi = await notifikasi_countUserNotifikasi();
- onLoadCountNtf(loadCountNotifikasi);
-
- const updateReadNotifikasi = await notifikasi_funUpdateIsReadById({
- notifId: dataId,
+ if (check.statusName == "") {
+ const checkTransaksi = await apiNotifikasiDonasiCheckTransaksiById({
+ id: appId,
});
- if (updateReadNotifikasi.status == 200) {
- onSetVisible(true);
+ if (checkTransaksi.success) {
+ const updateReadNotifikasi = await notifikasi_funUpdateIsReadById({
+ notifId: dataId,
+ });
- const path = `/dev/donasi/detail/${check.statusName}/${appId}`;
- onSetMenuId(1);
- router.push(path, { scroll: false });
+ if (updateReadNotifikasi.status == 200) {
+ router.push(RouterDonasi.main_donasi_saya, { scroll: false });
+ onSetMenuId(2);
+ }
}
} else {
- ComponentGlobal_NotifikasiPeringatan("Status tidak ditemukan");
+ const checkAuthor = await notifikasi_checkAuthorDonasiById({
+ donasiId: appId,
+ userId: userId,
+ });
+
+ if (check.status == 200) {
+ const updateReadNotifikasi = await notifikasi_funUpdateIsReadById({
+ notifId: dataId,
+ });
+
+ if (updateReadNotifikasi.status == 200) {
+ const pathToCreator = `/dev/donasi/detail/${check.statusName}/${appId}`;
+ const pathToAllUser = `/dev/donasi/detail/main/${appId}`;
+
+ if (checkAuthor) {
+ router.push(pathToCreator, { scroll: false });
+ } else {
+ router.push(pathToAllUser, { scroll: false });
+ onSetMenuId(1);
+ }
+ }
+ } else {
+ onSetVisible(false);
+ ComponentGlobal_NotifikasiPeringatan("Status tidak ditemukan");
+ }
}
}
diff --git a/src/app_modules/notifikasi/component/path/event.ts b/src/app_modules/notifikasi/component/path/event.ts
index 34f0cbb3..c4062b41 100644
--- a/src/app_modules/notifikasi/component/path/event.ts
+++ b/src/app_modules/notifikasi/component/path/event.ts
@@ -8,33 +8,19 @@ import notifikasi_countUserNotifikasi from "../../fun/count/fun_count_by_id";
export async function notifikasi_eventCheckStatus({
appId,
dataId,
- categoryPage,
router,
- onLoadDataEvent,
onSetEventMenuId,
onSetVisible,
- onLoadCountNtf,
}: {
appId: string;
dataId: string;
- categoryPage: string
router: AppRouterInstance;
- onLoadDataEvent: (val: any) => void;
onSetEventMenuId(val: number): void;
onSetVisible(val: boolean): void;
- onLoadCountNtf(val: number): void;
}) {
const check = await notifikasi_funEventCheckStatus({ id: appId });
if (check.status == 200) {
- const loadListNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: categoryPage as any,
- });
- onLoadDataEvent(loadListNotifikasi);
-
- const loadCountNotifikasi = await notifikasi_countUserNotifikasi();
- onLoadCountNtf(loadCountNotifikasi);
const updateReadNotifikasi = await notifikasi_funUpdateIsReadById({
notifId: dataId,
diff --git a/src/app_modules/notifikasi/component/path/forum.ts b/src/app_modules/notifikasi/component/path/forum.ts
index e31c9f88..a8a382b6 100644
--- a/src/app_modules/notifikasi/component/path/forum.ts
+++ b/src/app_modules/notifikasi/component/path/forum.ts
@@ -1,26 +1,46 @@
-import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
+import { RouterForum } from "@/lib/router_hipmi/router_forum";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
import { MODEL_NOTIFIKASI } from "../../model/interface";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import notifikasi_funUpdateIsReadById from "../../fun/update/fun_update_is_read_by_user_id";
-export function redirectDetailForumPage({
+export async function redirectDetailForumPage({
data,
router,
+ onSetVisible,
}: {
data: MODEL_NOTIFIKASI;
router: AppRouterInstance;
+ onSetVisible(val: boolean): void;
}) {
- if (data.status === null) {
- const path = RouterForum.main_detail + data.appId;
- router.push(path, { scroll: false });
- }
+ try {
+ if (data.status === null) {
+ const path = RouterForum.main_detail + data.appId;
+ router.push(path, { scroll: false });
+ }
- if (data.status === "Report Komentar") {
- const path = RouterForum.detail_report_komentar + data.appId;
- router.push(path, { scroll: false });
- }
+ if (data.status === "Report Komentar") {
+ const path = RouterForum.detail_report_komentar + data.appId;
+ router.push(path, { scroll: false });
+ }
- if (data.status === "Report Posting") {
- const path = RouterForum.detail_report_posting + data.appId;
- router.push(path, { scroll: false });
+ if (data.status === "Report Posting") {
+ const path = RouterForum.detail_report_posting + data.appId;
+ router.push(path, { scroll: false });
+ }
+
+ const updateReadNotifikasi = await notifikasi_funUpdateIsReadById({
+ notifId: data.id,
+ });
+
+ if (updateReadNotifikasi.status == 200) {
+ onSetVisible(true);
+
+ }
+
+
+ } catch (error) {
+ console.error("Error get all forum :", error);
+ ComponentGlobal_NotifikasiPeringatan("Status tidak ditemukan");
}
}
diff --git a/src/app_modules/notifikasi/component/path/investasi.ts b/src/app_modules/notifikasi/component/path/investasi.ts
index 82be9827..1e95dad7 100644
--- a/src/app_modules/notifikasi/component/path/investasi.ts
+++ b/src/app_modules/notifikasi/component/path/investasi.ts
@@ -1,37 +1,65 @@
-import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
-import { MODEL_NOTIFIKASI } from "../../model/interface";
-import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
+import {
+ notifikasi_funInvestasiChecInvestaorStatus
+} from "../../fun";
+import { notifikasi_funInvestasiCheckStatus } from "../../fun/check/fun_check_investasi_status";
+import notifikasi_funUpdateIsReadById from "../../fun/update/fun_update_is_read_by_user_id";
-export function redirectInvestasiPage({
- data,
+export async function redirectInvestasiPage({
+ appId,
+ dataId,
router,
- onSetPage,
+ onSetMenuId,
+ onSetVisible,
}: {
- data: MODEL_NOTIFIKASI;
+ appId: string;
+ dataId: string;
router: AppRouterInstance;
- onSetPage: (val: any) => void;
+ onSetMenuId(val: number): void;
+ onSetVisible(val: boolean): void;
}) {
- const path = RouterInvestasi_OLD.portofolio;
+ const check = await notifikasi_funInvestasiCheckStatus({ id: appId });
+ const checkInvestor = await notifikasi_funInvestasiChecInvestaorStatus({
+ id: appId,
+ });
- if (data.status === "Publish") {
- onSetPage({
- menuId: 2,
- status: data.status,
+ if (check.status == 200) {
+ const updateReadNotifikasi = await notifikasi_funUpdateIsReadById({
+ notifId: dataId,
});
- router.push(path, { scroll: false });
- }
- // console.log(data)
- if (data.status === "Reject") {
- onSetPage({
- menuId: 2,
- status: data.status,
+ if (updateReadNotifikasi.status == 200) {
+ onSetVisible(true);
+ onSetMenuId(1);
+
+ if (check.statusName == "publish") {
+ router.push(`/dev/investasi/detail/${appId}`, { scroll: false });
+ } else {
+ const path = `/dev/investasi/detail/portofolio/${appId}`;
+ router.push(path, { scroll: false });
+ }
+ }
+ } else if (checkInvestor.status == 200) {
+ const updateReadNotifikasi = await notifikasi_funUpdateIsReadById({
+ notifId: dataId,
});
- router.push(path, { scroll: false });
- }
- // if (data.status === "Peserta Event") {
- // router.push(RouterEvent.detail_main + data.appId, { scroll: false });
- // }
+ if (updateReadNotifikasi.status == 200) {
+ onSetVisible(true);
+ onSetMenuId(1);
+
+ if (checkInvestor.statusName == "berhasil") {
+ const path = `/dev/investasi/detail/saham/${appId}`;
+ router.push(path, { scroll: false });
+ }
+
+ if (checkInvestor.statusName == "gagal") {
+ const path = `/dev/investasi/status-transaksi/gagal/${appId}`;
+ router.push(path, { scroll: false });
+ }
+ }
+ } else {
+ ComponentGlobal_NotifikasiPeringatan("Status tidak ditemukan");
+ }
}
diff --git a/src/app_modules/notifikasi/component/path/job.ts b/src/app_modules/notifikasi/component/path/job.ts
index b9471bd2..fef128df 100644
--- a/src/app_modules/notifikasi/component/path/job.ts
+++ b/src/app_modules/notifikasi/component/path/job.ts
@@ -8,35 +8,20 @@ import notifikasi_countUserNotifikasi from "../../fun/count/fun_count_by_id";
export async function notifikasi_jobCheckStatus({
appId,
dataId,
- categoryPage,
router,
- onLoadDataJob,
onSetJobMenuId,
onSetVisible,
- onLoadCountNtf,
}: {
appId: string;
dataId: string;
- categoryPage:string
router: AppRouterInstance;
- onLoadDataJob: (val: any) => void;
onSetJobMenuId(val: number): void;
onSetVisible(val: boolean): void;
- onLoadCountNtf(val: number): void;
}) {
const check = await notifikasi_funJobCheckStatus({
id: appId,
});
- const loadListNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: categoryPage as any,
- });
- onLoadDataJob(loadListNotifikasi);
-
- const loadCountNotifikasi = await notifikasi_countUserNotifikasi();
- onLoadCountNtf(loadCountNotifikasi);
-
if (check.status == 200) {
const updateReadNotifikasi = await notifikasi_funUpdateIsReadById({
notifId: dataId,
diff --git a/src/app_modules/notifikasi/component/path/voting.ts b/src/app_modules/notifikasi/component/path/voting.ts
index 9d687761..cd61770f 100644
--- a/src/app_modules/notifikasi/component/path/voting.ts
+++ b/src/app_modules/notifikasi/component/path/voting.ts
@@ -1,4 +1,4 @@
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
import { MODEL_NOTIFIKASI } from "../../model/interface";
import { notifikasi_funVotingCheckStatus } from "../../fun/check/fun_check_voting_status";
@@ -10,34 +10,19 @@ import notifikasi_funUpdateIsReadById from "../../fun/update/fun_update_is_read_
export async function notifikasi_votingCheckStatus({
appId,
dataId,
- categoryPage,
router,
- onLoadDataEvent,
onSetMenuId,
onSetVisible,
- onLoadCountNtf,
}: {
appId: string;
dataId: string;
- categoryPage: string;
router: AppRouterInstance;
- onLoadDataEvent: (val: any) => void;
onSetMenuId(val: number): void;
onSetVisible(val: boolean): void;
- onLoadCountNtf(val: number): void;
}) {
const check = await notifikasi_funVotingCheckStatus({ id: appId });
if (check.status == 200) {
- const loadListNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: categoryPage as any,
- });
- onLoadDataEvent(loadListNotifikasi);
-
- const loadCountNotifikasi = await notifikasi_countUserNotifikasi();
- onLoadCountNtf(loadCountNotifikasi);
-
const updateReadNotifikasi = await notifikasi_funUpdateIsReadById({
notifId: dataId,
});
@@ -52,6 +37,4 @@ export async function notifikasi_votingCheckStatus({
} else {
ComponentGlobal_NotifikasiPeringatan("Status tidak ditemukan");
}
-
-
}
diff --git a/src/app_modules/notifikasi/component/skeleton_view.tsx b/src/app_modules/notifikasi/component/skeleton_view.tsx
new file mode 100644
index 00000000..57a7a664
--- /dev/null
+++ b/src/app_modules/notifikasi/component/skeleton_view.tsx
@@ -0,0 +1,30 @@
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Divider, Group, Stack } from "@mantine/core";
+
+export default function Notifikasi_ComponentSkeletonView() {
+ return (
+ <>
+ {Array.from({ length: 3 }).map((_, i) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ))}
+ >
+ );
+}
diff --git a/src/app_modules/notifikasi/fun/check/fun_check_author_donasi_by_id.ts b/src/app_modules/notifikasi/fun/check/fun_check_author_donasi_by_id.ts
new file mode 100644
index 00000000..06908830
--- /dev/null
+++ b/src/app_modules/notifikasi/fun/check/fun_check_author_donasi_by_id.ts
@@ -0,0 +1,24 @@
+"use server";
+
+import { prisma } from "@/lib";
+
+export async function notifikasi_checkAuthorDonasiById({
+ userId,
+ donasiId,
+}: {
+ userId: string;
+ donasiId: string;
+}) {
+ const check = await prisma.donasi.findFirst({
+ where: {
+ authorId: userId,
+ id: donasiId,
+ },
+ });
+
+ if (check) {
+ return true;
+ } else {
+ return false;
+ }
+}
diff --git a/src/app_modules/notifikasi/fun/check/fun_check_donasi_status.ts b/src/app_modules/notifikasi/fun/check/fun_check_donasi_status.ts
index 50362563..46b19017 100644
--- a/src/app_modules/notifikasi/fun/check/fun_check_donasi_status.ts
+++ b/src/app_modules/notifikasi/fun/check/fun_check_donasi_status.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import _ from "lodash";
export async function notifikasi_funDonasiCheckStatus({ id }: { id: string }) {
diff --git a/src/app_modules/notifikasi/fun/check/fun_check_event_status.ts b/src/app_modules/notifikasi/fun/check/fun_check_event_status.ts
index 08c7fa73..f16b13c8 100644
--- a/src/app_modules/notifikasi/fun/check/fun_check_event_status.ts
+++ b/src/app_modules/notifikasi/fun/check/fun_check_event_status.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import _ from "lodash";
export async function notifikasi_funEventCheckStatus({ id }: { id: string }) {
diff --git a/src/app_modules/notifikasi/fun/check/fun_check_investasi_status.ts b/src/app_modules/notifikasi/fun/check/fun_check_investasi_status.ts
new file mode 100644
index 00000000..86d8ef00
--- /dev/null
+++ b/src/app_modules/notifikasi/fun/check/fun_check_investasi_status.ts
@@ -0,0 +1,32 @@
+"use server";
+
+import { prisma } from "@/lib";
+import _ from "lodash";
+
+export async function notifikasi_funInvestasiCheckStatus({
+ id,
+}: {
+ id: string;
+}) {
+ const data = await prisma.investasi.findUnique({
+ where: {
+ id: id,
+ },
+ select: {
+ MasterStatusInvestasi: true,
+ },
+ });
+
+ if (!data)
+ return {
+ status: 400,
+ message: "Investasi tidak ditemukan",
+ statusName: "",
+ };
+
+ return {
+ status: 200,
+ message: "Berhasil di cek",
+ statusName: _.lowerCase(data.MasterStatusInvestasi?.name),
+ };
+}
diff --git a/src/app_modules/notifikasi/fun/check/fun_check_investor_status.ts b/src/app_modules/notifikasi/fun/check/fun_check_investor_status.ts
new file mode 100644
index 00000000..ef2c9422
--- /dev/null
+++ b/src/app_modules/notifikasi/fun/check/fun_check_investor_status.ts
@@ -0,0 +1,32 @@
+"use server";
+
+import { prisma } from "@/lib";
+import _ from "lodash";
+
+export async function notifikasi_funInvestasiChecInvestaorStatus({
+ id,
+}: {
+ id: string;
+}) {
+ const data = await prisma.investasi_Invoice.findUnique({
+ where: {
+ id: id,
+ },
+ select: {
+ StatusInvoice: true,
+ },
+ });
+
+ if (!data)
+ return {
+ status: 400,
+ message: "Investasi tidak ditemukan",
+ statusName: "",
+ };
+
+ return {
+ status: 200,
+ message: "Berhasil di cek",
+ statusName: _.lowerCase(data.StatusInvoice?.name),
+ };
+}
diff --git a/src/app_modules/notifikasi/fun/check/fun_check_job_status.ts b/src/app_modules/notifikasi/fun/check/fun_check_job_status.ts
index bc01bc04..4bc62b71 100644
--- a/src/app_modules/notifikasi/fun/check/fun_check_job_status.ts
+++ b/src/app_modules/notifikasi/fun/check/fun_check_job_status.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import _ from "lodash";
export async function notifikasi_funJobCheckStatus({ id }: { id: string }) {
diff --git a/src/app_modules/notifikasi/fun/check/fun_check_voting_status.ts b/src/app_modules/notifikasi/fun/check/fun_check_voting_status.ts
index 39f3eef2..dd26437d 100644
--- a/src/app_modules/notifikasi/fun/check/fun_check_voting_status.ts
+++ b/src/app_modules/notifikasi/fun/check/fun_check_voting_status.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import _ from "lodash";
export async function notifikasi_funVotingCheckStatus({ id }: { id: string }) {
diff --git a/src/app_modules/notifikasi/fun/count/fun_count_by_id.ts b/src/app_modules/notifikasi/fun/count/fun_count_by_id.ts
index d61d3c82..017885bb 100644
--- a/src/app_modules/notifikasi/fun/count/fun_count_by_id.ts
+++ b/src/app_modules/notifikasi/fun/count/fun_count_by_id.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterHome } from "@/app/lib/router_hipmi/router_home";
+import prisma from "@/lib/prisma";
+import { RouterHome } from "@/lib/router_hipmi/router_home";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { revalidatePath } from "next/cache";
diff --git a/src/app_modules/notifikasi/fun/create/create_notif_to_admin.ts b/src/app_modules/notifikasi/fun/create/create_notif_to_admin.ts
index c7bda3e1..b69484d7 100644
--- a/src/app_modules/notifikasi/fun/create/create_notif_to_admin.ts
+++ b/src/app_modules/notifikasi/fun/create/create_notif_to_admin.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_NOTIFIKASI } from "../../model/interface";
export default async function notifikasiToAdmin_funCreate({
@@ -8,7 +8,6 @@ export default async function notifikasiToAdmin_funCreate({
}: {
data: MODEL_NOTIFIKASI;
}) {
-
const getAdmin = await prisma.user.findMany({
where: {
active: true,
diff --git a/src/app_modules/notifikasi/fun/create/create_notif_to_user.ts b/src/app_modules/notifikasi/fun/create/create_notif_to_user.ts
index e6f5ce65..8b953075 100644
--- a/src/app_modules/notifikasi/fun/create/create_notif_to_user.ts
+++ b/src/app_modules/notifikasi/fun/create/create_notif_to_user.ts
@@ -1,24 +1,30 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_NOTIFIKASI } from "../../model/interface";
+import backendLogger from "@/util/backendLogger";
export default async function notifikasiToUser_funCreate({
data,
}: {
data: MODEL_NOTIFIKASI;
}) {
- const created = await prisma.notifikasi.create({
- data: {
- userId: data.userId,
- appId: data.appId,
- status: data.status,
- title: data.title,
- pesan: data.pesan,
- kategoriApp: data.kategoriApp,
- userRoleId: "1",
- },
- });
- if (!created) return { status: 400, message: "Gagal mengirim notifikasi" };
- return { status: 201, message: "Berhasil mengirim notifikasi" };
+ try {
+ const created = await prisma.notifikasi.create({
+ data: {
+ userId: data.userId,
+ appId: data.appId,
+ status: data.status,
+ title: data.title,
+ pesan: data.pesan,
+ kategoriApp: data.kategoriApp,
+ userRoleId: "1",
+ },
+ });
+ if (!created) return { status: 400, message: "Gagal mengirim notifikasi" };
+ return { status: 201, message: "Berhasil mengirim notifikasi" };
+ } catch (error) {
+ backendLogger.error("Gagal mengirim notifikasi", error);
+ return { status: 401, message: "Error server" };
+ }
}
diff --git a/src/app_modules/notifikasi/fun/create/create_notif_to_user_collaboration.ts b/src/app_modules/notifikasi/fun/create/create_notif_to_user_collaboration.ts
index 549af323..c99330f8 100644
--- a/src/app_modules/notifikasi/fun/create/create_notif_to_user_collaboration.ts
+++ b/src/app_modules/notifikasi/fun/create/create_notif_to_user_collaboration.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function notifikasiToUser_CreateGroupCollaboration({
colabId,
diff --git a/src/app_modules/notifikasi/fun/create/create_notif_to_user_kabar_donasi.ts b/src/app_modules/notifikasi/fun/create/create_notif_to_user_kabar_donasi.ts
index d68de9e4..f6d0244b 100644
--- a/src/app_modules/notifikasi/fun/create/create_notif_to_user_kabar_donasi.ts
+++ b/src/app_modules/notifikasi/fun/create/create_notif_to_user_kabar_donasi.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import _ from "lodash";
import mqtt_client from "@/util/mqtt_client";
@@ -30,7 +30,6 @@ export async function notifikasiToUser_CreateKabarDonasi({
const dataFix = Array.from(data);
for (let authorId of dataFix) {
- console.log(authorId);
const createNotifikasi = await prisma.notifikasi.create({
data: {
userRoleId: "1",
diff --git a/src/app_modules/notifikasi/fun/get/fun_get_status_transaksi.ts b/src/app_modules/notifikasi/fun/get/fun_get_status_transaksi.ts
new file mode 100644
index 00000000..d5d8ca94
--- /dev/null
+++ b/src/app_modules/notifikasi/fun/get/fun_get_status_transaksi.ts
@@ -0,0 +1,22 @@
+"use server";
+
+import prisma from "@/lib/prisma";
+
+export default async function notifikasi_funGetStatusTransaksiById({
+ notifId,
+}: {
+ notifId: string;
+}) {
+ const data = await prisma.notifikasi.findFirst({
+ where: {
+ id: notifId,
+ },
+ select: {
+ status: true,
+ },
+ });
+
+
+ if (!data) return { status: 400 };
+ return { status: 200, data: data };
+}
diff --git a/src/app_modules/notifikasi/fun/get/get_notifiaksi_by_id.ts b/src/app_modules/notifikasi/fun/get/get_notifiaksi_by_id.ts
index ecd6212d..18c6293a 100644
--- a/src/app_modules/notifikasi/fun/get/get_notifiaksi_by_id.ts
+++ b/src/app_modules/notifikasi/fun/get/get_notifiaksi_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import _ from "lodash";
diff --git a/src/app_modules/notifikasi/fun/index.ts b/src/app_modules/notifikasi/fun/index.ts
index 8c097218..ca01304b 100644
--- a/src/app_modules/notifikasi/fun/index.ts
+++ b/src/app_modules/notifikasi/fun/index.ts
@@ -1,11 +1,15 @@
import { notifikasi_funEventCheckStatus } from "./check/fun_check_event_status";
+import { notifikasi_funInvestasiChecInvestaorStatus } from "./check/fun_check_investor_status";
import notifikasiToAdmin_funCreate from "./create/create_notif_to_admin";
import notifikasiToUser_funCreate from "./create/create_notif_to_user";
import { notifikasiToUser_CreateGroupCollaboration } from "./create/create_notif_to_user_collaboration";
import { notifikasiToUser_CreateKabarDonasi } from "./create/create_notif_to_user_kabar_donasi";
+import notifikasi_funGetStatusTransaksiById from "./get/fun_get_status_transaksi";
export { notifikasiToAdmin_funCreate };
export { notifikasiToUser_CreateGroupCollaboration };
export { notifikasiToUser_CreateKabarDonasi };
export { notifikasiToUser_funCreate };
export { notifikasi_funEventCheckStatus };
+export { notifikasi_funGetStatusTransaksiById };
+export { notifikasi_funInvestasiChecInvestaorStatus };
diff --git a/src/app_modules/notifikasi/fun/update/fun_update_is_read_by_user_id.ts b/src/app_modules/notifikasi/fun/update/fun_update_is_read_by_user_id.ts
index 6859eca6..78b05c12 100644
--- a/src/app_modules/notifikasi/fun/update/fun_update_is_read_by_user_id.ts
+++ b/src/app_modules/notifikasi/fun/update/fun_update_is_read_by_user_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export default async function notifikasi_funUpdateIsReadById({
notifId,
diff --git a/src/app_modules/notifikasi/lib/api_fetch_notifikasi.ts b/src/app_modules/notifikasi/lib/api_fetch_notifikasi.ts
new file mode 100644
index 00000000..beea94b5
--- /dev/null
+++ b/src/app_modules/notifikasi/lib/api_fetch_notifikasi.ts
@@ -0,0 +1,46 @@
+import { API_RouteNotifikasi } from "@/lib/api_user_router/route_api_notifikasi";
+import { ICategoryapp } from "../model/interface";
+
+export const apiGetAllNotifikasiByCategory = async ({
+ category,
+ page,
+}: {
+ category: ICategoryapp;
+ page: number;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const isCategory = category ? `?category=${category}` : "";
+ const isPage = page ? `&page=${page}` : "";
+ const response = await fetch(
+ `/api/notifikasi/kategori${isCategory}${isPage}`,
+ {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error("Failed to get all forum:", response.statusText, errorData);
+ throw new Error(errorData?.message || "Failed to get all forum");
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error get all forum", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
diff --git a/src/app_modules/notifikasi/lib/api_fetch_ntf_donasi.ts b/src/app_modules/notifikasi/lib/api_fetch_ntf_donasi.ts
new file mode 100644
index 00000000..bf8fecb4
--- /dev/null
+++ b/src/app_modules/notifikasi/lib/api_fetch_ntf_donasi.ts
@@ -0,0 +1,44 @@
+export { apiNotifikasiDonasiCheckTransaksiById };
+
+const apiNotifikasiDonasiCheckTransaksiById = async ({
+ id,
+}: {
+ id: string;
+}) => {
+ try {
+ // Fetch token from cookie
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) {
+ console.error("No token found");
+ return null;
+ }
+
+ const response = await fetch(`/api/notifikasi/donasi/transaksi/${id}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ // Check if the response is OK
+ if (!response.ok) {
+ const errorData = await response.json().catch(() => null);
+ console.error(
+ "Failed to check donasi transaksi:",
+ response.statusText,
+ errorData
+ );
+ throw new Error(
+ errorData?.message || "Failed to check donasi transaksi:"
+ );
+ }
+
+ // Return the JSON response
+ return await response.json();
+ } catch (error) {
+ console.error("Error to check donasi transaksi:", error);
+ throw error; // Re-throw the error to handle it in the calling function
+ }
+};
diff --git a/src/app_modules/notifikasi/model/interface.ts b/src/app_modules/notifikasi/model/interface.ts
index 8697bfd0..fa526102 100644
--- a/src/app_modules/notifikasi/model/interface.ts
+++ b/src/app_modules/notifikasi/model/interface.ts
@@ -33,8 +33,18 @@ export interface MODEL_NOTIFIKASI {
| "Gagal"
| "Donatur Baru"
| "Kabar Donasi"
- | "Pencairan Dana"
+ | "Pencairan Dana";
Role: MODEL_NEW_DEFAULT_MASTER;
userRoleId: String;
}
+
+export type ICategoryapp =
+ | "Semua"
+ | "Event"
+ | "Job"
+ | "Voting"
+ | "Donasi"
+ | "Investasi"
+ | "Forum"
+ | "Collaboration";
diff --git a/src/app_modules/notifikasi/ui/index.ts b/src/app_modules/notifikasi/ui/index.ts
deleted file mode 100644
index bd4ae05d..00000000
--- a/src/app_modules/notifikasi/ui/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { Notifikasi_UiLayout } from "./ui_layout_notifikasi";
-import { Notifikasi_UiView } from "./ui_notifiaksi";
-
-export { Notifikasi_UiLayout };
-export { Notifikasi_UiView };
diff --git a/src/app_modules/notifikasi/ui/ui_layout_notifikasi.tsx b/src/app_modules/notifikasi/ui/ui_layout_notifikasi.tsx
deleted file mode 100644
index 663a7052..00000000
--- a/src/app_modules/notifikasi/ui/ui_layout_notifikasi.tsx
+++ /dev/null
@@ -1,91 +0,0 @@
-"use client";
-
-import { MainColor } from "@/app_modules/_global/color/color_pallet";
-import {
- BackgroundImage,
- Box,
- Container,
- Footer,
- rem,
- ScrollArea,
-} from "@mantine/core";
-import React from "react";
-
-export function Notifikasi_UiLayout({
- children,
- header,
- footer,
-}: {
- children: React.ReactNode;
- header?: React.ReactNode;
- footer?: React.ReactNode;
-}) {
- return (
- <>
-
-
-
-
-
- {children}
-
-
-
- >
- );
-}
-
-function UIHeader({ header }: { header: React.ReactNode }) {
- return (
- <>
- {header ? (
-
- {header}
-
- ) : (
- ""
- )}
- >
- );
-}
-
-function UIChildren({
- children,
- footer,
-}: {
- children: React.ReactNode;
- footer: React.ReactNode;
-}) {
- return (
- <>
-
- {children}
- {/*
- */}
-
- >
- );
-}
-
-
diff --git a/src/app_modules/notifikasi/ui/ui_notifiaksi.tsx b/src/app_modules/notifikasi/ui/ui_notifiaksi.tsx
deleted file mode 100644
index 6f19330b..00000000
--- a/src/app_modules/notifikasi/ui/ui_notifiaksi.tsx
+++ /dev/null
@@ -1,176 +0,0 @@
-"use client";
-
-import { MainColor } from "@/app_modules/_global/color/color_pallet";
-import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
-import {
- gs_donasi_hot_menu,
- gs_donasi_tabs_posting,
-} from "@/app_modules/donasi/global_state";
-import {
- gs_event_hotMenu,
- gs_event_status,
-} from "@/app_modules/event/global_state";
-import {
- gs_investas_menu,
- gs_investasi_status,
-} from "@/app_modules/investasi/g_state";
-import {
- gs_vote_hotMenu,
- gs_vote_status,
-} from "@/app_modules/vote/global_state";
-import { Box, Button, Center, Flex, Stack } from "@mantine/core";
-import { useShallowEffect } from "@mantine/hooks";
-import { useAtom } from "jotai";
-import _ from "lodash";
-import { ScrollOnly } from "next-scroll-loader";
-import { useState } from "react";
-import { ComponentNotifiaksi_CardView } from "../component/card_view";
-import notifikasi_getByUserId from "../fun/get/get_notifiaksi_by_id";
-import { gs_notifikasi_kategori_app } from "../lib";
-import { MODEL_NOTIFIKASI } from "../model/interface";
-
-export function Notifikasi_UiView({
- listNotifikasi,
- masterKategori,
-}: {
- listNotifikasi: any[];
- masterKategori: any[];
-}) {
- const [data, setData] = useState(listNotifikasi);
- const [activePage, setActivePage] = useState(1);
- const [mstrKategori, setMstrKategori] = useState(masterKategori);
- const [activeKategori, setActiveKategori] = useAtom(
- gs_notifikasi_kategori_app
- );
-
- // Kategori App
- // const [voteMenu, setVoteMenu] = useAtom(gs_vote_hotMenu);
- // const [voteStatus, setVoteStatus] = useAtom(gs_vote_status);
- // const [eventMenu, setEventMenu] = useAtom(gs_event_hotMenu);
- // const [eventStatus, setEventStatus] = useAtom(gs_event_status);
- // const [donasiMenu, setDonasiMenu] = useAtom(gs_donasi_hot_menu);
- // const [donasiStatus, setDonasiStatus] = useAtom(gs_donasi_tabs_posting);
- // const [investasiMenu, setInvestasiMenu] = useAtom(gs_investas_menu);
- // const [investasiStatus, setInvestasiStatus] = useAtom(gs_investasi_status);
-
- useShallowEffect(() => {
- onLoadDataNotifikasi({ kategoriApp: activeKategori });
- }, [activeKategori]);
-
- async function onLoadDataNotifikasi({
- kategoriApp,
- }: {
- kategoriApp: string;
- }) {
- const loadNotifikasi = await notifikasi_getByUserId({
- page: 1,
- kategoriApp: "Semua",
- });
-
- setData(loadNotifikasi as any);
- }
-
-
- return (
- <>
-
-
-
- {mstrKategori.map((e, i) => (
- {
-
- // setActiveKategori(e.name);
- // onLoadDataNotifikasi(e.name);
- }}
- >
- {e.name}
-
- ))}
-
-
-
- {/*
- {_.isEmpty(data) ? (
-
- ) : (
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await notifikasi_getByUserId({
- page: activePage + 1,
- kategoriApp: activeKategori,
- });
- // console.log(loadData);
-
- setActivePage((val) => val + 1);
-
- return loadData;
- }}
- >
- {(item) => (
- {
- // if (item?.kategoriApp === "JOB") {
-
- // setJobMenuId(val.menuId);
- // // setJobStatus(val.status);
- // }
-
- // // if (item?.kategoriApp === "VOTING") {
- // // setVoteMenu(val.menuId);
- // // setVoteStatus(val.status);
- // // }
-
- // // if (item?.kategoriApp === "EVENT") {
- // // setEventMenu(val.menuId);
- // // setEventStatus(val.status);
- // // }
-
- // // if (item?.kategoriApp === "DONASI") {
- // // setDonasiMenu(val.menuId);
- // // setDonasiStatus(val.status);
- // // }
-
- // // if (item?.kategoriApp === "INVESTASI") {
- // // setInvestasiMenu(val.menuId);
- // // setInvestasiStatus(val.status);
- // // }
- // }}
- />
- )}
-
- )}
- */}
-
- >
- );
-}
diff --git a/src/app_modules/notifikasi/view/index.ts b/src/app_modules/notifikasi/view/index.ts
deleted file mode 100644
index 25af39f6..00000000
--- a/src/app_modules/notifikasi/view/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import Notifikasi_MainView from "./view_notifikasi";
-
-export { Notifikasi_MainView };
\ No newline at end of file
diff --git a/src/app_modules/notifikasi/view/view_notifikasi.tsx b/src/app_modules/notifikasi/view/view_notifikasi.tsx
deleted file mode 100644
index c295a81d..00000000
--- a/src/app_modules/notifikasi/view/view_notifikasi.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import UIGlobal_LayoutHeaderTamplate from "../../_global/ui/ui_header_tamplate";
-import { Notifikasi_UiLayout, Notifikasi_UiView } from "../ui";
-
-export default function Notifikasi_MainView({
- listNotifikasi,
- masterKategori,
- kategoriName,
-}: {
- listNotifikasi: any[];
- masterKategori: any[];
- kategoriName: string
-}) {
- return (
- <>
- }
- >
-
-
- >
- );
-}
diff --git a/src/app_modules/user/index.ts b/src/app_modules/user/index.ts
new file mode 100644
index 00000000..8779b5f7
--- /dev/null
+++ b/src/app_modules/user/index.ts
@@ -0,0 +1,5 @@
+import { IUserProfile } from './lib/type_user';
+import { apiGetUserProfile } from "./lib/api_user";
+
+export { apiGetUserProfile };
+export type { IUserProfile };
diff --git a/src/app_modules/user/lib/api_user.ts b/src/app_modules/user/lib/api_user.ts
new file mode 100644
index 00000000..824744de
--- /dev/null
+++ b/src/app_modules/user/lib/api_user.ts
@@ -0,0 +1,19 @@
+export const apiGetUserProfile = async (path?: string) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if(!token) return null
+
+ const response = await fetch(`/api/new/user${(path) ? path : ''}`, {
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Accept': 'application/json',
+ 'Access-Control-Allow-Origin': '*',
+ 'Authorization': `Bearer ${token}`,
+ }
+ })
+
+ // console.log(await response.json())
+
+ if (!response.ok) return null
+ const data: Record = await response.json()
+ return data
+}
\ No newline at end of file
diff --git a/src/app_modules/user/lib/type_user.ts b/src/app_modules/user/lib/type_user.ts
new file mode 100644
index 00000000..2f5a2177
--- /dev/null
+++ b/src/app_modules/user/lib/type_user.ts
@@ -0,0 +1,14 @@
+export interface IUserProfile {
+ id: string
+ username: string
+ nomor: string
+ active:boolean
+ masterUserRoleId: string
+ idProfile: string
+ name: string
+ email: string
+ alamat: string
+ jenisKelamin: string
+ imageId: string
+ imageBackgroundId: string
+}
\ No newline at end of file
diff --git a/src/app_modules/user_search/component/api_fetch_user_search.ts b/src/app_modules/user_search/component/api_fetch_user_search.ts
new file mode 100644
index 00000000..138aaa6d
--- /dev/null
+++ b/src/app_modules/user_search/component/api_fetch_user_search.ts
@@ -0,0 +1,24 @@
+export const apiGetUserSearch = async ({
+ page,
+ search,
+}: {
+ page: string;
+ search: string;
+}) => {
+ const { token } = await fetch("/api/get-cookie").then((res) => res.json());
+ if (!token) return await token.json().catch(() => null);
+
+ const isPage = page ? `?page=${page}` : "";
+ const isSearch = search ? `&search=${search}` : "";
+
+ const response = await fetch(`/api/user${isPage}${isSearch}`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ return await response.json().catch(() => null);
+};
diff --git a/src/app_modules/user_search/component/skeleton_view.tsx b/src/app_modules/user_search/component/skeleton_view.tsx
new file mode 100644
index 00000000..50a4e1ed
--- /dev/null
+++ b/src/app_modules/user_search/component/skeleton_view.tsx
@@ -0,0 +1,27 @@
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Grid, Group, Stack } from "@mantine/core";
+
+export function UserSearch_SkeletonView() {
+ return (
+ <>
+
+ {Array.from({ length: 2 }).map((e, i) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ))}
+
+ >
+ );
+}
diff --git a/src/app_modules/user_search/component/ui_user_search.tsx b/src/app_modules/user_search/component/ui_user_search.tsx
index cdefcc7c..13bded35 100644
--- a/src/app_modules/user_search/component/ui_user_search.tsx
+++ b/src/app_modules/user_search/component/ui_user_search.tsx
@@ -1,10 +1,10 @@
"use client";
-import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { MODEL_USER } from "@/app_modules/home/model/interface";
+import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
+import { clientLogger } from "@/util/clientLogger";
import {
ActionIcon,
Box,
@@ -16,65 +16,119 @@ import {
Text,
TextInput,
} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import { IconChevronRight, IconSearch } from "@tabler/icons-react";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { useRouter } from "next/navigation";
import { useState } from "react";
-import { userSearch_getAllUser } from "../fun/get/get_all_user";
+import { apiGetUserSearch } from "./api_fetch_user_search";
+import { UserSearch_SkeletonView } from "./skeleton_view";
-export function UserSearch_UiView({ listUser }: { listUser: MODEL_USER[] }) {
- const [data, setData] = useState(listUser);
+export function UserSearch_UiView() {
+ const [data, setData] = useState([]);
const [activePage, setActivePage] = useState(1);
- const [isSearch, setIsSearch] = useState("");
+ const [searchQuery, setSearchQuery] = useState("");
+ const [isLoading, setIsLoading] = useState(false);
+ const [hasMore, setHasMore] = useState(true);
- async function onSearch(name: string) {
- setIsSearch(name);
- const loadData = await userSearch_getAllUser({
- page: activePage,
- search: name,
- });
- setData(loadData as any);
+ useShallowEffect(() => {
+ const initializeData = async () => {
+ setIsLoading(true);
+ try {
+ const response = await apiGetUserSearch({
+ page: "1", // Selalu mulai dari page 1 untuk search baru
+ search: searchQuery,
+ });
+
+ if (response?.data) {
+ // Reset allData dan mulai dengan data baru
+ setData(response.data);
+ setActivePage(1);
+ // Jika data yang diterima kosong atau kurang dari yang diharapkan,
+ // berarti tidak ada data lagi
+ setHasMore(response.data.length > 0);
+ }
+ } catch (error) {
+ clientLogger.error("Error initializing data", error);
+ setData([]);
+ setHasMore(false);
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ initializeData();
+ }, [searchQuery]); // Dependency hanya pada searchQuery
+
+ function handleSearch(value: string) {
+ setSearchQuery(value);
+ // Reset state pagination
setActivePage(1);
+ setHasMore(true);
+ }
+
+ // Function untuk load more data (infinite scroll)
+ async function loadMoreData() {
+ if (!hasMore || isLoading) return null;
+
+ try {
+ const nextPage = activePage + 1;
+ const response = await apiGetUserSearch({
+ page: `${nextPage}`,
+ search: searchQuery,
+ });
+
+ if (response?.data && response.data.length > 0) {
+ setActivePage(nextPage);
+ // Update hasMore berdasarkan apakah ada data yang diterima
+ setHasMore(response.data.length > 0);
+ return response.data;
+ } else {
+ setHasMore(false);
+ return null;
+ }
+ } catch (error) {
+ clientLogger.error("Error loading more data", error);
+ setHasMore(false);
+ return null;
+ }
}
return (
<>
-
+
}
placeholder="Masukan nama pengguna "
- onChange={(val) => onSearch(val.target.value)}
+ onChange={(val) => handleSearch(val.target.value)}
+ // disabled={isLoading}
/>
-
- {_.isEmpty(data) ? (
-
- ) : (
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await userSearch_getAllUser({
- page: activePage + 1,
- search: isSearch,
- });
- setActivePage((val) => val + 1);
-
- return loadData;
- }}
- >
- {(item) => }
-
- )}
-
+ {!data.length && isLoading ? (
+
+ ) : (
+
+ {_.isEmpty(data) ? (
+
+ ) : (
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={loadMoreData}
+ >
+ {(item) => }
+
+ )}
+
+ )}
>
);
@@ -115,57 +169,12 @@ function CardView({ data }: { data: MODEL_USER }) {
- {loading ? (
-
- ) : (
-
- )}
+
-
- {/* {
- setLoading(true);
- router.push(RouterProfile.katalogOLD + `${data?.Profile?.id}`);
- }}
- >
-
-
-
-
-
-
-
- {data?.Profile.name}d sdasd sdas
-
-
- +{data?.nomor}
-
-
-
-
-
-
-
- {loading ? (
-
- ) : (
-
- )}
-
-
-
-
- */}
>
);
}
diff --git a/src/app_modules/user_search/fun/get/get_all_user.ts b/src/app_modules/user_search/fun/get/get_all_user.ts
index 84beaa71..a8b8afe7 100644
--- a/src/app_modules/user_search/fun/get/get_all_user.ts
+++ b/src/app_modules/user_search/fun/get/get_all_user.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function userSearch_getAllUser({
diff --git a/src/app_modules/user_search/view_user_seach.tsx b/src/app_modules/user_search/view_user_seach.tsx
index ebcd2f81..9177cf91 100644
--- a/src/app_modules/user_search/view_user_seach.tsx
+++ b/src/app_modules/user_search/view_user_seach.tsx
@@ -1,22 +1,27 @@
-import { MODEL_USER } from "@/app_modules/home/model/interface";
+import { Component_Header } from "../_global/component/new/component_header";
import UIGlobal_LayoutHeaderTamplate from "../_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "../_global/ui/ui_layout_tamplate";
+import UI_NewLayoutTamplate, { UI_NewHeader, UI_NewChildren } from "../_global/ui/V2_layout_tamplate";
import { UserSearch_UiView } from "./component/ui_user_search";
-export default function UserSearch_MainView({
- listUser,
-}: {
- listUser: MODEL_USER[];
-}) {
+export default function UserSearch_MainView() {
return (
<>
- }
>
-
-
- {/* {JSON.stringify(data, null, 2)} */}
+
+ */}
+
+
+
+
+
+
+
+
+
>
);
}
diff --git a/src/app_modules/vote/_lib/api_voting.ts b/src/app_modules/vote/_lib/api_voting.ts
new file mode 100644
index 00000000..fab95764
--- /dev/null
+++ b/src/app_modules/vote/_lib/api_voting.ts
@@ -0,0 +1,113 @@
+/**
+ * Mengambil daftar semua voting dari API berdasarkan filter yang diberikan.
+ *
+ * @param {Object} params - Parameter untuk permintaan data voting.
+ * @param {"beranda"|"status"} params.kategori - Kategori voting yang diminta, hanya dapat berupa "beranda" atau "status".
+ * @param {string} params.page - Nomor halaman untuk pagination.
+ * @param {string|null|undefined} [params.search] - Kata kunci pencarian untuk memfilter voting (opsional).
+ * @param {"1"|"2"|"3"|"4"|undefined} [params.status] - Status voting, di mana:
+ * - "1": Publish,
+ * - "2": Review,
+ * - "3": Draft,
+ * - "4": Reject.
+ * Parameter ini bersifat opsional.
+ * @returns {Promise
- }
- />
- ))}
-
- )}
-
+ {_.isEmpty(data) ? (
+
+ ) : (
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={handleMoreData}
+ >
+ {(item) => (
+
+
+
+ 10
+ ? 8
+ : 10
+ }
+ >
+ {item.Voting_DaftarNamaVote.value}
+
+
+
+ }
+ />
+
+ )}
+
+
+ )}
>
);
}
diff --git a/src/app_modules/vote/component/card_view_publish.tsx b/src/app_modules/vote/component/card_view_publish.tsx
index 90c1f433..c955100a 100644
--- a/src/app_modules/vote/component/card_view_publish.tsx
+++ b/src/app_modules/vote/component/card_view_publish.tsx
@@ -1,23 +1,15 @@
"use client";
-import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
import {
ComponentGlobal_AvatarAndUsername,
ComponentGlobal_CardLoadingOverlay,
ComponentGlobal_CardStyles,
} from "@/app_modules/_global/component";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
-import {
- Avatar,
- Badge,
- Box,
- Center,
- Grid,
- Group,
- Stack,
- Text,
- Title
-} from "@mantine/core";
+import { Avatar, Badge, Box, Center, Grid, Stack, Text } from "@mantine/core";
+import moment from "moment";
+import "moment/locale/id";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { MODEL_VOTING } from "../model/interface";
@@ -74,36 +66,24 @@ export default function ComponentVote_CardViewPublish({
root: {
backgroundColor: AccentColor.blue,
border: `1px solid ${AccentColor.skyblue}`,
- color: "white",
- width: "80%",
+ color: MainColor.white,
+ width: "70%",
},
}}
>
-
-
- {data
- ? data?.awalVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })
- : "tgl awal voting"}
-
- -
-
- {data
- ? data?.akhirVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })
- : "tgl akhir voting"}
-
-
+
+ {data
+ ? moment(data.awalVote).format("ll")
+ : "tgl awal voting"}{" "}
+ -{" "}
+ {data
+ ? moment(data.akhirVote).format("ll")
+ : "tgl akhir voting"}
+
{data ? (
-
- Hasil Voting
-
-
{data?.Voting_DaftarNamaVote.map((e) => (
{
if (data?.id === undefined) {
- ComponentGlobal_NotifikasiPeringatan("Path tidak ditemukan");
+ ComponentGlobal_NotifikasiPeringatan("Halaman tidak ditemukan");
} else {
setVisible(true);
router.push((path as string) + data?.id);
@@ -41,24 +46,15 @@ export default function ComponentVote_CardViewStatus({
root: {
backgroundColor: AccentColor.blue,
border: `1px solid ${AccentColor.skyblue}`,
- color: "white",
- width: "80%",
+ color: MainColor.white,
+ width: "70%",
},
}}
>
-
-
- {data?.awalVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })}
-
- -
-
- {data?.akhirVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })}
-
-
+
+ {data ? moment(data.awalVote).format("ll") : "tgl awal voting"} -{" "}
+ {data ? moment(data.akhirVote).format("ll") : "tgl akhir voting"}
+
{visible && }
diff --git a/src/app_modules/vote/component/component_footer_voting.tsx b/src/app_modules/vote/component/component_footer_voting.tsx
new file mode 100644
index 00000000..93d35625
--- /dev/null
+++ b/src/app_modules/vote/component/component_footer_voting.tsx
@@ -0,0 +1,76 @@
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
+import {
+ IconHome,
+ IconReservedLine,
+ IconClick,
+ IconHistory,
+} from "@tabler/icons-react";
+import { useAtom } from "jotai";
+import { useRouter } from "next/navigation";
+import { gs_vote_hotMenu } from "../global_state";
+import { MainColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
+import { SimpleGrid, Stack, ActionIcon, Text } from "@mantine/core";
+
+export function Voting_ComponentFooterLayout() {
+ const router = useRouter();
+ const [hotMenu, setHotMenu] = useAtom(gs_vote_hotMenu);
+
+ const listFooter = [
+ {
+ id: 1,
+ name: "Beranda",
+ path: RouterVote.beranda,
+ icon: ,
+ },
+
+ {
+ id: 2,
+ name: "Status",
+ path: RouterVote.status({ id: "1" }),
+ icon: ,
+ },
+ {
+ id: 3,
+ name: "Kontribusi",
+ path: RouterVote.kontribusi,
+ icon: ,
+ },
+ {
+ id: 4,
+ name: "Riwayat",
+ path: RouterVote.riwayat({ id: "1" }),
+ icon: ,
+ },
+ ];
+
+ return (
+ <>
+
+ {listFooter.map((e, i) => (
+
+
+ e.path === ""
+ ? ComponentGlobal_NotifikasiPeringatan("Cooming Soon")
+ : (router.replace(e.path), setHotMenu(e.id))
+ }
+ >
+ {e.icon}
+
+
+ {e.name}
+
+
+ ))}
+
+ >
+ );
+}
diff --git a/src/app_modules/vote/component/detail/comp_layout_header_detail_publish.tsx b/src/app_modules/vote/component/detail/comp_layout_header_detail_publish.tsx
index 2024bb93..40df7e65 100644
--- a/src/app_modules/vote/component/detail/comp_layout_header_detail_publish.tsx
+++ b/src/app_modules/vote/component/detail/comp_layout_header_detail_publish.tsx
@@ -1,10 +1,13 @@
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
-import { AccentColor } from "@/app_modules/_global/color";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { UIGlobal_Modal } from "@/app_modules/_global/ui";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import {
ActionIcon,
Button,
@@ -14,66 +17,104 @@ import {
Stack,
Text,
} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import {
IconArchive,
IconDotsVertical,
IconUsersGroup,
IconX,
} from "@tabler/icons-react";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import { apiGetOneVotingById } from "../../_lib/api_voting";
import { voting_funUpdateIsArsipById } from "../../fun";
import { MODEL_VOTING } from "../../model/interface";
-import { voting_funGetOneVotingbyId } from "../../fun/get/fun_get_one_by_id";
export function Voting_ComponentLayoutHeaderDetailPublish({
- votingId,
title,
- userLoginId,
- dataVoting,
}: {
- votingId: string;
title: string;
- userLoginId: string;
- dataVoting: any;
}) {
- const [data, setData] = useState(dataVoting);
+ const router = useRouter();
+ const { id } = useParams();
const [openDrawer, setOpenDrawer] = useState(false);
const [openModal, setOpenModal] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
+
+ const [data, setData] = useState();
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ handleGetUserId();
+ onLoadData();
+ }, []);
+
+ async function handleGetUserId() {
+ try {
+ const respone = await apiNewGetUserIdByToken();
+
+ if (respone) {
+ setUserLoginId(respone.userId);
+ }
+ } catch (error) {
+ console.error("Error get data detail", error);
+ }
+ }
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetOneVotingById({ id: id as string });
+ if (response) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ console.log(error);
+ }
+ }
async function onUpdateStatusArsip({ isArsip }: { isArsip: boolean }) {
- const res = await voting_funUpdateIsArsipById({
- votingId,
- isArsip: isArsip,
- });
- if (res.status === 200) {
- try {
- const loadData = await voting_funGetOneVotingbyId(votingId);
- setData(loadData as any);
- } catch (error) {
- console.log(error);
- } finally {
- setOpenModal(false);
- ComponentGlobal_NotifikasiBerhasil(res.message);
+ try {
+ setIsLoading(true);
+ const res = await voting_funUpdateIsArsipById({
+ votingId: id as string,
+ isArsip: isArsip,
+ });
+
+ if (res.status !== 200) {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiPeringatan(res.message);
+ return;
}
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiBerhasil("Berhasil Update");
+ router.back();
+ } catch (error) {
+ console.log(error);
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal("Gagal Update");
}
}
return (
<>
- {
- setOpenDrawer(true);
- }}
- >
-
-
+ userLoginId ? (
+ {
+ setOpenDrawer(true);
+ }}
+ >
+
+
+ ) : (
+
+ )
}
/>
@@ -118,14 +159,14 @@ export function Voting_ComponentLayoutHeaderDetailPublish({
{/* Check Author */}
{data?.authorId === userLoginId ? (
{
setOpenDrawer(val.drawer);
setOpenModal(val.modal);
}}
/>
) : (
-
+
)}
@@ -137,6 +178,8 @@ export function Voting_ComponentLayoutHeaderDetailPublish({
title={`Anda yakin ingin ${data?.isArsip ? "mempublish" : "mengarsipkan"} voting?`}
buttonKanan={
{
data?.isArsip
? onUpdateStatusArsip({ isArsip: false })
@@ -177,7 +220,7 @@ function BoxIsAuthor({
{/* Daftar Kontributor */}
{
setIsLoading(true);
router.push(RouterVote.daftar_kontributor + votingId, {
@@ -187,7 +230,7 @@ function BoxIsAuthor({
>
{isLoading ? : }
-
+
Daftar Kontributor
@@ -195,7 +238,7 @@ function BoxIsAuthor({
{/* Arsip button */}
{
onSetDrawer({
drawer: false,
@@ -206,7 +249,7 @@ function BoxIsAuthor({
>
-
+
Update Arsip
diff --git a/src/app_modules/vote/component/detail/detail_data_sebelum_publish.tsx b/src/app_modules/vote/component/detail/detail_data_sebelum_publish.tsx
index 476c2888..1e12a3e6 100644
--- a/src/app_modules/vote/component/detail/detail_data_sebelum_publish.tsx
+++ b/src/app_modules/vote/component/detail/detail_data_sebelum_publish.tsx
@@ -10,8 +10,10 @@ import {
} from "@mantine/core";
import { IconCircle } from "@tabler/icons-react";
import { MODEL_VOTING } from "../../model/interface";
-import { AccentColor } from "@/app_modules/_global/color/color_pallet";
-
+import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
+import { Comp_SetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
+import moment from "moment";
+import "moment/locale/id"
export default function ComponentVote_DetailDataSebelumPublish
({
data,
@@ -26,7 +28,7 @@ export default function ComponentVote_DetailDataSebelumPublish
backgroundColor: AccentColor.darkblue,
borderRadius: "10px",
border: `2px solid ${AccentColor.blue}`,
- color: "white",
+ color: MainColor.white,
}}
>
@@ -36,9 +38,9 @@ export default function ComponentVote_DetailDataSebelumPublish
{data?.title}
- {data?.deskripsi}
+
-
+
Batas Voting
@@ -49,22 +51,18 @@ export default function ComponentVote_DetailDataSebelumPublish
root: {
backgroundColor: AccentColor.blue,
border: `1px solid ${AccentColor.skyblue}`,
- color: "white",
+ color: MainColor.white,
width: "80%",
},
}}
>
- {data?.awalVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })}
+ {moment(data?.awalVote).format("DD MMM YYYY")}
-
- {data?.akhirVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })}
+ {moment(data?.akhirVote).format("DD MMM YYYY")}
diff --git a/src/app_modules/vote/component/detail/detail_data_setelah_publish.tsx b/src/app_modules/vote/component/detail/detail_data_setelah_publish.tsx
index a78d5d47..a121ccc5 100644
--- a/src/app_modules/vote/component/detail/detail_data_setelah_publish.tsx
+++ b/src/app_modules/vote/component/detail/detail_data_setelah_publish.tsx
@@ -1,11 +1,14 @@
"use client";
-import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
import {
ComponentGlobal_AvatarAndUsername,
ComponentGlobal_CardStyles,
} from "@/app_modules/_global/component";
import { Badge, Center, Group, Stack, Text, Title } from "@mantine/core";
import { MODEL_VOTING } from "../../model/interface";
+import moment from "moment"
+import "moment/locale/id"
+import { Comp_SetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
export default function ComponentVote_DetailDataSetelahPublish({
data,
@@ -31,7 +34,7 @@ export default function ComponentVote_DetailDataSetelahPublish({
{data?.title}
- {data?.deskripsi}
+
@@ -43,24 +46,20 @@ export default function ComponentVote_DetailDataSetelahPublish({
root: {
backgroundColor: AccentColor.blue,
border: `1px solid ${AccentColor.skyblue}`,
- color: "white",
+ color: MainColor.white,
width: "80%",
},
}}
>
-
-
- {data?.awalVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })}
-
- -
-
- {data?.akhirVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })}
-
-
+
+ {data
+ ? moment(data.awalVote).format("ll")
+ : "tgl awal voting"}{" "}
+ -{" "}
+ {data
+ ? moment(data.akhirVote).format("ll")
+ : "tgl akhir voting"}
+
diff --git a/src/app_modules/vote/component/detail/detail_hasil_voting.tsx b/src/app_modules/vote/component/detail/detail_hasil_voting.tsx
index 61a872b6..53963913 100644
--- a/src/app_modules/vote/component/detail/detail_hasil_voting.tsx
+++ b/src/app_modules/vote/component/detail/detail_hasil_voting.tsx
@@ -1,6 +1,6 @@
"use client";
-import { AccentColor } from "@/app_modules/_global/color/color_pallet";
+import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
import {
Avatar,
Card,
@@ -25,7 +25,7 @@ export default function ComponentVote_HasilVoting({
backgroundColor: AccentColor.darkblue,
borderRadius: "10px",
border: `2px solid ${AccentColor.blue}`,
- color: "white",
+ color: MainColor.white,
}}
>
diff --git a/src/app_modules/vote/component/index.tsx b/src/app_modules/vote/component/index.tsx
index 6353e17d..e7b6001b 100644
--- a/src/app_modules/vote/component/index.tsx
+++ b/src/app_modules/vote/component/index.tsx
@@ -1,3 +1,9 @@
import { Voting_ComponentLayoutHeaderDetailPublish } from "./detail/comp_layout_header_detail_publish";
+import {
+ Voting_ComponentSkeletonViewPublish,
+ Voting_ComponentSkeletonViewStatus,
+} from "./skeleton_view";
export { Voting_ComponentLayoutHeaderDetailPublish };
+export { Voting_ComponentSkeletonViewPublish };
+export { Voting_ComponentSkeletonViewStatus };
diff --git a/src/app_modules/vote/component/skeleton_view.tsx b/src/app_modules/vote/component/skeleton_view.tsx
new file mode 100644
index 00000000..5496b500
--- /dev/null
+++ b/src/app_modules/vote/component/skeleton_view.tsx
@@ -0,0 +1,186 @@
+import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { Center, Grid, Group, Stack } from "@mantine/core";
+
+export {
+ Voting_ComponentSkeletonDetail,
+ Voting_ComponentSkeletonViewKontribusi,
+ Voting_ComponentSkeletonViewPublish,
+ Voting_ComponentSkeletonViewStatus,
+ Voting_ComponentSkeletonDaftarKontributor,
+};
+
+function Voting_ComponentSkeletonViewPublish() {
+ return (
+ <>
+ {Array.from({ length: 2 }).map((e, i) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/* */}
+
+
+
+ {Array.from({ length: 2 }).map((e, i) => (
+
+
+
+
+
+
+ ))}
+
+
+
+ ))}
+ >
+ );
+}
+
+function Voting_ComponentSkeletonViewStatus() {
+ return (
+ <>
+ {Array.from({ length: 2 }).map((e, i) => (
+
+
+
+
+
+
+ ))}
+ >
+ );
+}
+
+function Voting_ComponentSkeletonViewKontribusi() {
+ return (
+ <>
+ {Array.from({ length: 2 }).map((e, i) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ))}
+ >
+ );
+}
+
+function Voting_ComponentSkeletonDetail() {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/*
+
+
+
+ */}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+function Voting_ComponentSkeletonDaftarKontributor(){
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/src/app_modules/vote/create/index.tsx b/src/app_modules/vote/create/index.tsx
index da449ec6..0184e06a 100644
--- a/src/app_modules/vote/create/index.tsx
+++ b/src/app_modules/vote/create/index.tsx
@@ -1,7 +1,7 @@
"use client";
-import { IRealtimeData } from "@/app/lib/global_state";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import { IRealtimeData } from "@/lib/global_state";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
@@ -28,6 +28,11 @@ import { useState } from "react";
import { WibuRealtime } from "wibu-pkg";
import { Vote_funCreate } from "../fun/create/create_vote";
import { gs_vote_hotMenu } from "../global_state";
+import { clientLogger } from "@/util/clientLogger";
+import { Component_V3_TextEditor } from "@/app_modules/_global/component/new/comp_V3_text_editor";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
+import Component_V3_Label_TextInput from "@/app_modules/_global/component/new/comp_V3_label_text_input";
export default function Vote_Create() {
const router = useRouter();
@@ -69,40 +74,46 @@ export default function Vote_Create() {
// console.log("berhasil");
- const res = await Vote_funCreate(data as any, listVote);
- if (res.status === 201) {
- const dataNotifikasi: IRealtimeData = {
- appId: res.data?.id as any,
- status: res.data?.Voting_Status?.name as any,
- userId: res.data?.authorId as any,
- pesan: res.data?.title as any,
- kategoriApp: "VOTING",
- title: "Voting baru",
- };
+ try {
+ setIsLoading(true);
+ const res = await Vote_funCreate(data as any, listVote);
+ if (res.status === 201) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res.data?.id as any,
+ status: res.data?.Voting_Status?.name as any,
+ userId: res.data?.authorId as any,
+ pesan: res.data?.title as any,
+ kategoriApp: "VOTING",
+ title: "Voting baru",
+ };
- const notif = await notifikasiToAdmin_funCreate({
- data: dataNotifikasi as any,
- });
-
- if (notif.status === 201) {
- WibuRealtime.setData({
- type: "notification",
- pushNotificationTo: "ADMIN",
+ const notif = await notifikasiToAdmin_funCreate({
+ data: dataNotifikasi as any,
});
- WibuRealtime.setData({
- type: "trigger",
- pushNotificationTo: "ADMIN",
- dataMessage: dataNotifikasi,
- });
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "ADMIN",
+ });
- setHotMenu(2);
- router.replace(RouterVote.status({ id: "2" }));
- ComponentGlobal_NotifikasiBerhasil(res.message);
- setIsLoading(true);
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "ADMIN",
+ dataMessage: dataNotifikasi,
+ });
+
+ setHotMenu(2);
+ router.replace(RouterVote.status({ id: "2" }));
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+ }
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
}
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ } catch (error) {
+ setIsLoading(false);
+ clientLogger.error("Error create voting", error);
}
}
@@ -113,7 +124,13 @@ export default function Vote_Create() {
+
+
+
+ {
+ setData({
+ ...data,
+ deskripsi: val,
+ });
+ }}
+ />
+
+
+
+
+ {/*
-
+ */}
-
+
Daftar Pilihan
@@ -192,7 +241,13 @@ export default function Vote_Create() {
e.value).includes("")
- ? true
- : false
+ listVote.map((e, i) => e.value).includes("") ||
+ funReplaceHtml({ html: data.deskripsi }).length > maxInputLength ||
+ funReplaceHtml({ html: data.deskripsi }).length === 0
}
loaderPosition="center"
loading={isLoading ? true : false}
diff --git a/src/app_modules/vote/create/layout.tsx b/src/app_modules/vote/create/layout.tsx
index 48fb1dfd..8ab0fca2 100644
--- a/src/app_modules/vote/create/layout.tsx
+++ b/src/app_modules/vote/create/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutVote_Create({
@@ -11,9 +14,16 @@ export default function LayoutVote_Create({
}) {
return (
<>
- }>
+ {/* }>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/vote/detail/draft/index.tsx b/src/app_modules/vote/detail/draft/index.tsx
index b5374cd7..9e0cfc96 100644
--- a/src/app_modules/vote/detail/draft/index.tsx
+++ b/src/app_modules/vote/detail/draft/index.tsx
@@ -1,48 +1,58 @@
"use client";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
-import { MainColor } from "@/app_modules/_global/color/color_pallet";
+import {
+ AccentColor,
+ MainColor,
+} from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
-import mqtt_client from "@/util/mqtt_client";
+import { IRealtimeData } from "@/lib/global_state";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
+import { clientLogger } from "@/util/clientLogger";
import { Button, SimpleGrid, Stack } from "@mantine/core";
-import moment from "moment";
-import { useRouter } from "next/navigation";
-import { useState } from "react";
-import ComponentVote_DetailDataSebelumPublish from "../../component/detail/detail_data_sebelum_publish";
-import { Vote_funDeleteById } from "../../fun/delete/fun_delete_by_id";
-import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
-import { MODEL_VOTING } from "../../model/interface";
-import { IRealtimeData } from "@/app/lib/global_state";
-import { WibuRealtime } from "wibu-pkg";
import { useShallowEffect } from "@mantine/hooks";
-import { voting_funGetOneVotingbyId } from "../../fun/get/fun_get_one_by_id";
-import _ from "lodash";
+import moment from "moment";
+import { useParams, useRouter } from "next/navigation";
+import { useState } from "react";
+import { WibuRealtime } from "wibu-pkg";
+import { apiGetOneVotingById } from "../../_lib/api_voting";
+import ComponentVote_DetailDataSebelumPublish from "../../component/detail/detail_data_sebelum_publish";
+import { MODEL_VOTING } from "../../model/interface";
+import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
+import { Vote_funDeleteById } from "../../fun/delete/fun_delete_by_id";
-export default function Vote_DetailDraft({
- dataVote,
-}: {
- dataVote: MODEL_VOTING;
-}) {
- const [data, setData] = useState(dataVote);
+export default function Vote_DetailDraft() {
+ const { id } = useParams();
+ const [data, setData] = useState();
useShallowEffect(() => {
- onLoadData(setData);
- }, [setData]);
+ onLoadData();
+ }, []);
- async function onLoadData(setData: any) {
- const loadData = await voting_funGetOneVotingbyId(dataVote.id);
- setData(loadData);
+ async function onLoadData() {
+ try {
+ const response = await apiGetOneVotingById({ id: id as string });
+ if (response) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ console.log(error);
+ }
}
+ if (!data) return ;
+
return (
<>
- {dataVote?.catatan && (
+ {data?.catatan && (
)}
@@ -71,50 +81,63 @@ function ButtonAction({
if (cekHari < 0)
return ComponentGlobal_NotifikasiPeringatan("Tanggal Voting Lewat");
- const res = await Vote_funEditStatusByStatusId(voteId, "2");
- if (res.status === 200) {
- const dataNotifikasi: IRealtimeData = {
- appId: res.data?.id as any,
- status: res.data?.Voting_Status?.name as any,
- userId: res.data?.authorId as any,
- pesan: res.data?.title as any,
- kategoriApp: "VOTING",
- title: "Mengajukan review",
- };
+ setIsLoading(true);
+ try {
+ const res = await Vote_funEditStatusByStatusId(voteId, "2");
+ if (res.status === 200) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res.data?.id as any,
+ status: res.data?.Voting_Status?.name as any,
+ userId: res.data?.authorId as any,
+ pesan: res.data?.title as any,
+ kategoriApp: "VOTING",
+ title: "Mengajukan review",
+ };
- const notif = await notifikasiToAdmin_funCreate({
- data: dataNotifikasi as any,
- });
-
- if (notif.status === 201) {
- WibuRealtime.setData({
- type: "notification",
- pushNotificationTo: "ADMIN",
+ const notif = await notifikasiToAdmin_funCreate({
+ data: dataNotifikasi as any,
});
- WibuRealtime.setData({
- type: "trigger",
- pushNotificationTo: "ADMIN",
- dataMessage: dataNotifikasi,
- });
+ if (notif.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "ADMIN",
+ });
- ComponentGlobal_NotifikasiBerhasil("Berhasil Ajukan Review", 2000);
- setIsLoading(true);
- router.replace(RouterVote.status({ id: "2" }));
+ WibuRealtime.setData({
+ type: "trigger",
+ pushNotificationTo: "ADMIN",
+ dataMessage: dataNotifikasi,
+ });
+
+ ComponentGlobal_NotifikasiBerhasil("Berhasil Ajukan Review", 2000);
+ router.replace(RouterVote.status({ id: "2" }));
+ }
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
}
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ } catch (error) {
+ setIsLoading(false);
+ clientLogger.error("Error update status vote", error);
}
}
async function onDelete() {
await Vote_funDeleteById(voteId).then((res) => {
- if (res.status === 200) {
- setOpenModal2(false);
- ComponentGlobal_NotifikasiBerhasil("Berhasil Hapus Vote", 2000);
- router.replace(RouterVote.status({ id: "3" }));
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ try {
+ setIsLoading(true);
+ if (res.status === 200) {
+ setOpenModal2(false);
+ ComponentGlobal_NotifikasiBerhasil("Berhasil Hapus Vote", 2000);
+ router.replace(RouterVote.status({ id: "3" }));
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ setIsLoading(false);
+ clientLogger.error("Error delete vote", error);
}
});
}
@@ -124,8 +147,8 @@ function ButtonAction({
{
setOpenModal1(true);
}}
@@ -134,7 +157,8 @@ function ButtonAction({
{
setOpenModal2(true);
}}
@@ -154,6 +178,8 @@ function ButtonAction({
onClick={() => {
setOpenModal1(false);
}}
+ style={{ backgroundColor: AccentColor.blue }}
+ c={AccentColor.white}
>
Batal
@@ -166,8 +192,8 @@ function ButtonAction({
onClick={() => {
onUpdate();
}}
- color="yellow"
- bg={MainColor.yellow}
+ c={MainColor.darkblue}
+ style={{ backgroundColor: AccentColor.yellow }}
>
Ajukan
@@ -181,6 +207,8 @@ function ButtonAction({
close={() => setOpenModal2(false)}
buttonKiri={
{
setOpenModal2(false);
@@ -192,6 +220,8 @@ function ButtonAction({
buttonKanan={
{
onDelete();
}}
diff --git a/src/app_modules/vote/detail/draft/layout.tsx b/src/app_modules/vote/detail/draft/layout.tsx
index 78ca1440..a3384489 100644
--- a/src/app_modules/vote/detail/draft/layout.tsx
+++ b/src/app_modules/vote/detail/draft/layout.tsx
@@ -1,9 +1,12 @@
"use client";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import { ActionIcon } from "@mantine/core";
import { IconDotsVertical, IconEdit } from "@tabler/icons-react";
import React, { useState } from "react";
@@ -27,7 +30,7 @@ export default function LayoutVote_DetailDraft({
return (
<>
-
{children}
-
+ */}
+
+
+
+ setOpenDrawer(true)}
+ >
+
+
+ }
+ />
+
+ {children}
+
();
+ const [data, setData] = useState(null);
+ const [hasil, setHasil] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ onLoadHasil();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetOneVotingById({
+ id: params.id,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data detail", error);
+ }
+ }
+
+ async function onLoadHasil() {
+ try {
+ const respone = await apiGetHasilVotingById({
+ id: params.id,
+ });
+
+ if (respone) {
+ setHasil(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data hasil voting", error);
+ }
+ }
+
+ if (_.isNull(data) && _.isNull(hasil)) {
+ return (
+ <>
+
+ >
+ );
+ }
-export default function Vote_DetailKontribusi({
- dataVote,
-}: {
- dataVote: MODEL_VOTING;
-}) {
return (
<>
-
+
-
+
>
);
diff --git a/src/app_modules/vote/detail/kontribusi/layout.tsx b/src/app_modules/vote/detail/kontribusi/layout.tsx
index 91beef23..735e153d 100644
--- a/src/app_modules/vote/detail/kontribusi/layout.tsx
+++ b/src/app_modules/vote/detail/kontribusi/layout.tsx
@@ -1,34 +1,25 @@
"use client";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
import { Voting_ComponentLayoutHeaderDetailPublish } from "../../component";
export default function LayoutVote_DetailKontribusi({
children,
- votingId,
- userLoginId,
- dataVoting
}: {
children: React.ReactNode;
- votingId: string;
- userLoginId: string;
- dataVoting: any
}) {
return (
<>
-
- }
- >
- {children}
-
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/vote/detail/main/index.tsx b/src/app_modules/vote/detail/main/index.tsx
index 4433d37d..216d63db 100644
--- a/src/app_modules/vote/detail/main/index.tsx
+++ b/src/app_modules/vote/detail/main/index.tsx
@@ -9,263 +9,349 @@ import {
ComponentGlobal_CardStyles,
} from "@/app_modules/_global/component";
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
+import { Comp_SetInnerHTML } from "@/app_modules/_global/component/new/comp_set_inner_html";
+import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import notifikasiToUser_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_user";
-import mqtt_client from "@/util/mqtt_client";
+import { IRealtimeData } from "@/lib/global_state";
+import { clientLogger } from "@/util/clientLogger";
import {
Badge,
Box,
Button,
Center,
- Group,
Radio,
Stack,
Text,
Title,
} from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import moment from "moment";
+import "moment/locale/id";
+import { useParams } from "next/navigation";
import { useState } from "react";
-import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
-import { Vote_funCreateHasil } from "../../fun/create/create_hasil";
-import { voting_funGetOneVotingbyId } from "../../fun/get/fun_get_one_by_id";
-import { MODEL_VOTING } from "../../model/interface";
-import { IRealtimeData } from "@/app/lib/global_state";
import { WibuRealtime } from "wibu-pkg";
+import {
+ apiCheckKontributorToOneVoting,
+ apiGetHasilVotingById,
+ apiGetOneVotingById,
+} from "../../_lib/api_voting";
+import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
+import { Voting_ComponentSkeletonDetail } from "../../component/skeleton_view";
+import { Vote_funCreateHasil } from "../../fun/create/create_hasil";
+import { MODEL_VOTING } from "../../model/interface";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
-export default function Vote_MainDetail({
- dataVote,
- hasilVoting,
- isKontributor,
- pilihanKontributor,
- listKontributor,
- userLoginId,
-}: {
- dataVote: MODEL_VOTING;
- hasilVoting: any;
- isKontributor: boolean;
- pilihanKontributor: string;
- listKontributor: any[];
- userLoginId: string;
-}) {
- const [data, setData] = useState(dataVote);
+export default function Vote_MainDetail() {
+ const params = useParams<{ id: string }>();
const today = new Date();
+ const [data, setData] = useState(null);
+ const [hasil, setHasil] = useState(null);
+ const [pilihanVotingId, setPilihanVotingId] = useState("");
+ const [pilihanKontributor, setPilihanKontributor] = useState(
+ null
+ );
+
+ const [isLoading, setLoading] = useState(false);
+ const [isKontributor, setIsKontributor] = useState(null);
+ const [userLoginId, setUserLoginId] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ onLoadHasil();
+ handleGetUserId();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetOneVotingById({
+ id: params.id,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data detail", error);
+ }
+ }
+
+ async function onLoadHasil() {
+ try {
+ const respone = await apiGetHasilVotingById({
+ id: params.id,
+ });
+
+ if (respone) {
+ setHasil(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data hasil voting", error);
+ }
+ }
+
+ useShallowEffect(() => {
+ onCheckKontribusi();
+ onLoadPilihan();
+ }, []);
+
+ async function handleGetUserId() {
+ try {
+ const respone = await apiNewGetUserIdByToken();
+
+ if (respone) {
+ setUserLoginId(respone.userId);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data detail", error);
+ }
+ }
+
+ async function onCheckKontribusi() {
+ try {
+ const respone = await apiCheckKontributorToOneVoting({
+ id: params.id,
+ kategori: "isKontributor",
+ });
+
+ if (respone) {
+ setIsKontributor(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error check kontibusi", error);
+ }
+ }
+
+ async function onLoadPilihan() {
+ try {
+ const respone = await apiCheckKontributorToOneVoting({
+ id: params.id,
+ kategori: "pilihan",
+ });
+
+ if (respone) {
+ setPilihanKontributor(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error check pilihan", error);
+ }
+ }
+
+ async function onVote() {
+ try {
+ setLoading(true);
+ const res = await Vote_funCreateHasil({
+ pilihanVotingId: pilihanVotingId,
+ votingId: params.id,
+ });
+ if (res.status === 201) {
+ const respone = await apiGetHasilVotingById({
+ id: params.id,
+ });
+
+ if (respone) {
+ setHasil(respone.data);
+ ComponentGlobal_NotifikasiBerhasil(res.message);
+
+ const checkKontibutor = await apiCheckKontributorToOneVoting({
+ id: params.id,
+ kategori: "isKontributor",
+ });
+
+ if (checkKontibutor) {
+ setIsKontributor(checkKontibutor.data);
+ }
+
+ const checkPilihan = await apiCheckKontributorToOneVoting({
+ id: params.id,
+ kategori: "pilihan",
+ });
+
+ if (checkPilihan) {
+ setPilihanKontributor(checkPilihan.data);
+ }
+ }
+
+ if (userLoginId !== res?.data?.Voting?.authorId) {
+ const dataNotifikasi: IRealtimeData = {
+ appId: res?.data?.Voting?.id as string,
+ userId: res?.data?.Voting?.authorId as string,
+ pesan: res?.pilihan as string,
+ status: "Voting Masuk",
+ kategoriApp: "VOTING",
+ title: "User lain telah melakukan voting !",
+ };
+
+ const createNotifikasi = await notifikasiToUser_funCreate({
+ data: dataNotifikasi as any,
+ });
+
+ if (createNotifikasi.status === 201) {
+ WibuRealtime.setData({
+ type: "notification",
+ pushNotificationTo: "USER",
+ dataMessage: dataNotifikasi,
+ });
+ }
+ }
+ } else {
+ setLoading(false);
+ ComponentGlobal_NotifikasiPeringatan(res.message);
+ }
+ } catch (error) {
+ clientLogger.error("Error vote", error);
+ setLoading(false);
+ ComponentGlobal_NotifikasiGagal("Gagal melakukan voting");
+ }
+ }
+
+ if (_.isNull(data) || _.isNull(hasil) || _.isNull(isKontributor)) {
+ return ;
+ }
return (
<>
- {moment(dataVote?.awalVote).diff(today, "hours") < 0 ? (
+ {moment(data?.awalVote).diff(today, "hours") < 0 ? (
""
) : (
)}
-
-
+
+
+
+
+
+
+
+
+ {data?.title}
+
+
+
+
+
+
+
+ Batas Voting
+
+
+
+
+ {data
+ ? moment(data.awalVote).format("ll")
+ : "tgl awal voting"}{" "}
+ -{" "}
+ {data
+ ? moment(data.akhirVote).format("ll")
+ : "tgl akhir voting"}
+
+
+
+
+
+
+ {isKontributor ? (
+
+
+ Pilihan anda:
+
+ {pilihanKontributor ? (
+ {pilihanKontributor}
+ ) : (
+
+ )}
+
+ ) : (
+
+ {
+ setPilihanVotingId(val);
+ }}
+ label={
+
+ Pilihan :
+
+ }
+ >
+
+ {_.isEmpty(data?.Voting_DaftarNamaVote) ? (
+ Pilihan Tidak Ditemukan
+ ) : (
+ data?.Voting_DaftarNamaVote.map((v) => (
+
+
+
+ ))
+ )}
+
+
+
+
+ onVote()}
+ >
+ Vote
+
+
+
+ )}
+
+
+
+
>
);
}
-
-function TampilanDataVoting({
- dataVote,
- setData,
- isKontributor,
- pilihanKontributor,
- userLoginId,
-}: {
- dataVote?: MODEL_VOTING;
- setData: any;
- isKontributor: boolean;
- pilihanKontributor: any;
- userLoginId: string;
-}) {
- const [votingNameId, setVotingNameId] = useState("");
- const today = new Date();
-
- return (
- <>
-
-
-
- {/* */}
-
-
-
- {dataVote?.title}
-
-
- {dataVote?.deskripsi}
-
-
-
-
- Batas Voting
-
-
-
-
-
- {dataVote?.awalVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })}
-
- -
-
- {dataVote?.akhirVote.toLocaleDateString(["id-ID"], {
- dateStyle: "medium",
- })}
-
-
-
-
-
-
- {isKontributor ? (
-
-
- Pilihan anda:
-
-
- {pilihanKontributor.Voting_DaftarNamaVote.value}
-
-
- ) : (
-
- {
- setVotingNameId(val);
- }}
- label={
-
- Pilihan :
-
- }
- >
-
- {dataVote?.Voting_DaftarNamaVote.map((v) => (
-
-
-
- ))}
-
-
-
- {_.isEmpty(votingNameId) ? (
-
- Vote
-
- ) : (
-
- onVote(
- votingNameId,
- dataVote?.id as any,
- setData,
- userLoginId
- )
- }
- bg={MainColor.yellow}
- color="yellow"
- c={"black"}
- >
- Vote
-
- )}
-
-
- )}
-
-
- >
- );
-}
-
-async function onVote(
- pilihanVotingId: string,
- voteId: string,
- setData: any,
- userLoginId: string
-) {
- const res = await Vote_funCreateHasil(pilihanVotingId, voteId);
- if (res.status === 201) {
- await voting_funGetOneVotingbyId(voteId).then((val) => {
- setData(val);
- ComponentGlobal_NotifikasiBerhasil(res.message);
- });
-
- if (userLoginId !== res?.data?.Voting?.authorId) {
- const dataNotifikasi: IRealtimeData = {
- appId: res?.data?.Voting?.id as string,
- userId: res?.data?.Voting?.authorId as string,
- pesan: res?.pilihan as string,
- status: "Voting Masuk",
- kategoriApp: "VOTING",
- title: "User lain telah melakukan voting !",
- };
-
- const createNotifikasi = await notifikasiToUser_funCreate({
- data: dataNotifikasi as any,
- });
-
- if (createNotifikasi.status === 201) {
- WibuRealtime.setData({
- type: "notification",
- pushNotificationTo: "USER",
- dataMessage: dataNotifikasi,
- });
- }
- }
- } else {
- ComponentGlobal_NotifikasiPeringatan(res.message);
- }
-}
diff --git a/src/app_modules/vote/detail/main/layout.tsx b/src/app_modules/vote/detail/main/layout.tsx
index bc8fbae3..86394e4e 100644
--- a/src/app_modules/vote/detail/main/layout.tsx
+++ b/src/app_modules/vote/detail/main/layout.tsx
@@ -1,34 +1,25 @@
"use client";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
import { Voting_ComponentLayoutHeaderDetailPublish } from "../../component";
export default function LayoutVote_MainDetail({
children,
- votingId,
- userLoginId,
- dataVoting,
}: {
children: React.ReactNode;
- votingId: string;
- userLoginId: string;
- dataVoting: any
}) {
return (
<>
-
- }
- >
- {children}
-
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/vote/detail/publish/index.tsx b/src/app_modules/vote/detail/publish/index.tsx
index d44049f7..05d0c9d0 100644
--- a/src/app_modules/vote/detail/publish/index.tsx
+++ b/src/app_modules/vote/detail/publish/index.tsx
@@ -4,22 +4,45 @@ import { Badge, Center, Stack } from "@mantine/core";
import ComponentVote_DetailDataSetelahPublish from "../../component/detail/detail_data_setelah_publish";
import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
import { MODEL_VOTING } from "../../model/interface";
+import { apiGetOneVotingById } from "../../_lib/api_voting";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import { useShallowEffect } from "@mantine/hooks";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+
+export default function Vote_DetailPublish() {
+ const { id } = useParams();
+ const [data, setData] = useState();
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetOneVotingById({ id: id as string });
+ if (response) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ console.log(error);
+ }
+ }
+
+ if (!data) return ;
-export default function Vote_DetailPublish({
- dataVote,
-}: {
- dataVote: MODEL_VOTING;
-}) {
return (
<>
-
-
- {dataVote?.isArsip ? "Arsip" : "Publish"}
+
+
+ {data?.isArsip ? "Arsip" : "Publish"}
-
-
+
+
>
);
diff --git a/src/app_modules/vote/detail/publish/layout.tsx b/src/app_modules/vote/detail/publish/layout.tsx
index ba311579..c698cd62 100644
--- a/src/app_modules/vote/detail/publish/layout.tsx
+++ b/src/app_modules/vote/detail/publish/layout.tsx
@@ -1,35 +1,25 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
import { Voting_ComponentLayoutHeaderDetailPublish } from "../../component";
export default function LayoutVote_DetailPublish({
children,
- votingId,
- userLoginId,
- dataVoting,
}: {
children: React.ReactNode;
- votingId: string;
- userLoginId: string;
- dataVoting: any;
}) {
return (
<>
-
- }
- >
- {children}
-
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/vote/detail/reject/index.tsx b/src/app_modules/vote/detail/reject/index.tsx
index b2ee5f4c..26aaa162 100644
--- a/src/app_modules/vote/detail/reject/index.tsx
+++ b/src/app_modules/vote/detail/reject/index.tsx
@@ -1,33 +1,52 @@
"use client";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
+import { clientLogger } from "@/util/clientLogger";
import { Button, SimpleGrid, Stack } from "@mantine/core";
-import { useAtom } from "jotai";
-import { useRouter } from "next/navigation";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import { apiGetOneVotingById } from "../../_lib/api_voting";
import ComponentVote_DetailDataSebelumPublish from "../../component/detail/detail_data_sebelum_publish";
import { Vote_funDeleteById } from "../../fun/delete/fun_delete_by_id";
import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
-import { gs_vote_status } from "../../global_state";
import { MODEL_VOTING } from "../../model/interface";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
-export default function Vote_DetailReject({
- dataVote,
-}: {
- dataVote: MODEL_VOTING;
-}) {
- const [data, setData] = useState(dataVote);
+export default function Vote_DetailReject() {
+ const { id } = useParams();
+ const [data, setData] = useState();
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetOneVotingById({ id: id as string });
+ if (response) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ console.log(error);
+ }
+ }
+
+ if (!data) return ;
return (
<>
-
+
>
);
@@ -41,24 +60,37 @@ function ButtonAction({ voteId }: { voteId: string }) {
async function onUpdate() {
await Vote_funEditStatusByStatusId(voteId, "3").then((res) => {
- if (res.status === 200) {
+ try {
setIsLoading(true);
- ComponentGlobal_NotifikasiBerhasil("Berhasil Masuk Draft", 2000);
- router.replace(RouterVote.status({ id: "3" }));
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil("Berhasil Masuk Draft", 2000);
+ router.replace(RouterVote.status({ id: "3" }));
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ setIsLoading(false);
+ clientLogger.error("Error update voting", error);
}
});
}
async function onDelete() {
await Vote_funDeleteById(voteId).then((res) => {
- if (res.status === 200) {
- setOpenModal2(false);
- ComponentGlobal_NotifikasiBerhasil("Berhasil Hapus Vote", 2000);
- router.replace(RouterVote.status({ id: "4" }));
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
+ try {
+ setIsLoading(true);
+ if (res.status === 200) {
+ setOpenModal2(false);
+ ComponentGlobal_NotifikasiBerhasil("Berhasil Hapus Vote", 2000);
+ router.replace(RouterVote.status({ id: "4" }));
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ } catch (error) {
+ setIsLoading(false);
+ clientLogger.error("Error delete vote", error);
}
});
}
@@ -68,7 +100,8 @@ function ButtonAction({ voteId }: { voteId: string }) {
{
setOpenModal1(true);
}}
@@ -77,7 +110,8 @@ function ButtonAction({ voteId }: { voteId: string }) {
{" "}
{
setOpenModal2(true);
}}
@@ -93,6 +127,8 @@ function ButtonAction({ voteId }: { voteId: string }) {
buttonKiri={
{
setOpenModal1(false);
}}
@@ -105,10 +141,11 @@ function ButtonAction({ voteId }: { voteId: string }) {
loaderPosition="center"
loading={isLoading ? true : false}
radius={"xl"}
+ style={{ backgroundColor: AccentColor.yellow }}
onClick={() => {
onUpdate();
}}
- color="orange"
+ c={MainColor.darkblue}
>
Simpan
@@ -126,12 +163,16 @@ function ButtonAction({ voteId }: { voteId: string }) {
onClick={() => {
setOpenModal2(false);
}}
+ style={{ backgroundColor: AccentColor.blue }}
+ c={AccentColor.white}
>
Batal
}
buttonKanan={
{
onDelete();
diff --git a/src/app_modules/vote/detail/reject/layout.tsx b/src/app_modules/vote/detail/reject/layout.tsx
index 0b361379..62b34764 100644
--- a/src/app_modules/vote/detail/reject/layout.tsx
+++ b/src/app_modules/vote/detail/reject/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutVote_DetailReject({
@@ -11,11 +14,18 @@ export default function LayoutVote_DetailReject({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/vote/detail/review/index.tsx b/src/app_modules/vote/detail/review/index.tsx
index 32243e69..d7d28095 100644
--- a/src/app_modules/vote/detail/review/index.tsx
+++ b/src/app_modules/vote/detail/review/index.tsx
@@ -1,34 +1,53 @@
"use client";
-import { IRealtimeData } from "@/app/lib/global_state";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
+import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
+import { IRealtimeData } from "@/lib/global_state";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import { Button, Stack } from "@mantine/core";
-import { useRouter } from "next/navigation";
+import { useShallowEffect } from "@mantine/hooks";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
import { WibuRealtime } from "wibu-pkg";
+import { apiGetOneVotingById } from "../../_lib/api_voting";
import ComponentVote_DetailDataSebelumPublish from "../../component/detail/detail_data_sebelum_publish";
+import { voting_checkStatus } from "../../fun";
import { Vote_funEditStatusByStatusId } from "../../fun/edit/fun_edit_status_by_id";
import { MODEL_VOTING } from "../../model/interface";
-import { voting_checkStatus } from "../../fun";
-import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global";
-export default function Vote_DetailReview({
- dataVote,
-}: {
- dataVote: MODEL_VOTING;
-}) {
+export default function Vote_DetailReview() {
+ const { id } = useParams();
+ const [data, setData] = useState();
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetOneVotingById({ id: id as string });
+ if (response) {
+ setData(response.data);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ console.log(error);
+ }
+ }
+
+ if (!data) return ;
+
return (
<>
-
-
+
+
>
);
@@ -49,6 +68,7 @@ function ButtonAction({
const check = await voting_checkStatus({ id: voteId });
if (check) {
+ setIsLoading(true);
const res = await Vote_funEditStatusByStatusId(voteId, "3");
if (res.status === 200) {
const dataNotifikasi: IRealtimeData = {
@@ -78,11 +98,12 @@ function ButtonAction({
}
ComponentGlobal_NotifikasiBerhasil("Berhasil Batalkan Review", 2000);
router.replace(RouterVote.status({ id: "3" }));
- setIsLoading(true);
} else {
+ setIsLoading(false);
ComponentGlobal_NotifikasiGagal(res.message);
}
} else {
+ setIsLoading(false);
ComponentGlobal_NotifikasiPeringatan("Voting telah direview admin");
}
}
@@ -90,7 +111,8 @@ function ButtonAction({
<>
{
setOpenModal(true);
}}
@@ -103,19 +125,24 @@ function ButtonAction({
opened={openModal}
close={() => setOpenModal(false)}
buttonKiri={
- setOpenModal(false)}>
+ setOpenModal(false)}
+ >
Batal
}
buttonKanan={
{
onUpdate();
- console.log(statusId);
}}
>
Simpan
diff --git a/src/app_modules/vote/detail/review/layout.tsx b/src/app_modules/vote/detail/review/layout.tsx
index 25e8ce74..69b066d4 100644
--- a/src/app_modules/vote/detail/review/layout.tsx
+++ b/src/app_modules/vote/detail/review/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutVote_DetailReview({
@@ -11,11 +14,18 @@ export default function LayoutVote_DetailReview({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/vote/detail/riwayat_saya/index.tsx b/src/app_modules/vote/detail/riwayat_saya/index.tsx
index c130f3e4..0a064fbc 100644
--- a/src/app_modules/vote/detail/riwayat_saya/index.tsx
+++ b/src/app_modules/vote/detail/riwayat_saya/index.tsx
@@ -5,25 +5,70 @@ import ComponentVote_DaftarKontributorVoter from "../../component/detail/detail_
import ComponentVote_DetailDataSetelahPublish from "../../component/detail/detail_data_setelah_publish";
import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
import { MODEL_VOTING } from "../../model/interface";
+import { clientLogger } from "@/util/clientLogger";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import {
+ apiGetOneVotingById,
+ apiGetHasilVotingById,
+} from "../../_lib/api_voting";
+import { Voting_ComponentSkeletonDetail } from "../../component/skeleton_view";
+
+export default function Vote_DetailRiwayatSaya() {
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [hasil, setHasil] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ onLoadHasil();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetOneVotingById({
+ id: params.id,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data detail", error);
+ }
+ }
+
+ async function onLoadHasil() {
+ try {
+ const respone = await apiGetHasilVotingById({
+ id: params.id,
+ });
+
+ if (respone) {
+ setHasil(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data hasil voting", error);
+ }
+ }
+
+ if (_.isNull(data) || _.isNull(hasil)) {
+ return ;
+ }
-export default function Vote_DetailRiwayatSaya({
- dataVote,
- listKontributor,
-}: {
- dataVote: MODEL_VOTING;
- listKontributor: any[];
-}) {
return (
<>
-
-
+ {/*
+ /> */}
>
);
diff --git a/src/app_modules/vote/detail/riwayat_saya/layout.tsx b/src/app_modules/vote/detail/riwayat_saya/layout.tsx
index df66b5e0..9db7fb16 100644
--- a/src/app_modules/vote/detail/riwayat_saya/layout.tsx
+++ b/src/app_modules/vote/detail/riwayat_saya/layout.tsx
@@ -1,21 +1,80 @@
"use client";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
+import { UIGlobal_Drawer } from "@/app_modules/_global/ui";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import React from "react";
+import { ActionIcon } from "@mantine/core";
+import { IconDotsVertical, IconUsersGroup } from "@tabler/icons-react";
+import { useParams } from "next/navigation";
+import React, { useState } from "react";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewHeader,
+ UI_NewChildren,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
export default function LayoutVote_DetailRiwayatSaya({
children,
}: {
children: React.ReactNode;
}) {
+ const params = useParams<{ id: string }>();
+ const [openDrawer, setOpenDrawer] = useState(false);
+
return (
<>
- }
+ {/* {
+ setOpenDrawer(true);
+ }}
+ >
+
+
+ }
+ />
+ }
>
{children}
-
+ */}
+
+
+
+ {
+ setOpenDrawer(true);
+ }}
+ >
+
+
+ }
+ />
+
+ {children}
+
+
+ setOpenDrawer(false)}
+ component={[
+ {
+ id: "1",
+ name: "Daftar Kontribusi",
+ icon: ,
+ path: RouterVote.daftar_kontributor + params.id,
+ },
+ ]}
+ />
>
);
}
diff --git a/src/app_modules/vote/detail/semua_riwayat/index.tsx b/src/app_modules/vote/detail/semua_riwayat/index.tsx
index 929d94aa..e9df576d 100644
--- a/src/app_modules/vote/detail/semua_riwayat/index.tsx
+++ b/src/app_modules/vote/detail/semua_riwayat/index.tsx
@@ -1,30 +1,73 @@
"use client";
+import { clientLogger } from "@/util/clientLogger";
import { Stack } from "@mantine/core";
-import ComponentVote_DetailDataTanpaVote from "../../component/detail/detail_data_tanpa_vote";
-import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
-import ComponentVote_DaftarKontributorVoter from "../../component/detail/detail_daftar_kontributor";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
+import { useParams } from "next/navigation";
+import { useState } from "react";
+import {
+ apiGetHasilVotingById,
+ apiGetOneVotingById,
+} from "../../_lib/api_voting";
import ComponentVote_DetailDataSetelahPublish from "../../component/detail/detail_data_setelah_publish";
-import { MODEL_VOTE_KONTRIBUTOR, MODEL_VOTING } from "../../model/interface";
+import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting";
+import { Voting_ComponentSkeletonDetail } from "../../component/skeleton_view";
+import { MODEL_VOTING } from "../../model/interface";
+
+export default function Vote_DetailSemuaRiwayat() {
+ const params = useParams<{ id: string }>();
+ const [data, setData] = useState(null);
+ const [hasil, setHasil] = useState(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ onLoadHasil();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetOneVotingById({
+ id: params.id,
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data detail", error);
+ }
+ }
+
+ async function onLoadHasil() {
+ try {
+ const respone = await apiGetHasilVotingById({
+ id: params.id,
+ });
+
+ if (respone) {
+ setHasil(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data hasil voting", error);
+ }
+ }
+
+ if (_.isNull(data) || _.isNull(hasil)) {
+ return ;
+ }
-export default function Vote_DetailSemuaRiwayat({
- dataVote,
- listKontributor,
-}: {
- dataVote: MODEL_VOTING;
- listKontributor: MODEL_VOTE_KONTRIBUTOR[];
-}) {
return (
<>
-
-
+ {/*
+ /> */}
>
);
diff --git a/src/app_modules/vote/detail/semua_riwayat/layout.tsx b/src/app_modules/vote/detail/semua_riwayat/layout.tsx
index 9780dc6d..50caffb1 100644
--- a/src/app_modules/vote/detail/semua_riwayat/layout.tsx
+++ b/src/app_modules/vote/detail/semua_riwayat/layout.tsx
@@ -1,25 +1,61 @@
"use client";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
+import { UIGlobal_Drawer } from "@/app_modules/_global/ui";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
-import React from "react";
+import { ActionIcon } from "@mantine/core";
+import { IconDotsVertical } from "@tabler/icons-react";
+import { IconUsersGroup } from "@tabler/icons-react";
+import { IconDots } from "@tabler/icons-react";
+import React, { useState } from "react";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, { UI_NewHeader, UI_NewChildren } from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { useParams } from "next/navigation";
export default function LayoutVote_DetailSemuaRiwayat({
children,
- votingId,
- userLoginId,
}: {
children: React.ReactNode;
- votingId: string;
- userLoginId: string;
}) {
+ const params = useParams<{ id: string }>();
+ const votingId = params.id;
+ const [openDrawer, setOpenDrawer] = useState(false);
+
return (
<>
- }
- >
- {children}
-
+
+
+
+ {
+ setOpenDrawer(true);
+ }}
+ >
+
+
+ }
+ />
+
+ {children}
+
+
+ setOpenDrawer(false)}
+ component={[
+ {
+ id: "1",
+ name: "Daftar Kontribusi",
+ icon: ,
+ path: RouterVote.daftar_kontributor + votingId,
+ },
+ ]}
+ />
>
);
}
diff --git a/src/app_modules/vote/edit/index.tsx b/src/app_modules/vote/edit/index.tsx
index 41ebc2d4..cf924ec2 100644
--- a/src/app_modules/vote/edit/index.tsx
+++ b/src/app_modules/vote/edit/index.tsx
@@ -3,8 +3,14 @@
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
+import Component_V3_Label_TextInput from "@/app_modules/_global/component/new/comp_V3_label_text_input";
+import { Component_V3_TextEditor } from "@/app_modules/_global/component/new/comp_V3_text_editor";
+import { funReplaceHtml } from "@/app_modules/_global/fun/fun_replace_html";
+import { maxInputLength } from "@/app_modules/_global/lib/maximal_setting";
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
+import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
+import { clientLogger } from "@/util/clientLogger";
import {
ActionIcon,
Box,
@@ -14,16 +20,17 @@ import {
Stack,
Text,
TextInput,
- Textarea
} from "@mantine/core";
-import { DatePickerInput } from "@mantine/dates";
import { useShallowEffect } from "@mantine/hooks";
import { IconPlus, IconTrash } from "@tabler/icons-react";
import { useAtom } from "jotai";
import _ from "lodash";
-import moment from "moment";
-import { useRouter } from "next/navigation";
+import { useParams, useRouter } from "next/navigation";
import { useState } from "react";
+import {
+ apiGetDaftarPilihanById,
+ apiGetOneVotingById,
+} from "../_lib/api_voting";
import { Vote_funEditById } from "../fun/edit/fun_edit_by_id";
import { Vote_getListDaftarNamaById } from "../fun/get/get_list_daftar_vote_by_id";
import { gs_vote_hotMenu, gs_vote_status } from "../global_state";
@@ -31,33 +38,67 @@ import {
MODEL_VOTING,
MODEL_VOTING_DAFTAR_NAMA_VOTE,
} from "../model/interface";
+import { DatePickerInput, DatesRangeValue } from "@mantine/dates";
+import moment from "moment";
+import "moment/locale/id";
-export default function Vote_Edit({
- dataVote,
- listDaftarVote,
-}: {
- dataVote: MODEL_VOTING;
- listDaftarVote: MODEL_VOTING_DAFTAR_NAMA_VOTE[];
-}) {
- const [data, setData] = useState(dataVote);
- const [pilihanNama, setPilihanNama] = useState(listDaftarVote);
+export default function Vote_Edit() {
+ const { id } = useParams();
+ const [data, setData] = useState();
+ const [daftarPilihan, setDaftarPilihan] = useState<
+ MODEL_VOTING_DAFTAR_NAMA_VOTE[] | null
+ >(null);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const response = await apiGetOneVotingById({ id: id as string });
+ if (response) {
+ const fixData = _.omit(response.data, ["Voting_DaftarNamaVote"]);
+ setData(fixData as any);
+ } else {
+ setData(null);
+ }
+ } catch (error) {
+ console.log(error);
+ }
+ }
useShallowEffect(() => {
onLoadList();
}, []);
async function onLoadList() {
- const loadList = await Vote_getListDaftarNamaById(data.id);
- setPilihanNama(loadList as any);
+ try {
+ const response = await apiGetDaftarPilihanById({ id: id as string });
+ if (response) {
+ setDaftarPilihan(response.data);
+ } else {
+ setDaftarPilihan(null);
+ }
+ } catch (error) {
+ console.log(error);
+ }
}
+ if (!data || !daftarPilihan) return ;
+
return (
<>
-
- ) : (
- ""
- )
- }
- onChange={(val) => {
+
+
+ {
setData({
...data,
- deskripsi: val.target.value,
+ deskripsi: val,
});
}}
/>
+ {funReplaceHtml({ html: data.deskripsi }).length === 0 && (
+
+ )}
+
{
return moment(date).diff(Date.now(), "days") < 0;
}}
- value={[data.awalVote, data.akhirVote]}
error={
data.awalVote === null || data.akhirVote === null ? (
@@ -137,11 +170,17 @@ export default function Vote_Edit({
""
)
}
- onChange={(val: any) => {
+ value={[
+ data.awalVote ? moment(data.awalVote).toDate() : null,
+ data.akhirVote ? moment(data.akhirVote).toDate() : null,
+ ]}
+ onChange={(val) => {
+ if (!val || val.length < 2) return;
+
setData({
...data,
- awalVote: val[0],
- akhirVote: val[1],
+ awalVote: val[0] as Date,
+ akhirVote: val[1] as Date,
});
}}
/>
@@ -155,13 +194,19 @@ export default function Vote_Edit({
- {pilihanNama.map((e, index) => (
+ {daftarPilihan.map((e, index) => (
{
- const cloneData = _.clone(pilihanNama);
+ const cloneData = _.clone(daftarPilihan);
cloneData[index].value = v.currentTarget.value;
- setPilihanNama([...pilihanNama]);
+ setDaftarPilihan([...cloneData]);
}}
/>
@@ -187,17 +232,17 @@ export default function Vote_Edit({
mt={"lg"}
variant="transparent"
radius={"xl"}
- disabled={pilihanNama.length < 3 ? true : false}
+ disabled={daftarPilihan.length < 3 ? true : false}
onClick={() => {
- pilihanNama.splice(index, 1);
- setPilihanNama([...pilihanNama]);
+ daftarPilihan.splice(index, 1);
+ setDaftarPilihan([...daftarPilihan]);
}}
>
@@ -206,11 +251,11 @@ export default function Vote_Edit({
= 4 ? true : false}
+ disabled={daftarPilihan.length >= 4 ? true : false}
radius={"xl"}
leftIcon={}
onClick={() => {
- setPilihanNama([...(pilihanNama as any), { value: "" }]);
+ setDaftarPilihan([...(daftarPilihan as any), { value: "" }]);
}}
compact
bg={MainColor.yellow}
@@ -223,9 +268,7 @@ export default function Vote_Edit({
-
-
- {/* {JSON.stringify(listDaftarVote, null, 2)} */}
+
>
);
@@ -246,23 +289,33 @@ function ButtonAction({
async function onUpdate() {
// console.log(listVoting);
- await Vote_funEditById(data, listVoting).then((res) => {
- if (res.status === 200) {
- ComponentGlobal_NotifikasiBerhasil("Berhasil Update");
- // setHotMenu(1);
- // setTabsStatus("Draft");
- router.back();
- setIsLoading(true);
- } else {
- ComponentGlobal_NotifikasiGagal(res.message);
- }
- });
+ try {
+ setIsLoading(true);
+ await Vote_funEditById(data, listVoting).then((res) => {
+ if (res.status === 200) {
+ ComponentGlobal_NotifikasiBerhasil("Berhasil Update");
+ // setHotMenu(1);
+ // setTabsStatus("Draft");
+ router.back();
+ } else {
+ setIsLoading(false);
+ ComponentGlobal_NotifikasiGagal(res.message);
+ }
+ });
+ } catch (error) {
+ setIsLoading(false);
+ clientLogger.error("Error update voting", error);
+ }
}
return (
<>
maxInputLength ||
+ funReplaceHtml({ html: data.deskripsi }).length === 0
+ }
loaderPosition="center"
loading={isLoading ? true : false}
mt={"lg"}
diff --git a/src/app_modules/vote/edit/layout.tsx b/src/app_modules/vote/edit/layout.tsx
index 0162bbcc..2c1d8f69 100644
--- a/src/app_modules/vote/edit/layout.tsx
+++ b/src/app_modules/vote/edit/layout.tsx
@@ -1,7 +1,10 @@
"use client";
-import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
-import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutVote_Edit({
@@ -11,11 +14,18 @@ export default function LayoutVote_Edit({
}) {
return (
<>
- }
>
{children}
-
+ */}
+
+
+
+
+
+ {children}
+
>
);
}
diff --git a/src/app_modules/vote/fun/create/create_hasil.ts b/src/app_modules/vote/fun/create/create_hasil.ts
index 3d199d6b..889c1c45 100644
--- a/src/app_modules/vote/fun/create/create_hasil.ts
+++ b/src/app_modules/vote/fun/create/create_hasil.ts
@@ -1,13 +1,16 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { revalidatePath } from "next/cache";
-export async function Vote_funCreateHasil(
- pilihanVotingId: string,
- votingId: string
-) {
+export async function Vote_funCreateHasil({
+ pilihanVotingId,
+ votingId,
+}: {
+ pilihanVotingId: string;
+ votingId: string;
+}) {
const userLoginId = await funGetUserIdByToken();
const get = await prisma.voting_DaftarNamaVote.findFirst({
diff --git a/src/app_modules/vote/fun/create/create_pilihan_voting.ts b/src/app_modules/vote/fun/create/create_pilihan_voting.ts
index 5112ed52..06cdd988 100644
--- a/src/app_modules/vote/fun/create/create_pilihan_voting.ts
+++ b/src/app_modules/vote/fun/create/create_pilihan_voting.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { revalidatePath } from "next/cache";
diff --git a/src/app_modules/vote/fun/create/create_vote.ts b/src/app_modules/vote/fun/create/create_vote.ts
index c55cd1a8..9dd439b7 100644
--- a/src/app_modules/vote/fun/create/create_vote.ts
+++ b/src/app_modules/vote/fun/create/create_vote.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import _ from "lodash";
import { revalidatePath } from "next/cache";
diff --git a/src/app_modules/vote/fun/delete/fun_delete_by_id.ts b/src/app_modules/vote/fun/delete/fun_delete_by_id.ts
index 455d05d3..045ba1da 100644
--- a/src/app_modules/vote/fun/delete/fun_delete_by_id.ts
+++ b/src/app_modules/vote/fun/delete/fun_delete_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
/**
diff --git a/src/app_modules/vote/fun/edit/fun_edit_by_id.ts b/src/app_modules/vote/fun/edit/fun_edit_by_id.ts
index ce6a8547..980f0507 100644
--- a/src/app_modules/vote/fun/edit/fun_edit_by_id.ts
+++ b/src/app_modules/vote/fun/edit/fun_edit_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import {
MODEL_VOTING,
MODEL_VOTING_DAFTAR_NAMA_VOTE,
@@ -19,7 +19,7 @@ export async function Vote_funEditById(
},
data: {
title: data.title,
- deskripsi: data.deskripsi,
+ deskripsi: data.deskripsi.trim(),
awalVote: data.awalVote,
akhirVote: data.akhirVote,
},
diff --git a/src/app_modules/vote/fun/edit/fun_edit_status_by_id.ts b/src/app_modules/vote/fun/edit/fun_edit_status_by_id.ts
index 588ba977..7857056d 100644
--- a/src/app_modules/vote/fun/edit/fun_edit_status_by_id.ts
+++ b/src/app_modules/vote/fun/edit/fun_edit_status_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function Vote_funEditStatusByStatusId(
diff --git a/src/app_modules/vote/fun/edit/fun_update_is_arsip_by_id.ts b/src/app_modules/vote/fun/edit/fun_update_is_arsip_by_id.ts
index e0e4c6ea..009c4719 100644
--- a/src/app_modules/vote/fun/edit/fun_update_is_arsip_by_id.ts
+++ b/src/app_modules/vote/fun/edit/fun_update_is_arsip_by_id.ts
@@ -1,7 +1,7 @@
"use server";
-import prisma from "@/app/lib/prisma";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import prisma from "@/lib/prisma";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import { revalidatePath } from "next/cache";
export async function voting_funUpdateIsArsipById({
diff --git a/src/app_modules/vote/fun/get/cek_kontributor_by_id.ts b/src/app_modules/vote/fun/get/cek_kontributor_by_id.ts
index 06210b1f..2a97e410 100644
--- a/src/app_modules/vote/fun/get/cek_kontributor_by_id.ts
+++ b/src/app_modules/vote/fun/get/cek_kontributor_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function Vote_cekKontributorById(votingId: string) {
diff --git a/src/app_modules/vote/fun/get/fun_check_status.ts b/src/app_modules/vote/fun/get/fun_check_status.ts
index 0ac8ef6d..f6219df3 100644
--- a/src/app_modules/vote/fun/get/fun_check_status.ts
+++ b/src/app_modules/vote/fun/get/fun_check_status.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
export async function voting_checkStatus({
id,
diff --git a/src/app_modules/vote/fun/get/fun_get_one_by_id.ts b/src/app_modules/vote/fun/get/fun_get_one_by_id.ts
index b5570b0e..7a15ad66 100644
--- a/src/app_modules/vote/fun/get/fun_get_one_by_id.ts
+++ b/src/app_modules/vote/fun/get/fun_get_one_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function voting_funGetOneVotingbyId(voteId: string) {
const data = await prisma.voting.findFirst({
diff --git a/src/app_modules/vote/fun/get/get_all_list_publish.ts b/src/app_modules/vote/fun/get/get_all_list_publish.ts
index 457efbc0..b94d4175 100644
--- a/src/app_modules/vote/fun/get/get_all_list_publish.ts
+++ b/src/app_modules/vote/fun/get/get_all_list_publish.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function vote_getAllListPublish({
page,
diff --git a/src/app_modules/vote/fun/get/get_all_list_riwayat.ts b/src/app_modules/vote/fun/get/get_all_list_riwayat.ts
index ca69b3c7..56dc921e 100644
--- a/src/app_modules/vote/fun/get/get_all_list_riwayat.ts
+++ b/src/app_modules/vote/fun/get/get_all_list_riwayat.ts
@@ -1,6 +1,6 @@
"use server"
-import prisma from "@/app/lib/prisma"
+import prisma from "@/lib/prisma"
export async function vote_getAllListRiwayat({ page }: { page: number }) {
const takeData = 5;
diff --git a/src/app_modules/vote/fun/get/get_all_list_riwayat_saya.ts b/src/app_modules/vote/fun/get/get_all_list_riwayat_saya.ts
index b7f90def..c812fc7b 100644
--- a/src/app_modules/vote/fun/get/get_all_list_riwayat_saya.ts
+++ b/src/app_modules/vote/fun/get/get_all_list_riwayat_saya.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function Vote_getAllListRiwayatSaya({ page }: { page: number }) {
diff --git a/src/app_modules/vote/fun/get/get_list_daftar_vote_by_id.ts b/src/app_modules/vote/fun/get/get_list_daftar_vote_by_id.ts
index 34bb375e..a2c7a0cf 100644
--- a/src/app_modules/vote/fun/get/get_list_daftar_vote_by_id.ts
+++ b/src/app_modules/vote/fun/get/get_list_daftar_vote_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Vote_getListDaftarNamaById(voteId: string) {
const data = await prisma.voting_DaftarNamaVote.findMany({
diff --git a/src/app_modules/vote/fun/get/get_list_hasil_by_id.ts b/src/app_modules/vote/fun/get/get_list_hasil_by_id.ts
index bdc856e3..8e896414 100644
--- a/src/app_modules/vote/fun/get/get_list_hasil_by_id.ts
+++ b/src/app_modules/vote/fun/get/get_list_hasil_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { MODEL_VOTING_DAFTAR_NAMA_VOTE } from "../../model/interface";
import _ from "lodash";
diff --git a/src/app_modules/vote/fun/get/get_list_kontribusi_by_author_id.ts b/src/app_modules/vote/fun/get/get_list_kontribusi_by_author_id.ts
index 237b5bf0..6859a7f5 100644
--- a/src/app_modules/vote/fun/get/get_list_kontribusi_by_author_id.ts
+++ b/src/app_modules/vote/fun/get/get_list_kontribusi_by_author_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function vote_getAllListKontribusiByAuthorId({
diff --git a/src/app_modules/vote/fun/get/get_list_kontributor_by_id.ts b/src/app_modules/vote/fun/get/get_list_kontributor_by_id.ts
index 13d4695b..628706f9 100644
--- a/src/app_modules/vote/fun/get/get_list_kontributor_by_id.ts
+++ b/src/app_modules/vote/fun/get/get_list_kontributor_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Vote_getListKontributorById(votingId: string) {
const data = await prisma.voting_Kontributor.findMany({
diff --git a/src/app_modules/vote/fun/get/get_list_status_voting.ts b/src/app_modules/vote/fun/get/get_list_status_voting.ts
index e676a8e2..1a806a14 100644
--- a/src/app_modules/vote/fun/get/get_list_status_voting.ts
+++ b/src/app_modules/vote/fun/get/get_list_status_voting.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
export async function voting_getMasterStatus() {
const data = await prisma.voting_Status.findMany({});
diff --git a/src/app_modules/vote/fun/get/get_one_pilihan_voting_by_user_id.ts b/src/app_modules/vote/fun/get/get_one_pilihan_voting_by_user_id.ts
index 25b21565..3da197dd 100644
--- a/src/app_modules/vote/fun/get/get_one_pilihan_voting_by_user_id.ts
+++ b/src/app_modules/vote/fun/get/get_one_pilihan_voting_by_user_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function Vote_getOnePilihanVotingByUserId(votingId: string) {
diff --git a/src/app_modules/vote/fun/get/get_one_publish_by_id.ts b/src/app_modules/vote/fun/get/get_one_publish_by_id.ts
index 73295884..05e8875e 100644
--- a/src/app_modules/vote/fun/get/get_one_publish_by_id.ts
+++ b/src/app_modules/vote/fun/get/get_one_publish_by_id.ts
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
export async function Vote_getOnePublishbyId(voteId: string) {
const data = await prisma.voting.findFirst({
diff --git a/src/app_modules/vote/fun/get/status/get_all_by_status_id.ts b/src/app_modules/vote/fun/get/status/get_all_by_status_id.ts
index 776e0cbf..31a930f1 100644
--- a/src/app_modules/vote/fun/get/status/get_all_by_status_id.ts
+++ b/src/app_modules/vote/fun/get/status/get_all_by_status_id.ts
@@ -1,6 +1,6 @@
"use server";
-import { prisma } from "@/app/lib";
+import { prisma } from "@/lib";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function vote_funGetAllByStatusId({
diff --git a/src/app_modules/vote/fun/get/status/get_all_draft.tsx b/src/app_modules/vote/fun/get/status/get_all_draft.tsx
index 3a9373a0..6b2a6dca 100644
--- a/src/app_modules/vote/fun/get/status/get_all_draft.tsx
+++ b/src/app_modules/vote/fun/get/status/get_all_draft.tsx
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function vote_getAllDraft({ page }: { page: number }) {
diff --git a/src/app_modules/vote/fun/get/status/get_all_publish.tsx b/src/app_modules/vote/fun/get/status/get_all_publish.tsx
index 07154c68..ed05f61e 100644
--- a/src/app_modules/vote/fun/get/status/get_all_publish.tsx
+++ b/src/app_modules/vote/fun/get/status/get_all_publish.tsx
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function vote_getAllPublish({ page }: { page: number }) {
diff --git a/src/app_modules/vote/fun/get/status/get_all_reject.tsx b/src/app_modules/vote/fun/get/status/get_all_reject.tsx
index 376f8b1e..e72deca2 100644
--- a/src/app_modules/vote/fun/get/status/get_all_reject.tsx
+++ b/src/app_modules/vote/fun/get/status/get_all_reject.tsx
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function vote_getAllReject({ page }: { page: number }) {
diff --git a/src/app_modules/vote/fun/get/status/get_all_review.tsx b/src/app_modules/vote/fun/get/status/get_all_review.tsx
index 998cf3bd..8779fbb9 100644
--- a/src/app_modules/vote/fun/get/status/get_all_review.tsx
+++ b/src/app_modules/vote/fun/get/status/get_all_review.tsx
@@ -1,6 +1,6 @@
"use server";
-import prisma from "@/app/lib/prisma";
+import prisma from "@/lib/prisma";
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
export async function vote_getAllReview({ page }: { page: number }) {
diff --git a/src/app_modules/vote/index.tsx b/src/app_modules/vote/index.tsx
index 26e9cef9..0a8b2abf 100644
--- a/src/app_modules/vote/index.tsx
+++ b/src/app_modules/vote/index.tsx
@@ -53,3 +53,4 @@ export {
Vote_DetailRiwayatSaya,
LayoutVote_DetailRiwayatSaya,
};
+
diff --git a/src/app_modules/vote/main/beranda.tsx b/src/app_modules/vote/main/beranda.tsx
index f33149fe..7a969152 100644
--- a/src/app_modules/vote/main/beranda.tsx
+++ b/src/app_modules/vote/main/beranda.tsx
@@ -1,8 +1,11 @@
"use client";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import { gs_votingTiggerBeranda } from "@/lib/global_state";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
+import { AccentColor, MainColor } from "@/app_modules/_global/color";
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { clientLogger } from "@/util/clientLogger";
import {
Affix,
Box,
@@ -14,22 +17,17 @@ import {
TextInput,
} from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
+import { useAtom } from "jotai";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
+import { apiGetAllVoting } from "../_lib/api_voting";
+import { Voting_ComponentSkeletonViewPublish } from "../component";
import ComponentVote_CardViewPublish from "../component/card_view_publish";
-import { vote_getAllListPublish } from "../fun/get/get_all_list_publish";
import { MODEL_VOTING } from "../model/interface";
-import { gs_votingTiggerBeranda } from "@/app/lib/global_state";
-import { useAtom } from "jotai";
-import { AccentColor } from "@/app_modules/_global/color";
-export default function Vote_Beranda({
- dataVote,
-}: {
- dataVote: MODEL_VOTING[];
-}) {
- const [data, setData] = useState(dataVote);
+export default function Vote_Beranda() {
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
// Realtime
@@ -46,36 +44,54 @@ export default function Vote_Beranda({
}, [isTriggerVotingBeranda, setIsShowUpdate]);
useShallowEffect(() => {
- onLoad({
- newData(val) {
- setData(val);
- },
- });
- setIsTriggerVotingBeranda(false);
- }, [setData, setIsTriggerVotingBeranda]);
+ onLoad();
+ }, []);
- async function onLoad({ newData }: { newData: (val: any) => void }) {
- const loadData = await vote_getAllListPublish({ page: 1 });
- newData(loadData);
+ async function onLoad() {
+ try {
+ const loadData = await apiGetAllVoting({
+ kategori: "beranda",
+ page: "1",
+ });
+ setData(loadData.data as any);
+ setIsTriggerVotingBeranda(false);
+ } catch (error) {
+ clientLogger.error("Error get data beranda", error);
+ }
}
async function onSearch(s: string) {
- const loadSearch = await vote_getAllListPublish({ page: 1, search: s });
- setData(loadSearch as any);
+ try {
+ const loadData = await apiGetAllVoting({
+ kategori: "beranda",
+ page: "1",
+ search: s,
+ });
+ setData(loadData.data as any);
+ } catch (error) {
+ clientLogger.error("Error get data beranda", error);
+ }
}
- async function onLoadData({ onPublish }: { onPublish: (val: any) => void }) {
- setIsLoading(true);
- const loadData = await vote_getAllListPublish({ page: 1 });
- onPublish(loadData);
-
- setIsShowUpdate(false);
- setIsTriggerVotingBeranda(false);
- setIsLoading(false);
+ async function onLoadData() {
+ try {
+ setIsLoading(true);
+ const loadData = await apiGetAllVoting({
+ kategori: "beranda",
+ page: "1",
+ });
+ setData(loadData.data as any);
+ setIsShowUpdate(false);
+ setIsTriggerVotingBeranda(false);
+ } catch (error) {
+ clientLogger.error("Error get data beranda", error);
+ } finally {
+ setIsLoading(false);
+ }
}
return (
-
+
{isShowUpdate && (
@@ -90,11 +106,7 @@ export default function Vote_Beranda({
radius={"xl"}
opacity={0.8}
onClick={() => {
- onLoadData({
- onPublish(val) {
- setData(val);
- },
- });
+ onLoadData();
}}
>
Update beranda
@@ -107,11 +119,14 @@ export default function Vote_Beranda({
radius={"xl"}
placeholder="Masukan judul voting"
onChange={(val) => onSearch(val.target.value)}
+ styles={{ input: { backgroundColor: MainColor.white } }}
/>
- {_.isEmpty(data) ? (
+ {_.isNull(data) ? (
+
+ ) : _.isEmpty(data) ? (
) : (
@@ -123,15 +138,16 @@ export default function Vote_Beranda({
)}
data={data}
- setData={setData}
+ setData={setData as any}
moreData={async () => {
- const loadData = await vote_getAllListPublish({
- page: activePage + 1,
+ const loadData = await apiGetAllVoting({
+ kategori: "beranda",
+ page: `${activePage + 1}`,
});
setActivePage((val) => val + 1);
- return loadData;
+ return loadData.data;
}}
>
{(item) => (
diff --git a/src/app_modules/vote/main/kontribusi.tsx b/src/app_modules/vote/main/kontribusi.tsx
index dadbae4d..7a6d172d 100644
--- a/src/app_modules/vote/main/kontribusi.tsx
+++ b/src/app_modules/vote/main/kontribusi.tsx
@@ -1,64 +1,80 @@
"use client";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
-import { Box, Center, Loader, Stack } from "@mantine/core";
-import _ from "lodash";
-import ComponentVote_CardViewPublish from "../component/card_view_publish";
-import ComponentVote_IsEmptyData from "../component/is_empty_data";
-import { MODEL_VOTE_KONTRIBUTOR } from "../model/interface";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import { data } from "autoprefixer";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Center, Loader, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
-import { vote_getAllListPublish } from "../fun/get/get_all_list_publish";
import { useState } from "react";
-import { vote_getAllListKontribusiByAuthorId } from "../fun/get/get_list_kontribusi_by_author_id";
+import { apiGetAllVoting } from "../_lib/api_voting";
+import ComponentVote_CardViewPublish from "../component/card_view_publish";
+import { MODEL_VOTE_KONTRIBUTOR } from "../model/interface";
+import { Voting_ComponentSkeletonViewKontribusi } from "../component/skeleton_view";
-export default function Vote_Kontribusi({
- dataKontribusi,
-}: {
- dataKontribusi: MODEL_VOTE_KONTRIBUTOR[];
-}) {
- const [data, setData] = useState(dataKontribusi);
+export default function Vote_Kontribusi() {
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoad();
+ }, []);
+
+ async function onLoad() {
+ try {
+ const loadData = await apiGetAllVoting({
+ kategori: "kontribusi",
+ page: "1",
+ });
+ setData(loadData.data as any);
+ } catch (error) {
+ clientLogger.error("Error get data beranda", error);
+ }
+ }
+
return (
<>
- {_.isEmpty(dataKontribusi) ? (
-
- ) : (
-
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await vote_getAllListKontribusiByAuthorId({
- page: activePage + 1,
- });
+
+ {_.isNull(data) ? (
+
+ ) : _.isEmpty(data) ? (
+
+ ) : (
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={async () => {
+ const loadData = await apiGetAllVoting({
+ kategori: "kontribusi",
+ page: `${activePage + 1}`,
+ });
- setActivePage((val) => val + 1);
+ setActivePage((val) => val + 1);
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
-
- )}
- {/* {JSON.stringify(dataKontribusi, null, 2)} */}
+ return loadData.data;
+ }}
+ >
+ {(item) => (
+
+ )}
+
+
+ )}
+
>
);
}
diff --git a/src/app_modules/vote/main/layout.tsx b/src/app_modules/vote/main/layout.tsx
index fb31f83b..10d264d3 100644
--- a/src/app_modules/vote/main/layout.tsx
+++ b/src/app_modules/vote/main/layout.tsx
@@ -1,7 +1,7 @@
"use client";
-import { RouterHome } from "@/app/lib/router_hipmi/router_home";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import { RouterHome } from "@/lib/router_hipmi/router_home";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import { MainColor } from "@/app_modules/_global/color/color_pallet";
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
@@ -70,7 +70,7 @@ export default function LayoutVote_Main({
e.path === ""
? ComponentGlobal_NotifikasiPeringatan("Cooming Soon")
diff --git a/src/app_modules/vote/main/new_layout_voting.tsx b/src/app_modules/vote/main/new_layout_voting.tsx
new file mode 100644
index 00000000..08236e9c
--- /dev/null
+++ b/src/app_modules/vote/main/new_layout_voting.tsx
@@ -0,0 +1,32 @@
+"use client";
+
+import { Component_Header } from "@/app_modules/_global/component/new/component_header";
+import UI_NewLayoutTamplate, {
+ UI_NewChildren,
+ UI_NewFooter,
+ UI_NewHeader,
+} from "@/app_modules/_global/ui/V2_layout_tamplate";
+import { RouterHome } from "@/lib/router_hipmi/router_home";
+import React from "react";
+import { Voting_ComponentFooterLayout } from "../component/component_footer_voting";
+
+
+export default function NewLayout_Voting({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <>
+
+
+
+
+ {children}
+
+
+
+
+ >
+ );
+}
diff --git a/src/app_modules/vote/main/riwayat/index.tsx b/src/app_modules/vote/main/riwayat/index.tsx
index 89f4506f..2ef45b1b 100644
--- a/src/app_modules/vote/main/riwayat/index.tsx
+++ b/src/app_modules/vote/main/riwayat/index.tsx
@@ -1,30 +1,18 @@
"use client";
-import { Stack, Tabs } from "@mantine/core";
-import { useState } from "react";
-import Vote_SemuaRiwayat from "./semua";
-import Vote_RiwayatSaya from "./saya";
-import { useAtom } from "jotai";
-import { gs_vote_riwayat } from "../../global_state";
-import { MODEL_VOTING } from "../../model/interface";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
-import { useRouter } from "next/navigation";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import { Stack, Tabs } from "@mantine/core";
+import { useParams, useRouter } from "next/navigation";
+import Vote_RiwayatSaya from "./saya";
+import Vote_SemuaRiwayat from "./semua";
-export default function Vote_Riwayat({
- riwayatId,
- listRiwayat,
- listRiwayatSaya,
-}: {
- riwayatId: string;
- listRiwayat?: MODEL_VOTING[];
- listRiwayatSaya?: MODEL_VOTING[];
-}) {
+export default function Vote_Riwayat() {
const router = useRouter();
- const [changeStatus, setChangeStatus] = useState(riwayatId);
+ const params = useParams<{ id: string }>();
const listTabs = [
{
@@ -39,20 +27,14 @@ export default function Vote_Riwayat({
},
];
- async function onChangeStatus({ statusId }: { statusId: string }) {
- router.push(RouterVote.riwayat({ id: statusId }));
- }
-
return (
<>
{
- setChangeStatus(val);
- onChangeStatus({ statusId: val });
+ router.replace(RouterVote.riwayat({ id: val }));
}}
styles={{
tabsList: {
@@ -77,11 +59,12 @@ export default function Vote_Riwayat({
style={{
transition: "0.5s",
backgroundColor:
- changeStatus === e.id ? MainColor.yellow : "white",
+ params.id === e.id ? MainColor.yellow : MainColor.white,
border:
- changeStatus === e.id
+ params.id === e.id
? `1px solid ${AccentColor.yellow}`
- : `1px solid white`,
+ : `1px solid ${MainColor.white}`,
+ color: "black",
}}
>
{e.label}
@@ -89,13 +72,8 @@ export default function Vote_Riwayat({
))}
- {riwayatId === "1" && (
-
- )}
-
- {riwayatId === "2" && (
-
- )}
+ {params.id === "1" && }
+ {params.id === "2" && }
>
diff --git a/src/app_modules/vote/main/riwayat/saya.tsx b/src/app_modules/vote/main/riwayat/saya.tsx
index f9822ff9..3f82f8ac 100644
--- a/src/app_modules/vote/main/riwayat/saya.tsx
+++ b/src/app_modules/vote/main/riwayat/saya.tsx
@@ -1,48 +1,70 @@
"use client";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
-import { Box, Center, Loader, Stack } from "@mantine/core";
-import _ from "lodash";
-import { useRouter } from "next/navigation";
-import ComponentVote_CardViewPublish from "../../component/card_view_publish";
-import ComponentVote_IsEmptyData from "../../component/is_empty_data";
-import { MODEL_VOTING } from "../../model/interface";
-import { useState } from "react";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Center, Loader } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
-import { Vote_getAllListRiwayatSaya } from "../../fun/get/get_all_list_riwayat_saya";
+import { useState } from "react";
+import { apiGetAllVoting } from "../../_lib/api_voting";
+import { Voting_ComponentSkeletonViewPublish } from "../../component";
+import ComponentVote_CardViewPublish from "../../component/card_view_publish";
+import { MODEL_VOTING } from "../../model/interface";
-export default function Vote_RiwayatSaya({
- listRiwayatSaya,
-}: {
- listRiwayatSaya: MODEL_VOTING[];
-}) {
- const [data, setData] = useState(listRiwayatSaya);
+export default function Vote_RiwayatSaya() {
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoad();
+ }, []);
+
+ async function onLoad() {
+ try {
+ const respone = await apiGetAllVoting({
+ kategori: "riwayat",
+ page: "1",
+ status: "2",
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data review", error);
+ }
+ }
+
return (
<>
- {_.isEmpty(data) ? (
+ {_.isNull(data) ? (
+
+ ) : _.isEmpty(data) ? (
) : (
// --- Main component --- //
(
)}
data={data}
- setData={setData}
+ setData={setData as any}
moreData={async () => {
- const loadData = await Vote_getAllListRiwayatSaya({
- page: activePage + 1,
+ const respone = await apiGetAllVoting({
+ kategori: "riwayat",
+ page: `${activePage + 1}`,
+ status: "2",
});
+
setActivePage((val) => val + 1);
- return loadData;
+ return respone.data;
}}
>
{(item) => (
diff --git a/src/app_modules/vote/main/riwayat/semua.tsx b/src/app_modules/vote/main/riwayat/semua.tsx
index d28574d8..e4410c42 100644
--- a/src/app_modules/vote/main/riwayat/semua.tsx
+++ b/src/app_modules/vote/main/riwayat/semua.tsx
@@ -1,46 +1,70 @@
"use client";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { clientLogger } from "@/util/clientLogger";
import { Box, Center, Loader } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
+import { apiGetAllVoting } from "../../_lib/api_voting";
+import { Voting_ComponentSkeletonViewPublish } from "../../component";
import ComponentVote_CardViewPublish from "../../component/card_view_publish";
-import { vote_getAllListRiwayat } from "../../fun/get/get_all_list_riwayat";
import { MODEL_VOTING } from "../../model/interface";
-export default function Vote_SemuaRiwayat({
- listRiwayat,
-}: {
- listRiwayat: MODEL_VOTING[];
-}) {
- const [data, setData] = useState(listRiwayat);
+export default function Vote_SemuaRiwayat() {
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoad();
+ }, []);
+
+ async function onLoad() {
+ try {
+ const respone = await apiGetAllVoting({
+ kategori: "riwayat",
+ page: "1",
+ status: "1",
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data review", error);
+ }
+ }
+
return (
<>
- {_.isEmpty(data) ? (
+ {_.isNull(data) ? (
+
+ ) : _.isEmpty(data) ? (
) : (
// --- Main component --- //
(
)}
data={data}
- setData={setData}
+ setData={setData as any}
moreData={async () => {
- const loadData = await vote_getAllListRiwayat({
- page: activePage + 1,
+ const respone = await apiGetAllVoting({
+ kategori: "riwayat",
+ page: `${activePage + 1}`,
+ status: "1",
});
+
setActivePage((val) => val + 1);
- return loadData;
+ return respone.data;
}}
>
{(item) => (
diff --git a/src/app_modules/vote/main/status/draft.tsx b/src/app_modules/vote/main/status/draft.tsx
index ef53fe86..2cc846bf 100644
--- a/src/app_modules/vote/main/status/draft.tsx
+++ b/src/app_modules/vote/main/status/draft.tsx
@@ -1,28 +1,47 @@
"use client";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
-import { Box, Center, Loader, Stack } from "@mantine/core";
-import _ from "lodash";
-import ComponentVote_CardViewStatus from "../../component/card_view_status";
-import ComponentVote_IsEmptyData from "../../component/is_empty_data";
-import { MODEL_VOTING } from "../../model/interface";
-import { useState } from "react";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Center, Loader } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
+import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
-import { vote_getAllReview } from "../../fun/get/status/get_all_review";
-import { vote_getAllDraft } from "../../fun/get/status/get_all_draft";
+import { useState } from "react";
+import { apiGetAllVoting } from "../../_lib/api_voting";
+import { Voting_ComponentSkeletonViewStatus } from "../../component";
+import ComponentVote_CardViewStatus from "../../component/card_view_status";
+import { MODEL_VOTING } from "../../model/interface";
-export default function Vote_StatusDraft({
- listDraft,
-}: {
- listDraft: MODEL_VOTING[];
-}) {
- const [data, setData] = useState(listDraft);
+export default function Vote_StatusDraft() {
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoad();
+ }, []);
+
+ async function onLoad() {
+ try {
+ const respone = await apiGetAllVoting({
+ kategori: "status",
+ page: "1",
+ status: "3",
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data review", error);
+ }
+ }
+
return (
<>
- {_.isEmpty(data) ? (
+ {_.isNull(data) ? (
+
+ ) : _.isEmpty(data) ? (
) : (
// --- Main component --- //
@@ -35,14 +54,16 @@ export default function Vote_StatusDraft({
)}
data={data}
- setData={setData}
+ setData={setData as any}
moreData={async () => {
- const loadData = await vote_getAllDraft({
- page: activePage + 1,
+ const respone = await apiGetAllVoting({
+ kategori: "status",
+ page: `${activePage + 1}`,
+ status: "3",
});
setActivePage((val) => val + 1);
- return loadData;
+ return respone.data;
}}
>
{(item) => (
diff --git a/src/app_modules/vote/main/status/index.tsx b/src/app_modules/vote/main/status/index.tsx
index 3f55e91c..0e3e9a4b 100644
--- a/src/app_modules/vote/main/status/index.tsx
+++ b/src/app_modules/vote/main/status/index.tsx
@@ -1,47 +1,47 @@
"use client";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import {
AccentColor,
MainColor,
} from "@/app_modules/_global/color/color_pallet";
-import { MODEL_NEW_DEFAULT_MASTER } from "@/app_modules/model_global/interface";
import { Box, Stack, Tabs } from "@mantine/core";
-import { useRouter } from "next/navigation";
-import { useState } from "react";
-import { MODEL_VOTING } from "../../model/interface";
+import { useParams, useRouter } from "next/navigation";
import Vote_StatusDraft from "./draft";
import Vote_StatusPublish from "./publish";
import Vote_StatusReject from "./reject";
import Vote_StatusReview from "./review";
-export default function Vote_Status({
- statusId,
- dataVoting,
- listStatus,
-}: {
- statusId: string;
- dataVoting: MODEL_VOTING[];
- listStatus: MODEL_NEW_DEFAULT_MASTER[];
-}) {
-
+export default function Vote_Status() {
const router = useRouter();
- const [changeStatus, setChangeStatus] = useState(statusId);
-
- async function onChangeStatus({ statusId }: { statusId: string }) {
- router.replace(RouterVote.status({ id: statusId }));
- }
+ const params = useParams<{ id: string }>();
+ const status = [
+ {
+ id: "1",
+ name: "Publish",
+ },
+ {
+ id: "2",
+ name: "Review",
+ },
+ {
+ id: "3",
+ name: "Draft",
+ },
+ {
+ id: "4",
+ name: "Reject",
+ },
+ ];
return (
<>
{
- setChangeStatus(val);
- onChangeStatus({ statusId: val });
+ router.replace(RouterVote.status({ id: val }));
}}
styles={{
tabsList: {
@@ -57,21 +57,22 @@ export default function Vote_Status({
>
- {listStatus.map((e) => (
+ {status.map((e) => (
{e.name}
@@ -80,12 +81,10 @@ export default function Vote_Status({
- {statusId === "1" && (
-
- )}
- {statusId === "2" && }
- {statusId === "3" && }
- {statusId === "4" && }
+ {params.id === "1" && }
+ {params.id === "2" && }
+ {params.id === "3" && }
+ {params.id === "4" && }
diff --git a/src/app_modules/vote/main/status/publish.tsx b/src/app_modules/vote/main/status/publish.tsx
index f8855e69..43776683 100644
--- a/src/app_modules/vote/main/status/publish.tsx
+++ b/src/app_modules/vote/main/status/publish.tsx
@@ -1,57 +1,83 @@
"use client";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
-import job_getAllStatusPublish from "@/app_modules/job/fun/get/status/get_list_publish";
-import { Center, Loader } from "@mantine/core";
+import { clientLogger } from "@/util/clientLogger";
+import { Box, Center, Loader, Stack } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
+import { apiGetAllVoting } from "../../_lib/api_voting";
import ComponentVote_CardViewPublish from "../../component/card_view_publish";
import { MODEL_VOTING } from "../../model/interface";
+import { Voting_ComponentSkeletonViewPublish } from "../../component";
-export default function Vote_StatusPublish({
- listPublish,
-}: {
- listPublish: MODEL_VOTING[];
-}) {
- const [data, setData] = useState(listPublish);
+export default function Vote_StatusPublish() {
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoad();
+ }, []);
+
+ async function onLoad() {
+ try {
+ const respone = await apiGetAllVoting({
+ kategori: "status",
+ page: "1",
+ status: "1",
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data review", error);
+ }
+ }
+
return (
<>
- {_.isEmpty(data) ? (
-
- ) : (
- // --- Main component --- //
- (
-
-
-
- )}
- data={data}
- setData={setData}
- moreData={async () => {
- const loadData = await job_getAllStatusPublish({
- page: activePage + 1,
- });
+
+ {_.isNull(data) ? (
+
+ ) : _.isEmpty(data) ? (
+
+ ) : (
+ // --- Main component --- //
+
+ (
+
+
+
+ )}
+ data={data}
+ setData={setData as any}
+ moreData={async () => {
+ const respone = await apiGetAllVoting({
+ kategori: "status",
+ page: `${activePage + 1}`,
+ status: "1",
+ });
+ setActivePage((val) => val + 1);
- setActivePage((val) => val + 1);
-
- return loadData;
- }}
- >
- {(item) => (
-
- )}
-
- )}
+ return respone.data;
+ }}
+ >
+ {(item) => (
+
+ )}
+
+
+ )}
+
>
);
}
diff --git a/src/app_modules/vote/main/status/reject.tsx b/src/app_modules/vote/main/status/reject.tsx
index 9d5716dd..da13b67c 100644
--- a/src/app_modules/vote/main/status/reject.tsx
+++ b/src/app_modules/vote/main/status/reject.tsx
@@ -1,26 +1,47 @@
"use client";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { clientLogger } from "@/util/clientLogger";
import { Box, Center, Loader } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
+import { apiGetAllVoting } from "../../_lib/api_voting";
+import { Voting_ComponentSkeletonViewStatus } from "../../component";
import ComponentVote_CardViewStatus from "../../component/card_view_status";
-import { vote_getAllReject } from "../../fun/get/status/get_all_reject";
import { MODEL_VOTING } from "../../model/interface";
-export default function Vote_StatusReject({
- listReject,
-}: {
- listReject: MODEL_VOTING[];
-}) {
- const [data, setData] = useState(listReject);
+export default function Vote_StatusReject() {
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoad();
+ }, []);
+
+ async function onLoad() {
+ try {
+ const respone = await apiGetAllVoting({
+ kategori: "status",
+ page: "1",
+ status: "4",
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data review", error);
+ }
+ }
+
return (
<>
- {_.isEmpty(data) ? (
+ {_.isNull(data) ? (
+
+ ) : _.isEmpty(data) ? (
) : (
// --- Main component --- //
@@ -33,14 +54,16 @@ export default function Vote_StatusReject({
)}
data={data}
- setData={setData}
+ setData={setData as any}
moreData={async () => {
- const loadData = await vote_getAllReject({
- page: activePage + 1,
+ const respone = await apiGetAllVoting({
+ kategori: "status",
+ page: `${activePage + 1}`,
+ status: "4",
});
setActivePage((val) => val + 1);
- return loadData;
+ return respone.data;
}}
>
{(item) => (
diff --git a/src/app_modules/vote/main/status/review.tsx b/src/app_modules/vote/main/status/review.tsx
index 3fc866c5..86a21386 100644
--- a/src/app_modules/vote/main/status/review.tsx
+++ b/src/app_modules/vote/main/status/review.tsx
@@ -1,30 +1,51 @@
"use client";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
+import { clientLogger } from "@/util/clientLogger";
import { Box, Center, Loader } from "@mantine/core";
+import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { useState } from "react";
+import { apiGetAllVoting } from "../../_lib/api_voting";
import ComponentVote_CardViewStatus from "../../component/card_view_status";
-import { vote_getAllReview } from "../../fun/get/status/get_all_review";
import { MODEL_VOTING } from "../../model/interface";
+import { Voting_ComponentSkeletonViewStatus } from "../../component";
-export default function Vote_StatusReview({
- listReview,
-}: {
- listReview: MODEL_VOTING[];
-}) {
- const [data, setData] = useState(listReview);
+export default function Vote_StatusReview() {
+ const [data, setData] = useState(null);
const [activePage, setActivePage] = useState(1);
+ useShallowEffect(() => {
+ onLoad();
+ }, []);
+
+ async function onLoad() {
+ try {
+ const respone = await apiGetAllVoting({
+ kategori: "status",
+ page: "1",
+ status: "2",
+ });
+
+ if (respone) {
+ setData(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get data review", error);
+ }
+ }
+
return (
<>
- {_.isEmpty(data) ? (
+ {_.isNull(data) ? (
+
+ ) : _.isEmpty(data) ? (
) : (
// --- Main component --- //
-
+
(
@@ -33,14 +54,16 @@ export default function Vote_StatusReview({
)}
data={data}
- setData={setData}
+ setData={setData as any}
moreData={async () => {
- const loadData = await vote_getAllReview({
- page: activePage + 1,
+ const respone = await apiGetAllVoting({
+ kategori: "status",
+ page: `${activePage + 1}`,
+ status: "2",
});
setActivePage((val) => val + 1);
- return loadData;
+ return respone.data;
}}
>
{(item) => (
diff --git a/src/app_modules/vote/model/interface.ts b/src/app_modules/vote/model/interface.ts
index 327ba6a8..1c4dc888 100644
--- a/src/app_modules/vote/model/interface.ts
+++ b/src/app_modules/vote/model/interface.ts
@@ -1,4 +1,6 @@
import { MODEL_USER } from "@/app_modules/home/model/interface";
+import { IDefaultMaster, MODEL_NEW_DEFAULT_MASTER } from "@/app_modules/model_global/interface";
+import { MODEL_DEFAULT_MASTER_OLD } from "@/app_modules/model_global/model_default_master";
export interface MODEL_VOTING {
id: string;
@@ -14,7 +16,8 @@ export interface MODEL_VOTING {
Author: MODEL_USER;
Voting_DaftarNamaVote: MODEL_VOTING_DAFTAR_NAMA_VOTE[];
isArsip: boolean;
- voting_StatusId: string
+ voting_StatusId: string;
+ Voting_Status: IDefaultMaster
}
export interface MODEL_VOTING_DAFTAR_NAMA_VOTE {
diff --git a/src/app_modules/vote/splash/index.tsx b/src/app_modules/vote/splash/index.tsx
index 17a90c19..02f36067 100644
--- a/src/app_modules/vote/splash/index.tsx
+++ b/src/app_modules/vote/splash/index.tsx
@@ -1,6 +1,6 @@
"use client";
-import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
+import { RouterVote } from "@/lib/router_hipmi/router_vote";
import { Center, Image, Paper, Stack, Text } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { useAtom } from "jotai";
@@ -24,7 +24,7 @@ export default function Vote_Splash() {
setTabsStatus("Publish");
setTabsRiwayat("Semua");
router.replace(RouterVote.beranda);
- }, 1000);
+ }, 500);
}, []);
return (
diff --git a/src/app_modules/waiting_room/view.tsx b/src/app_modules/waiting_room/view.tsx
index 942cc0c4..8a9057c5 100644
--- a/src/app_modules/waiting_room/view.tsx
+++ b/src/app_modules/waiting_room/view.tsx
@@ -2,28 +2,28 @@
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global";
import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui";
-import {
- Button,
- Center,
- Group,
- Skeleton,
- Stack,
- Text,
- Title,
-} from "@mantine/core";
+import { clientLogger } from "@/util/clientLogger";
+import { Button, Skeleton, Stack, Text } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
-import { redirect, useRouter } from "next/navigation";
+import _ from "lodash";
+import { useRouter } from "next/navigation";
import { useState } from "react";
+import { ComponentGlobal_CardStyles } from "../_global/component";
+import { apiGetACtivationUser } from "../_global/lib/api_user";
+import { gs_access_user } from "@/lib/global_state";
+import { useAtom } from "jotai";
+import { MainColor } from "../_global/color";
+import CustomSkeleton from "../components/CustomSkeleton";
export default function WaitingRoom_View({
- activationUser,
userLoginId,
}: {
- activationUser: boolean;
- userLoginId: string;
+ userLoginId?: string;
}) {
const router = useRouter();
const [loading, setLoading] = useState(false);
+ const [isLoadingHome, setIsLoadingHome] = useState(false);
+
async function onClickLogout() {
setLoading(true);
const res = await fetch(`/api/auth/logout?id=${userLoginId}`, {
@@ -37,71 +37,83 @@ export default function WaitingRoom_View({
}
}
- useShallowEffect(() => {
- if (activationUser == true) {
- return redirect("/");
- }
- }, [activationUser]);
+ const [isAccess, setIsAccess] = useState(null);
+ const [isAccessUser, setIsAccessUser] = useAtom(gs_access_user);
- const listhHuruf = [
- {
- huruf: "H",
- },
- {
- huruf: "I",
- },
- {
- huruf: "P",
- },
- {
- huruf: "M",
- },
- {
- huruf: "I",
- },
- ];
- const customLOader = (
-
-
- {listhHuruf.map((e, i) => (
-
-
-
- {e.huruf}
-
-
- ))}
-
-
- );
+ useShallowEffect(() => {
+ if (isAccessUser) {
+ setIsAccess(true);
+ setIsAccessUser(false);
+ }
+ }, [isAccessUser]);
+
+ useShallowEffect(() => {
+ onLoadData();
+ }, []);
+
+ async function onLoadData() {
+ try {
+ const respone = await apiGetACtivationUser();
+ if (respone) {
+ setIsAccess(respone.data);
+ }
+ } catch (error) {
+ clientLogger.error("Error get cookies user", error);
+ }
+ }
return (
<>
-
-
- {/* {customLOader} */}
-
-
-
- Anda telah berhasil mendaftar,
-
-
- Mohon menunggu konfirmansi Admin !
-
-
-
- onClickLogout()}
- >
- Keluar
-
-
-
+
+
+ {_.isNull(isAccess) ? (
+
+
+
+
+
+
+ ) : (
+
+
+
+ Permohonan akses Anda sedang dalam proses verifikasi oleh
+ admin.
+
+
+ Harap tunggu, Anda akan menerima pemberitahuan melalui
+ Whatsapp setelah disetujui.
+
+
+ {isAccess && (
+ {
+ try {
+ setIsLoadingHome(true);
+ router.replace("/", { scroll: false });
+ setTimeout(() => {
+ setIsLoadingHome(false);
+ }, 1000);
+ } catch (error) {
+ setIsLoadingHome(false);
+ clientLogger.error("Error button to home", error);
+ }
+ }}
+ >
+ Home
+
+ )}
+
+ )}
+
+
>
);
diff --git a/src/app_modules/zCoba/ui_coba_upload_file.tsx b/src/app_modules/zCoba/ui_coba_upload_file.tsx
index 091a09fa..8c3ecd48 100644
--- a/src/app_modules/zCoba/ui_coba_upload_file.tsx
+++ b/src/app_modules/zCoba/ui_coba_upload_file.tsx
@@ -1,5 +1,5 @@
-import { DIRECTORY_ID } from "@/app/lib";
-import { TokenStorage } from "@/app/lib/token";
+import { DIRECTORY_ID } from "@/lib";
+import { TokenStorage } from "@/lib/token";
import {
Button,
Center,
@@ -189,7 +189,7 @@ async function coba_ButtonFileUpload({
formData.append("dirId", dirId);
try {
- const res = await fetch("https://wibu-storage.wibudev.com/api/upload", {
+ const res = await fetch("https://wibu-storage.wibudev.com/api/image/upload", {
method: "POST",
body: formData,
headers: {
diff --git a/src/bin/HipmiProvider.tsx b/src/bin/HipmiProvider.tsx
index f46e83d1..eecd61b1 100644
--- a/src/bin/HipmiProvider.tsx
+++ b/src/bin/HipmiProvider.tsx
@@ -1,6 +1,6 @@
"use client";
-import { GlobalEnv } from "@/app/lib/token";
+import { GlobalEnv } from "@/lib/token";
export function HipmiProvider(
{ children }: { children: React.ReactNode },
diff --git a/src/bin/seeder/master/index.ts b/src/bin/seeder/master/index.ts
index b2a301c4..41c8830d 100644
--- a/src/bin/seeder/master/index.ts
+++ b/src/bin/seeder/master/index.ts
@@ -1,5 +1,12 @@
import master_kategori_app from "./master_kategori_app.json";
import master_nama_bank from "./master_nama_bank.json";
+import master_status_transaksi from "./master_status_transaksi.json";
+import master_new_bidang_bisnis from "./master_new_bidang_bisnis.json";
+import master_emotions from "./master_emotions.json";
export { master_kategori_app };
export { master_nama_bank };
+export { master_status_transaksi };
+export { master_new_bidang_bisnis };
+export { master_emotions };
+
diff --git a/src/bin/seeder/master/master_emotions.json b/src/bin/seeder/master/master_emotions.json
new file mode 100644
index 00000000..1278ee99
--- /dev/null
+++ b/src/bin/seeder/master/master_emotions.json
@@ -0,0 +1,17 @@
+[
+ { "value": "senang", "label": "Senang" },
+ { "value": "sedih", "label": "Sedih" },
+ { "value": "marah", "label": "Marah" },
+ { "value": "takut", "label": "Takut" },
+ { "value": "terkejut", "label": "Terkejut" },
+ { "value": "cinta", "label": "Cinta" },
+ { "value": "malas", "label": "Malas" },
+ { "value": "bangga", "label": "Bangga" },
+ { "value": "penasaran", "label": "Penasaran" },
+ { "value": "malu", "label": "Malu" },
+ { "value": "iri", "label": "Iri" },
+ { "value": "kesal", "label": "Kesal" },
+ { "value": "kaget", "label": "Kaget" },
+ { "value": "bingung", "label": "Bingung" },
+ { "value": "lega", "label": "Lega" }
+]
diff --git a/src/bin/seeder/master/master_new_bidang_bisnis.json b/src/bin/seeder/master/master_new_bidang_bisnis.json
new file mode 100644
index 00000000..c896ceba
--- /dev/null
+++ b/src/bin/seeder/master/master_new_bidang_bisnis.json
@@ -0,0 +1,331 @@
+[
+ {
+ "id": "1",
+ "name": "Teknologi dan Digital",
+ "slug": "teknologi_dan_digital",
+ "subBidangBisnis": [
+ {
+ "id": "TEK-01",
+ "name": "Software Developer",
+ "slug": "software_developer"
+ },
+ { "id": "TEK-02", "name": "Web Developer", "slug": "web_developer" },
+ {
+ "id": "TEK-03",
+ "name": "Mobile App Developer",
+ "slug": "mobile_app_developer"
+ },
+ { "id": "TEK-04", "name": "Konsultan IT", "slug": "konsultan_it" },
+ {
+ "id": "TEK-05",
+ "name": "Digital Marketing",
+ "slug": "digital_marketing"
+ },
+ { "id": "TEK-06", "name": "Cybersecurity", "slug": "cybersecurity" },
+ {
+ "id": "TEK-07",
+ "name": "AI & Machine Learning Services",
+ "slug": "ai_and_machine_learning_services"
+ },
+ {
+ "id": "TEK-08",
+ "name": "Data Analyst/Data Scientist",
+ "slug": "data_analyst_data_scientist"
+ },
+ {
+ "id": "TEK-09",
+ "name": "Blockchain Developer",
+ "slug": "blockchain_developer"
+ }
+ ]
+ },
+ {
+ "id": "2",
+ "name": "Kuliner",
+ "slug": "kuliner",
+ "subBidangBisnis": [
+ { "id": "KUL-01", "name": "Restoran", "slug": "restoran" },
+ { "id": "KUL-02", "name": "Kafe", "slug": "kafe" },
+ { "id": "KUL-03", "name": "Warung Makan", "slug": "warung_makan" },
+ { "id": "KUL-04", "name": "Catering", "slug": "catering" },
+ { "id": "KUL-05", "name": "Food Truck", "slug": "food_truck" },
+ {
+ "id": "KUL-06",
+ "name": "Minuman Kekinian",
+ "slug": "minuman_kekinian"
+ },
+ { "id": "KUL-07", "name": "Toko Roti & Kue", "slug": "toko_roti_kue" },
+ {
+ "id": "KUL-08",
+ "name": "Supplier Bahan Makanan",
+ "slug": "supplier_bahan_makanan"
+ }
+ ]
+ },
+ {
+ "id": "3",
+ "name": "Fashion dan Kecantikan",
+ "slug": "fashion_dan_kecantikan",
+ "subBidangBisnis": [
+ {
+ "id": "FAS-01",
+ "name": "Pakaian Dewasa & Anak",
+ "slug": "pakaian_dewasa_anak"
+ },
+ { "id": "FAS-02", "name": "Butik", "slug": "butik" },
+ {
+ "id": "FAS-03",
+ "name": "Desainer Fashion",
+ "slug": "desainer_fashion"
+ },
+ {
+ "id": "FAS-04",
+ "name": "Aksesoris & Perhiasan",
+ "slug": "aksesoris_perhiasan"
+ },
+ { "id": "FAS-05", "name": "Kosmetik", "slug": "kosmetik" },
+ { "id": "FAS-06", "name": "Skincare", "slug": "skincare" },
+ {
+ "id": "FAS-07",
+ "name": "Salon Kecantikan",
+ "slug": "salon_kecantikan"
+ },
+ { "id": "FAS-08", "name": "Barbershop", "slug": "barbershop" }
+ ]
+ },
+ {
+ "id": "4",
+ "name": "Otomotif",
+ "slug": "otomotif",
+ "subBidangBisnis": [
+ {
+ "id": "OTO-01",
+ "name": "Jual Beli Mobil/Motor",
+ "slug": "jual_beli_mobil_motor"
+ },
+ {
+ "id": "OTO-02",
+ "name": "Bengkel Mobil/Motor",
+ "slug": "bengkel_mobil_motor"
+ },
+ {
+ "id": "OTO-03",
+ "name": "Aksesori Kendaraan",
+ "slug": "aksesori_kendaraan"
+ },
+ {
+ "id": "OTO-04",
+ "name": "Rental Kendaraan",
+ "slug": "rental_kendaraan"
+ },
+ {
+ "id": "OTO-05",
+ "name": "Cuci Mobil/Motor",
+ "slug": "cuci_mobil_motor"
+ },
+ {
+ "id": "OTO-06",
+ "name": "Spare Part & Mesin Mobil",
+ "slug": "spare_part_mesin_mobil"
+ }
+ ]
+ },
+ {
+ "id": "5",
+ "name": "Industri Kreatif",
+ "slug": "industri_kreatif",
+ "subBidangBisnis": [
+ {
+ "id": "INK-01",
+ "name": "Fotografi & Videografi",
+ "slug": "fotografi_videografi"
+ },
+ { "id": "INK-02", "name": "Event Organizer", "slug": "event_organizer" },
+ { "id": "INK-03", "name": "Desain Grafis", "slug": "desain_grafis" },
+ {
+ "id": "INK-04",
+ "name": "Advertising & Branding",
+ "slug": "advertising_branding"
+ },
+ { "id": "INK-05", "name": "Jasa Percetakan", "slug": "jasa_percetakan" },
+ {
+ "id": "INK-06",
+ "name": "Dekorasi & Wedding Planner",
+ "slug": "dekorasi_wedding_planner"
+ },
+ {
+ "id": "INK-07",
+ "name": "Studio Musik & Produksi",
+ "slug": "studio_musik_produksi"
+ }
+ ]
+ },
+ {
+ "id": "6",
+ "name": "Konstruksi dan Pertukangan",
+ "slug": "konstruksi_dan_pertukangan",
+ "subBidangBisnis": [
+ {
+ "id": "KON-01",
+ "name": "Kontraktor Bangunan",
+ "slug": "kontraktor_bangunan"
+ },
+ { "id": "KON-02", "name": "Arsitek", "slug": "arsitek" },
+ { "id": "KON-03", "name": "Desain Interior", "slug": "desain_interior" },
+ {
+ "id": "KON-04",
+ "name": "Supplier Material Bangunan",
+ "slug": "supplier_material_bangunan"
+ },
+ {
+ "id": "KON-05",
+ "name": "Tukang & Renovasi Rumah",
+ "slug": "tukang_renovasi_rumah"
+ }
+ ]
+ },
+ {
+ "id": "7",
+ "name": "Agribisnis dan Pertanian",
+ "slug": "agribisnis_dan_pertanian",
+ "subBidangBisnis": [
+ { "id": "AGR-01", "name": "Perkebunan", "slug": "perkebunan" },
+ { "id": "AGR-02", "name": "Peternakan", "slug": "peternakan" },
+ { "id": "AGR-03", "name": "Perikanan", "slug": "perikanan" },
+ {
+ "id": "AGR-04",
+ "name": "Supplier Bibit & Pupuk",
+ "slug": "supplier_bibit_pupuk"
+ },
+ {
+ "id": "AGR-05",
+ "name": "Hasil Tani Organik",
+ "slug": "hasil_tani_organik"
+ },
+ {
+ "id": "AGR-06",
+ "name": "Alat & Mesin Pertanian",
+ "slug": "alat_mesin_pertanian"
+ }
+ ]
+ },
+ {
+ "id": "8",
+ "name": "Jasa Umum",
+ "slug": "jasa_umum",
+ "subBidangBisnis": [
+ { "id": "JAS-01", "name": "Jasa Kebersihan", "slug": "jasa_kebersihan" },
+ { "id": "JAS-02", "name": "Laundry", "slug": "laundry" },
+ { "id": "JAS-03", "name": "Penitipan Anak", "slug": "penitipan_anak" },
+ { "id": "JAS-04", "name": "Jasa Keamanan", "slug": "jasa_keamanan" },
+ {
+ "id": "JAS-05",
+ "name": "Jasa Pengiriman/Logistik",
+ "slug": "jasa_pengiriman_logistik"
+ },
+ { "id": "JAS-06", "name": "Jasa Ekspedisi", "slug": "jasa_ekspedisi" },
+ {
+ "id": "JAS-07",
+ "name": "Konsultan Bisnis",
+ "slug": "konsultan_bisnis"
+ },
+ { "id": "JAS-08", "name": "Jasa Hukum/Legal", "slug": "jasa_hukum_legal" }
+ ]
+ },
+ {
+ "id": "9",
+ "name": "Edukasi dan Pelatihan",
+ "slug": "edukasi_dan_pelatihan",
+ "subBidangBisnis": [
+ {
+ "id": "EDU-01",
+ "name": "Bimbingan Belajar",
+ "slug": "bimbingan_belajar"
+ },
+ { "id": "EDU-02", "name": "Kursus Bahasa", "slug": "kursus_bahasa" },
+ {
+ "id": "EDU-03",
+ "name": "Pelatihan Digital/Skill",
+ "slug": "pelatihan_digital_skill"
+ },
+ {
+ "id": "EDU-04",
+ "name": "LPK (Lembaga Pelatihan Kerja)",
+ "slug": "lpk_lembaga_pelatihan_kerja"
+ },
+ { "id": "EDU-05", "name": "Homeschooling", "slug": "homeschooling" }
+ ]
+ },
+ {
+ "id": "10",
+ "name": "Keuangan dan Investasi",
+ "slug": "keuangan_dan_investasi",
+ "subBidangBisnis": [
+ { "id": "KEU-01", "name": "Koperasi", "slug": "koperasi" },
+ { "id": "KEU-02", "name": "FinTEKh", "slug": "finTEKh" },
+ {
+ "id": "KEU-03",
+ "name": "Konsultan Keuangan",
+ "slug": "konsultan_keuangan"
+ },
+ {
+ "id": "KEU-04",
+ "name": "Investasi & Saham",
+ "slug": "investasi_saham"
+ },
+ { "id": "KEU-05", "name": "Asuransi", "slug": "asuransi" },
+ { "id": "KEU-06", "name": "Akuntan Publik", "slug": "akuntan_publik" }
+ ]
+ },
+ {
+ "id": "11",
+ "name": "Perdagangan Umum",
+ "slug": "perdagangan_umum",
+ "subBidangBisnis": [
+ { "id": "PER-01", "name": "Toko Kelontong", "slug": "toko_kelontong" },
+ { "id": "PER-02", "name": "Minimarket", "slug": "minimarket" },
+ {
+ "id": "PER-03",
+ "name": "Grosir & Distributor",
+ "slug": "grosir_distributor"
+ },
+ {
+ "id": "PER-04",
+ "name": "Dropshipper & Reseller",
+ "slug": "dropshipper_reseller"
+ },
+ {
+ "id": "PER-05",
+ "name": "Marketplace & E-commerce",
+ "slug": "marketplace_e_commerce"
+ },
+ { "id": "PER-06", "name": "Supplier Produk", "slug": "supplier_produk" }
+ ]
+ },
+ {
+ "id": "12",
+ "name": "Pariwisata dan Hospitality",
+ "slug": "pariwisata_dan_hospitality",
+ "subBidangBisnis": [
+ { "id": "PAR-01", "name": "Agen Travel", "slug": "agen_travel" },
+ { "id": "PAR-02", "name": "Tour Guide", "slug": "tour_guide" },
+ {
+ "id": "PAR-03",
+ "name": "Villa & Penginapan",
+ "slug": "villa_penginapan"
+ },
+ { "id": "PAR-04", "name": "Homestay", "slug": "homestay" },
+ { "id": "PAR-05", "name": "Hotel", "slug": "hotel" },
+ {
+ "id": "PAR-06",
+ "name": "Sewa Motor/Travel",
+ "slug": "sewa_motor_travel"
+ },
+ {
+ "id": "PAR-07",
+ "name": "Sovenir & Oleh-Oleh",
+ "slug": "sovenir_oleh_oleh"
+ }
+ ]
+ }
+]
diff --git a/src/bin/seeder/master/master_status_transaksi.json b/src/bin/seeder/master/master_status_transaksi.json
new file mode 100644
index 00000000..6093bdd0
--- /dev/null
+++ b/src/bin/seeder/master/master_status_transaksi.json
@@ -0,0 +1,18 @@
+[
+ {
+ "id": "1",
+ "name": "Berhasil"
+ },
+ {
+ "id": "2",
+ "name": "Proses"
+ },
+ {
+ "id": "3",
+ "name": "Menunggu"
+ },
+ {
+ "id": "4",
+ "name": "Gagal"
+ }
+]
diff --git a/src/bin/seeder/user_seeder.json b/src/bin/seeder/user_seeder.json
index afefe855..356be9bf 100644
--- a/src/bin/seeder/user_seeder.json
+++ b/src/bin/seeder/user_seeder.json
@@ -2,11 +2,13 @@
{
"name": "bagas_admin",
"nomor": "6282340374412",
- "masterUserRoleId": "2"
+ "masterUserRoleId": "3",
+ "active": true
},
{
"name": "fahmi_admin",
"nomor": "628123833845",
- "masterUserRoleId": "2"
+ "masterUserRoleId": "2",
+ "active": true
}
]
diff --git a/src/app/lib/APIs.ts b/src/lib/APIs.ts
similarity index 100%
rename from src/app/lib/APIs.ts
rename to src/lib/APIs.ts
diff --git a/src/lib/api_user_router/route_api_event.ts b/src/lib/api_user_router/route_api_event.ts
new file mode 100644
index 00000000..9b7094c2
--- /dev/null
+++ b/src/lib/api_user_router/route_api_event.ts
@@ -0,0 +1,10 @@
+export const API_RouteEvent = {
+ get_all: ({ page }: { page: number }) => `/api/event/get-all?page=${page}`,
+ get_one_by_id: ({ eventId }: { eventId: string }) =>
+ `/api/event/get-one-by-id?eventId=${eventId}`,
+ check_kehadiran: ({ eventId, userId }: { eventId: string; userId: string }) =>
+ `/api/event/check-kehadiran?eventId=${eventId}&userId=${userId}`,
+ check_peserta: ({ eventId, userId }: { eventId: string; userId: string }) =>
+ `/api/event/check-peserta?eventId=${eventId}&userId=${userId}`,
+ list_peserta: ({ eventId, page }: { eventId: string, page: number }) => `/api/event/list-peserta?eventId=${eventId}&page=${page}`,
+};
diff --git a/src/lib/api_user_router/route_api_job.ts b/src/lib/api_user_router/route_api_job.ts
new file mode 100644
index 00000000..66234665
--- /dev/null
+++ b/src/lib/api_user_router/route_api_job.ts
@@ -0,0 +1,4 @@
+export const API_RouteJob = {
+ get_all: ({ page, search }: { page: number; search?: string }) =>
+ `/api/job/get-all?page=${page}&search=${search || ""}`,
+};
diff --git a/src/lib/api_user_router/route_api_notifikasi.ts b/src/lib/api_user_router/route_api_notifikasi.ts
new file mode 100644
index 00000000..0fccc1b0
--- /dev/null
+++ b/src/lib/api_user_router/route_api_notifikasi.ts
@@ -0,0 +1,15 @@
+import { ICategoryapp } from "@/app_modules/notifikasi/model/interface";
+
+export const API_RouteNotifikasi = {
+ get_all_by_category: ({
+ category,
+ page,
+ }: {
+ category: ICategoryapp;
+ page: number;
+ }) => `/api/notifikasi/get-all-by-category?category=${category}&page=${page}`,
+
+ get_master_kategori: () => `/api/notifikasi/master`,
+
+ get_count_by_id: () => `/api/notifikasi/count`,
+};
diff --git a/src/app/lib/global_state.ts b/src/lib/global_state.ts
similarity index 75%
rename from src/app/lib/global_state.ts
rename to src/lib/global_state.ts
index 59259c1c..8e73e281 100644
--- a/src/app/lib/global_state.ts
+++ b/src/lib/global_state.ts
@@ -13,11 +13,13 @@ export type ITypeStatusNotifikasi =
| "Peserta Event"
// VOTING
| "Voting Masuk"
- // DONASI
+ // DONASI & INVESTASI
| "Berhasil"
| "Proses"
| "Menunggu"
- | "Gagal";
+ | "Gagal"
+ // Collaboration
+ | "Partisipan Project"
/**
* @param kategoriApp | "JOB", "VOTING", "EVENT", "DONASI", "INVESTASI", "COLLABORATION", "FORUM"
@@ -25,24 +27,28 @@ export type ITypeStatusNotifikasi =
*/
export type IRealtimeData = {
status?: ITypeStatusNotifikasi;
- appId: string;
+ appId?: string;
userId: string;
- pesan: string;
- title: string;
- kategoriApp:
+ pesan?: string;
+ title?: string;
+ kategoriApp?:
| "JOB"
| "VOTING"
| "EVENT"
| "DONASI"
| "INVESTASI"
| "COLLABORATION"
- | "FORUM";
+ | "FORUM"
+ | "ACCESS"; // Untuk trigger akses user
};
+// Access User
+export const gs_access_user = atom(false);
+
export const gs_realtimeData = atom(null);
export const gs_admin_ntf = atom(0);
export const gs_user_ntf = atom(0);
-export const gs_count_ntf = atom(0);
+export const gs_count_ntf = atom(null);
// job
export const gs_adminJob_triggerReview = atom(false);
@@ -59,3 +65,7 @@ export const gs_votingTiggerBeranda = atom(false);
// donasi
export const gs_adminDonasi_triggerReview = atom(false);
export const gs_donasiTriggerBeranda = atom(false);
+
+// investasi
+export const gs_adminInvestasi_triggerReview = atom(false);
+export const gs_investasiTriggerBeranda = atom(false);
diff --git a/src/app/lib/id-derectory.ts b/src/lib/id-derectory.ts
similarity index 84%
rename from src/app/lib/id-derectory.ts
rename to src/lib/id-derectory.ts
index dc430470..8f6a88bd 100644
--- a/src/app/lib/id-derectory.ts
+++ b/src/lib/id-derectory.ts
@@ -21,6 +21,13 @@ const DIRECTORY_ID = {
// Job
job_image: "cm0ypp6zl0003kp7jf59zuvjy",
+
+ // Event
+ event_sponsor: "cm65zlbyf001udvmggnd6i0oh",
+ event_bukti_transfer: "cm65zlehy001wdvmgnobur2zh",
+
+ // Sticker
+ sticker: "cmanquv32002fcesbk49cj07g",
};
export default DIRECTORY_ID;
diff --git a/src/app/lib/index.ts b/src/lib/index.ts
similarity index 100%
rename from src/app/lib/index.ts
rename to src/lib/index.ts
diff --git a/src/lib/limit.ts b/src/lib/limit.ts
new file mode 100644
index 00000000..1be48f04
--- /dev/null
+++ b/src/lib/limit.ts
@@ -0,0 +1,5 @@
+import pLimit from "p-limit";
+
+const global_limit = pLimit(1);
+
+export default global_limit;
\ No newline at end of file
diff --git a/src/app/lib/path_asset_image.tsx b/src/lib/path_asset_image.tsx
similarity index 81%
rename from src/app/lib/path_asset_image.tsx
rename to src/lib/path_asset_image.tsx
index a798163b..b43f1e25 100644
--- a/src/app/lib/path_asset_image.tsx
+++ b/src/lib/path_asset_image.tsx
@@ -3,4 +3,5 @@ export const pathAssetImage = {
avatar: "/aset/global/avatar.png",
main_background: "/aset/global/main_background.png",
new_loader: "/aset/global/loading.gif",
+ dummy_image: "/aset/global/dummy-image.jpg",
};
diff --git a/src/lib/prisma.back.txt b/src/lib/prisma.back.txt
new file mode 100644
index 00000000..ccd8945e
--- /dev/null
+++ b/src/lib/prisma.back.txt
@@ -0,0 +1,44 @@
+import { PrismaClient } from '@prisma/client';
+
+let prisma: PrismaClient;
+
+if (process.env.NODE_ENV === 'production') {
+ prisma = new PrismaClient();
+} else {
+ const globalWithPrisma = global as typeof globalThis & {
+ prisma: PrismaClient;
+ };
+ if (!globalWithPrisma.prisma) {
+ globalWithPrisma.prisma = new PrismaClient();
+ }
+ prisma = globalWithPrisma.prisma;
+}
+
+// Handle uncaught errors
+process.on('uncaughtException', async (error) => {
+ console.error('Uncaught Exception:', error);
+ await prisma.$disconnect();
+ process.exit(1);
+});
+
+// Handle unhandled promise rejections
+process.on('unhandledRejection', async (error) => {
+ console.error('Unhandled Rejection:', error);
+ await prisma.$disconnect();
+ process.exit(1);
+});
+
+// Handle graceful shutdown
+process.on('SIGINT', async () => {
+ console.log('Received SIGINT signal. Closing database connections...');
+ await prisma.$disconnect();
+ process.exit(0);
+});
+
+process.on('SIGTERM', async () => {
+ console.log('Received SIGTERM signal. Closing database connections...');
+ await prisma.$disconnect();
+ process.exit(0);
+});
+
+export default prisma;
\ No newline at end of file
diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts
new file mode 100644
index 00000000..1620968d
--- /dev/null
+++ b/src/lib/prisma.ts
@@ -0,0 +1,53 @@
+import { PrismaClient } from "@prisma/client";
+
+// Deklarasikan variabel global untuk menandai apakah listener sudah ditambahkan
+declare global {
+ var prisma: PrismaClient;
+ var prismaListenersAdded: boolean; // Flag untuk menandai listener
+}
+
+let prisma: PrismaClient;
+
+if (process.env.NODE_ENV === "production") {
+ prisma = new PrismaClient();
+} else {
+ if (!global.prisma) {
+ global.prisma = new PrismaClient();
+ }
+ prisma = global.prisma;
+}
+
+// Tambahkan listener hanya jika belum ditambahkan sebelumnya
+if (!global.prismaListenersAdded) {
+ // Handle uncaught errors
+ process.on("uncaughtException", async (error) => {
+ console.error("Uncaught Exception:", error);
+ await prisma.$disconnect();
+ process.exit(1);
+ });
+
+ // Handle unhandled promise rejections
+ process.on("unhandledRejection", async (error) => {
+ console.error("Unhandled Rejection:", error);
+ await prisma.$disconnect();
+ process.exit(1);
+ });
+
+ // Handle graceful shutdown
+ process.on("SIGINT", async () => {
+ console.log("Received SIGINT signal. Closing database connections...");
+ await prisma.$disconnect();
+ process.exit(0);
+ });
+
+ process.on("SIGTERM", async () => {
+ console.log("Received SIGTERM signal. Closing database connections...");
+ await prisma.$disconnect();
+ process.exit(0);
+ });
+
+ // Tandai bahwa listener sudah ditambahkan
+ global.prismaListenersAdded = true;
+}
+
+export default prisma;
diff --git a/src/lib/realtime_provider.tsx b/src/lib/realtime_provider.tsx
new file mode 100644
index 00000000..f86dd582
--- /dev/null
+++ b/src/lib/realtime_provider.tsx
@@ -0,0 +1,284 @@
+"use client";
+
+import { useShallowEffect } from "@mantine/hooks";
+import { useAtom } from "jotai";
+import { WibuRealtime } from "wibu-pkg";
+import {
+ gs_access_user,
+ gs_admin_ntf,
+ gs_adminDonasi_triggerReview,
+ gs_adminEvent_triggerReview,
+ gs_adminInvestasi_triggerReview,
+ gs_adminJob_triggerReview,
+ gs_adminVoting_triggerReview,
+ gs_donasiTriggerBeranda,
+ gs_eventTriggerBeranda,
+ gs_investasiTriggerBeranda,
+ gs_jobTiggerBeranda,
+ gs_realtimeData,
+ gs_user_ntf,
+ gs_votingTiggerBeranda,
+ IRealtimeData,
+} from "./global_state";
+import { apiNewGetUserIdByToken } from "@/app_modules/_global/lib/api_fetch_global";
+
+// const WIBU_REALTIME_TOKEN: string | undefined =
+// process.env.NEXT_PUBLIC_WIBU_REALTIME_TOKEN;
+
+// Pasang tipe data di package WibuRealtime sebagai type adata setData
+export type TypeNotification = {
+ type: "message" | "notification" | "trigger";
+ pushNotificationTo: "ADMIN" | "USER";
+ dataMessage?: IRealtimeData;
+ userId?: string;
+};
+
+type IResponseAPIGetUser = {
+ success: boolean;
+ userId: string;
+};
+
+// Tambahkan flag global untuk mencegah inisialisasi ulang
+let isWibuRealtimeInitialized = false;
+
+export default function RealtimeProvider({
+ // userId,
+ WIBU_REALTIME_TOKEN,
+}: {
+ // userId: string;
+ WIBU_REALTIME_TOKEN: string;
+}) {
+ const [dataRealtime, setDataRealtime] = useAtom(gs_realtimeData);
+ const [newAdminNtf, setNewAdminNtf] = useAtom(gs_admin_ntf);
+ const [newUserNtf, setNewUserNtf] = useAtom(gs_user_ntf);
+
+ // ACCESS USER
+ const [isAccessUser, setIsAccessUser] = useAtom(gs_access_user);
+
+ // JOB
+ const [isTriggerJobBeranda, setIsTriggerJobBeranda] =
+ useAtom(gs_jobTiggerBeranda);
+ const [isAdminJob_TriggerReview, setIsAdminJob_TriggerReview] = useAtom(
+ gs_adminJob_triggerReview
+ );
+
+ // EVENT
+ const [isTriggerEventBeranda, setIsTriggerEventBeranda] = useAtom(
+ gs_eventTriggerBeranda
+ );
+ const [isAdminEvent_TriggerReview, setIsAdminEvent_TriggerReview] = useAtom(
+ gs_adminEvent_triggerReview
+ );
+
+ // VOTING
+ const [isTriggerVotingBeranda, setIsTriggerVotingBeranda] = useAtom(
+ gs_votingTiggerBeranda
+ );
+ const [isAdminVoting_TriggerReview, setIsAdminVoting_TriggerReview] = useAtom(
+ gs_adminVoting_triggerReview
+ );
+
+ // DONASI
+ const [isAdminDonasi_TriggerReview, setIsAdminDonasi_TriggerReview] = useAtom(
+ gs_adminDonasi_triggerReview
+ );
+ const [isTriggerDonasiBeranda, setIsTriggerDonasiBeranda] = useAtom(
+ gs_donasiTriggerBeranda
+ );
+
+ // INVESTASI
+ const [isAdminInvestasi_TriggerReview, setIsAdminInvestasi_TriggerReview] =
+ useAtom(gs_adminInvestasi_triggerReview);
+
+ const [isTriggerInvestasiBeranda, setIsTriggerInvestasiBeranda] = useAtom(
+ gs_investasiTriggerBeranda
+ );
+
+ // Client-side only
+ useShallowEffect(() => {
+ const initRealtime = async () => {
+ if (typeof window === "undefined") return;
+
+ const response: IResponseAPIGetUser = await apiNewGetUserIdByToken();
+
+ if (response.success) {
+ WibuRealtime.init({
+ project: "hipmi",
+ WIBU_REALTIME_TOKEN: WIBU_REALTIME_TOKEN,
+ onData(data: TypeNotification) {
+ // Notifikasi ke admin
+ if (
+ data.type == "notification" &&
+ data.pushNotificationTo == "ADMIN"
+ ) {
+ setNewAdminNtf((e) => e + 1);
+ }
+
+ // trigger access
+ if (
+ data.type == "trigger" &&
+ data.pushNotificationTo == "USER" &&
+ data.dataMessage?.kategoriApp == "ACCESS" &&
+ data.dataMessage?.userId == response.userId
+ ) {
+ setIsAccessUser(data.dataMessage.status as any);
+ }
+
+ // Notifikasi ke semua user , yang datanya di acc admin
+ if (
+ data.type == "notification" &&
+ data.pushNotificationTo == "USER" &&
+ data.dataMessage?.userId == response.userId
+ ) {
+ setNewUserNtf((e) => e + 1);
+ setDataRealtime(data.dataMessage as any);
+ }
+
+ // ---------------------- JOB ------------------------- //
+ if (
+ data.type == "trigger" &&
+ data.pushNotificationTo == "ADMIN" &&
+ data.dataMessage?.kategoriApp == "JOB"
+ ) {
+ setIsAdminJob_TriggerReview(true);
+ }
+
+ if (
+ data.type == "trigger" &&
+ data.pushNotificationTo == "USER" &&
+ data.dataMessage?.kategoriApp == "JOB" &&
+ data.dataMessage.status == "Publish"
+ ) {
+ setIsTriggerJobBeranda(true);
+ }
+ // ---------------------- JOB ------------------------- //
+
+ // ---------------------- EVENT ------------------------- //
+ if (
+ data.type == "trigger" &&
+ data.pushNotificationTo == "ADMIN" &&
+ data.dataMessage?.kategoriApp == "EVENT"
+ ) {
+ setIsAdminEvent_TriggerReview(true);
+ }
+
+ if (
+ data.type == "trigger" &&
+ data.pushNotificationTo == "USER" &&
+ data.dataMessage?.kategoriApp == "EVENT" &&
+ data.dataMessage.status == "Publish"
+ ) {
+ setIsTriggerEventBeranda(true);
+ }
+
+ if (
+ data.type == "notification" &&
+ data.pushNotificationTo == "USER" &&
+ data.dataMessage?.status == "Peserta Event" &&
+ response.userId !== data.dataMessage?.userId
+ ) {
+ setNewUserNtf((e) => e + 1);
+ }
+ // ---------------------- EVENT ------------------------- //
+
+ // ---------------------- VOTING ------------------------- //
+ if (
+ data.type == "trigger" &&
+ data.pushNotificationTo == "ADMIN" &&
+ data.dataMessage?.kategoriApp == "VOTING"
+ ) {
+ setIsAdminVoting_TriggerReview(true);
+ }
+
+ if (
+ data.type == "trigger" &&
+ data.pushNotificationTo == "USER" &&
+ data.dataMessage?.kategoriApp == "VOTING" &&
+ data.dataMessage.status == "Publish"
+ ) {
+ setIsTriggerVotingBeranda(true);
+ }
+
+ if (
+ data.type == "notification" &&
+ data.pushNotificationTo == "USER" &&
+ data.dataMessage?.status == "Voting Masuk" &&
+ response.userId !== data.dataMessage?.userId
+ ) {
+ setNewUserNtf((e) => e + 1);
+ }
+ // ---------------------- VOTING ------------------------- //
+
+ // ---------------------- DONASI ------------------------- //
+ if (
+ data.type == "trigger" &&
+ data.pushNotificationTo == "ADMIN" &&
+ data.dataMessage?.kategoriApp == "DONASI"
+ ) {
+ setIsAdminDonasi_TriggerReview(true);
+ }
+
+ if (
+ data.type == "trigger" &&
+ data.pushNotificationTo == "USER" &&
+ data.dataMessage?.kategoriApp == "DONASI" &&
+ data.dataMessage.status == "Publish"
+ ) {
+ setIsTriggerDonasiBeranda(true);
+ }
+
+ // if (
+ // data.type == "notification" &&
+ // data.pushNotificationTo == "ADMIN" &&
+ // data.dataMessage?.status == "Menunggu" &&
+ // userId !== data.dataMessage?.userId
+ // ) {
+
+ // }
+ // ---------------------- DONASI ------------------------- //
+
+ // ---------------------- INVESTASI ------------------------- //
+
+ if (
+ data.type == "trigger" &&
+ data.pushNotificationTo == "ADMIN" &&
+ data.dataMessage?.kategoriApp == "INVESTASI"
+ ) {
+ setIsAdminInvestasi_TriggerReview(true);
+ }
+
+ if (
+ data.type == "trigger" &&
+ data.pushNotificationTo == "USER" &&
+ data.dataMessage?.kategoriApp == "INVESTASI" &&
+ data.dataMessage.status == "Publish"
+ ) {
+ setIsTriggerInvestasiBeranda(true);
+ }
+
+ // ---------------------- INVESTASI ------------------------- //
+
+ // ---------------------- COLLABORATION ------------------------- //
+ if (
+ data.type == "trigger" &&
+ data.pushNotificationTo == "USER" &&
+ data.dataMessage?.kategoriApp == "COLLABORATION" &&
+ data.dataMessage?.status == "Partisipan Project"
+ ) {
+ setNewUserNtf((e) => e + 1);
+ }
+ // ---------------------- COLLABORATION ------------------------- //
+ },
+ });
+
+ isWibuRealtimeInitialized = true;
+ }
+ };
+
+ if (!isWibuRealtimeInitialized) {
+ initRealtime();
+ }
+ }, []);
+
+ return null;
+}
diff --git a/src/app/lib/router_admin/router_admin_colab.ts b/src/lib/router_admin/router_admin_colab.ts
similarity index 81%
rename from src/app/lib/router_admin/router_admin_colab.ts
rename to src/lib/router_admin/router_admin_colab.ts
index 3bb5cc5a..fb3024b7 100644
--- a/src/app/lib/router_admin/router_admin_colab.ts
+++ b/src/lib/router_admin/router_admin_colab.ts
@@ -3,4 +3,5 @@ export const RouterAdminColab = {
table_publish: "/dev/admin/colab/sub-menu/publish",
table_group: "/dev/admin/colab/sub-menu/group",
table_reject: "/dev/admin/colab/sub-menu/reject",
+ detail_publish: "/dev/admin/colab/detail/publish/",
};
diff --git a/src/app/lib/router_admin/router_admin_developer.ts b/src/lib/router_admin/router_admin_developer.ts
similarity index 100%
rename from src/app/lib/router_admin/router_admin_developer.ts
rename to src/lib/router_admin/router_admin_developer.ts
diff --git a/src/app/lib/router_admin/router_admin_donasi.ts b/src/lib/router_admin/router_admin_donasi.ts
similarity index 100%
rename from src/app/lib/router_admin/router_admin_donasi.ts
rename to src/lib/router_admin/router_admin_donasi.ts
diff --git a/src/app/lib/router_admin/router_admin_event.ts b/src/lib/router_admin/router_admin_event.ts
similarity index 65%
rename from src/app/lib/router_admin/router_admin_event.ts
rename to src/lib/router_admin/router_admin_event.ts
index 1fa83338..c9a54d20 100644
--- a/src/app/lib/router_admin/router_admin_event.ts
+++ b/src/lib/router_admin/router_admin_event.ts
@@ -3,6 +3,11 @@ export const RouterAdminEvent = {
// detail
detail_peserta: "/dev/admin/event/detail/peserta/",
+ detail_publish: ({ id }: { id: string }) =>
+ `/dev/admin/event/detail/publish/${id}`,
+ new_detail: ({ id }: { id: string }) =>
+ `/dev/admin/event/${id}`,
+ detail_sponsor: "/dev/admin/event/detail/detail_sponsor/",
// child
detail_tipe_acara: "/dev/admin/event/child/tipe_acara",
diff --git a/src/app/lib/router_admin/router_admin_forum.ts b/src/lib/router_admin/router_admin_forum.ts
similarity index 100%
rename from src/app/lib/router_admin/router_admin_forum.ts
rename to src/lib/router_admin/router_admin_forum.ts
diff --git a/src/app/lib/router_admin/router_admin_global.ts b/src/lib/router_admin/router_admin_global.ts
similarity index 100%
rename from src/app/lib/router_admin/router_admin_global.ts
rename to src/lib/router_admin/router_admin_global.ts
diff --git a/src/app/lib/router_admin/router_admin_investasi.ts b/src/lib/router_admin/router_admin_investasi.ts
similarity index 89%
rename from src/app/lib/router_admin/router_admin_investasi.ts
rename to src/lib/router_admin/router_admin_investasi.ts
index 0416b6c3..4ec67aed 100644
--- a/src/app/lib/router_admin/router_admin_investasi.ts
+++ b/src/lib/router_admin/router_admin_investasi.ts
@@ -12,4 +12,5 @@ export const RouterAdminInvestasi = {
detail_review: "/dev/admin/investasi/detail/review/",
detail_reject: "/dev/admin/investasi/detail/reject/",
bukti_transfer: "/dev/admin/investasi/bukti-transfer/",
+ detail_transaksi: "/dev/admin/investasi/detail/transaksi/",
};
diff --git a/src/app/lib/router_admin/router_admin_job.ts b/src/lib/router_admin/router_admin_job.ts
similarity index 81%
rename from src/app/lib/router_admin/router_admin_job.ts
rename to src/lib/router_admin/router_admin_job.ts
index 3379f9b3..e5d9d66f 100644
--- a/src/app/lib/router_admin/router_admin_job.ts
+++ b/src/lib/router_admin/router_admin_job.ts
@@ -5,4 +5,5 @@ export const RouterAdminJob = {
reject: "/dev/admin/job/child/reject",
arsip: "/dev/admin/job/child/arsip",
detail_poster: "/dev/admin/job/detail/poster/",
+ detail: ({ id }: { id: string }) => `/dev/admin/job/${id}`,
};
diff --git a/src/app/lib/router_admin/router_admin_map.ts b/src/lib/router_admin/router_admin_map.ts
similarity index 100%
rename from src/app/lib/router_admin/router_admin_map.ts
rename to src/lib/router_admin/router_admin_map.ts
diff --git a/src/app/lib/router_admin/router_admin_vote.ts b/src/lib/router_admin/router_admin_vote.ts
similarity index 81%
rename from src/app/lib/router_admin/router_admin_vote.ts
rename to src/lib/router_admin/router_admin_vote.ts
index 7b90c33f..3e48c662 100644
--- a/src/app/lib/router_admin/router_admin_vote.ts
+++ b/src/lib/router_admin/router_admin_vote.ts
@@ -5,4 +5,5 @@ export const RouterAdminVote = {
table_review: "/dev/admin/vote/child/table_review",
table_reject: "/dev/admin/vote/child/table_reject",
riwayat: "/dev/admin/vote/child/riwayat",
+ detail: ({ id }: { id: string }) => `/dev/admin/vote/${id}`,
};
diff --git a/src/app/lib/router_admin/router_admn_user_acces.ts b/src/lib/router_admin/router_admn_user_acces.ts
similarity index 100%
rename from src/app/lib/router_admin/router_admn_user_acces.ts
rename to src/lib/router_admin/router_admn_user_acces.ts
diff --git a/src/lib/router_admin/router_app_information.ts b/src/lib/router_admin/router_app_information.ts
new file mode 100644
index 00000000..9218a74f
--- /dev/null
+++ b/src/lib/router_admin/router_app_information.ts
@@ -0,0 +1,10 @@
+export const RouterAdminAppInformation = {
+ main: "/dev/admin/app-information/main",
+ infoBank: "/dev/admin/app-information/info-bank",
+ bidangBisnis: "/dev/admin/app-information/bidang-bisnis",
+ createBidangBisnis: "/dev/admin/app-information/bidang-bisnis/create",
+ // Sticker
+ sticker: "/dev/admin/app-information/sticker",
+ createSticker: "/dev/admin/app-information/sticker/create",
+ detailSticker: ({ id }: { id: string }) => `/dev/admin/app-information/sticker/${id}`,
+};
diff --git a/src/app/lib/router_hipmi/router_admin.ts b/src/lib/router_hipmi/router_admin.ts
similarity index 89%
rename from src/app/lib/router_hipmi/router_admin.ts
rename to src/lib/router_hipmi/router_admin.ts
index b44b523c..8fa80599 100644
--- a/src/app/lib/router_hipmi/router_admin.ts
+++ b/src/lib/router_hipmi/router_admin.ts
@@ -22,6 +22,7 @@ export const RouterAdminDonasi_OLD = {
table_publish: "/dev/admin/donasi/table/publish",
table_review: "/dev/admin/donasi/table/review",
table_reject: "/dev/admin/donasi/table/reject",
+ table_kategori: "/dev/admin/donasi/table/kategori",
// detail
detail_publish: "/dev/admin/donasi/detail/publish/",
@@ -33,6 +34,10 @@ export const RouterAdminDonasi_OLD = {
pencairan_dana: "/dev/admin/donasi/pencairan_dana/",
};
+export const RouterAdminColab = {
+ // detail
+ detail_publish: "/dev/admin/colab/detail/publish/",
+}
export const RouterAdminAward = {
diff --git a/src/app/lib/router_hipmi/router_auth.ts b/src/lib/router_hipmi/router_auth.ts
similarity index 100%
rename from src/app/lib/router_hipmi/router_auth.ts
rename to src/lib/router_hipmi/router_auth.ts
diff --git a/src/app/lib/router_hipmi/router_colab.ts b/src/lib/router_hipmi/router_colab.ts
similarity index 100%
rename from src/app/lib/router_hipmi/router_colab.ts
rename to src/lib/router_hipmi/router_colab.ts
diff --git a/src/app/lib/router_hipmi/router_crowd.ts b/src/lib/router_hipmi/router_crowd.ts
similarity index 100%
rename from src/app/lib/router_hipmi/router_crowd.ts
rename to src/lib/router_hipmi/router_crowd.ts
diff --git a/src/app/lib/router_hipmi/router_donasi.ts b/src/lib/router_hipmi/router_donasi.ts
similarity index 100%
rename from src/app/lib/router_hipmi/router_donasi.ts
rename to src/lib/router_hipmi/router_donasi.ts
diff --git a/src/app/lib/router_hipmi/router_event.ts b/src/lib/router_hipmi/router_event.ts
similarity index 60%
rename from src/app/lib/router_hipmi/router_event.ts
rename to src/lib/router_hipmi/router_event.ts
index fcbd0cd9..41154204 100644
--- a/src/app/lib/router_hipmi/router_event.ts
+++ b/src/lib/router_hipmi/router_event.ts
@@ -7,7 +7,7 @@ export const RouterEvent = {
riwayat: ({ id }: { id: string }) => `/dev/event/main/riwayat/${id}`,
/**
- *
+ *
* @param statusId | 1 - 4 | 1: Publish, 2: Review, 3: Draft, 4: Reject
* @type string
*/
@@ -32,4 +32,22 @@ export const RouterEvent = {
detail_draft: "/dev/event/detail/draft/",
detail_reject: "/dev/event/detail/reject/",
detail_riwayat: "/dev/event/detail/riwayat/",
+
+ //peserta
+ daftar_peserta: ({ id }: { id: string }) => `/dev/event/detail/peserta/${id}`,
+
+ //sponsor
+ daftar_sponsor: ({ id }: { id: string }) => `/dev/event/detail/sponsor/${id}`,
+ edit_sponsor: "/dev/event/detail/sponsor/edit_sponsor/",
+ tambah_sponsor: ({ id }: { id: string }) =>
+ `/dev/event/detail/sponsor/tambah_sponsor/${id}`,
+ detail_sponsor: ({ id }: { id: string }) =>
+ `/dev/event/detail/detail_sponsor/${id}`,
+ nominal_sponsor: ({ id }: { id: string }) =>
+ `/dev/event/detail/sponsor/nominal_sponsor/${id}`,
+
+ metode_pembayaran: ({ id }: { id: string }) =>
+ `/dev/event/detail/sponsor/metode_pembayaran/${id}`,
+ invoice: ({ id }: { id: string }) =>
+ `/dev/event/invoice/${id}`,
};
diff --git a/src/app/lib/router_hipmi/router_forum.ts b/src/lib/router_hipmi/router_forum.ts
similarity index 100%
rename from src/app/lib/router_hipmi/router_forum.ts
rename to src/lib/router_hipmi/router_forum.ts
diff --git a/src/app/lib/router_hipmi/router_home.ts b/src/lib/router_hipmi/router_home.ts
similarity index 100%
rename from src/app/lib/router_hipmi/router_home.ts
rename to src/lib/router_hipmi/router_home.ts
diff --git a/src/app/lib/router_hipmi/router_image_preview.ts b/src/lib/router_hipmi/router_image_preview.ts
similarity index 100%
rename from src/app/lib/router_hipmi/router_image_preview.ts
rename to src/lib/router_hipmi/router_image_preview.ts
diff --git a/src/app/lib/router_hipmi/router_investasi.ts b/src/lib/router_hipmi/router_investasi.ts
similarity index 94%
rename from src/app/lib/router_hipmi/router_investasi.ts
rename to src/lib/router_hipmi/router_investasi.ts
index 7d185e12..2b598fbe 100644
--- a/src/app/lib/router_hipmi/router_investasi.ts
+++ b/src/lib/router_hipmi/router_investasi.ts
@@ -10,6 +10,7 @@ export const NEW_RouterInvestasi = {
*/
portofolio: ({ id }: { id: "1" | "2" | "3" | "4" }) =>
`/dev/investasi/main/portofolio/${id}`,
+ // portofolio: ({ id }: { id?: string }) => `/dev/investasi/main/portofolio/${id}`,
// TRANSAKSI
pembelian: "/dev/investasi/transaksi/pembelian/",
@@ -24,6 +25,8 @@ export const NEW_RouterInvestasi = {
// FILE VIEW
file_prospektus: ({ id }: { id: string }) =>
`/dev/investasi/file-view/prospektus/${id}`,
+ file_dokumen: ({ id }: { id: string }) =>
+ `/dev/investasi/file-view/dokumen/${id}`,
OLD_file_view_prospektus: "/dev/investasi/file-view/prospektus/",
OLD_file_view_dokumen: "/dev/investasi/file-view/dokumen/",
@@ -108,6 +111,8 @@ export const NEW_RouterInvestasi = {
*/
edit_prospektus: ({ id }: { id: string }) =>
`/dev/investasi/edit/prospektus/${id}`,
+
+ list_investor: ({ id }: { id: string }) => `/dev/investasi/${id}/investor`,
};
export const RouterInvestasi_OLD = {
@@ -150,7 +155,11 @@ export const RouterInvestasi_OLD = {
detail_saham_terbeli: "/dev/investasi/detail_saham_terbeli/",
detail_prospektus: "/dev/investasi/detail_prospektus/",
detail_dokumen: "/dev/investasi/detail_dokumen/",
+
+ // -- DELETE SOON -- //
detail_berita: "/dev/investasi/detail_berita/",
+ // -- DELETE SOON -- //
+
detail_draft: "/dev/investasi/detail_portofolio/draft/",
detail_publish: "/dev/investasi/detail_portofolio/publish/",
detail_review: "/dev/investasi/detail_portofolio/review/",
diff --git a/src/app/lib/router_hipmi/router_job.ts b/src/lib/router_hipmi/router_job.ts
similarity index 95%
rename from src/app/lib/router_hipmi/router_job.ts
rename to src/lib/router_hipmi/router_job.ts
index 29cd8585..5863448a 100644
--- a/src/app/lib/router_hipmi/router_job.ts
+++ b/src/lib/router_hipmi/router_job.ts
@@ -1,6 +1,4 @@
export const RouterJob = {
- //api
- api_gambar: "/api/job/gambar/",
//spalsh
spalsh: "/dev/job/splash",
diff --git a/src/app/lib/router_hipmi/router_katalog.ts b/src/lib/router_hipmi/router_katalog.ts
similarity index 100%
rename from src/app/lib/router_hipmi/router_katalog.ts
rename to src/lib/router_hipmi/router_katalog.ts
diff --git a/src/app/lib/router_hipmi/router_map.ts b/src/lib/router_hipmi/router_map.ts
similarity index 100%
rename from src/app/lib/router_hipmi/router_map.ts
rename to src/lib/router_hipmi/router_map.ts
diff --git a/src/app/lib/router_hipmi/router_notifikasi.ts b/src/lib/router_hipmi/router_notifikasi.ts
similarity index 100%
rename from src/app/lib/router_hipmi/router_notifikasi.ts
rename to src/lib/router_hipmi/router_notifikasi.ts
diff --git a/src/app/lib/router_hipmi/router_user_search.ts b/src/lib/router_hipmi/router_user_search.ts
similarity index 100%
rename from src/app/lib/router_hipmi/router_user_search.ts
rename to src/lib/router_hipmi/router_user_search.ts
diff --git a/src/app/lib/router_hipmi/router_vote.ts b/src/lib/router_hipmi/router_vote.ts
similarity index 100%
rename from src/app/lib/router_hipmi/router_vote.ts
rename to src/lib/router_hipmi/router_vote.ts
diff --git a/src/lib/routes.ts b/src/lib/routes.ts
index c339a1f9..ed0e0fa4 100644
--- a/src/lib/routes.ts
+++ b/src/lib/routes.ts
@@ -414,7 +414,6 @@ export const apies = {
`/api/portofolio/logo/${id}`,
"/api/map/pin/[id]": ({ id }: { id: string }) => `/api/map/pin/${id}`,
"/api/map/foto/[id]": ({ id }: { id: string }) => `/api/map/foto/${id}`,
- "/api/job/gambar/[id]": ({ id }: { id: string }) => `/api/job/gambar/${id}`,
"/api/investasi/prospektus/[id]": ({ id }: { id: string }) =>
`/api/investasi/prospektus/${id}`,
"/api/investasi/midtrans/[id]": ({ id }: { id: string }) =>
diff --git a/src/app/lib/server_env.ts b/src/lib/server_env.ts
similarity index 100%
rename from src/app/lib/server_env.ts
rename to src/lib/server_env.ts
diff --git a/src/app/lib/token.ts b/src/lib/token.ts
similarity index 100%
rename from src/app/lib/token.ts
rename to src/lib/token.ts
diff --git a/src/app/lib/warna.ts b/src/lib/warna.ts
similarity index 100%
rename from src/app/lib/warna.ts
rename to src/lib/warna.ts
diff --git a/src/middleware-v.1.4.5.txt b/src/middleware-v.1.4.5.txt
new file mode 100644
index 00000000..77d32d97
--- /dev/null
+++ b/src/middleware-v.1.4.5.txt
@@ -0,0 +1,386 @@
+import { jwtVerify } from "jose";
+import { NextRequest, NextResponse } from "next/server";
+import { cookies } from "next/headers";
+
+type MiddlewareConfig = {
+ apiPath: string;
+ loginPath: string;
+ userPath: string;
+ publicRoutes: string[];
+ encodedKey: string;
+ sessionKey: string;
+ validationApiRoute: string;
+ log: boolean;
+};
+
+const middlewareConfig: MiddlewareConfig = {
+ apiPath: "/api",
+ loginPath: "/login",
+ userPath: "/dev/home",
+ publicRoutes: [
+ // API
+ "/",
+ "/api/voting/*",
+ "/api/collaboration/*",
+ "/api/notifikasi/*",
+ "/api/logs/*",
+ "/api/auth/*",
+ // "/api/origin-url",
+ // "/api/job*",
+
+ // ADMIN API
+ // >> buat dibawah sini <<
+ "/api/admin/donasi/*",
+ "/api/admin/investasi/*",
+ "/api/admin/collaboration/*",
+
+ // Akses awal
+ "/api/get-cookie",
+ "/api/user/activation",
+ "/api/user-validate",
+ "/api/version",
+ "/api/validation",
+
+ // PAGE
+ "/login",
+ "/register",
+ "/validasi",
+ "/splash",
+ "/invalid-user",
+ "/job-vacancy",
+ "/preview-image",
+ "/auth/login",
+ "/auth/api/login",
+ "/waiting-room",
+ "/zCoba/*",
+
+ // ASSETS
+ "/aset/global/main_background.png",
+ "/aset/logo/logo-hipmi.png",
+ ],
+ encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
+ sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
+ validationApiRoute: "/api/validation",
+ log: false,
+};
+
+export const middleware = async (req: NextRequest) => {
+ const {
+ apiPath,
+ encodedKey,
+ loginPath,
+ publicRoutes,
+ sessionKey,
+ validationApiRoute,
+ userPath,
+ } = middlewareConfig;
+
+ const { pathname } = req.nextUrl;
+ const corsResponse = handleCors(req);
+
+ if (corsResponse) {
+ return corsResponse;
+ }
+
+ // Check if route is public
+ const isPublicRoute = isRoutePublic(pathname, publicRoutes, loginPath);
+ if (isPublicRoute && pathname !== loginPath) {
+ return setCorsHeaders(NextResponse.next());
+ }
+
+ // Get token from cookies or Authorization header
+ const token = getToken(req, sessionKey);
+ const user = await verifyToken({ token, encodedKey });
+
+ // Handle login page access
+ if (pathname === loginPath) {
+ if (user) {
+ const response = NextResponse.redirect(new URL(userPath, req.url));
+ // Preserve token in cookie when redirecting
+ if (token) {
+ response.cookies.set(sessionKey, token, {
+ // httpOnly: true,
+ secure: process.env.NODE_ENV === "production",
+ sameSite: "lax",
+ path: "/",
+ });
+ }
+ return setCorsHeaders(response);
+ }
+ return setCorsHeaders(NextResponse.next());
+ }
+
+ // Redirect to login if no user found
+ if (!user) {
+ const response = NextResponse.redirect(new URL(loginPath, req.url));
+ // Clear invalid token
+ response.cookies.delete(sessionKey);
+ return setCorsHeaders(response);
+ }
+
+ // Handle API requests
+ if (pathname.startsWith(apiPath)) {
+ // const reqToken = req.headers.get("Authorization")?.split(" ")[1];
+ if (!token) {
+ return setCorsHeaders(unauthorizedResponseTokenAPI());
+ }
+
+ try {
+
+ const apiBaseUrl =
+ process.env.NEXT_PUBLIC_API_URL || new URL(req.url).origin;
+ const validationResponse = await fetch(`${apiBaseUrl}/api/validation`, {
+ headers: {
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!validationResponse.ok) {
+ console.error("Validation failed:", validationResponse.statusText);
+ return setCorsHeaders(unauthorizedResponseAPI());
+ }
+
+ const validationResponseJson = await validationResponse.json();
+
+ if (validationResponseJson.success === false) {
+ return setCorsHeaders(unauthorizedResponseDataUserNotFound(req));
+ }
+ } catch (error) {
+ console.error(
+ "Error validating API request:",
+ (error as Error).message || error
+ );
+ return setCorsHeaders(unauthorizedResponseValidationAPIRequest());
+ }
+ }
+
+ // Handle /dev routes that require active status
+ if (pathname.startsWith("/dev")) {
+ try {
+ const apiBaseUrl =
+ process.env.NEXT_PUBLIC_API_URL || new URL(req.url).origin;
+
+ const userValidate = await fetch(`${apiBaseUrl}/api/user-validate`, {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!userValidate.ok) {
+ console.error("Validation failed:", userValidate.statusText);
+ return setCorsHeaders(unauthorizedResponseAPIUserValidate());
+ }
+
+ const userValidateJson = await userValidate.json();
+
+ if (userValidateJson.success == true && !userValidateJson.data) {
+ unauthorizedResponseDataUserNotFound(req);
+ }
+
+ if (!userValidateJson.data.active) {
+ return setCorsHeaders(unauthorizedResponseUserNotActive(req));
+ }
+ } catch (error) {
+ console.error("Error api user validate:", error);
+ if (!token) {
+ console.error("Token is undefined");
+ return setCorsHeaders(unauthorizedResponseTokenPAGE());
+ }
+ return setCorsHeaders(
+ await unauthorizedResponseValidationUser({
+ loginPath,
+ sessionKey,
+ token,
+ req,
+ })
+ );
+ }
+ }
+
+ // // Ensure token is preserved in cookie
+ // if (token) {
+ // response.cookies.set(sessionKey, token, {
+ // // httpOnly: true,
+ // secure: process.env.NODE_ENV === "production",
+ // sameSite: "lax",
+ // path: "/",
+ // });
+ // }
+ const response = NextResponse.next();
+ return setCorsHeaders(response);
+};
+
+// ============================== RESPONSE HANDLERS ==============================//
+function isRoutePublic(
+ pathname: string,
+ publicRoutes: string[],
+ loginPath: string
+): boolean {
+ return [...publicRoutes, loginPath].some((route) => {
+ const pattern = route.replace(/\*/g, ".*");
+ return new RegExp(`^${pattern}$`).test(pathname);
+ });
+}
+
+function getToken(req: NextRequest, sessionKey: string): string | undefined {
+ return (
+ req.cookies.get(sessionKey)?.value ||
+ req.headers.get("Authorization")?.split(" ")[1]
+ );
+}
+
+function unauthorizedResponse() {
+ return new NextResponse(JSON.stringify({ error: "Unauthorized" }), {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ });
+}
+
+function unauthorizedResponseAPIUserValidate() {
+ return new NextResponse(
+ JSON.stringify({ error: "Unauthorized api user validate" }),
+ {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ }
+ );
+}
+
+function unauthorizedResponseTokenAPI() {
+ return new NextResponse(
+ JSON.stringify({ error: "Unauthorized token on API" }),
+ {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ }
+ );
+}
+
+function unauthorizedResponseTokenPAGE() {
+ return new NextResponse(JSON.stringify({ error: "Unauthorized on page" }), {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ });
+}
+
+function unauthorizedResponseAPI() {
+ return new NextResponse(
+ JSON.stringify({ error: "Unauthorized Response API" }),
+ {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ }
+ );
+}
+
+function unauthorizedResponseValidationAPIRequest() {
+ return new NextResponse(
+ JSON.stringify({ error: "Unauthorized validation api request" }),
+ {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ }
+ );
+}
+
+function unauthorizedResponseDataUserNotFound(req: NextRequest) {
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/invalid-user", req.url))
+ );
+}
+
+function unauthorizedResponseUserNotActive(req: NextRequest) {
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/waiting-room", req.url))
+ );
+}
+
+async function unauthorizedResponseValidationUser({
+ loginPath,
+ sessionKey,
+ token,
+ req,
+}: {
+ loginPath: string;
+ sessionKey: string;
+ token: string;
+ req: NextRequest;
+}) {
+ const userLogout = await fetch(new URL("/api/auth/logout", req.url), {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (userLogout.ok) {
+ const response = NextResponse.redirect(new URL(loginPath, req.url));
+ // Clear invalid token
+ response.cookies.delete(sessionKey);
+ return setCorsHeaders(response);
+ }
+ console.error("Error logging out user:", await userLogout.json());
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/invalid-user", req.url))
+ );
+ // return setCorsHeaders(
+ // new NextResponse(JSON.stringify({ error: "Logout failed" }), {
+ // status: 500,
+ // headers: { "Content-Type": "application/json" },
+ // })
+ // );
+}
+
+function setCorsHeaders(res: NextResponse): NextResponse {
+ res.headers.set("Access-Control-Allow-Origin", "*");
+ res.headers.set(
+ "Access-Control-Allow-Methods",
+ "GET, POST, PUT, DELETE, OPTIONS"
+ );
+ res.headers.set(
+ "Access-Control-Allow-Headers",
+ "Content-Type, Authorization"
+ );
+ return res;
+}
+
+function handleCors(req: NextRequest): NextResponse | null {
+ if (req.method === "OPTIONS") {
+ return new NextResponse(null, {
+ status: 204,
+ headers: {
+ "Access-Control-Allow-Origin": "*",
+ "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
+ "Access-Control-Allow-Headers": "Content-Type, Authorization",
+ "Access-Control-Max-Age": "86400",
+ },
+ });
+ }
+ return null;
+}
+
+async function verifyToken({
+ token,
+ encodedKey,
+}: {
+ token: string | undefined;
+ encodedKey: string;
+}): Promise | null> {
+ if (!token) return null;
+
+ try {
+ const enc = new TextEncoder().encode(encodedKey);
+ const { payload } = await jwtVerify(token, enc, {
+ algorithms: ["HS256"],
+ });
+ return (payload.user as Record) || null;
+ } catch (error) {
+ console.error("Token verification failed:", error);
+ return null;
+ }
+}
+
+export const config = {
+ matcher: ["/((?!_next|static|favicon.ico|manifest).*)"],
+};
diff --git a/src/middleware.final.back.txt b/src/middleware.final.back.txt
new file mode 100644
index 00000000..e96e9af7
--- /dev/null
+++ b/src/middleware.final.back.txt
@@ -0,0 +1,420 @@
+import { jwtVerify } from "jose";
+import { NextRequest, NextResponse } from "next/server";
+
+type MiddlewareConfig = {
+ apiPath: string;
+ loginPath: string;
+ userPath: string;
+ publicRoutes: string[];
+ encodedKey: string;
+ sessionKey: string;
+ validationApiRoute: string;
+ log: boolean;
+};
+
+const CONFIG: MiddlewareConfig = {
+ apiPath: "/api",
+ loginPath: "/login",
+ userPath: "/dev/home",
+ publicRoutes: [
+ "/",
+ "/api/not-user/*",
+ "/api/voting/*",
+ "/api/collaboration/*",
+ "/api/notifikasi/*",
+ "/api/logs/*",
+ "/api/auth/*",
+ "/api/admin/donasi/*",
+ "/api/admin/investasi/*",
+ "/api/admin/collaboration/*",
+ "/api/get-cookie",
+ "/api/user/activation",
+ "/api/user-validate",
+ "/api/version",
+ "/api/validation",
+ "/login",
+ "/register",
+ "/validasi",
+ "/splash",
+ "/invalid-user",
+ "/job-vacancy/*",
+ "/preview-image",
+ "/auth/login",
+ "/auth/api/login",
+ "/waiting-room",
+ "/zCoba/*",
+ "/aset/global/main_background.png",
+ "/aset/logo/logo-hipmi.png",
+ ],
+ encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
+ sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
+ validationApiRoute: "/api/validation",
+ log: false,
+};
+
+export const middleware = async (req: NextRequest) => {
+ const { apiPath, encodedKey, loginPath, publicRoutes, sessionKey, userPath } =
+ CONFIG;
+
+ const { pathname } = req.nextUrl;
+
+ // Handle CORS preflight
+ const corsResponse = handleCors(req);
+ if (corsResponse) return corsResponse;
+
+ // Check if route is public
+ const isPublicRoute = isRoutePublic(pathname, publicRoutes, loginPath);
+ if (isPublicRoute && pathname !== loginPath) {
+ return setCorsHeaders(NextResponse.next());
+ }
+
+ // Get token from cookie or Authorization header
+ const token = getToken(req, sessionKey);
+ const user = await verifyToken({ token, encodedKey });
+ // console.log("user >>", user);
+
+ // Handle login page access
+ if (pathname === loginPath) {
+ if (user) {
+ const response = NextResponse.redirect(new URL(userPath, req.url));
+ if (token) setTokenCookie(response, sessionKey, token);
+ return setCorsHeaders(response);
+ }
+ return setCorsHeaders(NextResponse.next());
+ }
+
+ // Redirect to login if no valid user
+ if (!user) {
+ const response = NextResponse.redirect(new URL(loginPath, req.url));
+ deleteTokenCookie(response, sessionKey);
+ return setCorsHeaders(response);
+ }
+
+ // Handle API requests under /api
+ if (pathname.startsWith(apiPath)) {
+ if (!token) return setCorsHeaders(unauthorizedResponseTokenAPI());
+
+ try {
+ const apiBaseUrl =
+ process.env.NEXT_PUBLIC_API_URL || new URL(req.url).origin;
+ const validationResponse = await fetch(
+ `${apiBaseUrl}${CONFIG.validationApiRoute}`,
+ {
+ headers: { Authorization: `Bearer ${token}` },
+ }
+ );
+
+ if (!validationResponse.ok) {
+ console.error("Validation failed:", validationResponse.statusText);
+ return setCorsHeaders(unauthorizedResponseAPI());
+ }
+
+ const validationData = await validationResponse.json();
+ if (validationData.success === false) {
+ return setCorsHeaders(unauthorizedResponseDataUserNotFound(req));
+ }
+ } catch (error) {
+ console.error("Error validating API request:", error);
+ return setCorsHeaders(unauthorizedResponseValidationAPIRequest());
+ }
+ }
+
+ // Handle /dev routes - active user check
+ if (pathname.startsWith("/dev")) {
+ try {
+ const apiBaseUrl =
+ process.env.NEXT_PUBLIC_API_URL || new URL(req.url).origin;
+ const userValidateResponse = await fetch(
+ `${apiBaseUrl}/api/user-validate`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ if (!userValidateResponse.ok) {
+ console.error(
+ "User validation failed:",
+ userValidateResponse.statusText
+ );
+ return setCorsHeaders(unauthorizedResponseAPIUserValidate(req));
+ }
+
+ const userValidateJson = await userValidateResponse.json();
+
+ if (userValidateJson.success === true && !userValidateJson.data) {
+ return setCorsHeaders(unauthorizedResponseDataUserNotFound(req));
+ }
+
+ if (!userValidateJson.data.active) {
+ return setCorsHeaders(unauthorizedResponseUserNotActive(req));
+ }
+ } catch (error) {
+ console.error("Error during user validation API:", error);
+ if (!token) return setCorsHeaders(unauthorizedResponseTokenPAGE());
+ return setCorsHeaders(
+ await unauthorizedResponseValidationUser({
+ loginPath,
+ sessionKey,
+ token,
+ req,
+ })
+ );
+ }
+ }
+
+ if (pathname.startsWith("/dev/admin")) {
+ try {
+ const apiBaseUrl =
+ process.env.NEXT_PUBLIC_API_URL || new URL(req.url).origin;
+ const userValidateResponse = await fetch(
+ `${apiBaseUrl}/api/user-validate`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ if (!userValidateResponse.ok) {
+ console.error(
+ "User validation failed:",
+ userValidateResponse.statusText
+ );
+ return setCorsHeaders(unauthorizedResponseAPIUserValidate(req));
+ }
+
+ const userValidateJson = await userValidateResponse.json();
+ // console.log("data json >>", userValidateJson.data);
+
+ if (userValidateJson.success === true && !userValidateJson.data) {
+ return setCorsHeaders(unauthorizedResponseDataUserNotFound(req));
+ }
+
+ if (userValidateJson.data.masterUserRoleId === "1") {
+ return setCorsHeaders(unauthorizedResponseUserNotAdmin(req));
+ }
+
+ if (!userValidateJson.data.active) {
+ return setCorsHeaders(unauthorizedResponseUserNotActive(req));
+ }
+ } catch (error) {
+ console.error("Error during user validation API:", error);
+ if (!token) return setCorsHeaders(unauthorizedResponseTokenPAGE());
+ return setCorsHeaders(
+ await unauthorizedResponseValidationUser({
+ loginPath,
+ sessionKey,
+ token,
+ req,
+ })
+ );
+ }
+ }
+
+ // Default: proceed with request and add CORS headers
+ const response = NextResponse.next();
+ return setCorsHeaders(response);
+};
+
+// ========================== HELPERS ==========================
+
+function isRoutePublic(
+ pathname: string,
+ publicRoutes: string[],
+ loginPath: string
+): boolean {
+ return [...publicRoutes, loginPath].some((route) => {
+ const pattern = route.replace(/\*/g, ".*");
+ return new RegExp(`^${pattern}$`).test(pathname);
+ });
+}
+
+function getToken(req: NextRequest, sessionKey: string): string | undefined {
+ const tokenFromCookie = req.cookies.get(sessionKey)?.value;
+ if (tokenFromCookie) return tokenFromCookie;
+
+ const authHeader = req.headers.get("Authorization");
+ if (authHeader && authHeader.startsWith("Bearer ")) {
+ return authHeader.split(" ")[1];
+ }
+ return undefined;
+}
+
+function cookieOptions() {
+ return {
+ secure: process.env.NODE_ENV === "production",
+ sameSite: "lax" as const,
+ path: "/",
+ httpOnly: true,
+ };
+}
+
+function setTokenCookie(
+ response: NextResponse,
+ sessionKey: string,
+ token: string
+) {
+ response.cookies.set(sessionKey, token, cookieOptions());
+}
+
+function deleteTokenCookie(response: NextResponse, sessionKey: string) {
+ response.cookies.delete(sessionKey);
+}
+
+function setCorsHeaders(res: NextResponse): NextResponse {
+ res.headers.set("Access-Control-Allow-Origin", "*");
+ res.headers.set(
+ "Access-Control-Allow-Methods",
+ "GET, POST, PUT, DELETE, OPTIONS"
+ );
+ res.headers.set(
+ "Access-Control-Allow-Headers",
+ "Content-Type, Authorization"
+ );
+ return res;
+}
+
+function handleCors(req: NextRequest): NextResponse | null {
+ if (req.method === "OPTIONS") {
+ return new NextResponse(null, {
+ status: 204,
+ headers: {
+ "Access-Control-Allow-Origin": "*",
+ "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
+ "Access-Control-Allow-Headers": "Content-Type, Authorization",
+ "Access-Control-Max-Age": "86400",
+ },
+ });
+ }
+ return null;
+}
+
+async function verifyToken({
+ token,
+ encodedKey,
+}: {
+ token: string | undefined;
+ encodedKey: string;
+}): Promise | null> {
+ if (!token) return null;
+
+ try {
+ const enc = new TextEncoder().encode(encodedKey);
+ const { payload } = await jwtVerify(token, enc, { algorithms: ["HS256"] });
+ return (payload.user as Record) || null;
+ } catch (error) {
+ console.error("Token verification failed:", error);
+ return null;
+ }
+}
+
+function unauthorizedResponse() {
+ return new NextResponse(JSON.stringify({ error: "Unauthorized" }), {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ });
+}
+
+function unauthorizedResponseTokenAPI() {
+ return new NextResponse(
+ JSON.stringify({ error: "Unauthorized token on API" }),
+ {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ }
+ );
+}
+
+function unauthorizedResponseTokenPAGE() {
+ return new NextResponse(JSON.stringify({ error: "Unauthorized on page" }), {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ });
+}
+
+function unauthorizedResponseAPI() {
+ return new NextResponse(
+ JSON.stringify({ error: "Unauthorized Response API" }),
+ {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ }
+ );
+}
+
+function unauthorizedResponseValidationAPIRequest() {
+ return new NextResponse(
+ JSON.stringify({ error: "Unauthorized validation api request" }),
+ {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ }
+ );
+}
+
+function unauthorizedResponseAPIUserValidate(req: NextRequest) {
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/waiting-room", req.url))
+ );
+ // return new NextResponse(
+ // JSON.stringify({ error: "Unauthorized api user validate" }),
+ // {
+ // status: 401,
+ // headers: { "Content-Type": "application/json" },
+ // }
+ // );
+}
+
+function unauthorizedResponseDataUserNotFound(req: NextRequest) {
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/invalid-user", req.url))
+ );
+}
+
+function unauthorizedResponseUserNotActive(req: NextRequest) {
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/waiting-room", req.url))
+ );
+}
+
+function unauthorizedResponseUserNotAdmin(req: NextRequest) {
+ return setCorsHeaders(NextResponse.redirect(new URL("/dev/home", req.url)));
+}
+
+async function unauthorizedResponseValidationUser({
+ loginPath,
+ sessionKey,
+ token,
+ req,
+}: {
+ loginPath: string;
+ sessionKey: string;
+ token: string;
+ req: NextRequest;
+}) {
+ const userLogout = await fetch(new URL("/api/auth/logout", req.url), {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (userLogout.ok) {
+ const response = NextResponse.redirect(new URL(loginPath, req.url));
+ deleteTokenCookie(response, sessionKey);
+ return setCorsHeaders(response);
+ }
+
+ console.error("Error logging out user:", await userLogout.json());
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/invalid-user", req.url))
+ );
+}
+
+export const config = {
+ matcher: ["/((?!_next|static|favicon.ico|manifest).*)"],
+};
diff --git a/src/middleware.tsx b/src/middleware.tsx
new file mode 100644
index 00000000..4ad8930c
--- /dev/null
+++ b/src/middleware.tsx
@@ -0,0 +1,405 @@
+import { jwtVerify } from "jose";
+import { NextRequest, NextResponse } from "next/server";
+
+type MiddlewareConfig = {
+ apiPath: string;
+ loginPath: string;
+ userPath: string;
+ publicRoutes: string[];
+ encodedKey: string;
+ sessionKey: string;
+ validationApiRoute: string;
+ log: boolean;
+};
+
+const CONFIG: MiddlewareConfig = {
+ apiPath: "/api",
+ loginPath: "/login",
+ userPath: "/dev/home",
+ publicRoutes: [
+ "/",
+ "/api/not-user/*",
+ "/api/voting/*",
+ "/api/collaboration/*",
+ "/api/notifikasi/*",
+ "/api/logs/*",
+ "/api/auth/*",
+ "/api/admin/donasi/*",
+ "/api/admin/investasi/*",
+ "/api/admin/collaboration/*",
+ "/api/get-cookie",
+ "/api/user/activation",
+ "/api/user-validate",
+ "/api/version",
+ "/api/validation",
+ "/login",
+ "/register",
+ "/validasi",
+ "/splash",
+ "/invalid-user",
+ "/job-vacancy/*",
+ "/preview-image",
+ "/auth/login",
+ "/auth/api/login",
+ "/waiting-room",
+ "/zCoba/*",
+ "/aset/global/main_background.png",
+ "/aset/logo/logo-hipmi.png",
+ ],
+ encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
+ sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
+ validationApiRoute: "/api/validation",
+ log: false,
+};
+
+export const middleware = async (req: NextRequest) => {
+ const { apiPath, encodedKey, loginPath, publicRoutes, sessionKey, userPath } =
+ CONFIG;
+
+ const { pathname } = req.nextUrl;
+
+ const apiBaseUrl = new URL(req.url).origin || process.env.NEXT_PUBLIC_API_URL;
+
+ // Handle CORS preflight
+ const corsResponse = handleCors(req);
+ if (corsResponse) return corsResponse;
+
+ // Check if route is public
+ const isPublicRoute = isRoutePublic(pathname, publicRoutes, loginPath);
+ if (isPublicRoute && pathname !== loginPath) {
+ return setCorsHeaders(NextResponse.next());
+ }
+
+ // Get token from cookie or Authorization header
+ const token = getToken(req, sessionKey);
+ const user = await verifyToken({ token, encodedKey });
+
+ // Handle login page access
+ if (pathname === loginPath) {
+ if (user) {
+ const response = NextResponse.redirect(new URL(userPath, req.url));
+ if (token) setTokenCookie(response, sessionKey, token);
+ return setCorsHeaders(response);
+ }
+ return setCorsHeaders(NextResponse.next());
+ }
+
+ // Redirect to login if no valid user
+ if (!user) {
+ const response = NextResponse.redirect(new URL(loginPath, req.url));
+ deleteTokenCookie(response, sessionKey);
+ return setCorsHeaders(response);
+ }
+
+ // Handle API requests under /api
+ if (pathname.startsWith(apiPath)) {
+ if (!token) return setCorsHeaders(unauthorizedResponseTokenAPI());
+
+ try {
+ const validationResponse = await fetch(
+ `${apiBaseUrl}${CONFIG.validationApiRoute}`,
+ {
+ headers: { Authorization: `Bearer ${token}` },
+ }
+ );
+
+ if (!validationResponse.ok) {
+ return setCorsHeaders(unauthorizedResponseAPI());
+ }
+
+ const validationData = await validationResponse.json();
+ if (validationData.success === false) {
+ return setCorsHeaders(unauthorizedResponseDataUserNotFound(req));
+ }
+ } catch (error) {
+ console.error("Error validating API request:", error);
+ return setCorsHeaders(unauthorizedResponseValidationAPIRequest());
+ }
+ }
+
+ // Handle /dev routes - active user check
+ if (pathname.startsWith("/dev")) {
+ try {
+ const userValidateResponse = await fetch(
+ `${apiBaseUrl}/api/user-validate`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ if (!userValidateResponse.ok) {
+ return setCorsHeaders(unauthorizedResponseAPIUserValidate(req));
+ }
+
+ const userValidateJson = await userValidateResponse.json();
+
+ if (userValidateJson.success === true && !userValidateJson.data) {
+ return setCorsHeaders(unauthorizedResponseDataUserNotFound(req));
+ }
+
+ if (!userValidateJson.data.active) {
+ return setCorsHeaders(unauthorizedResponseUserNotActive(req));
+ }
+ } catch (error) {
+ console.error("Error during user validation API:", error);
+ if (!token) return setCorsHeaders(unauthorizedResponseTokenPAGE());
+ return setCorsHeaders(
+ await unauthorizedResponseValidationUser({
+ loginPath,
+ sessionKey,
+ token,
+ req,
+ })
+ );
+ }
+ }
+
+ if (pathname.startsWith("/dev/admin")) {
+ try {
+ const userValidateResponse = await fetch(
+ `${apiBaseUrl}/api/user-validate`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ if (!userValidateResponse.ok) {
+ return setCorsHeaders(unauthorizedResponseAPIUserValidate(req));
+ }
+
+ const userValidateJson = await userValidateResponse.json();
+
+ if (userValidateJson.success === true && !userValidateJson.data) {
+ return setCorsHeaders(unauthorizedResponseDataUserNotFound(req));
+ }
+
+ if (userValidateJson.data.masterUserRoleId === "1") {
+ return setCorsHeaders(unauthorizedResponseUserNotAdmin(req));
+ }
+
+ if (!userValidateJson.data.active) {
+ return setCorsHeaders(unauthorizedResponseUserNotActive(req));
+ }
+ } catch (error) {
+ console.error("Error during user validation API:", error);
+ if (!token) return setCorsHeaders(unauthorizedResponseTokenPAGE());
+ return setCorsHeaders(
+ await unauthorizedResponseValidationUser({
+ loginPath,
+ sessionKey,
+ token,
+ req,
+ })
+ );
+ }
+ }
+
+ // Default: proceed with request and add CORS headers
+ const response = NextResponse.next();
+ return setCorsHeaders(response);
+};
+
+// ========================== HELPERS ==========================
+
+function isRoutePublic(
+ pathname: string,
+ publicRoutes: string[],
+ loginPath: string
+): boolean {
+ return [...publicRoutes, loginPath].some((route) => {
+ const pattern = route.replace(/\*/g, ".*");
+ return new RegExp(`^${pattern}$`).test(pathname);
+ });
+}
+
+function getToken(req: NextRequest, sessionKey: string): string | undefined {
+ const tokenFromCookie = req.cookies.get(sessionKey)?.value;
+ if (tokenFromCookie) return tokenFromCookie;
+
+ const authHeader = req.headers.get("Authorization");
+ if (authHeader && authHeader.startsWith("Bearer ")) {
+ return authHeader.split(" ")[1];
+ }
+ return undefined;
+}
+
+function cookieOptions() {
+ return {
+ secure: process.env.NODE_ENV === "production",
+ sameSite: "lax" as const,
+ path: "/",
+ httpOnly: true,
+ };
+}
+
+function setTokenCookie(
+ response: NextResponse,
+ sessionKey: string,
+ token: string
+) {
+ response.cookies.set(sessionKey, token, cookieOptions());
+}
+
+function deleteTokenCookie(response: NextResponse, sessionKey: string) {
+ response.cookies.delete(sessionKey);
+}
+
+function setCorsHeaders(res: NextResponse): NextResponse {
+ res.headers.set("Access-Control-Allow-Origin", "*");
+ res.headers.set(
+ "Access-Control-Allow-Methods",
+ "GET, POST, PUT, DELETE, OPTIONS"
+ );
+ res.headers.set(
+ "Access-Control-Allow-Headers",
+ "Content-Type, Authorization"
+ );
+ return res;
+}
+
+function handleCors(req: NextRequest): NextResponse | null {
+ if (req.method === "OPTIONS") {
+ return new NextResponse(null, {
+ status: 204,
+ headers: {
+ "Access-Control-Allow-Origin": "*",
+ "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
+ "Access-Control-Allow-Headers": "Content-Type, Authorization",
+ "Access-Control-Max-Age": "86400",
+ },
+ });
+ }
+ return null;
+}
+
+async function verifyToken({
+ token,
+ encodedKey,
+}: {
+ token: string | undefined;
+ encodedKey: string;
+}): Promise | null> {
+ if (!token) return null;
+
+ try {
+ const enc = new TextEncoder().encode(encodedKey);
+ const { payload } = await jwtVerify(token, enc, { algorithms: ["HS256"] });
+ return (payload.user as Record) || null;
+ } catch (error) {
+ console.error("Token verification failed:", error);
+ return null;
+ }
+}
+
+function unauthorizedResponse() {
+ return new NextResponse(JSON.stringify({ error: "Unauthorized" }), {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ });
+}
+
+function unauthorizedResponseTokenAPI() {
+ return new NextResponse(
+ JSON.stringify({ error: "Unauthorized token on API" }),
+ {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ }
+ );
+}
+
+function unauthorizedResponseTokenPAGE() {
+ return new NextResponse(JSON.stringify({ error: "Unauthorized on page" }), {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ });
+}
+
+function unauthorizedResponseAPI() {
+ return new NextResponse(
+ JSON.stringify({ error: "Unauthorized Response API" }),
+ {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ }
+ );
+}
+
+function unauthorizedResponseValidationAPIRequest() {
+ return new NextResponse(
+ JSON.stringify({ error: "Unauthorized validation api request" }),
+ {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ }
+ );
+}
+
+function unauthorizedResponseAPIUserValidate(req: NextRequest) {
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/waiting-room", req.url))
+ );
+ // return new NextResponse(
+ // JSON.stringify({ error: "Unauthorized api user validate" }),
+ // {
+ // status: 401,
+ // headers: { "Content-Type": "application/json" },
+ // }
+ // );
+}
+
+function unauthorizedResponseDataUserNotFound(req: NextRequest) {
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/invalid-user", req.url))
+ );
+}
+
+function unauthorizedResponseUserNotActive(req: NextRequest) {
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/waiting-room", req.url))
+ );
+}
+
+function unauthorizedResponseUserNotAdmin(req: NextRequest) {
+ return setCorsHeaders(NextResponse.redirect(new URL("/dev/home", req.url)));
+}
+
+async function unauthorizedResponseValidationUser({
+ loginPath,
+ sessionKey,
+ token,
+ req,
+}: {
+ loginPath: string;
+ sessionKey: string;
+ token: string;
+ req: NextRequest;
+}) {
+ const userLogout = await fetch(new URL("/api/auth/logout", req.url), {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (userLogout.ok) {
+ const response = NextResponse.redirect(new URL(loginPath, req.url));
+ deleteTokenCookie(response, sessionKey);
+ return setCorsHeaders(response);
+ }
+
+ console.error("Error logging out user:", await userLogout.json());
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/invalid-user", req.url))
+ );
+}
+
+export const config = {
+ matcher: ["/((?!_next|static|favicon.ico|manifest).*)"],
+};
diff --git a/src/middleware.ts b/src/middleware.v2.back.txt
similarity index 54%
rename from src/middleware.ts
rename to src/middleware.v2.back.txt
index c0c3f708..7b7aea01 100644
--- a/src/middleware.ts
+++ b/src/middleware.v2.back.txt
@@ -5,6 +5,8 @@ import { apies, pages } from "./lib/routes";
type MiddlewareConfig = {
apiPath: string;
loginPath: string;
+ // validasiPath: string;
+ // registarasiPath: string;
userPath: string;
publicRoutes: string[];
encodedKey: string;
@@ -16,16 +18,50 @@ type MiddlewareConfig = {
const middlewareConfig: MiddlewareConfig = {
apiPath: "/api",
loginPath: "/login",
+ // validasiPath: "/validasi",
+ // registarasiPath: "/register",
userPath: "/dev/home",
publicRoutes: [
+ // API
"/",
+ "/api/voting/*",
+ "/api/collaboration/*",
+ "/api/notifikasi/*",
+ "/api/logs/*",
+ "/api/job/*",
"/api/auth/*",
+ "/api/origin-url",
+ "/api/event/*",
+ // "/api/master/*",
+ // "/api/image/*",
+ // "/api/user/*",
+ // "/api/new/*",
+ // ADMIN API
+ // "/api/admin/event/*",
+ // "/api/admin/investasi/*",
+ // "/api/admin/donasi/dashboard/*",
+ // "/api/admin/voting/dashboard/*",
+ // "/api/admin/job/dashboard/*",
+ // "/api/admin/forum/dashboard/*",
+
+ // Akses awal
+ "/api/get-cookie",
+ "/api/user/activation",
+ "/api/user-validate",
+
+ // PAGE
"/login",
"/register",
"/validasi",
"/splash",
+ "/job-vacancy",
+ "/preview-image",
"/auth/login",
"/auth/api/login",
+ "/waiting-room",
+ "/zCoba/*",
+
+ // ASSETS
"/aset/global/main_background.png",
"/aset/logo/logo-hipmi.png",
],
@@ -34,11 +70,14 @@ const middlewareConfig: MiddlewareConfig = {
validationApiRoute: "/api/validation",
log: false,
};
+
export const middleware = async (req: NextRequest) => {
const {
apiPath,
encodedKey,
loginPath,
+ // validasiPath,
+ // registarasiPath,
publicRoutes,
sessionKey,
validationApiRoute,
@@ -53,14 +92,31 @@ export const middleware = async (req: NextRequest) => {
}
// Skip authentication for public routes
- const isPublicRoute = [...publicRoutes, loginPath, validationApiRoute].some(
- (route) => {
- const pattern = route.replace(/\*/g, ".*");
- return new RegExp(`^${pattern}$`).test(pathname);
- }
- );
+ const isPublicRoute = [
+ ...publicRoutes,
+ loginPath,
+ // validasiPath,
+ // registarasiPath,
+ ].some((route) => {
+ const pattern = route.replace(/\*/g, ".*");
+ return new RegExp(`^${pattern}$`).test(pathname);
+ });
- if (isPublicRoute) {
+ // Always protect validation endpoint
+ if (pathname === validationApiRoute) {
+ const reqToken = req.headers.get("Authorization")?.split(" ")[1];
+ if (!reqToken) {
+ return setCorsHeaders(unauthorizedResponse());
+ }
+ }
+
+ if (
+ isPublicRoute &&
+ pathname !== loginPath
+ // &&
+ // pathname !== validasiPath &&
+ // pathname !== registarasiPath
+ ) {
return setCorsHeaders(NextResponse.next());
}
@@ -68,24 +124,71 @@ export const middleware = async (req: NextRequest) => {
req.cookies.get(sessionKey)?.value ||
req.headers.get("Authorization")?.split(" ")[1];
+ // ==================== Authentication: Login, Validasi, Registrasi ==================== //
// Token verification
const user = await verifyToken({ token, encodedKey });
+ console.log("middlaware console:", user);
+
+ // Handle login page access
+ if (pathname === loginPath) {
+ console.log("cek pathname >>", pathname);
+ if (user) {
+ console.log("sudah login, cek user >>", user);
+ return setCorsHeaders(NextResponse.redirect(new URL(userPath, req.url)));
+ }
+ return setCorsHeaders(NextResponse.next());
+ }
if (!user) {
- if (pathname.startsWith(apiPath)) {
- return setCorsHeaders(unauthorizedResponse());
- }
-
return setCorsHeaders(NextResponse.redirect(new URL(loginPath, req.url)));
}
- // Redirect authenticated user away from login page
- if (user && pathname === loginPath) {
- return setCorsHeaders(NextResponse.redirect(new URL(userPath, req.url)));
+ // // Handle validation page access
+ // if (pathname === validasiPath) {
+ // if (user) {
+ // return setCorsHeaders(NextResponse.redirect(new URL(userPath, req.url)));
+ // }
+ // return setCorsHeaders(NextResponse.next());
+ // }
+
+ // // Handle register page access
+ // if (pathname === registarasiPath) {
+ // if (user) {
+ // return setCorsHeaders(NextResponse.redirect(new URL(userPath, req.url)));
+ // }
+ // return setCorsHeaders(NextResponse.next());
+ // }
+
+ // Handle protected routes
+ // if (!user) {
+ // return setCorsHeaders(NextResponse.redirect(new URL(loginPath, req.url)));
+ // }
+ // ==================== Authentication: Login, Validasi, Registrasi ==================== //
+
+ if (pathname.startsWith("/dev")) {
+ const userValidate = await fetch(new URL("/api/user-validate", req.url), {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ const userValidateJson = await userValidate.json();
+
+ if (!userValidateJson.data.active) {
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/waiting-room", req.url))
+ );
+ }
}
- if (req.nextUrl.pathname.startsWith(apiPath)) {
+ // Handle authenticated API requests
+ if (pathname.startsWith(apiPath)) {
const reqToken = req.headers.get("Authorization")?.split(" ")[1];
+ if (!reqToken) {
+ return setCorsHeaders(unauthorizedResponse());
+ }
+
// Validate user access with external API
const validationResponse = await fetch(
new URL(validationApiRoute, req.url),
@@ -100,6 +203,8 @@ export const middleware = async (req: NextRequest) => {
if (!validationResponse.ok) {
return setCorsHeaders(unauthorizedResponse());
}
+
+ const dataJson = await validationResponse.json();
}
// Proceed with the request
diff --git a/src/middleware.v3.back.txt b/src/middleware.v3.back.txt
new file mode 100644
index 00000000..5f86f614
--- /dev/null
+++ b/src/middleware.v3.back.txt
@@ -0,0 +1,244 @@
+import { NextRequest, NextResponse } from "next/server";
+import { jwtVerify } from "jose";
+
+type MiddlewareConfig = {
+ apiPath: string;
+ loginPath: string;
+ userPath: string;
+ publicRoutes: string[];
+ encodedKey: string;
+ sessionKey: string;
+ validationApiRoute: string;
+ log: boolean;
+};
+
+const middlewareConfig: MiddlewareConfig = {
+ apiPath: "/api",
+ loginPath: "/login",
+ userPath: "/dev/home",
+ publicRoutes: [
+ "/",
+ "/api/voting/*",
+ "/api/collaboration/*",
+ "/api/notifikasi/*",
+ "/api/logs/*",
+ "/api/job/*",
+ "/api/auth/*",
+ "/api/origin-url",
+ "/api/event/*",
+ "/api/get-cookie",
+ "/api/user/activation",
+ "/api/user-validate",
+ "/login",
+ "/register",
+ "/validasi",
+ "/splash",
+ "/job-vacancy",
+ "/preview-image",
+ "/auth/login",
+ "/auth/api/login",
+ "/waiting-room",
+ "/zCoba/*",
+ "/aset/global/main_background.png",
+ "/aset/logo/logo-hipmi.png",
+ ],
+ encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
+ sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
+ validationApiRoute: "/api/validation",
+ log: false,
+};
+
+export const middleware = async (req: NextRequest) => {
+ const {
+ apiPath,
+ encodedKey,
+ loginPath,
+ publicRoutes,
+ sessionKey,
+ validationApiRoute,
+ userPath,
+ } = middlewareConfig;
+
+ const { pathname } = req.nextUrl;
+
+ // Handle CORS
+ const corsResponse = handleCors(req);
+ if (corsResponse) {
+ return corsResponse;
+ }
+
+ // Check if route is public
+ const isPublicRoute = isRoutePublic(pathname, publicRoutes, loginPath);
+ if (isPublicRoute && pathname !== loginPath) {
+ return setCorsHeaders(NextResponse.next());
+ }
+
+ // Get token from cookies or Authorization header
+ const token = getToken(req, sessionKey);
+
+ // Verify token and get user data
+ const user = await verifyToken({ token, encodedKey });
+
+ // Handle login page access
+ if (pathname === loginPath) {
+ if (user) {
+ const response = NextResponse.redirect(new URL(userPath, req.url));
+ // Preserve token in cookie when redirecting
+ if (token) {
+ response.cookies.set(sessionKey, token, {
+ httpOnly: true,
+ secure: process.env.NODE_ENV === 'production',
+ sameSite: 'lax',
+ path: '/'
+ });
+ }
+ return setCorsHeaders(response);
+ }
+ return setCorsHeaders(NextResponse.next());
+ }
+
+ // Redirect to login if no user found
+ if (!user) {
+ const response = NextResponse.redirect(new URL(loginPath, req.url));
+ // Clear invalid token
+ response.cookies.delete(sessionKey);
+ return setCorsHeaders(response);
+ }
+
+ // Handle /dev routes that require active status
+ if (pathname.startsWith("/dev")) {
+ try {
+ const userValidate = await fetch(new URL("/api/user-validate", req.url), {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!userValidate.ok) {
+ throw new Error('Failed to validate user');
+ }
+
+ const userValidateJson = await userValidate.json();
+
+ if (!userValidateJson.data.active) {
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/waiting-room", req.url))
+ );
+ }
+ } catch (error) {
+ console.error('Error validating user:', error);
+ return setCorsHeaders(unauthorizedResponse());
+ }
+ }
+
+ // Handle API requests
+ if (pathname.startsWith(apiPath)) {
+ if (!token) {
+ return setCorsHeaders(unauthorizedResponse());
+ }
+
+ try {
+ const validationResponse = await fetch(
+ new URL(validationApiRoute, req.url),
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ if (!validationResponse.ok) {
+ throw new Error('Failed to validate API request');
+ }
+ } catch (error) {
+ console.error('Error validating API request:', error);
+ return setCorsHeaders(unauthorizedResponse());
+ }
+ }
+
+ const response = NextResponse.next();
+ // Ensure token is preserved in cookie
+ if (token) {
+ response.cookies.set(sessionKey, token, {
+ httpOnly: true,
+ secure: process.env.NODE_ENV === 'production',
+ sameSite: 'lax',
+ path: '/'
+ });
+ }
+ return setCorsHeaders(response);
+};
+
+function isRoutePublic(pathname: string, publicRoutes: string[], loginPath: string): boolean {
+ return [...publicRoutes, loginPath].some((route) => {
+ const pattern = route.replace(/\*/g, ".*");
+ return new RegExp(`^${pattern}$`).test(pathname);
+ });
+}
+
+function getToken(req: NextRequest, sessionKey: string): string | undefined {
+ return req.cookies.get(sessionKey)?.value ||
+ req.headers.get("Authorization")?.split(" ")[1];
+}
+
+function unauthorizedResponse(): NextResponse {
+ return new NextResponse(JSON.stringify({ error: "Unauthorized" }), {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ });
+}
+
+function setCorsHeaders(res: NextResponse): NextResponse {
+ res.headers.set("Access-Control-Allow-Origin", "*");
+ res.headers.set(
+ "Access-Control-Allow-Methods",
+ "GET, POST, PUT, DELETE, OPTIONS"
+ );
+ res.headers.set(
+ "Access-Control-Allow-Headers",
+ "Content-Type, Authorization"
+ );
+ return res;
+}
+
+function handleCors(req: NextRequest): NextResponse | null {
+ if (req.method === "OPTIONS") {
+ return new NextResponse(null, {
+ status: 204,
+ headers: {
+ "Access-Control-Allow-Origin": "*",
+ "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
+ "Access-Control-Allow-Headers": "Content-Type, Authorization",
+ "Access-Control-Max-Age": "86400",
+ },
+ });
+ }
+ return null;
+}
+
+async function verifyToken({
+ token,
+ encodedKey,
+}: {
+ token: string | undefined;
+ encodedKey: string;
+}): Promise | null> {
+ if (!token) return null;
+
+ try {
+ const enc = new TextEncoder().encode(encodedKey);
+ const { payload } = await jwtVerify(token, enc, {
+ algorithms: ["HS256"],
+ });
+ return (payload.user as Record) || null;
+ } catch (error) {
+ console.error("Token verification failed:", error);
+ return null;
+ }
+}
+
+export const config = {
+ matcher: ["/((?!_next|static|favicon.ico|manifest).*)"],
+};
\ No newline at end of file
diff --git a/src/middleware.v4.back.txt b/src/middleware.v4.back.txt
new file mode 100644
index 00000000..2e884344
--- /dev/null
+++ b/src/middleware.v4.back.txt
@@ -0,0 +1,275 @@
+import { jwtVerify } from "jose";
+import { NextRequest, NextResponse } from "next/server";
+
+type MiddlewareConfig = {
+ apiPath: string;
+ loginPath: string;
+ // validasiPath: string;
+ // registarasiPath: string;
+ userPath: string;
+ publicRoutes: string[];
+ encodedKey: string;
+ sessionKey: string;
+ validationApiRoute: string;
+ log: boolean;
+};
+
+const middlewareConfig: MiddlewareConfig = {
+ apiPath: "/api",
+ loginPath: "/login",
+ // validasiPath: "/validasi",
+ // registarasiPath: "/register",
+ userPath: "/dev/home",
+ publicRoutes: [
+ // API
+ "/",
+ "/api/voting/*",
+ "/api/collaboration/*",
+ "/api/notifikasi/*",
+ "/api/logs/*",
+ "/api/auth/*",
+ "/api/origin-url",
+ "/api/job*",
+ // "/api/event/*",
+
+ // ADMIN API
+ // >> buat dibawah sini <<
+ "/api/admin/donasi/*",
+ "/api/admin/investasi/*",
+ "/api/admin/collaboration/*",
+
+ // Akses awal
+ "/api/get-cookie",
+ "/api/user/activation",
+ "/api/user-validate",
+
+ // PAGE
+ "/login",
+ "/register",
+ "/validasi",
+ "/splash",
+ "/invalid-user",
+ "/job-vacancy",
+ "/preview-image",
+ "/auth/login",
+ "/auth/api/login",
+ "/waiting-room",
+ "/zCoba/*",
+
+ // ASSETS
+ "/aset/global/main_background.png",
+ "/aset/logo/logo-hipmi.png",
+ ],
+ encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
+ sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
+ validationApiRoute: "/api/validation",
+ log: false,
+};
+
+export const middleware = async (req: NextRequest) => {
+ const {
+ apiPath,
+ encodedKey,
+ loginPath,
+ publicRoutes,
+ sessionKey,
+ validationApiRoute,
+ userPath,
+ } = middlewareConfig;
+
+ const { pathname } = req.nextUrl;
+
+ // Handle CORS
+ const corsResponse = handleCors(req);
+ if (corsResponse) {
+ return corsResponse;
+ }
+
+ // Check if route is public
+ const isPublicRoute = isRoutePublic(pathname, publicRoutes, loginPath);
+ if (isPublicRoute && pathname !== loginPath) {
+ console.log("Public route accessed:", isPublicRoute);
+ return setCorsHeaders(NextResponse.next());
+ }
+
+ // Get token from cookies or Authorization header
+ const token = getToken(req, sessionKey);
+
+ // Verify token and get user data
+ const user = await verifyToken({ token, encodedKey });
+
+ // Handle login page access
+ if (pathname === loginPath) {
+ if (user) {
+ const response = NextResponse.redirect(new URL(userPath, req.url));
+ // Preserve token in cookie when redirecting
+ if (token) {
+ response.cookies.set(sessionKey, token, {
+ // httpOnly: true,
+ secure: process.env.NODE_ENV === "production",
+ sameSite: "lax",
+ path: "/",
+ });
+ }
+ return setCorsHeaders(response);
+ }
+ return setCorsHeaders(NextResponse.next());
+ }
+
+ // Redirect to login if no user found
+ if (!user) {
+ const response = NextResponse.redirect(new URL(loginPath, req.url));
+ // Clear invalid token
+ response.cookies.delete(sessionKey);
+ return setCorsHeaders(response);
+ }
+
+ // Handle API requests
+ if (pathname.startsWith(apiPath)) {
+ if (!token) {
+ return setCorsHeaders(unauthorizedResponse());
+ }
+
+ try {
+ const validationResponse = await fetch(
+ new URL(validationApiRoute, req.url),
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ if (!validationResponse.ok) {
+ throw new Error("Failed to validate API request");
+ }
+ } catch (error) {
+ console.error("Error validating API request:", error);
+ return setCorsHeaders(unauthorizedResponse());
+ }
+ }
+
+ // Handle /dev routes that require active status
+ if (pathname.startsWith("/dev")) {
+ try {
+ const userValidate = await fetch(new URL("/api/user-validate", req.url), {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (!userValidate.ok) {
+ throw new Error("Failed to validate user");
+ }
+
+ const userValidateJson = await userValidate.json();
+
+ if (userValidateJson.success == true && userValidateJson.data == null) {
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/invalid-user", req.url))
+ );
+ }
+
+ if (!userValidateJson.data.active) {
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/waiting-room", req.url))
+ );
+ }
+ } catch (error) {
+ console.error("Error validating user:", error);
+ return setCorsHeaders(unauthorizedResponse());
+ }
+ }
+
+ const response = NextResponse.next();
+ // Ensure token is preserved in cookie
+ if (token) {
+ response.cookies.set(sessionKey, token, {
+ // httpOnly: true,
+ secure: process.env.NODE_ENV === "production",
+ sameSite: "lax",
+ path: "/",
+ });
+ }
+ return setCorsHeaders(response);
+};
+
+function isRoutePublic(
+ pathname: string,
+ publicRoutes: string[],
+ loginPath: string
+): boolean {
+ return [...publicRoutes, loginPath].some((route) => {
+ const pattern = route.replace(/\*/g, ".*");
+ return new RegExp(`^${pattern}$`).test(pathname);
+ });
+}
+
+function getToken(req: NextRequest, sessionKey: string): string | undefined {
+ return (
+ req.cookies.get(sessionKey)?.value ||
+ req.headers.get("Authorization")?.split(" ")[1]
+ );
+}
+
+function unauthorizedResponse(): NextResponse {
+ return new NextResponse(JSON.stringify({ error: "Unauthorized" }), {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ });
+}
+
+function setCorsHeaders(res: NextResponse): NextResponse {
+ res.headers.set("Access-Control-Allow-Origin", "*");
+ res.headers.set(
+ "Access-Control-Allow-Methods",
+ "GET, POST, PUT, DELETE, OPTIONS"
+ );
+ res.headers.set(
+ "Access-Control-Allow-Headers",
+ "Content-Type, Authorization"
+ );
+ return res;
+}
+
+function handleCors(req: NextRequest): NextResponse | null {
+ if (req.method === "OPTIONS") {
+ return new NextResponse(null, {
+ status: 204,
+ headers: {
+ "Access-Control-Allow-Origin": "*",
+ "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
+ "Access-Control-Allow-Headers": "Content-Type, Authorization",
+ "Access-Control-Max-Age": "86400",
+ },
+ });
+ }
+ return null;
+}
+
+async function verifyToken({
+ token,
+ encodedKey,
+}: {
+ token: string | undefined;
+ encodedKey: string;
+}): Promise | null> {
+ if (!token) return null;
+
+ try {
+ const enc = new TextEncoder().encode(encodedKey);
+ const { payload } = await jwtVerify(token, enc, {
+ algorithms: ["HS256"],
+ });
+ return (payload.user as Record) || null;
+ } catch (error) {
+ console.error("Token verification failed:", error);
+ return null;
+ }
+}
+
+export const config = {
+ matcher: ["/((?!_next|static|favicon.ico|manifest).*)"],
+};
diff --git a/src/middleware5.back.txt b/src/middleware5.back.txt
new file mode 100644
index 00000000..8bbd52cc
--- /dev/null
+++ b/src/middleware5.back.txt
@@ -0,0 +1,371 @@
+import { jwtVerify } from "jose";
+import { NextRequest, NextResponse } from "next/server";
+
+type MiddlewareConfig = {
+ apiPath: string;
+ loginPath: string;
+ // validasiPath: string;
+ // registarasiPath: string;
+ userPath: string;
+ publicRoutes: string[];
+ encodedKey: string;
+ sessionKey: string;
+ validationApiRoute: string;
+ log: boolean;
+};
+
+const middlewareConfig: MiddlewareConfig = {
+ apiPath: "/api",
+ loginPath: "/login",
+ // validasiPath: "/validasi",
+ // registarasiPath: "/register",
+ userPath: "/dev/home",
+ publicRoutes: [
+ // API
+ "/",
+ "/api/voting/*",
+ "/api/collaboration/*",
+ "/api/notifikasi/*",
+ "/api/logs/*",
+ "/api/auth/*",
+ // "/api/origin-url",
+ // "/api/job*",
+
+ // ADMIN API
+ // >> buat dibawah sini <<
+ "/api/admin/donasi/*",
+ "/api/admin/investasi/*",
+ "/api/admin/collaboration/*",
+
+ // Akses awal
+ "/api/get-cookie",
+ "/api/user/activation",
+ "/api/user-validate",
+ "/api/version",
+
+ // PAGE
+ "/login",
+ "/register",
+ "/validasi",
+ "/splash",
+ "/invalid-user",
+ "/job-vacancy",
+ "/preview-image",
+ "/auth/login",
+ "/auth/api/login",
+ "/waiting-room",
+ "/zCoba/*",
+
+ // ASSETS
+ "/aset/global/main_background.png",
+ "/aset/logo/logo-hipmi.png",
+ ],
+ encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
+ sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
+ validationApiRoute: "/api/validation",
+ log: false,
+};
+
+export const middleware = async (req: NextRequest) => {
+ const {
+ apiPath,
+ encodedKey,
+ loginPath,
+ publicRoutes,
+ sessionKey,
+ validationApiRoute,
+ userPath,
+ } = middlewareConfig;
+
+ const { pathname } = req.nextUrl;
+
+ // Handle CORS
+ const corsResponse = handleCors(req);
+ if (corsResponse) {
+ return corsResponse;
+ }
+
+ // Check if route is public
+ const isPublicRoute = isRoutePublic(pathname, publicRoutes, loginPath);
+ if (isPublicRoute && pathname !== loginPath) {
+ return setCorsHeaders(NextResponse.next());
+ }
+
+ // Get token from cookies or Authorization header
+ const token = getToken(req, sessionKey);
+ const user = await verifyToken({ token, encodedKey });
+
+ // Handle login page access
+ if (pathname === loginPath) {
+ if (user) {
+ const response = NextResponse.redirect(new URL(userPath, req.url));
+ // Preserve token in cookie when redirecting
+ if (token) {
+ response.cookies.set(sessionKey, token, {
+ // httpOnly: true,
+ secure: process.env.NODE_ENV === "production",
+ sameSite: "lax",
+ path: "/",
+ });
+ }
+ return setCorsHeaders(response);
+ }
+ return setCorsHeaders(NextResponse.next());
+ }
+
+ // Redirect to login if no user found
+ if (!user) {
+ const response = NextResponse.redirect(new URL(loginPath, req.url));
+ // Clear invalid token
+ response.cookies.delete(sessionKey);
+ return setCorsHeaders(response);
+ }
+
+ // Handle API requests
+ if (pathname.startsWith(apiPath)) {
+ // const reqToken = req.headers.get("Authorization")?.split(" ")[1];
+ if (!token) {
+ return setCorsHeaders(unauthorizedResponseTokenAPI());
+ }
+
+ try {
+ // const origin = new URL(req.url).origin;
+ // console.log("origin", origin);
+
+ const validationResponse = await fetch(
+ `${new URL(req.url).origin}/api/validation`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ if (!validationResponse.ok) {
+ return setCorsHeaders(unauthorizedResponseAPI());
+ }
+ } catch (error) {
+ console.error("Error validating API request:", error);
+ return setCorsHeaders(unauthorizedResponseValidationAPIRequest());
+ }
+ }
+
+ // Handle /dev routes that require active status
+ if (pathname.startsWith("/dev")) {
+ try {
+ const userValidate = await fetch(
+ new URL(req.url).origin + "/api/user-validate",
+ {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+
+ if (!userValidate.ok) {
+ throw new Error("Failed to validate user");
+ }
+
+ const userValidateJson = await userValidate.json();
+
+ if (userValidateJson.success == true && !userValidateJson.data) {
+ unauthorizedResponseDataUserNotFound(req);
+ }
+
+ if (!userValidateJson.data.active) {
+ return setCorsHeaders(unauthorizedResponseUserNotActive(req));
+ }
+ } catch (error) {
+ console.error("Error validating user:", error);
+ if (!token) {
+ console.error("Token is undefined");
+ return setCorsHeaders(unauthorizedResponseTokenPAGE());
+ }
+ return setCorsHeaders(
+ await unauthorizedResponseValidationUser({
+ loginPath,
+ sessionKey,
+ token,
+ req,
+ })
+ );
+ }
+ }
+
+ const response = NextResponse.next();
+ // Ensure token is preserved in cookie
+ if (token) {
+ response.cookies.set(sessionKey, token, {
+ // httpOnly: true,
+ secure: process.env.NODE_ENV === "production",
+ sameSite: "lax",
+ path: "/",
+ });
+ }
+ return setCorsHeaders(response);
+};
+
+function isRoutePublic(
+ pathname: string,
+ publicRoutes: string[],
+ loginPath: string
+): boolean {
+ return [...publicRoutes, loginPath].some((route) => {
+ const pattern = route.replace(/\*/g, ".*");
+ return new RegExp(`^${pattern}$`).test(pathname);
+ });
+}
+
+function getToken(req: NextRequest, sessionKey: string): string | undefined {
+ return (
+ req.cookies.get(sessionKey)?.value ||
+ req.headers.get("Authorization")?.split(" ")[1]
+ );
+}
+
+function unauthorizedResponse() {
+ return new NextResponse(JSON.stringify({ error: "Unauthorized" }), {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ });
+}
+
+function unauthorizedResponseTokenAPI() {
+ return new NextResponse(
+ JSON.stringify({ error: "Unauthorized token on API" }),
+ {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ }
+ );
+}
+
+function unauthorizedResponseTokenPAGE() {
+ return new NextResponse(JSON.stringify({ error: "Unauthorized on page" }), {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ });
+}
+
+function unauthorizedResponseAPI() {
+ return new NextResponse(
+ JSON.stringify({ error: "Unauthorized Response API" }),
+ {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ }
+ );
+}
+
+function unauthorizedResponseValidationAPIRequest() {
+ return new NextResponse(
+ JSON.stringify({ error: "Unauthorized validation api request" }),
+ {
+ status: 401,
+ headers: { "Content-Type": "application/json" },
+ }
+ );
+}
+
+function unauthorizedResponseDataUserNotFound(req: NextRequest) {
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/invalid-user", req.url))
+ );
+}
+
+function unauthorizedResponseUserNotActive(req: NextRequest) {
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/waiting-room", req.url))
+ );
+}
+
+async function unauthorizedResponseValidationUser({
+ loginPath,
+ sessionKey,
+ token,
+ req,
+}: {
+ loginPath: string;
+ sessionKey: string;
+ token: string;
+ req: NextRequest;
+}) {
+ const userLogout = await fetch(new URL("/api/auth/logout", req.url), {
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ });
+
+ if (userLogout.ok) {
+ const response = NextResponse.redirect(new URL(loginPath, req.url));
+ // Clear invalid token
+ response.cookies.delete(sessionKey);
+ return setCorsHeaders(response);
+ }
+ console.error("Error logging out user:", await userLogout.json());
+ return setCorsHeaders(
+ NextResponse.redirect(new URL("/invalid-user", req.url))
+ );
+ // return setCorsHeaders(
+ // new NextResponse(JSON.stringify({ error: "Logout failed" }), {
+ // status: 500,
+ // headers: { "Content-Type": "application/json" },
+ // })
+ // );
+}
+
+function setCorsHeaders(res: NextResponse): NextResponse {
+ res.headers.set("Access-Control-Allow-Origin", "*");
+ res.headers.set(
+ "Access-Control-Allow-Methods",
+ "GET, POST, PUT, DELETE, OPTIONS"
+ );
+ res.headers.set(
+ "Access-Control-Allow-Headers",
+ "Content-Type, Authorization"
+ );
+ return res;
+}
+
+function handleCors(req: NextRequest): NextResponse | null {
+ if (req.method === "OPTIONS") {
+ return new NextResponse(null, {
+ status: 204,
+ headers: {
+ "Access-Control-Allow-Origin": "*",
+ "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
+ "Access-Control-Allow-Headers": "Content-Type, Authorization",
+ "Access-Control-Max-Age": "86400",
+ },
+ });
+ }
+ return null;
+}
+
+async function verifyToken({
+ token,
+ encodedKey,
+}: {
+ token: string | undefined;
+ encodedKey: string;
+}): Promise | null> {
+ if (!token) return null;
+
+ try {
+ const enc = new TextEncoder().encode(encodedKey);
+ const { payload } = await jwtVerify(token, enc, {
+ algorithms: ["HS256"],
+ });
+ return (payload.user as Record) || null;
+ } catch (error) {
+ console.error("Token verification failed:", error);
+ return null;
+ }
+}
+
+export const config = {
+ matcher: ["/((?!_next|static|favicon.ico|manifest).*)"],
+};
diff --git a/src/util/backendLogger.ts b/src/util/backendLogger.ts
new file mode 100644
index 00000000..9a8e3d30
--- /dev/null
+++ b/src/util/backendLogger.ts
@@ -0,0 +1,37 @@
+// src/utils/backendLogger.ts
+import winston from "winston";
+import DailyRotateFile from "winston-daily-rotate-file";
+import path from "path";
+
+const backendLogger = winston.createLogger({
+ level: "info",
+ format: winston.format.combine(
+ winston.format.timestamp(),
+ winston.format.json()
+ ),
+ transports: [
+ // Error logs
+ new DailyRotateFile({
+ filename: path.join("logs/backend/error-%DATE%.log"),
+ datePattern: "YYYY-MM-DD",
+ level: "error",
+ zippedArchive: true,
+ maxSize: "20m",
+ maxFiles: "14d",
+ }),
+ // Combined logs
+ new DailyRotateFile({
+ filename: path.join("logs/backend/combined-%DATE%.log"),
+ datePattern: "YYYY-MM-DD",
+ zippedArchive: true,
+ maxSize: "20m",
+ maxFiles: "14d",
+ }),
+ // Console output in development
+ ...(process.env.NODE_ENV !== "production"
+ ? [new winston.transports.Console()]
+ : []),
+ ],
+});
+
+export default backendLogger;
diff --git a/src/util/clientLogger.ts b/src/util/clientLogger.ts
new file mode 100644
index 00000000..4782df23
--- /dev/null
+++ b/src/util/clientLogger.ts
@@ -0,0 +1,87 @@
+// src/utils/clientLogger.ts
+interface LogEntry {
+ level: "info" | "warn" | "error";
+ message: string;
+ data?: any;
+ timestamp?: string;
+}
+
+class ClientLogger {
+ private queue: LogEntry[] = [];
+ private readonly maxQueueSize: number = 10;
+ private readonly apiEndpoint: string = "/api/logs";
+ private isSending: boolean = false;
+
+ private async sendLogs(): Promise {
+ if (this.isSending || this.queue.length === 0) return;
+
+ this.isSending = true;
+ const logsToSend = [...this.queue];
+ this.queue = [];
+
+ try {
+ const response = await fetch(this.apiEndpoint, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(logsToSend),
+ });
+
+ if (!response.ok) {
+ console.error("Failed to send logs:", response.statusText);
+ // Restore logs to queue if send failed
+ this.queue = [...logsToSend, ...this.queue];
+ }
+ } catch (error) {
+ console.error("Error sending logs:", error);
+ // Restore logs to queue if send failed
+ this.queue = [...logsToSend, ...this.queue];
+ } finally {
+ this.isSending = false;
+ }
+ }
+
+ private addToQueue(entry: LogEntry): void {
+ this.queue.push({
+ ...entry,
+ timestamp: new Date().toISOString(),
+ });
+
+ if (this.queue.length >= this.maxQueueSize) {
+ this.sendLogs();
+ }
+ }
+
+ public info(message: string, data?: any): void {
+ this.addToQueue({ level: "info", message, data });
+ }
+
+ public warn(message: string, data?: any): void {
+ this.addToQueue({ level: "warn", message, data });
+ // Send immediately for warnings
+ this.sendLogs();
+ }
+
+ public error(message: string, error?: Error | any): void {
+ const errorData =
+ error instanceof Error
+ ? {
+ name: error.name,
+ message: error.message,
+ stack: error.stack,
+ }
+ : error;
+
+ this.addToQueue({ level: "error", message, data: errorData });
+ // Send immediately for errors
+ this.sendLogs();
+ }
+
+ // Flush remaining logs (useful when page is about to unload)
+ public flush(): void {
+ this.sendLogs();
+ }
+}
+
+export const clientLogger = new ClientLogger();
diff --git a/src/util/frontendLogger.ts b/src/util/frontendLogger.ts
new file mode 100644
index 00000000..6eff4277
--- /dev/null
+++ b/src/util/frontendLogger.ts
@@ -0,0 +1,101 @@
+// utils/frontend-logger.ts
+import winston from "winston";
+import DailyRotateFile from "winston-daily-rotate-file";
+import path from "path";
+
+// Define log levels and their priorities
+const levels = {
+ error: 0,
+ warn: 1,
+ info: 2,
+ debug: 3,
+};
+
+// Define interface for log entries
+export interface LogEntry {
+ level: keyof typeof levels;
+ message: string;
+ data?: any;
+ timestamp?: string;
+ userAgent?: string;
+ ip?: string;
+ url?: string;
+}
+
+// Custom format for log entries
+const logFormat = winston.format.combine(
+ winston.format.timestamp({
+ format: "YYYY-MM-DD HH:mm:ss",
+ }),
+ winston.format.metadata({ fillExcept: ["message", "level", "timestamp"] }),
+ winston.format.json()
+);
+
+// Create the logger instance
+const frontendLogger: winston.Logger = winston.createLogger({
+ levels,
+ level: process.env.LOG_LEVEL || "info",
+ format: logFormat,
+ transports: [
+ // Daily Rotate File for errors
+ new DailyRotateFile({
+ filename: path.join(process.cwd(), "logs/frontend/error-%DATE%.log"),
+ datePattern: "YYYY-MM-DD",
+ zippedArchive: true,
+ maxSize: "20m",
+ maxFiles: "14d",
+ level: "error",
+ format: logFormat,
+ }),
+
+ // Daily Rotate File for all logs
+ new DailyRotateFile({
+ filename: path.join(process.cwd(), "logs/frontend/combined-%DATE%.log"),
+ datePattern: "YYYY-MM-DD",
+ zippedArchive: true,
+ maxSize: "20m",
+ maxFiles: "14d",
+ format: logFormat,
+ }),
+ ],
+ // Handle errors from the logger itself
+ exitOnError: false,
+});
+
+// Add console transport in development
+if (process.env.NODE_ENV !== "production") {
+ frontendLogger.add(
+ new winston.transports.Console({
+ format: winston.format.combine(
+ winston.format.colorize(),
+ winston.format.simple()
+ ),
+ })
+ );
+}
+
+// Helper functions for type-safe logging
+export function logError(message: string, data?: any) {
+ frontendLogger.error(message, { data });
+}
+
+export function logWarn(message: string, data?: any) {
+ frontendLogger.warn(message, { data });
+}
+
+export function logInfo(message: string, data?: any) {
+ frontendLogger.info(message, { data });
+}
+
+export function logDebug(message: string, data?: any) {
+ frontendLogger.debug(message, { data });
+}
+
+// Helper function for dynamic logging
+export function log(entry: LogEntry) {
+ const { level, message, ...metadata } = entry;
+ frontendLogger[level](message, metadata);
+}
+
+// Export the logger instance as default
+export default frontendLogger;
diff --git a/test/coba.test.ts b/test/coba.test.ts
new file mode 100644
index 00000000..1cc5d3e1
--- /dev/null
+++ b/test/coba.test.ts
@@ -0,0 +1,9 @@
+import { prisma } from "@/lib";
+import { describe, test, expect } from "bun:test";
+
+describe("coba test", () => {
+ test("coba", async () => {
+ const user = await prisma.user.findMany();
+ expect(user).not.toBeEmpty();
+ });
+});
diff --git a/types/env.d.ts b/types/env.d.ts
new file mode 100644
index 00000000..d85d4b56
--- /dev/null
+++ b/types/env.d.ts
@@ -0,0 +1,15 @@
+declare namespace NodeJS {
+ interface ProcessEnv {
+ DATABASE_URL?: string;
+ WIBU_PWD?: string;
+ Client_KEY?: string;
+ Server_KEY?: string;
+ MAPBOX_TOKEN?: string;
+ WS_APIKEY?: string;
+ NEXT_PUBLIC_WIBU_REALTIME_TOKEN?: string;
+ NEXT_PUBLIC_BASE_TOKEN_KEY?: string;
+ NEXT_PUBLIC_BASE_SESSION_KEY?: string;
+ NEXT_PUBLIC_API_URL?: string;
+ }
+}
+
diff --git a/x-example-show-pdf/index.html b/x-example-show-pdf/index.html
new file mode 100644
index 00000000..3aeee7f1
--- /dev/null
+++ b/x-example-show-pdf/index.html
@@ -0,0 +1,44 @@
+
+
+
+
+
+ Document
+
+
+
+
+
+
+
diff --git a/x.sh b/x.sh
index 7eb36730..5fcf5302 100644
--- a/x.sh
+++ b/x.sh
@@ -1 +1,7 @@
-# Test sh
\ No newline at end of file
+TOKEN="eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7ImlkIjoiY202MGc3eDR2MDAwODEyNHVsbmg0MDR6bSIsIm5vbW9yIjoiNjI4MTMzOTE1ODkxMSIsInVzZXJuYW1lIjoiQmFnYXNfYmFudW5hIiwiYWN0aXZlIjp0cnVlLCJtYXN0ZXJVc2VyUm9sZUlkIjoiMSJ9LCJpYXQiOjE3NDQwOTQyMjQsImV4cCI6MTk2NDk5NzQyNH0.ByTKFPpcL6oljeizWkUM4Z0jaWzc9oPrkpCCImQY3KE"
+URL="https://stg-hipmi.wibudev.com"
+# curl -X GET -H "Authorization: Bearer $TOKEN" ${URL}/api/middleware
+
+
+
+curl -X GET -H "Cookie: hipmi-key=$TOKEN; user_id=789" ${URL}/dev/home | tee test.html
diff --git a/xcoba.sh b/xcoba.sh
deleted file mode 100644
index 47e2a998..00000000
--- a/xcoba.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-ffmpeg -f avfoundation \
--i "1:0" \
--s 1280x720 \
--framerate 30 \
--c:v libx264 \
--preset ultrafast \
--tune zerolatency \
--b:v 3000k \
--c:a aac \
--b:a 192k \
--vf "format=uyvy422" \
--f flv "rtmp://192.168.1.243:1935/live/bagas" \
--probesize 10M
\ No newline at end of file
diff --git a/xserver/index.html b/xserver/index.html
new file mode 100644
index 00000000..e443fc18
--- /dev/null
+++ b/xserver/index.html
@@ -0,0 +1,471 @@
+
+
+
+
+
+ HIPMI Feature Checklist
+
+
+
+ HIPMI Feature Checklist
+
+
+
+
+
Authentication
+
+
+
Profile
+
+
+
Portofolio
+
+
+
User Search
+
+
+
Business Map
+
+
+
Event
+
+
+
Collaboration
+
+
+
Voting
+
+
+
Investasi
+
+
+
Donasi
+
+
+
Job
+
+
+
Forum
+
+
+
+ Reset Semua Checklist
+
+
+
+
diff --git a/zCoba.js b/zCoba.js
index 2d066471..cd3fd16f 100644
--- a/zCoba.js
+++ b/zCoba.js
@@ -1,25 +1,28 @@
-const data = [
- {
- authorId: "clx8pl7r90005su4mldioo0v1",
- Donasi: {
- id: "clyr304q0000410ljvzms3mag",
- title: "Donasi Bencana Alam Aceh",
- },
- },
- {
- authorId: "clx8pl7r90005su4mldioo0v1",
- Donasi: {
- id: "clyr304q0000410ljvzms3mag",
- title: "Donasi Bencana Alam Aceh",
- },
- },
- {
- authorId: "clycka5eu0001ina3i1ssgze9",
- Donasi: {
- id: "clyr304q0000410ljvzms3mag",
- title: "Donasi Bencana Alam Aceh",
- },
- },
-];
+// const data = [
+// {
+// authorId: "clx8pl7r90005su4mldioo0v1",
+// Donasi: {
+// id: "clyr304q0000410ljvzms3mag",
+// title: "Donasi Bencana Alam Aceh",
+// },
+// },
+// {
+// authorId: "clx8pl7r90005su4mldioo0v1",
+// Donasi: {
+// id: "clyr304q0000410ljvzms3mag",
+// title: "Donasi Bencana Alam Aceh",
+// },
+// },
+// {
+// authorId: "clycka5eu0001ina3i1ssgze9",
+// Donasi: {
+// id: "clyr304q0000410ljvzms3mag",
+// title: "Donasi Bencana Alam Aceh",
+// },
+// },
+// ];
+
+console.error("errornya disini klik aja",import.meta.url);
console.log(new Set(data.map((d) => d.authorId)));
+