diff --git a/.env b/.env deleted file mode 100644 index 4eb73080..00000000 --- a/.env +++ /dev/null @@ -1,5 +0,0 @@ -DATABASE_URL="postgresql://bip:Production_123@localhost:5433/hipmi?schema=public" -PWD="QWERTYUIOPLKJHGFDSAZXCVBNMQAZWSXEDCRFVTGBYHNUJMIKOLPPOIUYTREWQLKJHGFDSAMNBVCXZlghvftyguhijknhbgvcfytguu8okjnhbgvfty7u8oilkjnhgvtygu7u8ojilnkhbgvhujnkhghvjhukjnhb" -Client_KEY="SB-Mid-client-9NDTxltqdZrEB9m-" -Server_KEY="SB-Mid-server-NyltU-U7fLVQd1nv1LWBKylr" -MAPBOX_TOKEN="pk.eyJ1IjoibWFsaWtrdXJvc2FraSIsImEiOiJjbHppZHh2enYwZnQ3MmlyMWc2Y2RlMzZoIn0.XssvJvq_iniclf8UhvXaIg" diff --git a/.gitignore b/.gitignore index 02f0ee31..8fbb7710 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,8 @@ yarn-error.log* # local env files .env*.local - +# env here +.env # vercel .vercel diff --git a/prisma/schema.prisma b/prisma/schema.prisma index cd71c4c9..ff99d8c2 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -114,6 +114,7 @@ model Images { Donasi_Invoice Donasi_Invoice[] Portofolio Portofolio[] Job Job[] + BusinessMaps BusinessMaps[] } model ImagesBackground { @@ -143,6 +144,7 @@ model Portofolio { Logo Images? @relation(fields: [logoId], references: [id]) logoId String? Portofolio_MediaSosial Portofolio_MediaSosial? + BusinessMaps BusinessMaps? } model Portofolio_MediaSosial { @@ -873,13 +875,17 @@ model Notifikasi { } model BusinessMaps { - id String @id @default(cuid()) - isActive Boolean @default(true) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - namePin String - latitude Float - longitude Float - Author User? @relation(fields: [authorId], references: [id]) - authorId String? + id String @id @default(cuid()) + isActive Boolean @default(true) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + namePin String + latitude Float + longitude Float + Author User? @relation(fields: [authorId], references: [id]) + authorId String? + Portofolio Portofolio? @relation(fields: [portofolioId], references: [id]) + portofolioId String? @unique + Images Images? @relation(fields: [imagesId], references: [id]) + imagesId String? } diff --git a/public/map/994abfea-c671-40e6-80ff-085d1ab630d8.jpeg b/public/map/994abfea-c671-40e6-80ff-085d1ab630d8.jpeg new file mode 100644 index 00000000..fb1937e3 Binary files /dev/null and b/public/map/994abfea-c671-40e6-80ff-085d1ab630d8.jpeg differ diff --git a/public/map/9f873fae-7b5e-4c60-a5fa-cb6b63a1eba3.jpg b/public/map/9f873fae-7b5e-4c60-a5fa-cb6b63a1eba3.jpg new file mode 100644 index 00000000..c4c104d6 Binary files /dev/null and b/public/map/9f873fae-7b5e-4c60-a5fa-cb6b63a1eba3.jpg differ diff --git a/public/map/c9b8ae8d-840a-4d67-9417-bb385779aca7.jpg b/public/map/c9b8ae8d-840a-4d67-9417-bb385779aca7.jpg new file mode 100644 index 00000000..0b6c4e4a Binary files /dev/null and b/public/map/c9b8ae8d-840a-4d67-9417-bb385779aca7.jpg differ diff --git a/public/map/d81f191e-9d94-433f-8e33-ad5bbaa187e8.jpg b/public/map/d81f191e-9d94-433f-8e33-ad5bbaa187e8.jpg new file mode 100644 index 00000000..830b275a Binary files /dev/null and b/public/map/d81f191e-9d94-433f-8e33-ad5bbaa187e8.jpg differ diff --git a/public/portofolio/logo/28c87bcb-61dd-4111-a694-c8d1e792311f.jpg b/public/portofolio/logo/28c87bcb-61dd-4111-a694-c8d1e792311f.jpg new file mode 100644 index 00000000..d906e018 Binary files /dev/null and b/public/portofolio/logo/28c87bcb-61dd-4111-a694-c8d1e792311f.jpg differ diff --git a/public/portofolio/logo/c457514a-9b0b-48b8-8ae6-2d903f8964bc.jpg b/public/portofolio/logo/350232de-d19d-4aed-8e65-0f4aed58d386.jpg similarity index 100% rename from public/portofolio/logo/c457514a-9b0b-48b8-8ae6-2d903f8964bc.jpg rename to public/portofolio/logo/350232de-d19d-4aed-8e65-0f4aed58d386.jpg diff --git a/public/portofolio/logo/55409a1f-8d3d-455a-b5bf-10cd64eda28b.png b/public/portofolio/logo/55409a1f-8d3d-455a-b5bf-10cd64eda28b.png deleted file mode 100644 index 176da5a2..00000000 Binary files a/public/portofolio/logo/55409a1f-8d3d-455a-b5bf-10cd64eda28b.png and /dev/null differ diff --git a/public/portofolio/logo/b5716434-cc9d-4b83-a447-6ad4376d4899.png b/public/portofolio/logo/b5716434-cc9d-4b83-a447-6ad4376d4899.png new file mode 100644 index 00000000..0733e81b Binary files /dev/null and b/public/portofolio/logo/b5716434-cc9d-4b83-a447-6ad4376d4899.png differ diff --git a/public/portofolio/logo/a7ebdb61-1200-45b3-b868-ed9cc811c8b8.png b/public/portofolio/logo/baad553b-93eb-4f3a-b2cf-bfc017d1f745.png similarity index 100% rename from public/portofolio/logo/a7ebdb61-1200-45b3-b868-ed9cc811c8b8.png rename to public/portofolio/logo/baad553b-93eb-4f3a-b2cf-bfc017d1f745.png diff --git a/src/app/api/auth/validasi/route.ts b/src/app/api/auth/validasi/route.ts index be2bc349..1ba3e6c5 100644 --- a/src/app/api/auth/validasi/route.ts +++ b/src/app/api/auth/validasi/route.ts @@ -10,11 +10,9 @@ import yaml from "yaml"; const config = yaml.parse(fs.readFileSync("config.yaml").toString()); export async function POST(req: Request) { - if (req.method === "POST") { const body = await req.json(); - const data = await prisma.user.findUnique({ where: { nomor: body.nomor, @@ -27,7 +25,7 @@ export async function POST(req: Request) { }, }); - myConsole(data) + myConsole(data); if (!data) return NextResponse.json({ status: 404 }); @@ -38,7 +36,7 @@ export async function POST(req: Request) { username: data.username, }), { - password: (await config.server.password), + password: await config.server.password, } ); @@ -48,7 +46,7 @@ export async function POST(req: Request) { maxAge: 60 * 60 * 24 * 7, }); - revalidatePath("/dev/home") + revalidatePath("/dev/home"); return NextResponse.json({ status: 200, data }); } diff --git a/src/app/api/map/[id]/route.ts b/src/app/api/map/[id]/route.ts new file mode 100644 index 00000000..5b5bba33 --- /dev/null +++ b/src/app/api/map/[id]/route.ts @@ -0,0 +1,32 @@ +import prisma from "@/app/lib/prisma"; +import fs from "fs"; +import { NextRequest, NextResponse } from "next/server"; + +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(`./public/map/${get?.url}`)) { + const notFile = fs.readFileSync("./public/aset/global/no_img.png"); + return new NextResponse(notFile, { + headers: { + "Content-Type": "image/png", + }, + }); + } + const file = fs.readFileSync(`./public/map/${get?.url}`); + return new NextResponse(file, { + headers: { + "Content-Type": "image/png", + }, + }); +} diff --git a/src/app/dev/admin/colab/dashboard/loading.tsx b/src/app/dev/admin/colab/dashboard/loading.tsx index dcf03736..8767538e 100644 --- a/src/app/dev/admin/colab/dashboard/loading.tsx +++ b/src/app/dev/admin/colab/dashboard/loading.tsx @@ -1,4 +1,4 @@ -import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/component_global/loading_admin_page"; +import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page"; export default async function Page() { return ( diff --git a/src/app/dev/admin/colab/sub-menu/loading.tsx b/src/app/dev/admin/colab/sub-menu/loading.tsx index dcf03736..8767538e 100644 --- a/src/app/dev/admin/colab/sub-menu/loading.tsx +++ b/src/app/dev/admin/colab/sub-menu/loading.tsx @@ -1,4 +1,4 @@ -import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/component_global/loading_admin_page"; +import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page"; export default async function Page() { return ( diff --git a/src/app/dev/admin/developer/loading.tsx b/src/app/dev/admin/developer/loading.tsx index dcf03736..8767538e 100644 --- a/src/app/dev/admin/developer/loading.tsx +++ b/src/app/dev/admin/developer/loading.tsx @@ -1,4 +1,4 @@ -import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/component_global/loading_admin_page"; +import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page"; export default async function Page() { return ( diff --git a/src/app/dev/admin/donasi/main/loading.tsx b/src/app/dev/admin/donasi/main/loading.tsx index dcf03736..8767538e 100644 --- a/src/app/dev/admin/donasi/main/loading.tsx +++ b/src/app/dev/admin/donasi/main/loading.tsx @@ -1,4 +1,4 @@ -import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/component_global/loading_admin_page"; +import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page"; export default async function Page() { return ( diff --git a/src/app/dev/admin/event/main/loading.tsx b/src/app/dev/admin/event/main/loading.tsx index dcf03736..8767538e 100644 --- a/src/app/dev/admin/event/main/loading.tsx +++ b/src/app/dev/admin/event/main/loading.tsx @@ -1,4 +1,4 @@ -import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/component_global/loading_admin_page"; +import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page"; export default async function Page() { return ( diff --git a/src/app/dev/admin/forum/main/loading.tsx b/src/app/dev/admin/forum/main/loading.tsx index dcf03736..8767538e 100644 --- a/src/app/dev/admin/forum/main/loading.tsx +++ b/src/app/dev/admin/forum/main/loading.tsx @@ -1,4 +1,4 @@ -import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/component_global/loading_admin_page"; +import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page"; export default async function Page() { return ( diff --git a/src/app/dev/admin/investasi/main/loading.tsx b/src/app/dev/admin/investasi/main/loading.tsx index dcf03736..8767538e 100644 --- a/src/app/dev/admin/investasi/main/loading.tsx +++ b/src/app/dev/admin/investasi/main/loading.tsx @@ -1,4 +1,4 @@ -import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/component_global/loading_admin_page"; +import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page"; export default async function Page() { return ( diff --git a/src/app/dev/admin/job/main/loading.tsx b/src/app/dev/admin/job/main/loading.tsx index dcf03736..8767538e 100644 --- a/src/app/dev/admin/job/main/loading.tsx +++ b/src/app/dev/admin/job/main/loading.tsx @@ -1,4 +1,4 @@ -import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/component_global/loading_admin_page"; +import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page"; export default async function Page() { return ( diff --git a/src/app/dev/admin/main/dashboard/loading.tsx b/src/app/dev/admin/main/dashboard/loading.tsx index dcf03736..8767538e 100644 --- a/src/app/dev/admin/main/dashboard/loading.tsx +++ b/src/app/dev/admin/main/dashboard/loading.tsx @@ -1,4 +1,4 @@ -import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/component_global/loading_admin_page"; +import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page"; export default async function Page() { return ( diff --git a/src/app/dev/admin/map/page.tsx b/src/app/dev/admin/map/page.tsx new file mode 100644 index 00000000..efacf8ee --- /dev/null +++ b/src/app/dev/admin/map/page.tsx @@ -0,0 +1,10 @@ +import { AdminMap_View } from "@/app_modules/admin/map/view"; + + +export default async function Page() { + return ( + <> + + + ); +} diff --git a/src/app/dev/admin/vote/main/loading.tsx b/src/app/dev/admin/vote/main/loading.tsx index dcf03736..8767538e 100644 --- a/src/app/dev/admin/vote/main/loading.tsx +++ b/src/app/dev/admin/vote/main/loading.tsx @@ -1,4 +1,4 @@ -import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/component_global/loading_admin_page"; +import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page"; export default async function Page() { return ( diff --git a/src/app/dev/map/create/[id]/page.tsx b/src/app/dev/map/create/[id]/page.tsx new file mode 100644 index 00000000..5a27ae8e --- /dev/null +++ b/src/app/dev/map/create/[id]/page.tsx @@ -0,0 +1,10 @@ +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/create/page.tsx b/src/app/dev/map/create/page.tsx deleted file mode 100644 index 2841a5d2..00000000 --- a/src/app/dev/map/create/page.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { Map_CreateNewPin } from "@/app_modules/map/view"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/map/edit/[id]/page.tsx b/src/app/dev/map/edit/[id]/page.tsx new file mode 100644 index 00000000..79a07168 --- /dev/null +++ b/src/app/dev/map/edit/[id]/page.tsx @@ -0,0 +1,13 @@ +import { map_funGetOneByPortofolioId } 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_funGetOneByPortofolioId({portofolioId: portofolioId}) + + return ( + <> + + + ); +} diff --git a/src/app/dev/portofolio/main/[id]/page.tsx b/src/app/dev/portofolio/main/[id]/page.tsx index fe44019e..6e863ebc 100644 --- a/src/app/dev/portofolio/main/[id]/page.tsx +++ b/src/app/dev/portofolio/main/[id]/page.tsx @@ -1,17 +1,20 @@ +import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data"; import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token"; 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 getPorto = await portofolio_getOneById(params.id); const userLoginId = await user_getOneUserId(); return ( <> - {/* {JSON.stringify(getPorto)} */} + {/*
{JSON.stringify(getPorto, null, 2)}
*/} ); diff --git a/src/app/lib/router_admin/router_admin_map.ts b/src/app/lib/router_admin/router_admin_map.ts new file mode 100644 index 00000000..50a09bf2 --- /dev/null +++ b/src/app/lib/router_admin/router_admin_map.ts @@ -0,0 +1,3 @@ +export const RouterAdminMap = { + main: "/dev/admin/map", +}; diff --git a/src/app/lib/router_hipmi/router_map.ts b/src/app/lib/router_hipmi/router_map.ts index d24fae8d..b2c4bd15 100644 --- a/src/app/lib/router_hipmi/router_map.ts +++ b/src/app/lib/router_hipmi/router_map.ts @@ -1,5 +1,10 @@ export const RouterMap = { + // api + api_foto: "/api/map/", + + // main splash: "/dev/map/splash", main_view: "/dev/map/main", - create: "/dev/map/create", + create: "/dev/map/create/", + edit: "/dev/map/edit/", }; diff --git a/src/app_modules/_global/ui/ui_drawer.tsx b/src/app_modules/_global/ui/ui_drawer.tsx index ab3a4465..b604532a 100644 --- a/src/app_modules/_global/ui/ui_drawer.tsx +++ b/src/app_modules/_global/ui/ui_drawer.tsx @@ -91,7 +91,7 @@ export default function UIGlobal_Drawer({ e?.icon )} - + {e?.name} diff --git a/src/app_modules/admin/component_global/admin_notifikasi/notifikasi_berhasil.tsx b/src/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil.tsx similarity index 100% rename from src/app_modules/admin/component_global/admin_notifikasi/notifikasi_berhasil.tsx rename to src/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil.tsx diff --git a/src/app_modules/admin/component_global/admin_notifikasi/notifikasi_gagal.tsx b/src/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal.tsx similarity index 100% rename from src/app_modules/admin/component_global/admin_notifikasi/notifikasi_gagal.tsx rename to src/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal.tsx diff --git a/src/app_modules/admin/component_global/admin_notifikasi/notifikasi_peringatan.tsx b/src/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_peringatan.tsx similarity index 100% rename from src/app_modules/admin/component_global/admin_notifikasi/notifikasi_peringatan.tsx rename to src/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_peringatan.tsx diff --git a/src/app_modules/admin/component_global/back_button.tsx b/src/app_modules/admin/_admin_global/back_button.tsx similarity index 100% rename from src/app_modules/admin/component_global/back_button.tsx rename to src/app_modules/admin/_admin_global/back_button.tsx diff --git a/src/app_modules/admin/component_global/header_tamplate.tsx b/src/app_modules/admin/_admin_global/header_tamplate.tsx similarity index 100% rename from src/app_modules/admin/component_global/header_tamplate.tsx rename to src/app_modules/admin/_admin_global/header_tamplate.tsx diff --git a/src/app_modules/admin/component_global/is_empty_data.tsx b/src/app_modules/admin/_admin_global/is_empty_data.tsx similarity index 100% rename from src/app_modules/admin/component_global/is_empty_data.tsx rename to src/app_modules/admin/_admin_global/is_empty_data.tsx diff --git a/src/app_modules/admin/component_global/loading_admin_page.tsx b/src/app_modules/admin/_admin_global/loading_admin_page.tsx similarity index 100% rename from src/app_modules/admin/component_global/loading_admin_page.tsx rename to src/app_modules/admin/_admin_global/loading_admin_page.tsx diff --git a/src/app_modules/admin/component_global/logout.tsx b/src/app_modules/admin/_admin_global/logout.tsx similarity index 100% rename from src/app_modules/admin/component_global/logout.tsx rename to src/app_modules/admin/_admin_global/logout.tsx diff --git a/src/app_modules/admin/component_global/tampilan_rupiah.tsx b/src/app_modules/admin/_admin_global/tampilan_rupiah.tsx similarity index 100% rename from src/app_modules/admin/component_global/tampilan_rupiah.tsx rename to src/app_modules/admin/_admin_global/tampilan_rupiah.tsx diff --git a/src/app_modules/admin/app_info/main/index.tsx b/src/app_modules/admin/app_info/main/index.tsx index 7494c5c5..e5127d56 100644 --- a/src/app_modules/admin/app_info/main/index.tsx +++ b/src/app_modules/admin/app_info/main/index.tsx @@ -4,7 +4,7 @@ import { Space, Stack } from "@mantine/core"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; import InformasiBank from "./info_bank"; import InformasiWhatApps from "./info_whatsapp"; diff --git a/src/app_modules/admin/app_info/main/info_bank.tsx b/src/app_modules/admin/app_info/main/info_bank.tsx index 70d11f08..be6d5e55 100644 --- a/src/app_modules/admin/app_info/main/info_bank.tsx +++ b/src/app_modules/admin/app_info/main/info_bank.tsx @@ -24,8 +24,8 @@ import { } from "@tabler/icons-react"; import _ from "lodash"; import { useState } from "react"; -import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../component_global/admin_notifikasi/notifikasi_berhasil"; -import { ComponentAdminGlobal_NotifikasiGagal } from "../../component_global/admin_notifikasi/notifikasi_gagal"; +import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil"; +import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal"; 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"; diff --git a/src/app_modules/admin/app_info/main/info_whatsapp.tsx b/src/app_modules/admin/app_info/main/info_whatsapp.tsx index f181f1be..77773476 100644 --- a/src/app_modules/admin/app_info/main/info_whatsapp.tsx +++ b/src/app_modules/admin/app_info/main/info_whatsapp.tsx @@ -12,8 +12,8 @@ import { } from "@mantine/core"; import { IconEdit, IconPhone } from "@tabler/icons-react"; import { useState } from "react"; -import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../component_global/admin_notifikasi/notifikasi_berhasil"; -import { ComponentAdminGlobal_NotifikasiGagal } from "../../component_global/admin_notifikasi/notifikasi_gagal"; +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"; diff --git a/src/app_modules/admin/colab/dashboard/index.tsx b/src/app_modules/admin/colab/dashboard/index.tsx index 94a96b8d..6f865bdd 100644 --- a/src/app_modules/admin/colab/dashboard/index.tsx +++ b/src/app_modules/admin/colab/dashboard/index.tsx @@ -2,7 +2,7 @@ import { Stack, SimpleGrid, Paper, Group, Title, Text } from "@mantine/core"; import { useRouter } from "next/navigation"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; export default function AdminColab_Dashboard({ countPublish, diff --git a/src/app_modules/admin/colab/sub_menu/group.tsx b/src/app_modules/admin/colab/sub_menu/group.tsx index 30bc2c58..08f137fe 100644 --- a/src/app_modules/admin/colab/sub_menu/group.tsx +++ b/src/app_modules/admin/colab/sub_menu/group.tsx @@ -17,7 +17,7 @@ import { SimpleGrid, Box, } from "@mantine/core"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; import { MODEL_COLLABORATION, MODEL_COLLABORATION_ROOM_CHAT, diff --git a/src/app_modules/admin/colab/sub_menu/publish.tsx b/src/app_modules/admin/colab/sub_menu/publish.tsx index 3f8cabbd..acdb54fb 100644 --- a/src/app_modules/admin/colab/sub_menu/publish.tsx +++ b/src/app_modules/admin/colab/sub_menu/publish.tsx @@ -18,7 +18,7 @@ import { Textarea, Box, } from "@mantine/core"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +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"; diff --git a/src/app_modules/admin/colab/sub_menu/reject.tsx b/src/app_modules/admin/colab/sub_menu/reject.tsx index 180d33bb..f5c51c72 100644 --- a/src/app_modules/admin/colab/sub_menu/reject.tsx +++ b/src/app_modules/admin/colab/sub_menu/reject.tsx @@ -14,7 +14,7 @@ import { Box, Pagination, } from "@mantine/core"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +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"; diff --git a/src/app_modules/admin/developer/index.tsx b/src/app_modules/admin/developer/index.tsx index d09864a4..eb0bf165 100644 --- a/src/app_modules/admin/developer/index.tsx +++ b/src/app_modules/admin/developer/index.tsx @@ -14,7 +14,7 @@ import { TextInput, Title, } from "@mantine/core"; -import ComponentAdminGlobal_HeaderTamplate from "../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../_admin_global/header_tamplate"; import { MODEL_USER } from "@/app_modules/home/model/interface"; import _ from "lodash"; import { IconSearch } from "@tabler/icons-react"; diff --git a/src/app_modules/admin/donasi/detail/detail_reject.tsx b/src/app_modules/admin/donasi/detail/detail_reject.tsx index 64d434a6..78f9fd04 100644 --- a/src/app_modules/admin/donasi/detail/detail_reject.tsx +++ b/src/app_modules/admin/donasi/detail/detail_reject.tsx @@ -25,7 +25,7 @@ import { NotifBerhasil } from "@/app_modules/donasi/component/notifikasi/notif_b import { NotifGagal } from "@/app_modules/donasi/component/notifikasi/notif_gagal"; import { AdminDonasi_getOneById } from "../fun/get/get_one_by_id"; import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown"; -import ComponentAdminGlobal_BackButton from "../../component_global/back_button"; +import ComponentAdminGlobal_BackButton from "../../_admin_global/back_button"; import ComponentAdminDonasi_TampilanDetailDonasi from "../component/tampilan_detail_donasi"; import ComponentAdminDonasi_CeritaPenggalangDana from "../component/tampilan_detail_cerita"; diff --git a/src/app_modules/admin/donasi/detail/detail_review.tsx b/src/app_modules/admin/donasi/detail/detail_review.tsx index a24ee397..08680856 100644 --- a/src/app_modules/admin/donasi/detail/detail_review.tsx +++ b/src/app_modules/admin/donasi/detail/detail_review.tsx @@ -25,14 +25,14 @@ import { import { useDisclosure } from "@mantine/hooks"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../component_global/admin_notifikasi/notifikasi_berhasil"; -import { ComponentAdminGlobal_NotifikasiGagal } from "../../component_global/admin_notifikasi/notifikasi_gagal"; -import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../component_global/admin_notifikasi/notifikasi_peringatan"; +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 ComponentAdminDonasi_TombolKembali from "../component/tombol_kembali"; 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 ComponentAdminGlobal_BackButton from "../../component_global/back_button"; +import ComponentAdminGlobal_BackButton from "../../_admin_global/back_button"; import ComponentAdminDonasi_TampilanDetailDonasi from "../component/tampilan_detail_donasi"; import ComponentAdminDonasi_CeritaPenggalangDana from "../component/tampilan_detail_cerita"; import mqtt_client from "@/util/mqtt_client"; 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 59f325f7..86c0ad58 100644 --- a/src/app_modules/admin/donasi/detail/publish/detail_publish.tsx +++ b/src/app_modules/admin/donasi/detail/publish/detail_publish.tsx @@ -48,13 +48,13 @@ import { useRouter } from "next/navigation"; import { useDisclosure, useInterval, useShallowEffect } from "@mantine/hooks"; import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id"; import { AdminDonasi_getOneById } from "../../fun/get/get_one_by_id"; -import ComponentAdminGlobal_BackButton from "@/app_modules/admin/component_global/back_button"; +import ComponentAdminGlobal_BackButton from "@/app_modules/admin/_admin_global/back_button"; import { MODEL_NEW_DEFAULT_MASTER } from "@/app_modules/model_global/interface"; import { adminDonasi_getListDonatur } from "../../fun/get/get_list_donatur_by_id"; import { RouterAdminDonasi } from "@/app/lib/router_admin/router_admin_donasi"; import adminDonasi_funUpdateStatusDanTotal from "../../fun/update/fun_update_status_dan_total"; -import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_berhasil"; -import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_gagal"; +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 mqtt_client from "@/util/mqtt_client"; import adminNotifikasi_funCreateToUser from "@/app_modules/admin/notifikasi/fun/create/fun_create_notif_user"; 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 c6ee4611..339fd4dd 100644 --- a/src/app_modules/admin/donasi/detail/publish/pencairan_dana.tsx +++ b/src/app_modules/admin/donasi/detail/publish/pencairan_dana.tsx @@ -1,10 +1,10 @@ "use client"; import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input"; -import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_berhasil"; -import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_gagal"; -import { ComponentAdminGlobal_NotifikasiPeringatan } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_peringatan"; -import ComponentAdminGlobal_TampilanRupiahDonasi from "@/app_modules/admin/component_global/tampilan_rupiah"; +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_NotifikasiPeringatan } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_peringatan"; +import ComponentAdminGlobal_TampilanRupiahDonasi from "@/app_modules/admin/_admin_global/tampilan_rupiah"; import adminNotifikasi_funCreateToUser from "@/app_modules/admin/notifikasi/fun/create/fun_create_notif_user"; import ComponentDonasi_NotedBox from "@/app_modules/donasi/component/noted_box"; import mqtt_client from "@/util/mqtt_client"; diff --git a/src/app_modules/admin/donasi/main/index.tsx b/src/app_modules/admin/donasi/main/index.tsx index 39a9c8c0..33415ad8 100644 --- a/src/app_modules/admin/donasi/main/index.tsx +++ b/src/app_modules/admin/donasi/main/index.tsx @@ -15,7 +15,7 @@ import { } from "@mantine/core"; import { IconChevronsRight } from "@tabler/icons-react"; import { useRouter } from "next/navigation"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; export default function AdminDonasi_Main({ countPublish, diff --git a/src/app_modules/admin/donasi/sub-detail/bukti_transfer.tsx b/src/app_modules/admin/donasi/sub-detail/bukti_transfer.tsx index d4c0585c..20cf92e2 100644 --- a/src/app_modules/admin/donasi/sub-detail/bukti_transfer.tsx +++ b/src/app_modules/admin/donasi/sub-detail/bukti_transfer.tsx @@ -1,7 +1,7 @@ "use client"; import { AspectRatio, Box, Image, Paper, Stack } from "@mantine/core"; -import ComponentAdminGlobal_BackButton from "../../component_global/back_button"; +import ComponentAdminGlobal_BackButton from "../../_admin_global/back_button"; import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin"; export default function AdminDonasi_BuktiTransfer({ diff --git a/src/app_modules/admin/donasi/sub-detail/bukti_transfer_pencairan.tsx b/src/app_modules/admin/donasi/sub-detail/bukti_transfer_pencairan.tsx index 4fdd2589..1b241fd0 100644 --- a/src/app_modules/admin/donasi/sub-detail/bukti_transfer_pencairan.tsx +++ b/src/app_modules/admin/donasi/sub-detail/bukti_transfer_pencairan.tsx @@ -1,7 +1,7 @@ "use client"; import { AspectRatio, Box, Image, Paper, Stack } from "@mantine/core"; -import ComponentAdminGlobal_BackButton from "../../component_global/back_button"; +import ComponentAdminGlobal_BackButton from "../../_admin_global/back_button"; import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin"; import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi"; diff --git a/src/app_modules/admin/donasi/sub_menu/table_kategori.tsx b/src/app_modules/admin/donasi/sub_menu/table_kategori.tsx index a0b2739c..9f1d1f2d 100644 --- a/src/app_modules/admin/donasi/sub_menu/table_kategori.tsx +++ b/src/app_modules/admin/donasi/sub_menu/table_kategori.tsx @@ -18,13 +18,13 @@ import { Switch, Modal, } from "@mantine/core"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; import { MODEL_NEW_DEFAULT_MASTER } from "@/app_modules/model_global/interface"; import { useState } from "react"; import { IconCirclePlus, IconEdit, IconTrash } from "@tabler/icons-react"; import adminDonasi_funCreateKategori from "../fun/create/fun_create_kategori"; -import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../component_global/admin_notifikasi/notifikasi_berhasil"; -import { ComponentAdminGlobal_NotifikasiGagal } from "../../component_global/admin_notifikasi/notifikasi_gagal"; +import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil"; +import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal"; import adminDonasi_getMasterKategori from "../fun/master/get_list_kategori"; import adminDonasi_funDeleteKategori from "../fun/delete/fun_delete_by_id"; import adminDonasi_funUpdatekategoriById from "../fun/update/fun_update_kategori_by_id"; diff --git a/src/app_modules/admin/donasi/sub_menu/table_publish.tsx b/src/app_modules/admin/donasi/sub_menu/table_publish.tsx index 8e896daf..398791ab 100644 --- a/src/app_modules/admin/donasi/sub_menu/table_publish.tsx +++ b/src/app_modules/admin/donasi/sub_menu/table_publish.tsx @@ -22,7 +22,7 @@ import ComponentAdminDonasi_TombolKembali from "../component/tombol_kembali"; import { MODEL_DONASI } from "@/app_modules/donasi/model/interface"; import { useState } from "react"; import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; import adminDonasi_getListPublish from "../fun/get/get_list_publish"; export default function AdminDonasi_TablePublish({ 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 effb2074..2f2ddda0 100644 --- a/src/app_modules/admin/donasi/sub_menu/table_reject.tsx +++ b/src/app_modules/admin/donasi/sub_menu/table_reject.tsx @@ -31,7 +31,7 @@ import AdminDonasi_DetailReview from "../detail/detail_review"; import { MODEL_DONASI } from "@/app_modules/donasi/model/interface"; import { useState } from "react"; import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; import adminDonasi_getListReject from "../fun/get/get_list_reject"; export default function AdminDonasi_TableReject({ 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 b11cf446..06e8d952 100644 --- a/src/app_modules/admin/donasi/sub_menu/table_review.tsx +++ b/src/app_modules/admin/donasi/sub_menu/table_review.tsx @@ -25,7 +25,7 @@ import AdminDonasi_DetailReview from "../detail/detail_review"; import { MODEL_DONASI } from "@/app_modules/donasi/model/interface"; import { useState } from "react"; import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; import _ from "lodash"; import adminDonasi_getListReview from "../fun/get/get_list_review"; diff --git a/src/app_modules/admin/event/child/riwayat.tsx b/src/app_modules/admin/event/child/riwayat.tsx index 33ab6a77..0a3fa315 100644 --- a/src/app_modules/admin/event/child/riwayat.tsx +++ b/src/app_modules/admin/event/child/riwayat.tsx @@ -18,7 +18,7 @@ import { Text, Title, } from "@mantine/core"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; import { MODEL_EVENT, MODEL_EVENT_PESERTA, diff --git a/src/app_modules/admin/event/child/tipe_acara.tsx b/src/app_modules/admin/event/child/tipe_acara.tsx index 4dd7fadd..d90f136d 100644 --- a/src/app_modules/admin/event/child/tipe_acara.tsx +++ b/src/app_modules/admin/event/child/tipe_acara.tsx @@ -16,7 +16,7 @@ import { Title, } from "@mantine/core"; import ComponentAdminDonasi_TombolKembali from "../../donasi/component/tombol_kembali"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; import { MODEL_DEFAULT_MASTER_OLD } from "@/app_modules/model_global/interface"; import { useState } from "react"; import { AdminEvent_funCreateTipeAcara } from "../fun/create/fun_create_tipe_acara"; diff --git a/src/app_modules/admin/event/main/index.tsx b/src/app_modules/admin/event/main/index.tsx index 1f4cb67e..7259f6b0 100644 --- a/src/app_modules/admin/event/main/index.tsx +++ b/src/app_modules/admin/event/main/index.tsx @@ -11,7 +11,7 @@ import { Title } from "@mantine/core"; import { useRouter } from "next/navigation"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; export default function AdminEvent_Main({ countPublish, 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 80866e6e..fccd6733 100644 --- a/src/app_modules/admin/event/table_status/table_publish.tsx +++ b/src/app_modules/admin/event/table_status/table_publish.tsx @@ -36,7 +36,7 @@ import { MODEL_EVENT, MODEL_EVENT_PESERTA, } from "@/app_modules/event/model/interface"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; import moment from "moment"; import _ from "lodash"; import { AdminEvent_funEditStatusPublishById } from "../fun/edit/fun_edit_status_publish_by_id"; 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 ebed2d1d..9cb5c589 100644 --- a/src/app_modules/admin/event/table_status/table_reject.tsx +++ b/src/app_modules/admin/event/table_status/table_reject.tsx @@ -33,7 +33,7 @@ import { useState } from "react"; import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah"; import ComponentAdminDonasi_TombolKembali from "../../donasi/component/tombol_kembali"; import { MODEL_EVENT } from "@/app_modules/event/model/interface"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; import moment from "moment"; import _ from "lodash"; import { AdminEvent_funEditStatusPublishById } from "../fun/edit/fun_edit_status_publish_by_id"; 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 19bb5c0f..21123cf4 100644 --- a/src/app_modules/admin/event/table_status/table_review.tsx +++ b/src/app_modules/admin/event/table_status/table_review.tsx @@ -25,7 +25,7 @@ import mqtt_client from "@/util/mqtt_client"; import _ from "lodash"; import moment from "moment"; import { useState } from "react"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; import adminNotifikasi_funCreateToUser from "../../notifikasi/fun/create/fun_create_notif_user"; import { AdminEvent_funEditStatusPublishById } from "../fun/edit/fun_edit_status_publish_by_id"; import { AdminEvent_funEditCatatanById } from "../fun/edit/fun_edit_status_reject_by_id"; diff --git a/src/app_modules/admin/forum/detail/detail_posting.tsx b/src/app_modules/admin/forum/detail/detail_posting.tsx index 904b0fb2..b936f8f5 100644 --- a/src/app_modules/admin/forum/detail/detail_posting.tsx +++ b/src/app_modules/admin/forum/detail/detail_posting.tsx @@ -1,7 +1,7 @@ "use client"; import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum"; -import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate"; import ComponentAdminDonasi_TombolKembali from "@/app_modules/admin/donasi/component/tombol_kembali"; import { MODEL_FORUM_KOMENTAR, @@ -34,9 +34,9 @@ import { adminForum_funDeleteKomentarById } from "../fun/delete/fun_delete_komen 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 "../../component_global/is_empty_data"; +import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data"; import { adminForum_getListKomentarById } from "../fun/get/get_list_komentar_by_id"; -import ComponentAdminGlobal_BackButton from "../../component_global/back_button"; +import ComponentAdminGlobal_BackButton from "../../_admin_global/back_button"; import ComponentAdminForum_ViewOneDetailPosting from "../component/detail_one_posting"; export default function AdminForum_DetailPosting({ diff --git a/src/app_modules/admin/forum/main/dashboard.tsx b/src/app_modules/admin/forum/main/dashboard.tsx index 989cadc4..94cb0e43 100644 --- a/src/app_modules/admin/forum/main/dashboard.tsx +++ b/src/app_modules/admin/forum/main/dashboard.tsx @@ -1,8 +1,8 @@ "use client"; import { Group, Paper, SimpleGrid, Stack, Text, Title } from "@mantine/core"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; -import ComponentAdminGlobal_LoadingPage from "../../component_global/loading_admin_page"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; +import ComponentAdminGlobal_LoadingPage from "../../_admin_global/loading_admin_page"; export default function AdminForum_Main({ countPublish, 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 bf65a746..d46d99e2 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,6 +1,6 @@ "use client"; -import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate"; import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal"; import { @@ -29,8 +29,8 @@ import { import _ from "lodash"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import ComponentAdminGlobal_BackButton from "../../component_global/back_button"; -import ComponentAdminGlobal_IsEmptyData from "../../component_global/is_empty_data"; +import ComponentAdminGlobal_BackButton from "../../_admin_global/back_button"; +import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data"; 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"; 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 8c83187f..497a63d1 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,6 +1,6 @@ "use client"; -import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate"; import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal"; import { @@ -26,8 +26,8 @@ import { IconTrash } from "@tabler/icons-react"; import _ from "lodash"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import ComponentAdminGlobal_BackButton from "../../component_global/back_button"; -import ComponentAdminGlobal_IsEmptyData from "../../component_global/is_empty_data"; +import ComponentAdminGlobal_BackButton 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"; 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 3df67c3c..f69340d2 100644 --- a/src/app_modules/admin/forum/sub_menu/table_posting.tsx +++ b/src/app_modules/admin/forum/sub_menu/table_posting.tsx @@ -2,7 +2,7 @@ import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum"; import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; -import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate"; import { MODEL_FORUM_POSTING } from "@/app_modules/forum/model/interface"; import { Badge, @@ -34,7 +34,7 @@ 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 ComponentAdminForum_ButtonDeletePosting from "../component/button_delete"; -import ComponentAdminGlobal_IsEmptyData from "../../component_global/is_empty_data"; +import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data"; export default function AdminForum_TablePosting({ listPublish, 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 acdfde05..6deb3a63 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,7 +1,7 @@ "use client"; import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum"; -import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate"; import { MODEL_FORUM_REPORT_KOMENTAR, MODEL_FORUM_REPORT_POSTING, @@ -26,7 +26,7 @@ import { IconFlag3, IconSearch } from "@tabler/icons-react"; import { isEmpty } from "lodash"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import ComponentAdminGlobal_IsEmptyData from "../../component_global/is_empty_data"; +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 { Forum_Komentar } from "@/app_modules/forum"; 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 0dac9b93..c85bbf50 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,7 +1,7 @@ "use client"; import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum"; -import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate"; import { MODEL_FORUM_REPORT_POSTING } from "@/app_modules/forum/model/interface"; @@ -25,7 +25,7 @@ import { IconFlag3, IconSearch } from "@tabler/icons-react"; import { isEmpty } from "lodash"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import ComponentAdminGlobal_IsEmptyData from "../../component_global/is_empty_data"; +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"; diff --git a/src/app_modules/admin/investasi/detail/detail_publish.tsx b/src/app_modules/admin/investasi/detail/detail_publish.tsx index 8bc9c76b..ab7ae43b 100644 --- a/src/app_modules/admin/investasi/detail/detail_publish.tsx +++ b/src/app_modules/admin/investasi/detail/detail_publish.tsx @@ -15,7 +15,7 @@ import { ThemeIcon, Title, } from "@mantine/core"; -import ComponentAdminGlobal_BackButton from "../../component_global/back_button"; +import ComponentAdminGlobal_BackButton from "../../_admin_global/back_button"; import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi"; import { IconCircleCheck, IconHome } from "@tabler/icons-react"; import investasi from "../../notifikasi/route_setting/investasi"; diff --git a/src/app_modules/admin/investasi/detail/detail_reject.tsx b/src/app_modules/admin/investasi/detail/detail_reject.tsx index a20e247e..fa3015c6 100644 --- a/src/app_modules/admin/investasi/detail/detail_reject.tsx +++ b/src/app_modules/admin/investasi/detail/detail_reject.tsx @@ -8,7 +8,7 @@ import { Text, Title } from "@mantine/core"; -import ComponentAdminGlobal_BackButton from "../../component_global/back_button"; +import ComponentAdminGlobal_BackButton 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"; diff --git a/src/app_modules/admin/investasi/detail/detail_review.tsx b/src/app_modules/admin/investasi/detail/detail_review.tsx index f6bb3516..3d2dfd26 100644 --- a/src/app_modules/admin/investasi/detail/detail_review.tsx +++ b/src/app_modules/admin/investasi/detail/detail_review.tsx @@ -33,10 +33,10 @@ import Link from "next/link"; import { useRouter } from "next/navigation"; import { useState } from "react"; import "react-simple-toasts/dist/theme/dark.css"; -import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../component_global/admin_notifikasi/notifikasi_berhasil"; -import { ComponentAdminGlobal_NotifikasiGagal } from "../../component_global/admin_notifikasi/notifikasi_gagal"; -import { ComponentAdminGlobal_NotifikasiPeringatan } from "../../component_global/admin_notifikasi/notifikasi_peringatan"; -import ComponentAdminGlobal_BackButton from "../../component_global/back_button"; +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 ComponentAdminGlobal_BackButton 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"; diff --git a/src/app_modules/admin/investasi/main/table_publish.tsx b/src/app_modules/admin/investasi/main/table_publish.tsx index 378533c3..e6cb0324 100644 --- a/src/app_modules/admin/investasi/main/table_publish.tsx +++ b/src/app_modules/admin/investasi/main/table_publish.tsx @@ -18,8 +18,8 @@ import { IconSearch } from "@tabler/icons-react"; import _ from "lodash"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; -import ComponentAdminGlobal_IsEmptyData from "../../component_global/is_empty_data"; +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 { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi"; diff --git a/src/app_modules/admin/investasi/main/table_reject.tsx b/src/app_modules/admin/investasi/main/table_reject.tsx index 698ad227..0389ff25 100644 --- a/src/app_modules/admin/investasi/main/table_reject.tsx +++ b/src/app_modules/admin/investasi/main/table_reject.tsx @@ -23,8 +23,8 @@ import { IconChevronLeft, IconEdit, IconSearch } from "@tabler/icons-react"; import _ from "lodash"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; -import ComponentAdminGlobal_IsEmptyData from "../../component_global/is_empty_data"; +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"; diff --git a/src/app_modules/admin/investasi/main/table_review.tsx b/src/app_modules/admin/investasi/main/table_review.tsx index e8287733..bc9aba75 100644 --- a/src/app_modules/admin/investasi/main/table_review.tsx +++ b/src/app_modules/admin/investasi/main/table_review.tsx @@ -23,11 +23,11 @@ import { import { IconChevronLeft, IconEdit, IconSearch } from "@tabler/icons-react"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; import { adminInvestasi_funGetAllReview } from "../fun/get/get_all_review"; import _ from "lodash"; -import ComponentAdminGlobal_IsEmptyData from "../../component_global/is_empty_data"; -import ComponentAdminGlobal_TampilanRupiahDonasi from "../../component_global/tampilan_rupiah"; +import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data"; +import ComponentAdminGlobal_TampilanRupiahDonasi from "../../_admin_global/tampilan_rupiah"; export default function Admin_TableReviewInvestasi({ dataInvestsi, diff --git a/src/app_modules/admin/investasi/main/view.tsx b/src/app_modules/admin/investasi/main/view.tsx index 6f2fc16b..90301a45 100644 --- a/src/app_modules/admin/investasi/main/view.tsx +++ b/src/app_modules/admin/investasi/main/view.tsx @@ -38,7 +38,7 @@ import moment from "moment"; import _ from "lodash"; import TableTotalInvestasi from "./table_total_investasi"; import TablePublikasiProgresInvestasi from "./table_publikasi_progres"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; export default function Admin_Investasi({ listInvestasi, diff --git a/src/app_modules/admin/job/child/arsip/index.tsx b/src/app_modules/admin/job/child/arsip/index.tsx index d09283e0..3f4dd666 100644 --- a/src/app_modules/admin/job/child/arsip/index.tsx +++ b/src/app_modules/admin/job/child/arsip/index.tsx @@ -1,7 +1,7 @@ "use client"; import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; -import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate"; import { AdminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id"; import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; import { diff --git a/src/app_modules/admin/job/child/publish/index.tsx b/src/app_modules/admin/job/child/publish/index.tsx index dcd0e6fe..f7bba87f 100644 --- a/src/app_modules/admin/job/child/publish/index.tsx +++ b/src/app_modules/admin/job/child/publish/index.tsx @@ -1,7 +1,7 @@ "use client"; import { RouterAdminJob } from "@/app/lib/router_admin/router_admin_job"; -import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate"; import { MODEL_JOB } from "@/app_modules/job/model/interface"; import { Badge, diff --git a/src/app_modules/admin/job/child/reject/index.tsx b/src/app_modules/admin/job/child/reject/index.tsx index 9302a734..8299b4e1 100644 --- a/src/app_modules/admin/job/child/reject/index.tsx +++ b/src/app_modules/admin/job/child/reject/index.tsx @@ -1,7 +1,7 @@ "use client"; import { RouterAdminJob } from "@/app/lib/router_admin/router_admin_job"; -import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate"; 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"; diff --git a/src/app_modules/admin/job/child/review/index.tsx b/src/app_modules/admin/job/child/review/index.tsx index 8ba765d3..89b90f5e 100644 --- a/src/app_modules/admin/job/child/review/index.tsx +++ b/src/app_modules/admin/job/child/review/index.tsx @@ -1,7 +1,7 @@ "use client"; import { RouterAdminJob } from "@/app/lib/router_admin/router_admin_job"; -import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate"; +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 { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal"; diff --git a/src/app_modules/admin/job/detail/detail_poster.tsx b/src/app_modules/admin/job/detail/detail_poster.tsx index 49b9dfa9..4cf40b10 100644 --- a/src/app_modules/admin/job/detail/detail_poster.tsx +++ b/src/app_modules/admin/job/detail/detail_poster.tsx @@ -2,7 +2,7 @@ import { RouterJob } from "@/app/lib/router_hipmi/router_job"; import { Center, Image, Stack } from "@mantine/core"; -import ComponentAdminGlobal_BackButton from "../../component_global/back_button"; +import ComponentAdminGlobal_BackButton from "../../_admin_global/back_button"; export default function AdminJob_DetailPoster({ imageId, diff --git a/src/app_modules/admin/job/main/index.tsx b/src/app_modules/admin/job/main/index.tsx index 3e1c4f77..79a1fd27 100644 --- a/src/app_modules/admin/job/main/index.tsx +++ b/src/app_modules/admin/job/main/index.tsx @@ -1,7 +1,7 @@ "use client"; import { Group, Paper, SimpleGrid, Stack, Text, Title } from "@mantine/core"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; import { useRouter } from "next/navigation"; export default function AdminJob_Main({ diff --git a/src/app_modules/admin/layout.tsx b/src/app_modules/admin/layout.tsx index 134eca14..56e95175 100644 --- a/src/app_modules/admin/layout.tsx +++ b/src/app_modules/admin/layout.tsx @@ -39,7 +39,7 @@ import { useRouter } from "next/navigation"; import React, { useEffect, useState } from "react"; import { MODEL_USER } from "../home/model/interface"; import { MODEL_NOTIFIKASI } from "../notifikasi/model/interface"; -import Admin_Logout from "./component_global/logout"; +import Admin_Logout from "./_admin_global/logout"; import { gs_admin_hotMenu, gs_admin_subMenu, diff --git a/src/app_modules/admin/list_page.tsx b/src/app_modules/admin/list_page.tsx index 8fdd5160..7f549961 100644 --- a/src/app_modules/admin/list_page.tsx +++ b/src/app_modules/admin/list_page.tsx @@ -5,12 +5,11 @@ 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 { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin"; import { IconAffiliate, IconBriefcase, @@ -18,6 +17,7 @@ import { IconDeviceMobile, IconHeartHandshake, IconHome, + IconMap2, IconMessages, IconMoneybag, IconPackageImport, @@ -270,6 +270,15 @@ export const listAdminPage = [ ], }, + { + id: 9, + name: "Maps", + path: RouterAdminMap.main, + icon: , + child: [], + }, + + // App Information { id: 97, name: "App Information", diff --git a/src/app_modules/admin/map/component/drawer.tsx b/src/app_modules/admin/map/component/drawer.tsx new file mode 100644 index 00000000..6bebfd1e --- /dev/null +++ b/src/app_modules/admin/map/component/drawer.tsx @@ -0,0 +1,37 @@ +"use client"; + +import { Drawer, Group, Text } from "@mantine/core"; +import { ComponentAdmin_UIDrawerNotifikasi } from "../../notifikasi/ui_drawer_notifikasi"; +import { MODEL_MAP } from "@/app_modules/map/lib/interface"; + +export function ComponentAdminMap_Drawer({ + opened, + onClose, + data, +}: { + opened: boolean; + onClose: () => void; + data: MODEL_MAP | any; +}) { + return ( + <> + + + Detail Map + + + } + opened={opened} + onClose={onClose} + position="right" + size={"xs"} + transitionProps={{transition: "fade", duration: 500}} + > + Detail Map + {data} + + + ); +} diff --git a/src/app_modules/admin/map/component/index.ts b/src/app_modules/admin/map/component/index.ts new file mode 100644 index 00000000..9831e325 --- /dev/null +++ b/src/app_modules/admin/map/component/index.ts @@ -0,0 +1,3 @@ +import { ComponentAdminMap_Drawer } from "./drawer"; + +export { ComponentAdminMap_Drawer }; 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 new file mode 100644 index 00000000..2f26be0f --- /dev/null +++ b/src/app_modules/admin/map/fun/fun_get_all_maps.ts @@ -0,0 +1,16 @@ +"use server"; + +import prisma from "@/app/lib/prisma"; + +export async function adminMap_funGetAllMaps() { + const data = await prisma.businessMaps.findMany({ + orderBy: { + createdAt: "desc", + }, + where: { + isActive: true, + }, + }); + + return data; +} diff --git a/src/app_modules/admin/map/fun/index.ts b/src/app_modules/admin/map/fun/index.ts new file mode 100644 index 00000000..04f30b48 --- /dev/null +++ b/src/app_modules/admin/map/fun/index.ts @@ -0,0 +1,3 @@ +import { adminMap_funGetAllMaps } from "./fun_get_all_maps"; + +export { adminMap_funGetAllMaps }; diff --git a/src/app_modules/admin/map/ui/index.ts b/src/app_modules/admin/map/ui/index.ts new file mode 100644 index 00000000..710039e2 --- /dev/null +++ b/src/app_modules/admin/map/ui/index.ts @@ -0,0 +1,3 @@ +import { UiAdminMap_MapBoxView } from "./ui_map_view"; + +export { UiAdminMap_MapBoxView }; diff --git a/src/app_modules/admin/map/ui/ui_map_view.tsx b/src/app_modules/admin/map/ui/ui_map_view.tsx new file mode 100644 index 00000000..68bdbee9 --- /dev/null +++ b/src/app_modules/admin/map/ui/ui_map_view.tsx @@ -0,0 +1,117 @@ +"use client"; + +import { MODEL_MAP } from "@/app_modules/map/lib/interface"; +import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data"; +import { useState } from "react"; +import { + defaultLatLong, + defaultMapZoom, +} from "@/app_modules/map/lib/default_lat_long"; +import { Image, Paper, Stack, Text } from "@mantine/core"; +import "mapbox-gl/dist/mapbox-gl.css"; +import Map, { + AttributionControl, + Marker, + NavigationControl, + ScaleControl, +} from "react-map-gl"; +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); + + if (!mapboxToken) + return ; + + return ( + <> + + + {data.map((e, i) => ( + + + { + setMapId(e.id); + setOpenDrawer(true); + }} + > + image + + {e.namePin} + + + + + ))} + + + + + + + + setOpenDrawer(false)} + data={mapId as any} + /> + + ); +} diff --git a/src/app_modules/admin/map/view/index.ts b/src/app_modules/admin/map/view/index.ts new file mode 100644 index 00000000..857572ae --- /dev/null +++ b/src/app_modules/admin/map/view/index.ts @@ -0,0 +1,3 @@ +import { AdminMap_View } from "./view"; + +export { AdminMap_View } \ No newline at end of file diff --git a/src/app_modules/admin/map/view/view.tsx b/src/app_modules/admin/map/view/view.tsx new file mode 100644 index 00000000..79d8dec9 --- /dev/null +++ b/src/app_modules/admin/map/view/view.tsx @@ -0,0 +1,19 @@ +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; +import { adminMap_funGetAllMaps } from "../fun/fun_get_all_maps"; +import { UiAdminMap_MapBoxView } from "../ui"; + + +const mapboxToken = process.env.MAPBOX_TOKEN!; +export async function AdminMap_View() { + const dataMap = await adminMap_funGetAllMaps(); + return ( + <> + + + + + ); +} diff --git a/src/app_modules/admin/vote/child/riwayat/index.tsx b/src/app_modules/admin/vote/child/riwayat/index.tsx index 84d76f3b..e28e4cdd 100644 --- a/src/app_modules/admin/vote/child/riwayat/index.tsx +++ b/src/app_modules/admin/vote/child/riwayat/index.tsx @@ -1,7 +1,7 @@ "use client"; import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; -import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate"; import { AdminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id"; import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; import { MODEL_VOTING } from "@/app_modules/vote/model/interface"; diff --git a/src/app_modules/admin/vote/child/table_publish/index.tsx b/src/app_modules/admin/vote/child/table_publish/index.tsx index de6d2c9f..1b814369 100644 --- a/src/app_modules/admin/vote/child/table_publish/index.tsx +++ b/src/app_modules/admin/vote/child/table_publish/index.tsx @@ -1,7 +1,7 @@ "use client"; import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; -import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate"; import { AdminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id"; import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; import { 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 e396446b..bc92e452 100644 --- a/src/app_modules/admin/vote/child/table_reject/index.tsx +++ b/src/app_modules/admin/vote/child/table_reject/index.tsx @@ -1,7 +1,7 @@ "use client"; import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; -import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate"; import { AdminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id"; import { MODEL_VOTING } from "@/app_modules/vote/model/interface"; import { diff --git a/src/app_modules/admin/vote/child/table_review/index.tsx b/src/app_modules/admin/vote/child/table_review/index.tsx index f14023a2..587e4ae1 100644 --- a/src/app_modules/admin/vote/child/table_review/index.tsx +++ b/src/app_modules/admin/vote/child/table_review/index.tsx @@ -1,6 +1,6 @@ "use client"; -import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate"; import { MODEL_VOTING } from "@/app_modules/vote/model/interface"; import { Box, diff --git a/src/app_modules/admin/vote/main/index.tsx b/src/app_modules/admin/vote/main/index.tsx index ba29d2e5..883ad486 100644 --- a/src/app_modules/admin/vote/main/index.tsx +++ b/src/app_modules/admin/vote/main/index.tsx @@ -2,7 +2,7 @@ import { Stack, SimpleGrid, Paper, Group, Title, Text } from "@mantine/core"; import { useRouter } from "next/navigation"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate"; export default function AdminVote_Main({ countPublish, 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 6b5b1e1b..a711aa7b 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 @@ -2,15 +2,12 @@ import prisma from "@/app/lib/prisma"; -export async function auth_funEditAktivasiKodeOtpById(otpId: string) { +export async function auth_funDeleteAktivasiKodeOtpById(otpId: string) { // console.log(otpId); - const updt = await prisma.kodeOtp.update({ + const updt = await prisma.kodeOtp.delete({ where: { id: otpId, }, - data: { - isActive: false, - }, }); if (!updt) return { status: 400, message: "Gagal Update Aktivasi Kode OTP" }; diff --git a/src/app_modules/auth/fun/fun_login.ts b/src/app_modules/auth/fun/fun_login.ts index 918a53bb..7f53c3a2 100644 --- a/src/app_modules/auth/fun/fun_login.ts +++ b/src/app_modules/auth/fun/fun_login.ts @@ -9,7 +9,10 @@ export async function auth_funLogin(nomor: string) { try { const res = await fetch( - `https://wa.wibudev.com/code?nom=${nomor}&text=HIPMI - Masukan kode OTP sesuai dengan nomor yang anda daftarkan, kode ini bersifat rahasia & jangan di bagikan pada siapapun termasuk anggota ataupun pengurus HIPMI lainnya. Kode OTP anda: ${codeOtp}` + `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(); @@ -31,6 +34,7 @@ export async function auth_funLogin(nomor: string) { kodeOtpId: createOtpId.id, }; } catch (error) { + console.log(error); return { status: 500, message: "Server Error !!!" }; } } diff --git a/src/app_modules/auth/fun/fun_logout.ts b/src/app_modules/auth/fun/fun_logout.ts index 60f8a143..88c8d311 100644 --- a/src/app_modules/auth/fun/fun_logout.ts +++ b/src/app_modules/auth/fun/fun_logout.ts @@ -14,13 +14,12 @@ export async function auth_Logout(kodeId: string) { const c = cookies().get("ssn"); if (c?.value !== "") return { status: 400, message: "Gagal Logout" }; - const del = await prisma.kodeOtp.delete({ - where: { - id: kodeId, - }, - }); - - if (!del) return { status: 400, message: "Gagal Hapus Kode OTP Id"}; + // const del = await prisma.kodeOtp.delete({ + // where: { + // id: kodeId, + // }, + // }); + // if (!del) return { status: 400, message: "Gagal Hapus Kode OTP Id"}; // revalidatePath("/dev/katalog") return { status: 200, message: "Logout Berhasil" }; } diff --git a/src/app_modules/auth/fun/get_kode_otp_by_id.ts b/src/app_modules/auth/fun/get_kode_otp_by_id.ts index 8b0849ae..7780afad 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 @@ -9,5 +9,5 @@ export async function auth_getKodeOtpById(otpId: string) { }, }); - return data + return data; } diff --git a/src/app_modules/auth/login/view.tsx b/src/app_modules/auth/login/view.tsx index c7bf866b..eea2d111 100644 --- a/src/app_modules/auth/login/view.tsx +++ b/src/app_modules/auth/login/view.tsx @@ -1,35 +1,29 @@ "use client"; -import { - BackgroundImage, - Box, - Button, - Center, - Flex, - Grid, - Group, - Image, - Stack, - Text, - TextInput, - Title, -} from "@mantine/core"; -import { useFocusTrap } from "@mantine/hooks"; -import { useRouter } from "next/navigation"; -import { useState } from "react"; -import { useAtom } from "jotai"; -import { gs_kodeId } from "../state/state"; -import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; -import { auth_funLogin } from "@/app_modules/auth/fun/fun_login"; import { RouterAuth } from "@/app/lib/router_hipmi/router_auth"; -import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; -import { PhoneInput } from "react-international-phone"; -import "react-international-phone/style.css"; import { AccentColor, MainColor, } from "@/app_modules/_global/color/color_pallet"; import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input"; +import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; +import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; +import { auth_funLogin } from "@/app_modules/auth/fun/fun_login"; +import { + BackgroundImage, + Button, + Center, + Stack, + Text, + Title +} from "@mantine/core"; +import { useFocusTrap } from "@mantine/hooks"; +import { useAtom } from "jotai"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; +import { PhoneInput } from "react-international-phone"; +import "react-international-phone/style.css"; +import { gs_kodeId } from "../state/state"; export default function Login() { const router = useRouter(); diff --git a/src/app_modules/auth/logout/view.tsx b/src/app_modules/auth/logout/view.tsx index e0a3dc33..5562145c 100644 --- a/src/app_modules/auth/logout/view.tsx +++ b/src/app_modules/auth/logout/view.tsx @@ -1,26 +1,21 @@ "use client"; +import { Warna } from "@/app/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 UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal"; import { ActionIcon, Button, - Group, - Modal, Stack, - Text, - Title, + Text } from "@mantine/core"; -import { useRouter } from "next/navigation"; -import { useAtom } from "jotai"; -import { gs_kodeId, gs_nomor, gs_otp } from "../state/state"; import { IconLogout } from "@tabler/icons-react"; -import { Warna } from "@/app/lib/warna"; -import { useDisclosure } from "@mantine/hooks"; -import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; -import { auth_Logout } from "../fun/fun_logout"; -import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; -import { RouterAuth } from "@/app/lib/router_hipmi/router_auth"; +import { useAtom } from "jotai"; +import { useRouter } from "next/navigation"; import { useState } from "react"; -import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal"; +import { auth_Logout } from "../fun/fun_logout"; +import { gs_kodeId } from "../state/state"; export default function Component_Logout() { const router = useRouter(); diff --git a/src/app_modules/auth/register/view.tsx b/src/app_modules/auth/register/view.tsx index 2e8fc7fa..087db307 100644 --- a/src/app_modules/auth/register/view.tsx +++ b/src/app_modules/auth/register/view.tsx @@ -1,42 +1,31 @@ "use client"; -import { Warna } from "@/app/lib/warna"; -import { - Flex, - Title, - TextInput, - Button, - Text, - Center, - PinInput, - Stack, - BackgroundImage, -} from "@mantine/core"; -import { - IconCircleLetterH, - IconCloudLockOpen, - IconUserCircle, -} from "@tabler/icons-react"; -import { gs_nomor } from "../state/state"; -import { useAtom } from "jotai"; -import { useState } from "react"; -import { myConsole } from "@/app/fun/my_console"; -import toast from "react-simple-toasts"; -import { ApiHipmi } from "@/app/lib/api"; -import { useRouter } from "next/navigation"; -import _ from "lodash"; -import { useFocusTrap } from "@mantine/hooks"; -import { Auth_funRegister } from "../fun/fun_register"; -import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; -import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; -import { IconPencilCheck } from "@tabler/icons-react"; import { RouterHome } from "@/app/lib/router_hipmi/router_home"; -import { auth_funEditAktivasiKodeOtpById } from "../fun/fun_edit_aktivasi_kode_otp_by_id"; -import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input"; import { AccentColor, MainColor, } from "@/app_modules/_global/color/color_pallet"; +import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input"; +import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; +import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; +import { + BackgroundImage, + Button, + Center, + Stack, + Text, + TextInput, + Title +} from "@mantine/core"; +import { useFocusTrap } from "@mantine/hooks"; +import { + IconUserCircle +} from "@tabler/icons-react"; +import _ from "lodash"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; +import { auth_funDeleteAktivasiKodeOtpById } from "../fun/fun_edit_aktivasi_kode_otp_by_id"; +import { Auth_funRegister } from "../fun/fun_register"; export default function Register({ dataOtp }: { dataOtp: any }) { const router = useRouter(); @@ -60,21 +49,20 @@ export default function Register({ dataOtp }: { dataOtp: any }) { if (body.username.length < 5) return null; if (_.values(body.username).includes(" ")) return null; - await Auth_funRegister(body).then(async (res) => { - if (res.status === 200) { - await auth_funEditAktivasiKodeOtpById(dataOtp.id).then((val) => { - if (val.status === 200) { - ComponentGlobal_NotifikasiBerhasil(res.message); - setLoading(true); - router.push(RouterHome.main_home, { scroll: false }); - } else { - ComponentGlobal_NotifikasiPeringatan(val.message); - } - }); - } else { - ComponentGlobal_NotifikasiPeringatan(res.message); - } - }); + const res = await Auth_funRegister(body) + if (res.status === 200) { + await auth_funDeleteAktivasiKodeOtpById(dataOtp.id).then((val) => { + if (val.status === 200) { + ComponentGlobal_NotifikasiBerhasil(res.message); + setLoading(true); + router.push(RouterHome.main_home, { scroll: false }); + } else { + ComponentGlobal_NotifikasiPeringatan(val.message); + } + }); + } else { + ComponentGlobal_NotifikasiPeringatan(res.message); + } } return ( diff --git a/src/app_modules/auth/validasi/view.tsx b/src/app_modules/auth/validasi/view.tsx index 40398736..c80cab25 100644 --- a/src/app_modules/auth/validasi/view.tsx +++ b/src/app_modules/auth/validasi/view.tsx @@ -24,7 +24,7 @@ import { useFocusTrap } from "@mantine/hooks"; import { IconChevronLeft } from "@tabler/icons-react"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import { auth_funEditAktivasiKodeOtpById } from "../fun/fun_edit_aktivasi_kode_otp_by_id"; +import { auth_funDeleteAktivasiKodeOtpById } from "../fun/fun_edit_aktivasi_kode_otp_by_id"; import { auth_funValidasi } from "../fun/fun_validasi"; export default function Validasi({ dataOtp }: { dataOtp: any }) { @@ -41,26 +41,26 @@ export default function Validasi({ dataOtp }: { dataOtp: any }) { if (code != inputCode) return ComponentGlobal_NotifikasiPeringatan("Kode Salah"); - await auth_funValidasi(nomor).then(async (res) => { - if (res.status === 200) { - await auth_funEditAktivasiKodeOtpById(dataOtp.id).then((val) => { - if (val.status === 200) { - if (res.role === "1") { - ComponentGlobal_NotifikasiBerhasil(res.message); - setLoading(true); - router.push(RouterHome.main_home, { scroll: false }); - } else { - router.push(RouterAdminDashboard.splash_admin); - } - } else { - ComponentGlobal_NotifikasiPeringatan(val.message); - } - }); + const res = await auth_funValidasi(nomor); + if (res.status === 200) { + + const resAktivasi = await auth_funDeleteAktivasiKodeOtpById(dataOtp.id); + if (resAktivasi.status === 200) { + if (res.role === "1") { + ComponentGlobal_NotifikasiBerhasil(res.message); + setLoading(true); + router.push(RouterHome.main_home, { scroll: false }); + } else { + router.push(RouterAdminDashboard.splash_admin); + } } else { - ComponentGlobal_NotifikasiBerhasil(res.message); - router.push(RouterAuth.register + dataOtp.id); + ComponentGlobal_NotifikasiPeringatan(resAktivasi.message); } - }); + + } else { + ComponentGlobal_NotifikasiBerhasil(res.message); + router.push(RouterAuth.register + dataOtp.id, { scroll: false }); + } } return ( diff --git a/src/app_modules/katalog/portofolio/component/button_more.tsx b/src/app_modules/katalog/portofolio/component/button_more.tsx index b3cda470..65397a97 100644 --- a/src/app_modules/katalog/portofolio/component/button_more.tsx +++ b/src/app_modules/katalog/portofolio/component/button_more.tsx @@ -1,6 +1,7 @@ "use client"; import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog"; +import { RouterMap } from "@/app/lib/router_hipmi/router_map"; import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer"; import { ActionIcon } from "@mantine/core"; import { @@ -8,6 +9,7 @@ import { IconDotsVertical, IconEdit, IconId, + IconMapPinMinus, IconPhotoEdit, } from "@tabler/icons-react"; import { useRouter } from "next/navigation"; @@ -26,22 +28,28 @@ export function ComponentPortofolio_ButtonMore({ const listPage = [ { id: "1", - name: "Update detail bisnis", + name: "Edit detail ", icon: , path: RouterPortofolio.edit_data_bisnis + `${portoId}`, }, { id: "2", - name: "Update logo ", + name: "Edit logo ", icon: , path: RouterPortofolio.edit_logo_bisnis + `${portoId}`, }, { id: "3", - name: "Update sosial media", + name: "Edit sosial media", icon: , path: RouterPortofolio.edit_medsos_bisnis + `${portoId}`, }, + { + id: "4", + name: "Edit pin map", + icon: , + path: RouterMap.edit + `${portoId}`, + }, ]; return ( 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 64bb66be..671b0ee6 100644 --- a/src/app_modules/katalog/portofolio/component/card_view_daftar.tsx +++ b/src/app_modules/katalog/portofolio/component/card_view_daftar.tsx @@ -1,6 +1,6 @@ import { Group, Paper, Stack, Text } from "@mantine/core"; import { MODEL_PORTOFOLIO } from "../model/interface"; -import { AccentColor } from "@/app_modules/_global/color/color_pallet"; +import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet"; import ComponentGlobal_Loader from "@/app_modules/_global/component/loader"; import { IconCaretRight } from "@tabler/icons-react"; import { useRouter } from "next/navigation"; @@ -33,9 +33,15 @@ export function ComponentPortofolio_DaftarBoxView({ }} > - - {data?.namaBisnis} - + + + {data?.namaBisnis} + + + #{data?.id_Portofolio} + + + {isLoading ? ( diff --git a/src/app_modules/katalog/portofolio/component/detail_data_drawer_map.tsx b/src/app_modules/katalog/portofolio/component/detail_data_drawer_map.tsx new file mode 100644 index 00000000..146975cd --- /dev/null +++ b/src/app_modules/katalog/portofolio/component/detail_data_drawer_map.tsx @@ -0,0 +1,108 @@ +"use client"; + +import { RouterMap } from "@/app/lib/router_hipmi/router_map"; +import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header"; +import { + Box, + Button, + Grid, + Group, + Image, + SimpleGrid, + Stack, + Text, + Title, +} from "@mantine/core"; +import { useShallowEffect } from "@mantine/hooks"; +import { useState } from "react"; +import { + IconBuildingSkyscraper, + IconListDetails, + IconPhoneCall, + IconMapPin, +} from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; +import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog"; +import { MainColor } from "@/app_modules/_global/color/color_pallet"; +import { MODEL_MAP } from "@/app_modules/map/lib/interface"; +import { map_funGetOneById } from "@/app_modules/map/fun/get/fun_get_one_by_id"; + +export function ComponentPortofolio_DetailDataMap({ mapId }: { mapId: any }) { + const router = useRouter(); + const [data, setData] = useState(); + + useShallowEffect(() => { + onLoadData(mapId); + }, [mapId]); + + async function onLoadData(mapId: string) { + const res: any = await map_funGetOneById({ mapId: mapId }); + setData(res); + } + + return ( + <> + + + + + Foto + + + + + + + {data?.Portofolio.namaBisnis} + + + + + + + + {data?.Portofolio.MasterBidangBisnis.name} + + + + + + + + +{data?.Portofolio.tlpn} + + + + + + + + {data?.Portofolio.alamatKantor} + + + + + + {/*
{JSON.stringify(data, null, 2)}
*/} +
+ + ); +} diff --git a/src/app_modules/katalog/portofolio/component/index.ts b/src/app_modules/katalog/portofolio/component/index.ts new file mode 100644 index 00000000..ce8e74ee --- /dev/null +++ b/src/app_modules/katalog/portofolio/component/index.ts @@ -0,0 +1 @@ +export { ComponentPortofolio_DetailDataMap } from "./detail_data_drawer_map"; diff --git a/src/app_modules/katalog/portofolio/create/create_intro.tsx b/src/app_modules/katalog/portofolio/create/create_intro.tsx deleted file mode 100644 index ec59e159..00000000 --- a/src/app_modules/katalog/portofolio/create/create_intro.tsx +++ /dev/null @@ -1 +0,0 @@ -// create \ 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 1857e261..c9054145 100644 --- a/src/app_modules/katalog/portofolio/create/layout.tsx +++ b/src/app_modules/katalog/portofolio/create/layout.tsx @@ -3,13 +3,17 @@ import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate"; import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate"; -export default function CreatePortofolioLayout({ children, profileId }: { children: any, profileId: any }) { +export default function CreatePortofolioLayout({ + children, + profileId, +}: { + children: any; + profileId: any; +}) { return ( <> - } + header={} > {children} diff --git a/src/app_modules/katalog/portofolio/create/view.tsx b/src/app_modules/katalog/portofolio/create/view.tsx index fd148a57..b11ed7fe 100644 --- a/src/app_modules/katalog/portofolio/create/view.tsx +++ b/src/app_modules/katalog/portofolio/create/view.tsx @@ -1,9 +1,12 @@ "use client"; -import { Warna } from "@/app/lib/warna"; -import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input"; +import { RouterMap } from "@/app/lib/router_hipmi/router_map"; +import { + AccentColor, + MainColor, +} from "@/app_modules/_global/color/color_pallet"; +import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information"; 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 { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; import { @@ -12,6 +15,7 @@ import { } from "@/app_modules/model_global/portofolio"; import { AspectRatio, + Box, Button, Center, FileButton, @@ -19,21 +23,17 @@ import { Paper, Select, Stack, + Text, TextInput, Textarea, + Title, } from "@mantine/core"; import { IconCamera } from "@tabler/icons-react"; import _ from "lodash"; import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import ComponentKatalog_NotedBox from "../../component/noted_box"; import funCreatePortofolio from "../fun/fun_create_portofolio"; -import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information"; -import { - AccentColor, - MainColor, -} from "@/app_modules/_global/color/color_pallet"; export default function CreatePortofolio({ bidangBisnis, @@ -84,7 +84,7 @@ export default function CreatePortofolio({ onChange={(val) => { setValue({ ...value, - namaBisnis: val.target.value, + namaBisnis: _.startCase(val.target.value), }); }} /> @@ -115,8 +115,8 @@ export default function CreatePortofolio({ }, }} withAsterisk - label="Alamat Kantor" - placeholder="Alamat kantor" + label="Alamat Bisnis" + placeholder="Alamat bisnis" maxLength={100} onChange={(val) => { setValue({ @@ -132,8 +132,8 @@ export default function CreatePortofolio({ }, }} withAsterisk - label="Nomor Telepon Kantor" - placeholder="Nomor telepon kantor" + label="Nomor Telepon " + placeholder="Nomor telepon " type="number" onChange={(val) => { setValue({ @@ -149,7 +149,7 @@ export default function CreatePortofolio({ color: "white", }, }} - maxLength={150} + maxLength={300} autosize minRows={2} maxRows={5} @@ -164,7 +164,7 @@ export default function CreatePortofolio({ }} />
@@ -172,12 +172,62 @@ export default function CreatePortofolio({ - + {/* Foto - {isFile ? : ""} + + + + {isFile ? : ""} */} + + {img ? ( + + + Foto + + + ) : ( + + + + + Upload Logo Bisnis + + Masukan logo bisnis anda untuk ditampilkan dalam + portofolio + + + + + + )}
- + @@ -361,15 +409,17 @@ async function onSubmit( const gambar = new FormData(); gambar.append("file", file as any); - await funCreatePortofolio(profileId, porto as any, gambar, dataMedsos).then( - (res) => { - if (res.status === 201) { - setLoading(true); - ComponentGlobal_NotifikasiBerhasil("Berhasil disimpan"); - router.back(); - } else { - ComponentGlobal_NotifikasiGagal("Gagal disimpan"); - } - } + const res = await funCreatePortofolio( + profileId, + porto as any, + gambar, + dataMedsos ); + if (res.status === 201) { + setLoading(true); + // ComponentGlobal_NotifikasiBerhasil("Berhasil disimpan"); + router.replace(RouterMap.create + res.id , {scroll: false}); + } else { + ComponentGlobal_NotifikasiGagal("Gagal disimpan"); + } } 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 7ff8771e..b5bfb78f 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 @@ -147,7 +147,7 @@ export default function Portofolio_EditDataBisnis({ value={value.deskripsi} label="Deskripsi" placeholder="Deskripsi singkat mengenai usaha" - maxLength={150} + maxLength={300} error={ value.deskripsi === "" ? ( @@ -163,7 +163,7 @@ export default function Portofolio_EditDataBisnis({ }} /> 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 fab639b5..58d0f117 100644 --- a/src/app_modules/katalog/portofolio/fun/fun_create_portofolio.ts +++ b/src/app_modules/katalog/portofolio/fun/fun_create_portofolio.ts @@ -34,7 +34,7 @@ export default async function funCreatePortofolio( const upload_Folder = Buffer.from(await gambar.arrayBuffer()); fs.writeFileSync(`./public/portofolio/logo/${upload.url}`, upload_Folder); - const createProto = await prisma.portofolio.create({ + const createPortofolio = await prisma.portofolio.create({ data: { profileId: profileId, id_Portofolio: "Porto" + Date.now().toString(), @@ -47,11 +47,11 @@ export default async function funCreatePortofolio( }, }); - if (!createProto) return { status: 400, message: "Gagal membuat portofolio" }; + if (!createPortofolio) return { status: 400, message: "Gagal membuat portofolio" }; const createMedsos = await prisma.portofolio_MediaSosial.create({ data: { - portofolioId: createProto.id, + portofolioId: createPortofolio.id, facebook: medsos.facebook, instagram: medsos.instagram, tiktok: medsos.tiktok, @@ -65,6 +65,7 @@ export default async function funCreatePortofolio( revalidatePath(`/dev/katalog`); return { + id: createPortofolio.id, status: 201, message: "Berhasil menambahakan portofolio", }; 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 77c87b5b..9afa5443 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 @@ -14,6 +14,7 @@ export async function funGetListPortofolio(profileId: any) { }, select: { id: true, + id_Portofolio: true, namaBisnis: true, profileId: true, }, 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 73f01ce2..49565a82 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 @@ -10,6 +10,7 @@ export async function portofolio_getOneById(portoId: string) { }, select: { id: true, + id_Portofolio: true, namaBisnis: true, alamatKantor: true, deskripsi: true, @@ -37,6 +38,11 @@ export async function portofolio_getOneById(portoId: string) { }, }, }, + BusinessMaps: { + include: { + Author: true, + }, + }, }, }); diff --git a/src/app_modules/katalog/portofolio/model/interface.ts b/src/app_modules/katalog/portofolio/model/interface.ts index a954ecfa..67b1f53e 100644 --- a/src/app_modules/katalog/portofolio/model/interface.ts +++ b/src/app_modules/katalog/portofolio/model/interface.ts @@ -1,6 +1,7 @@ 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"; export interface MODEL_PORTOFOLIO { id: string; @@ -14,8 +15,10 @@ export interface MODEL_PORTOFOLIO { profileId: string; Logo: MODEL_IMAGES; logoId: string; - Portofolio_MediaSosial: MODEL_PORTOFOLIO_MEDSOS - Profile: MODEL_PROFILE + Portofolio_MediaSosial: MODEL_PORTOFOLIO_MEDSOS; + Profile: MODEL_PROFILE; + BusinessMaps: MODEL_MAP; + id_Portofolio: string } export interface MODEL_PORTOFOLIO_BIDANG_BISNIS { 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 01564ac1..a6927246 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,16 @@ -import { Paper, Title, Stack, Grid, Text } from "@mantine/core"; +import { + Paper, + Title, + Stack, + Grid, + Text, + SimpleGrid, + Box, + AspectRatio, + Image, + Group, + Divider, +} from "@mantine/core"; import { IconBuildingSkyscraper, IconPhoneCall, @@ -7,7 +19,11 @@ import { IconPinned, } from "@tabler/icons-react"; import { MODEL_PORTOFOLIO } from "../model/interface"; -import { AccentColor } from "@/app_modules/_global/color/color_pallet"; +import { + AccentColor, + MainColor, +} from "@/app_modules/_global/color/color_pallet"; +import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog"; export function Portofolio_UiDetailData({ dataPorto, @@ -26,48 +42,86 @@ export function Portofolio_UiDetailData({ color: "white", }} > - Data Bisnis - - - - - - - {dataPorto?.namaBisnis} - - - - - - - - +{dataPorto?.tlpn} - - - - - - - - {dataPorto?.alamatKantor} - - - - - - - - {dataPorto?.MasterBidangBisnis.name} - - - - + + + Data Bisnis + + id: {" "} + #{dataPorto.id_Portofolio} + + + + + + + + Foto + + + + + + + + + + + {dataPorto?.namaBisnis} + + + + + + + + {dataPorto?.MasterBidangBisnis.name} + + + + + + + + +{dataPorto?.tlpn} + + + + + + + + {dataPorto?.alamatKantor} + + + + + + + + + + - - - {dataPorto?.deskripsi} - - + + Tentang Kami + + + {dataPorto?.deskripsi} + diff --git a/src/app_modules/katalog/portofolio/ui/ui_detail_map.tsx b/src/app_modules/katalog/portofolio/ui/ui_detail_map.tsx new file mode 100644 index 00000000..4cc9d467 --- /dev/null +++ b/src/app_modules/katalog/portofolio/ui/ui_detail_map.tsx @@ -0,0 +1,135 @@ +"use client"; + +import { AccentColor } from "@/app_modules/_global/color/color_pallet"; +import { ComponentMap_DrawerDetailData } from "@/app_modules/map/_component"; +import { + defaultMapZoom +} from "@/app_modules/map/lib/default_lat_long"; +import { MODEL_MAP } from "@/app_modules/map/lib/interface"; +import { Image, Paper, Stack, Text, Title } from "@mantine/core"; +import "mapbox-gl/dist/mapbox-gl.css"; +import { useState } from "react"; +import { + AttributionControl, + Map, + Marker, + NavigationControl, + ScaleControl, +} from "react-map-gl"; +import { ComponentPortofolio_DetailDataMap } from "../component"; + +export function Portofolio_UiMap({ + mapboxToken, + data, +}: { + mapboxToken: string; + data: MODEL_MAP; +}) { + return ( + + + + Lokasi Bisnis + + + + + + ); +} + +function MapView({ + mapboxToken, + data, +}: { + mapboxToken: string; + data: MODEL_MAP; +}) { + const [openDrawer, setOpenDrawer] = useState(false); + + return ( + <> + + { + setOpenDrawer(true); + }} + pitchAlignment="auto" + > + + image + + + {data.namePin} + + + + + + + + + + setOpenDrawer(false)} + mapId={data.id} + component={} + /> + + ); +} +// ComponentPortofolio_DetailDataMap; diff --git a/src/app_modules/katalog/portofolio/ui/ui_detail_portofolio.tsx b/src/app_modules/katalog/portofolio/ui/ui_detail_portofolio.tsx index 007d91f6..0ded4dc1 100644 --- a/src/app_modules/katalog/portofolio/ui/ui_detail_portofolio.tsx +++ b/src/app_modules/katalog/portofolio/ui/ui_detail_portofolio.tsx @@ -8,20 +8,23 @@ import { MODEL_PORTOFOLIO } from "../model/interface"; import { Portofolio_UiDetailData } from "./ui_detail_data"; import { Portofolio_UiDetailLogo } from "./ui_detail_logo"; import { Portofolio_UiSosialMedia } from "./ui_detail_media"; +import { Portofolio_UiMap } from "./ui_detail_map"; export default function Portofolio_UiDetail({ dataPorto, userLoginId, + mapboxToken, }: { dataPorto: MODEL_PORTOFOLIO; userLoginId: string; + mapboxToken: string }) { - return ( <> - + + {/* */} { - router.push(RouterPortofolio.create + `${profile.id}`); + router.push(RouterPortofolio.create + `${profile.id}`, { + scroll: false, + }); setLoading(true); }} > @@ -102,9 +104,14 @@ export function Portofolio_UiListView({ }} > - - {e?.namaBisnis} - + + + {e?.namaBisnis} + + + #{e.id_Portofolio} + + {idPorto === e?.id && loadingPorto ? ( diff --git a/src/app_modules/map/_component/detail_data.tsx b/src/app_modules/map/_component/detail_data.tsx index 114cf432..043e88e6 100644 --- a/src/app_modules/map/_component/detail_data.tsx +++ b/src/app_modules/map/_component/detail_data.tsx @@ -1,14 +1,37 @@ "use client"; -import { Skeleton, Stack, Text, Title } from "@mantine/core"; -import { Suspense, useState } from "react"; -import { MODEL_MAP } from "../lib/interface"; -import { useShallowEffect } from "@mantine/hooks"; -import { map_funGetOneById } from "../fun/get/fun_get_one_by_id"; -import ComponentGlobal_Loader from "@/app_modules/_global/component/loader"; +import { RouterMap } from "@/app/lib/router_hipmi/router_map"; import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header"; +import { + Box, + Button, + Flex, + Grid, + Group, + Image, + Loader, + SimpleGrid, + Skeleton, + Stack, + Text, + Title, +} from "@mantine/core"; +import { useShallowEffect } from "@mantine/hooks"; +import { useState } from "react"; +import { map_funGetOneById } from "../fun/get/fun_get_one_by_id"; +import { MODEL_MAP } from "../lib/interface"; +import { + IconBuildingSkyscraper, + IconListDetails, + IconPhoneCall, + IconMapPin, +} from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; +import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog"; +import { MainColor } from "@/app_modules/_global/color/color_pallet"; -export function ComponentMap_DetailData({ mapId }: { mapId: string }) { +export function ComponentMap_DetailData({ mapId }: { mapId: any }) { + const router = useRouter(); const [data, setData] = useState(); useShallowEffect(() => { @@ -20,35 +43,117 @@ export function ComponentMap_DetailData({ mapId }: { mapId: string }) { setData(res); } + if (!data) return ; + return ( <> - - - - latitude:{" "} - - {data?.latitude} - - - - longitude:{" "} - - {data?.longitude} - - - - - {data?.namePin} - {/* {data?.Author?.username} */} - + + + Foto + + + + + + + {data?.Portofolio.namaBisnis} + + + + + + + + {data?.Portofolio.MasterBidangBisnis.name} + + + + + + + + +{data?.Portofolio.tlpn} + + + + + + + + {data?.Portofolio.alamatKantor} + + + + + + + + + + + + + {/*
{JSON.stringify(data, null, 2)}
*/}
); } + +function CustomLoading() { + return ( + + + + + + + + + + + + + ); +} diff --git a/src/app_modules/map/_component/drawer.tsx b/src/app_modules/map/_component/drawer.tsx index 25abd243..f8f5c812 100644 --- a/src/app_modules/map/_component/drawer.tsx +++ b/src/app_modules/map/_component/drawer.tsx @@ -9,13 +9,12 @@ import { Stack, Title, } from "@mantine/core"; +import { useShallowEffect } from "@mantine/hooks"; import { IconX } from "@tabler/icons-react"; import { useRouter } from "next/navigation"; -import { Suspense, useState } from "react"; +import React, { useState } from "react"; +import { map_funGetOneById } from "../fun/get/fun_get_one_by_id"; import { MODEL_MAP } from "../lib/interface"; -import { useShallowEffect } from "@mantine/hooks"; -import { ComponentMap_DetailData } from "./detail_data"; -import ComponentGlobal_Loader from "@/app_modules/_global/component/loader"; interface MODEL_DRAWER { id: string; @@ -27,15 +26,27 @@ export function ComponentMap_DrawerDetailData({ opened, close, mapId, + component, }: { opened: boolean; close: () => void; mapId: string; + component: React.ReactNode; }) { const router = useRouter(); - const [isLoading, setIsLoading] = useState(false); const [data, setData] = useState(); + useShallowEffect(() => { + onLoadData(mapId); + }, [mapId]); + + async function onLoadData(mapId: string) { + const res: any = await map_funGetOneById({ mapId: mapId }); + if (res !== null) { + setData(res); + } + } + return ( <> - Detail Map + + {data?.namePin ? ( + data?.namePin + ) : ( + <Skeleton radius={"xl"} w={100} /> + )} + - }> - - + {component} diff --git a/src/app_modules/map/_component/header.tsx b/src/app_modules/map/_component/header.tsx index 75e8a759..ea6f9539 100644 --- a/src/app_modules/map/_component/header.tsx +++ b/src/app_modules/map/_component/header.tsx @@ -25,11 +25,11 @@ export function ComponentMap_Header() { <> setOpenDrawer(true)}> - - - } + // customButtonRight={ + // setOpenDrawer(true)}> + // + // + // } /> (null); + const [img, setImg] = useState(null); return ( <> - + + + + - - { - setNamePin(_.startCase(val.currentTarget.value)); - }} - /> - - + { + setNamePin(_.startCase(val.currentTarget.value)); + }} + /> + + + {img ? ( + + + Foto + + + ) : ( + + + + + 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) => ( + + )} + +
+
+ +
); @@ -106,14 +218,23 @@ function ButtonSavePin({ namePin, lat, long, + portofolioId, + file, }: { namePin: string; lat: string; long: string; + portofolioId: string; + file: FormData; }) { const router = useRouter(); async function onSavePin() { - const res = await map_funCreatePin({ data: { namePin, lat, long } }); + const gambar = new FormData(); + gambar.append("file", file as any); + + const res = await map_funCreatePin({ + data: { namePin, lat, long, portofolioId, gambar }, + }); res.status === 200 ? (ComponentGlobal_NotifikasiBerhasil(res.message), router.back()) : ComponentGlobal_NotifikasiGagal(res.message); @@ -121,19 +242,18 @@ function ButtonSavePin({ return ( <> - - - + ); } diff --git a/src/app_modules/map/ui/ui_edit_pin.tsx b/src/app_modules/map/ui/ui_edit_pin.tsx new file mode 100644 index 00000000..47e7d986 --- /dev/null +++ b/src/app_modules/map/ui/ui_edit_pin.tsx @@ -0,0 +1,241 @@ +"use client"; + +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 { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; +import { + AspectRatio, + Box, + Button, + Center, + FileButton, + Image, + Paper, + Stack, + Text, + TextInput, + Title, +} from "@mantine/core"; +import { IconCamera } from "@tabler/icons-react"; +import _ from "lodash"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; +import Map, { + AttributionControl, + Marker, + NavigationControl, + ScaleControl, +} from "react-map-gl"; +import { map_funCreatePin } from "../fun/create/fun_create_pin"; +import { defaultLatLong, defaultMapZoom } from "../lib/default_lat_long"; +import { MODEL_MAP } from "../lib/interface"; +import { RouterMap } from "@/app/lib/router_hipmi/router_map"; +import { map_funEditMap } from "../fun/edit/fun_edit_map"; + +export function UiMap_EditPin({ + mapboxToken, + dataMap, +}: { + mapboxToken: string; + dataMap: MODEL_MAP; +}) { + const [data, setData] = useState(dataMap); + const [file, setFile] = useState(null); + const [img, setImg] = useState(null); + + + return ( + <> + + { + setData({ + ...data, + latitude: a.lngLat.lat, + longitude: a.lngLat.lng, + }); + }} + attributionControl={false} + > + + + image + + + + + + + + + { + setData({ + ...data, + namePin: val.currentTarget.value, + }); + }} + /> + + + + {img ? ( + + + Foto + + + ) : ( + + + Foto + + + )} + +
+ { + 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) => ( + + )} + +
+
+ + +
+ + ); +} + +function ButtonSavePin({ data, file }: { data: MODEL_MAP; file: FormData }) { + const router = useRouter(); + async function onSavePin() { + const gambar = new FormData(); + gambar.append("file", file as any); + + const res = await map_funEditMap({ + data: data, + file: gambar + + }); + res.status === 200 + ? (ComponentGlobal_NotifikasiBerhasil(res.message), router.back()) + : ComponentGlobal_NotifikasiGagal(res.message); + } + + return ( + <> + + + ); +} diff --git a/src/app_modules/map/ui/ui_map.tsx b/src/app_modules/map/ui/ui_map.tsx index 6c0d60f1..095f6122 100644 --- a/src/app_modules/map/ui/ui_map.tsx +++ b/src/app_modules/map/ui/ui_map.tsx @@ -1,21 +1,20 @@ "use client"; -import "mapbox-gl/dist/mapbox-gl.css"; -import { Image, Stack, Text, Tooltip } from "@mantine/core"; +import { Image, Stack, Text } from "@mantine/core"; import { useShallowEffect } from "@mantine/hooks"; -import { useRef, useState } from "react"; +import "mapbox-gl/dist/mapbox-gl.css"; +import { useState } from "react"; import Map, { AttributionControl, - GeolocateControl, Marker, NavigationControl, - Popup, - ScaleControl, + ScaleControl } from "react-map-gl"; +import { ComponentMap_DrawerDetailData } from "../_component"; +import { ComponentMap_DetailData } from "../_component/detail_data"; +import { map_funGetAllMap } from "../fun/get/fun_get_all_map"; import { defaultLatLong, defaultMapZoom } from "../lib/default_lat_long"; import { MODEL_MAP } from "../lib/interface"; -import { ComponentMap_DrawerDetailData } from "../_component"; -import { map_funGetAllMap } from "../fun/get/fun_get_all_map"; export function UiMap_MapBoxView({ mapboxToken, @@ -90,7 +89,7 @@ export function UiMap_MapBoxView({ style={{ borderRadius: "5px", padding: "5px", - width: "auto", + width: 50, }} lineClamp={2} > @@ -111,6 +110,7 @@ export function UiMap_MapBoxView({ opened={openDrawer} close={() => setOpenDrawer(false)} mapId={mapId} + component={} /> ); diff --git a/src/app_modules/map/view/create.tsx b/src/app_modules/map/view/create.tsx index 21ba5642..7912ae91 100644 --- a/src/app_modules/map/view/create.tsx +++ b/src/app_modules/map/view/create.tsx @@ -4,16 +4,25 @@ import { UiMap_CreatePin } from "../ui/ui_create_pin"; import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data"; const mapboxToken = process.env.MAPBOX_TOKEN!; -export async function Map_CreateNewPin() { +export async function Map_CreateNewPin({ + portofolioId, +}: { + portofolioId: string; +}) { if (!mapboxToken) return ; return ( <> } + header={ + + } > - + ); diff --git a/src/app_modules/map/view/edit.tsx b/src/app_modules/map/view/edit.tsx new file mode 100644 index 00000000..6de5083d --- /dev/null +++ b/src/app_modules/map/view/edit.tsx @@ -0,0 +1,27 @@ +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 { UiMap_EditPin } from "../ui"; + +const mapboxToken = process.env.MAPBOX_TOKEN!; +export async function Map_EditPin({ + portofolioId, + dataMap, +}: { + portofolioId: string; + dataMap: any +}) { + if (!mapboxToken) + return ; + + return ( + <> + } + > + + + + ); +} diff --git a/src/app_modules/map/view/index.ts b/src/app_modules/map/view/index.ts index 0771b827..019ec033 100644 --- a/src/app_modules/map/view/index.ts +++ b/src/app_modules/map/view/index.ts @@ -1,3 +1,4 @@ export { Map_View } from "./main_view"; export { Map_Splash } from "./splash"; export { Map_CreateNewPin } from "./create"; +export { Map_EditPin } from "./edit";