@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hipmi",
|
"name": "hipmi",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"prisma": {
|
"prisma": {
|
||||||
"seed": "npx tsx prisma/seed.ts"
|
"seed": "npx tsx prisma/seed.ts"
|
||||||
|
|||||||
@@ -80,23 +80,19 @@ model KodeOtp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model Profile {
|
model Profile {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
name String
|
name String
|
||||||
email String @unique
|
email String @unique
|
||||||
alamat String
|
alamat String
|
||||||
jenisKelamin String
|
jenisKelamin String
|
||||||
active Boolean @default(true)
|
active Boolean @default(true)
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @default(now()) @updatedAt
|
updatedAt DateTime @default(now()) @updatedAt
|
||||||
User User? @relation(fields: [userId], references: [id])
|
User User? @relation(fields: [userId], references: [id])
|
||||||
userId String? @unique
|
userId String? @unique
|
||||||
ImageProfile Images? @relation(fields: [imagesId], references: [id])
|
Portofolio Portofolio[]
|
||||||
imagesId String? @unique
|
imageId String?
|
||||||
Portofolio Portofolio[]
|
imageBackgroundId String?
|
||||||
ImagesBackground ImagesBackground? @relation(fields: [imagesBackgroundId], references: [id])
|
|
||||||
imagesBackgroundId String? @unique
|
|
||||||
imageId String?
|
|
||||||
imageBackgroundId String?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
model Images {
|
model Images {
|
||||||
@@ -106,7 +102,6 @@ model Images {
|
|||||||
active Boolean @default(true)
|
active Boolean @default(true)
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @default(now()) @updatedAt
|
updatedAt DateTime @default(now()) @updatedAt
|
||||||
Profile Profile?
|
|
||||||
Investasi Investasi?
|
Investasi Investasi?
|
||||||
BeritaInvestasi BeritaInvestasi[]
|
BeritaInvestasi BeritaInvestasi[]
|
||||||
Donasi Donasi?
|
Donasi Donasi?
|
||||||
@@ -118,16 +113,6 @@ model Images {
|
|||||||
Investasi_Invoice Investasi_Invoice[]
|
Investasi_Invoice Investasi_Invoice[]
|
||||||
}
|
}
|
||||||
|
|
||||||
model ImagesBackground {
|
|
||||||
id String @id @default(cuid())
|
|
||||||
url String
|
|
||||||
label String
|
|
||||||
active Boolean @default(true)
|
|
||||||
createdAt DateTime @default(now())
|
|
||||||
updatedAt DateTime @updatedAt
|
|
||||||
Profile Profile?
|
|
||||||
}
|
|
||||||
|
|
||||||
model Portofolio {
|
model Portofolio {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
id_Portofolio String @unique
|
id_Portofolio String @unique
|
||||||
@@ -232,8 +217,7 @@ model Investasi {
|
|||||||
masterProgresInvestasiId String?
|
masterProgresInvestasiId String?
|
||||||
Investasi_Invoice Investasi_Invoice[]
|
Investasi_Invoice Investasi_Invoice[]
|
||||||
|
|
||||||
// imageId String?
|
imageId String?
|
||||||
// prospektusId String?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
model MasterPencarianInvestor {
|
model MasterPencarianInvestor {
|
||||||
@@ -281,6 +265,9 @@ model ProspektusInvestasi {
|
|||||||
updatedAt DateTime @default(now()) @updatedAt
|
updatedAt DateTime @default(now()) @updatedAt
|
||||||
investasi Investasi? @relation(fields: [investasiId], references: [id])
|
investasi Investasi? @relation(fields: [investasiId], references: [id])
|
||||||
investasiId String? @unique
|
investasiId String? @unique
|
||||||
|
|
||||||
|
fileId String?
|
||||||
|
title String?
|
||||||
}
|
}
|
||||||
|
|
||||||
model DokumenInvestasi {
|
model DokumenInvestasi {
|
||||||
@@ -292,6 +279,8 @@ model DokumenInvestasi {
|
|||||||
updatedAt DateTime @default(now()) @updatedAt
|
updatedAt DateTime @default(now()) @updatedAt
|
||||||
investasi Investasi? @relation(fields: [investasiId], references: [id])
|
investasi Investasi? @relation(fields: [investasiId], references: [id])
|
||||||
investasiId String?
|
investasiId String?
|
||||||
|
|
||||||
|
fileId String?
|
||||||
}
|
}
|
||||||
|
|
||||||
model BeritaInvestasi {
|
model BeritaInvestasi {
|
||||||
@@ -305,6 +294,8 @@ model BeritaInvestasi {
|
|||||||
imagesId String?
|
imagesId String?
|
||||||
investasi Investasi @relation(fields: [investasiId], references: [id])
|
investasi Investasi @relation(fields: [investasiId], references: [id])
|
||||||
investasiId String
|
investasiId String
|
||||||
|
|
||||||
|
imageId String?
|
||||||
}
|
}
|
||||||
|
|
||||||
model MasterProgresInvestasi {
|
model MasterProgresInvestasi {
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 7.7 KiB |
@@ -1,32 +0,0 @@
|
|||||||
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.imagesBackground.findUnique({
|
|
||||||
where: {
|
|
||||||
id: params.id,
|
|
||||||
},
|
|
||||||
select: {
|
|
||||||
url: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!fs.existsSync(`./public/profile/background/${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/profile/background/${get?.url}`);
|
|
||||||
return new NextResponse(file, {
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "image/png",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
import { Admin_KonfirmasiInvestasi } from "@/app_modules/admin/investasi";
|
import { Admin_KonfirmasiInvestasi } from "@/app_modules/admin/investasi";
|
||||||
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
|
|
||||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const dataInvestasi = await getOneInvestasiById(params.id);
|
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||||
const dataUser = await funGetUserProfile(dataInvestasi?.authorId as any);
|
|
||||||
// console.log(dataUser)
|
// console.log(dataUser)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
import { LayoutForum_Komentar } from "@/app_modules/forum";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export default async function Layout({children}: {children: React.ReactNode}) {
|
|
||||||
return<>
|
|
||||||
<LayoutForum_Komentar>{children}</LayoutForum_Komentar>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
|
||||||
import { Forum_Komentar } from "@/app_modules/forum";
|
|
||||||
import { forum_getOnePostingById } from "@/app_modules/forum/fun/get/get_one_posting_by_id";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
|
||||||
let postingId = params.id;
|
|
||||||
const dataPosting = await forum_getOnePostingById(postingId);
|
|
||||||
const userLoginId = await funGetUserIdByToken();
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Forum_Komentar
|
|
||||||
dataPosting={dataPosting as any}
|
|
||||||
userLoginId={userLoginId}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
|
|
||||||
import { EditProfileLayout } from "@/app_modules/katalog/profile";
|
import { EditProfileLayout } from "@/app_modules/katalog/profile";
|
||||||
|
|
||||||
export default async function Layout({
|
export default async function Layout({
|
||||||
@@ -8,8 +7,6 @@ export default async function Layout({
|
|||||||
children: any;
|
children: any;
|
||||||
params: { id: string };
|
params: { id: string };
|
||||||
}) {
|
}) {
|
||||||
let profileId = params.id;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<EditProfileLayout>{children}</EditProfileLayout>
|
<EditProfileLayout>{children}</EditProfileLayout>
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
|
|
||||||
import EditProfile from "@/app_modules/katalog/profile/edit/view";
|
import EditProfile from "@/app_modules/katalog/profile/edit/view";
|
||||||
import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile";
|
import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
let profileId = params.id
|
let profileId = params.id
|
||||||
const data = await funGetUserProfile(params.id);
|
|
||||||
const dataProfile = await Profile_getOneProfileAndUserById(profileId)
|
const dataProfile = await Profile_getOneProfileAndUserById(profileId)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,114 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
|
||||||
import {
|
|
||||||
Stack,
|
|
||||||
Grid,
|
|
||||||
Avatar,
|
|
||||||
Divider,
|
|
||||||
Text,
|
|
||||||
Group,
|
|
||||||
Loader,
|
|
||||||
Overlay,
|
|
||||||
Center,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "./notif_global/notifikasi_peringatan";
|
|
||||||
import moment from "moment";
|
|
||||||
import { useState } from "react";
|
|
||||||
|
|
||||||
export default function ComponentGlobal_AuthorNameAndAvatar({
|
|
||||||
profileId,
|
|
||||||
imagesId,
|
|
||||||
authorName,
|
|
||||||
tglPublish,
|
|
||||||
isPembatas,
|
|
||||||
}: {
|
|
||||||
profileId?: string;
|
|
||||||
imagesId?: string;
|
|
||||||
authorName?: string;
|
|
||||||
tglPublish?: Date;
|
|
||||||
isPembatas?: boolean;
|
|
||||||
}) {
|
|
||||||
const router = useRouter();
|
|
||||||
const skrng = new Date();
|
|
||||||
const [visible, setVisible] = useState(false);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Stack spacing={"xs"}>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col
|
|
||||||
span={"content"}
|
|
||||||
onClick={() => {
|
|
||||||
if (profileId) {
|
|
||||||
setVisible(true);
|
|
||||||
router.push(RouterProfile.katalogOLD + profileId);
|
|
||||||
} else {
|
|
||||||
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{visible ? (
|
|
||||||
<Avatar
|
|
||||||
size={30}
|
|
||||||
sx={{
|
|
||||||
borderStyle: "solid",
|
|
||||||
borderWidth: "1px",
|
|
||||||
borderColor: "white",
|
|
||||||
}}
|
|
||||||
radius={"xl"}
|
|
||||||
bg={"gray.1"}
|
|
||||||
>
|
|
||||||
<Overlay opacity={0.1}>
|
|
||||||
<Center h={"100%"}>
|
|
||||||
<Loader color="gray" size={20} />
|
|
||||||
</Center>
|
|
||||||
</Overlay>
|
|
||||||
</Avatar>
|
|
||||||
) : (
|
|
||||||
<Avatar
|
|
||||||
size={30}
|
|
||||||
sx={{
|
|
||||||
borderStyle: "solid",
|
|
||||||
borderWidth: "1px",
|
|
||||||
borderColor: "white",
|
|
||||||
}}
|
|
||||||
radius={"xl"}
|
|
||||||
bg={"gray.1"}
|
|
||||||
src={
|
|
||||||
imagesId
|
|
||||||
? RouterProfile.api_foto_profile + imagesId
|
|
||||||
: "/aset/global/avatar.png"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Stack justify="center" h={"100%"} c={"white"}>
|
|
||||||
<Group position="apart">
|
|
||||||
<Stack justify="center" h={"100%"} >
|
|
||||||
<Text lineClamp={1} fz={"sm"} fw={"bold"}>
|
|
||||||
{authorName ? authorName : "Nama author"}
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
|
||||||
<Stack justify="center" h={"100%"}>
|
|
||||||
{tglPublish ? (
|
|
||||||
<Text c={"white"} fz={"xs"}>
|
|
||||||
{skrng.toLocaleDateString(["id-ID"], {
|
|
||||||
dateStyle: "medium",
|
|
||||||
})}
|
|
||||||
</Text>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</Stack>
|
|
||||||
</Group>
|
|
||||||
</Stack>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
{isPembatas ? <Divider /> : ""}
|
|
||||||
</Stack>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
|
||||||
import {
|
|
||||||
Avatar,
|
|
||||||
Center,
|
|
||||||
Divider,
|
|
||||||
Grid,
|
|
||||||
Group,
|
|
||||||
Loader,
|
|
||||||
Overlay,
|
|
||||||
Stack,
|
|
||||||
Text,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
|
||||||
import React, { useState } from "react";
|
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "../notif_global/notifikasi_peringatan";
|
|
||||||
|
|
||||||
export default function ComponentGlobal_AvatarAndAuthorName({
|
|
||||||
dataUser,
|
|
||||||
isPembatas,
|
|
||||||
componentRight,
|
|
||||||
}: {
|
|
||||||
dataUser: MODEL_USER;
|
|
||||||
isPembatas?: boolean;
|
|
||||||
componentRight?: React.ReactNode;
|
|
||||||
}) {
|
|
||||||
const router = useRouter();
|
|
||||||
const [visible, setVisible] = useState(false);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Stack spacing={"xs"}>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col
|
|
||||||
span={"content"}
|
|
||||||
onClick={() => {
|
|
||||||
if (dataUser?.Profile?.id) {
|
|
||||||
setVisible(true);
|
|
||||||
router.push(RouterProfile.katalogOLD + dataUser?.Profile?.id);
|
|
||||||
} else {
|
|
||||||
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{visible ? (
|
|
||||||
<Avatar
|
|
||||||
size={30}
|
|
||||||
sx={{
|
|
||||||
borderStyle: "solid",
|
|
||||||
borderWidth: "1px",
|
|
||||||
borderColor: "white",
|
|
||||||
}}
|
|
||||||
radius={"xl"}
|
|
||||||
bg={"gray.1"}
|
|
||||||
>
|
|
||||||
<Overlay opacity={0.1}>
|
|
||||||
<Center h={"100%"}>
|
|
||||||
<Loader color="gray" size={20} />
|
|
||||||
</Center>
|
|
||||||
</Overlay>
|
|
||||||
</Avatar>
|
|
||||||
) : (
|
|
||||||
<Avatar
|
|
||||||
size={30}
|
|
||||||
sx={{
|
|
||||||
borderStyle: "solid",
|
|
||||||
borderWidth: "1px",
|
|
||||||
borderColor: "white",
|
|
||||||
}}
|
|
||||||
radius={"xl"}
|
|
||||||
bg={"gray.1"}
|
|
||||||
src={
|
|
||||||
dataUser?.Profile?.imagesId
|
|
||||||
? RouterProfile.api_foto_profile +
|
|
||||||
dataUser?.Profile?.imagesId
|
|
||||||
: "/aset/global/avatar.png"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Stack justify="center" h={"100%"} c={"white"}>
|
|
||||||
<Group position="apart">
|
|
||||||
<Stack justify="center" h={"100%"}>
|
|
||||||
<Text lineClamp={1} fz={"sm"} fw={"bold"}>
|
|
||||||
{dataUser?.username ? dataUser?.username : "Nama author"}
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
|
||||||
{componentRight ? componentRight : null}
|
|
||||||
</Group>
|
|
||||||
</Stack>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
{isPembatas ? <Divider /> : ""}
|
|
||||||
</Stack>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import { ComponentGlobal_ButtonUploadFileImage } from "../button/comp_button_upload_photo";
|
import { ComponentGlobal_ButtonUploadFileImage } from "../button/comp_button_upload_photo";
|
||||||
import ComponentGlobal_BoxInformation from "./box_information";
|
import ComponentGlobal_BoxInformation from "./box_information";
|
||||||
import ComponentGlobal_AvatarAndAuthorName from "./comp_author_name_and_avatar";
|
|
||||||
import { ComponentGlobal_AvatarAndUsername } from "./comp_avatar_and_username";
|
import { ComponentGlobal_AvatarAndUsername } from "./comp_avatar_and_username";
|
||||||
import { ComponentGlobal_BoxUploadImage } from "./comp_box_upload_image";
|
import { ComponentGlobal_BoxUploadImage } from "./comp_box_upload_image";
|
||||||
import { ComponentGlobal_CardStyles } from "./comp_card_box_and_background";
|
import { ComponentGlobal_CardStyles } from "./comp_card_box_and_background";
|
||||||
@@ -16,7 +15,6 @@ import ComponentGlobal_InputCountDown from "./input_countdown";
|
|||||||
|
|
||||||
export { ComponentGlobal_TampilanRupiah };
|
export { ComponentGlobal_TampilanRupiah };
|
||||||
export { ComponentGlobal_TampilanAngkaRatusan };
|
export { ComponentGlobal_TampilanAngkaRatusan };
|
||||||
export { ComponentGlobal_AvatarAndAuthorName };
|
|
||||||
export { ComponentGlobal_CardLoadingOverlay };
|
export { ComponentGlobal_CardLoadingOverlay };
|
||||||
export { ComponentGlobal_BoxInformation };
|
export { ComponentGlobal_BoxInformation };
|
||||||
export { ComponentGlobal_InputCountDown };
|
export { ComponentGlobal_InputCountDown };
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Box,
|
|
||||||
Center,
|
Center,
|
||||||
Group,
|
Group,
|
||||||
LoadingOverlay,
|
LoadingOverlay,
|
||||||
Skeleton,
|
Skeleton,
|
||||||
Text,
|
Text
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { MainColor } from "./color/color_pallet";
|
|
||||||
|
|
||||||
export default function ComponentGlobal_V2_LoadingPage() {
|
export default function ComponentGlobal_V2_LoadingPage() {
|
||||||
const listhHuruf = [
|
const listhHuruf = [
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||||
import {
|
import {
|
||||||
MODEL_EVENT,
|
MODEL_EVENT,
|
||||||
@@ -23,14 +24,12 @@ import {
|
|||||||
TextInput,
|
TextInput,
|
||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
import { IconCircleCheck, IconSearch } from "@tabler/icons-react";
|
import { IconCircleCheck, IconSearch } from "@tabler/icons-react";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
||||||
import { adminEvent_funGetListAllRiwayat } from "../fun";
|
import { adminEvent_funGetListAllRiwayat } from "../fun";
|
||||||
import { adminEvent_getListPesertaById } from "../fun/get/get_list_peserta_by_id";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
|
|
||||||
|
|
||||||
export default function AdminEvent_Riwayat({
|
export default function AdminEvent_Riwayat({
|
||||||
listRiwayat,
|
listRiwayat,
|
||||||
@@ -49,8 +48,6 @@ export default function AdminEvent_Riwayat({
|
|||||||
|
|
||||||
function DetailRiwayat({ listRiwayat }: { listRiwayat: any }) {
|
function DetailRiwayat({ listRiwayat }: { listRiwayat: any }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [opened, { open, close }] = useDisclosure(false);
|
|
||||||
const [peserta, setPeserta] = useState<MODEL_EVENT_PESERTA[]>();
|
|
||||||
const [eventId, setEventId] = useState("");
|
const [eventId, setEventId] = useState("");
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
@@ -89,14 +86,6 @@ function DetailRiwayat({ listRiwayat }: { listRiwayat: any }) {
|
|||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
router.push(RouterAdminEvent.detail_peserta + e.id);
|
router.push(RouterAdminEvent.detail_peserta + e.id);
|
||||||
// setEventId(e.id);
|
|
||||||
// setLoading(true);
|
|
||||||
// await new Promise((v) => setTimeout(v, 500));
|
|
||||||
// await AdminEvent_getListPesertaById(e.id).then((res: any) => {
|
|
||||||
// setPeserta(res);
|
|
||||||
// setLoading(false);
|
|
||||||
// });
|
|
||||||
// open();
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Lihat Peserta
|
Lihat Peserta
|
||||||
@@ -146,16 +135,6 @@ function DetailRiwayat({ listRiwayat }: { listRiwayat: any }) {
|
|||||||
</tr>
|
</tr>
|
||||||
));
|
));
|
||||||
|
|
||||||
// useShallowEffect(() => {
|
|
||||||
// getAllPeserta(eventId);
|
|
||||||
// }, [eventId]);
|
|
||||||
|
|
||||||
// async function getAllPeserta(eventId: string) {
|
|
||||||
// await adminEvent_getListPesertaById(eventId).then((res: any) =>
|
|
||||||
// setPeserta(res)
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={"xs"} h={"100%"}>
|
<Stack spacing={"xs"} h={"100%"}>
|
||||||
@@ -229,46 +208,6 @@ function DetailRiwayat({ listRiwayat }: { listRiwayat: any }) {
|
|||||||
</Center>
|
</Center>
|
||||||
</Paper>
|
</Paper>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Modal
|
|
||||||
opened={opened}
|
|
||||||
onClose={close}
|
|
||||||
size={"md"}
|
|
||||||
// closeOnClickOutside={false}
|
|
||||||
withCloseButton={false}
|
|
||||||
>
|
|
||||||
<Paper>
|
|
||||||
<Stack>
|
|
||||||
<Center>
|
|
||||||
<Title order={3}>Daftar Peserta</Title>
|
|
||||||
</Center>
|
|
||||||
<Stack>
|
|
||||||
{peserta?.map((e) => (
|
|
||||||
<Stack key={e.id} spacing={"xs"}>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={"content"}>
|
|
||||||
<Avatar
|
|
||||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
|
||||||
radius={"xl"}
|
|
||||||
src={
|
|
||||||
RouterProfile.api_foto_profile +
|
|
||||||
e?.User?.Profile?.imagesId
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Group align="center" h={"100%"}>
|
|
||||||
<Text>{e?.User?.Profile?.name}</Text>
|
|
||||||
</Group>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<Divider />
|
|
||||||
</Stack>
|
|
||||||
))}
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Paper>
|
|
||||||
</Modal>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,13 +51,10 @@ export default function AdminEvent_TablePublish({
|
|||||||
|
|
||||||
function TableStatus({ listPublish }: { listPublish: any }) {
|
function TableStatus({ listPublish }: { listPublish: any }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [opened, { open, close }] = useDisclosure(false);
|
|
||||||
const [data, setData] = useState<MODEL_EVENT[]>(listPublish.data);
|
const [data, setData] = useState<MODEL_EVENT[]>(listPublish.data);
|
||||||
const [isNPage, setNPage] = useState(listPublish.nPage);
|
const [isNPage, setNPage] = useState(listPublish.nPage);
|
||||||
const [isActivePage, setActivePage] = useState(1);
|
const [isActivePage, setActivePage] = useState(1);
|
||||||
const [isSearch, setSearch] = useState("");
|
const [isSearch, setSearch] = useState("");
|
||||||
|
|
||||||
const [peserta, setPeserta] = useState<MODEL_EVENT_PESERTA[]>();
|
|
||||||
const [eventId, setEventId] = useState("");
|
const [eventId, setEventId] = useState("");
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
@@ -132,14 +129,6 @@ function TableStatus({ listPublish }: { listPublish: any }) {
|
|||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
router.push(RouterAdminEvent.detail_peserta + e.id);
|
router.push(RouterAdminEvent.detail_peserta + e.id);
|
||||||
// setEventId(e.id);
|
|
||||||
// setLoading(true);
|
|
||||||
// await new Promise((v) => setTimeout(v, 500));
|
|
||||||
// await adminEvent_getListPesertaById(e.id).then((res: any) => {
|
|
||||||
// setPeserta(res);
|
|
||||||
// setLoading(false);
|
|
||||||
// });
|
|
||||||
// open();
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Lihat Peserta
|
Lihat Peserta
|
||||||
@@ -221,46 +210,6 @@ function TableStatus({ listPublish }: { listPublish: any }) {
|
|||||||
</Center>
|
</Center>
|
||||||
</Paper>
|
</Paper>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Modal opened={opened} onClose={close}>
|
|
||||||
<Paper>
|
|
||||||
<Stack>
|
|
||||||
<Center>
|
|
||||||
<Title order={3}>Daftar Peserta</Title>
|
|
||||||
</Center>
|
|
||||||
<Stack>
|
|
||||||
{_.isEmpty(peserta) ? (
|
|
||||||
<Center>
|
|
||||||
<Text c={"gray"}>Tidak ada peserta</Text>
|
|
||||||
</Center>
|
|
||||||
) : (
|
|
||||||
peserta?.map((e) => (
|
|
||||||
<Stack key={e.id} spacing={"xs"}>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={"content"}>
|
|
||||||
<Avatar
|
|
||||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
|
||||||
radius={"xl"}
|
|
||||||
src={
|
|
||||||
RouterProfile.api_foto_profile +
|
|
||||||
e?.User?.Profile?.imagesId
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Group align="center" h={"100%"}>
|
|
||||||
<Text>{e?.User?.Profile?.name}</Text>
|
|
||||||
</Group>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<Divider />
|
|
||||||
</Stack>
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Paper>
|
|
||||||
</Modal>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export async function adminForum_getListKomentarById({
|
|||||||
Profile: {
|
Profile: {
|
||||||
select: {
|
select: {
|
||||||
name: true,
|
name: true,
|
||||||
imagesId: true,
|
imageId: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,11 +3,9 @@
|
|||||||
import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum";
|
import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum";
|
||||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
|
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
|
||||||
import {
|
import {
|
||||||
MODEL_FORUM_REPORT_KOMENTAR,
|
MODEL_FORUM_REPORT_KOMENTAR
|
||||||
MODEL_FORUM_REPORT_POSTING,
|
|
||||||
} from "@/app_modules/forum/model/interface";
|
} from "@/app_modules/forum/model/interface";
|
||||||
import {
|
import {
|
||||||
Badge,
|
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
Center,
|
Center,
|
||||||
@@ -20,18 +18,15 @@ import {
|
|||||||
Table,
|
Table,
|
||||||
Text,
|
Text,
|
||||||
TextInput,
|
TextInput,
|
||||||
Title,
|
Title
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { IconFlag3, IconSearch } from "@tabler/icons-react";
|
import { IconFlag3, IconSearch } from "@tabler/icons-react";
|
||||||
import { isEmpty } from "lodash";
|
import { isEmpty } from "lodash";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentAdminGlobal_IsEmptyData from "../../_admin_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";
|
|
||||||
import adminForum_funGetAllReportKomentar from "../fun/get/get_all_report_komentar";
|
import adminForum_funGetAllReportKomentar from "../fun/get/get_all_report_komentar";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
|
||||||
|
|
||||||
export default function AdminForum_TableReportKomentar({
|
export default function AdminForum_TableReportKomentar({
|
||||||
listData,
|
listData,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { pathAssetImage, RouterImagePreview } from "@/app/lib";
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||||
import {
|
import {
|
||||||
MODEL_VOTE_KONTRIBUTOR,
|
MODEL_VOTE_KONTRIBUTOR,
|
||||||
@@ -72,7 +73,8 @@ export default function ComponentAdminVote_DetailHasil({
|
|||||||
span={2}
|
span={2}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
router.push(
|
router.push(
|
||||||
RouterProfile.katalogOLD + e?.Author?.Profile?.id
|
RouterProfile.katalogOLD +
|
||||||
|
e?.Author?.Profile?.id
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -84,12 +86,7 @@ export default function ComponentAdminVote_DetailHasil({
|
|||||||
}}
|
}}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
bg={"gray.1"}
|
bg={"gray.1"}
|
||||||
src={
|
src={pathAssetImage.avatar}
|
||||||
e
|
|
||||||
? RouterProfile.api_foto_profile +
|
|
||||||
e?.Author?.Profile?.imagesId
|
|
||||||
: "/aset/global/avatar.png"
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={5}>
|
<Grid.Col span={5}>
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
|
import { Group, Stack, Text, Title } from "@mantine/core";
|
||||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
|
||||||
import { Card, Group, Stack, Text, Title } from "@mantine/core";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ComponentGlobal_AvatarAndUsername,
|
ComponentGlobal_AvatarAndUsername,
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Stack, Title, Grid, Text, Paper, Spoiler } from "@mantine/core";
|
|
||||||
import moment from "moment";
|
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
|
||||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
|
|
||||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
|
||||||
import {
|
import {
|
||||||
ComponentGlobal_AvatarAndUsername,
|
ComponentGlobal_AvatarAndUsername,
|
||||||
ComponentGlobal_CardStyles,
|
ComponentGlobal_CardStyles,
|
||||||
} from "@/app_modules/_global/component";
|
} from "@/app_modules/_global/component";
|
||||||
|
import { Grid, Stack, Text, Title } from "@mantine/core";
|
||||||
|
import { MODEL_EVENT } from "../../model/interface";
|
||||||
|
|
||||||
export default function ComponentEvent_DetailMainData({
|
export default function ComponentEvent_DetailMainData({
|
||||||
data,
|
data,
|
||||||
|
|||||||
@@ -1,19 +1,14 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
import { Stack, Tabs } from "@mantine/core";
|
||||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
|
|
||||||
import { Card, Stack, Grid, Title, Text, Center, Tabs } from "@mantine/core";
|
|
||||||
import moment from "moment";
|
|
||||||
|
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
|
||||||
import _ from "lodash";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { useState } from "react";
|
|
||||||
import Event_SemuaRiwayat from "./semua";
|
|
||||||
import Event_RiwayatSaya from "./saya";
|
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import { gs_event_riwayat } from "../../global_state";
|
|
||||||
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import { useAtom } from "jotai";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { gs_event_riwayat } from "../../global_state";
|
||||||
|
import { MODEL_EVENT } from "../../model/interface";
|
||||||
|
import Event_RiwayatSaya from "./saya";
|
||||||
|
import Event_SemuaRiwayat from "./semua";
|
||||||
|
|
||||||
export default function Event_Riwayat({
|
export default function Event_Riwayat({
|
||||||
dataSemuaRiwayat,
|
dataSemuaRiwayat,
|
||||||
|
|||||||
@@ -1,155 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
|
||||||
import {
|
|
||||||
Stack,
|
|
||||||
Grid,
|
|
||||||
Avatar,
|
|
||||||
Divider,
|
|
||||||
Text,
|
|
||||||
Group,
|
|
||||||
Badge,
|
|
||||||
Loader,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import moment from "moment";
|
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
|
||||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
|
||||||
import {
|
|
||||||
IconCircleFilled,
|
|
||||||
IconDots,
|
|
||||||
IconEdit,
|
|
||||||
IconFlag3,
|
|
||||||
IconMessageCircle,
|
|
||||||
IconTrash,
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
import { IconCircle } from "@tabler/icons-react";
|
|
||||||
import { IoIosMore } from "react-icons/io";
|
|
||||||
import { useDisclosure } from "@mantine/hooks";
|
|
||||||
import { useState } from "react";
|
|
||||||
import ComponentForum_PostingButtonMore from "../more_button/posting_button_more";
|
|
||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
import { data } from "autoprefixer";
|
|
||||||
|
|
||||||
export default function ComponentForum_PostingAuthorNameOnHeader({
|
|
||||||
authorId,
|
|
||||||
postingId,
|
|
||||||
imagesId,
|
|
||||||
authorName,
|
|
||||||
tglPublish,
|
|
||||||
isPembatas,
|
|
||||||
isMoreButton,
|
|
||||||
statusId,
|
|
||||||
userLoginId,
|
|
||||||
setData,
|
|
||||||
}: {
|
|
||||||
authorId?: string;
|
|
||||||
postingId?: string;
|
|
||||||
imagesId?: string;
|
|
||||||
authorName?: string;
|
|
||||||
tglPublish?: Date;
|
|
||||||
isPembatas?: boolean;
|
|
||||||
isMoreButton?: boolean;
|
|
||||||
statusId?: string;
|
|
||||||
userLoginId: string;
|
|
||||||
setData?:any
|
|
||||||
}) {
|
|
||||||
const router = useRouter();
|
|
||||||
const [loading, setLoading] = useState(false);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Stack spacing={"xs"}>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col
|
|
||||||
span={"content"}
|
|
||||||
onClick={() => {
|
|
||||||
if (authorId) {
|
|
||||||
setLoading(true);
|
|
||||||
router.push(RouterForum.forumku + authorId);
|
|
||||||
} else {
|
|
||||||
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{loading ? (
|
|
||||||
<Loader color="gray" variant="dots" />
|
|
||||||
) : (
|
|
||||||
<Avatar
|
|
||||||
size={40}
|
|
||||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
|
||||||
radius={"xl"}
|
|
||||||
bg={"gray.1"}
|
|
||||||
src={
|
|
||||||
imagesId
|
|
||||||
? RouterProfile.api_foto_profile + imagesId
|
|
||||||
: "/aset/global/avatar.png"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Grid.Col>
|
|
||||||
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Stack justify="center" h={"100%"} spacing={0}>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Text lineClamp={1} fz={"sm"} fw={"bold"}>
|
|
||||||
{authorName ? authorName : "Nama author "}
|
|
||||||
</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={"content"}></Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<Badge
|
|
||||||
w={70}
|
|
||||||
variant="light"
|
|
||||||
color={(statusId as any) === 1 ? "green" : "red"}
|
|
||||||
>
|
|
||||||
<Text fz={10}>
|
|
||||||
{(statusId as any) === 1 ? "Open" : "Close"}
|
|
||||||
</Text>
|
|
||||||
</Badge>
|
|
||||||
</Stack>
|
|
||||||
</Grid.Col>
|
|
||||||
|
|
||||||
<Grid.Col span={"content"}>
|
|
||||||
<Group position="center" spacing={"xs"}>
|
|
||||||
<Group spacing={3}>
|
|
||||||
<Text c={"gray"} fz={"sm"}>
|
|
||||||
{tglPublish
|
|
||||||
? tglPublish.toLocaleDateString(["id-ID"], {
|
|
||||||
day: "numeric",
|
|
||||||
month: "short",
|
|
||||||
})
|
|
||||||
: new Date().toLocaleDateString(["id-ID"], {
|
|
||||||
day: "numeric",
|
|
||||||
month: "short",
|
|
||||||
})}
|
|
||||||
<IconCircle
|
|
||||||
size={5}
|
|
||||||
color="gray"
|
|
||||||
style={{ marginLeft: "5px" }}
|
|
||||||
/>
|
|
||||||
</Text>
|
|
||||||
</Group>
|
|
||||||
|
|
||||||
{isMoreButton ? (
|
|
||||||
<Group position="right">
|
|
||||||
<ComponentForum_PostingButtonMore
|
|
||||||
authorId={authorId}
|
|
||||||
postingId={postingId as any}
|
|
||||||
statusId={statusId}
|
|
||||||
userLoginId={userLoginId}
|
|
||||||
setData={setData}
|
|
||||||
/>
|
|
||||||
</Group>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</Group>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
{isPembatas ? <Divider /> : ""}
|
|
||||||
</Stack>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
|
||||||
import { Stack, Card, Group, ActionIcon, Divider, Text } from "@mantine/core";
|
|
||||||
import { IconMessageCircle, IconMessageCircleOff } from "@tabler/icons-react";
|
|
||||||
|
|
||||||
import ComponentForum_PostingAuthorNameOnHeader from "./header/posting_author_header_name";
|
|
||||||
import { MODEL_FORUM_POSTING } from "../model/interface";
|
|
||||||
import { useState } from "react";
|
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import { gs_forum_total_komentar } from "../global_state";
|
|
||||||
import { forum_countOneTotalKomentarById } from "../fun/count/count_one_total_komentar_by_id";
|
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
|
||||||
import { IconMessageCircleX } from "@tabler/icons-react";
|
|
||||||
|
|
||||||
export default function ComponentForum_MainCardView({
|
|
||||||
data,
|
|
||||||
setData,
|
|
||||||
setLoadingKomen,
|
|
||||||
setLoadingDetail,
|
|
||||||
userLoginId,
|
|
||||||
}: {
|
|
||||||
data: MODEL_FORUM_POSTING[];
|
|
||||||
setData: any,
|
|
||||||
setLoadingKomen: any;
|
|
||||||
setLoadingDetail: any;
|
|
||||||
userLoginId: any;
|
|
||||||
}) {
|
|
||||||
const router = useRouter();
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Stack spacing={"xl"}>
|
|
||||||
{data.map((e, i) => (
|
|
||||||
<Card key={i}>
|
|
||||||
<Card.Section>
|
|
||||||
{/* <pre>{JSON.stringify(e.Author.id, null, 2)}</pre>
|
|
||||||
<pre>{JSON.stringify(userLoginId, null, 2)}</pre> */}
|
|
||||||
|
|
||||||
<ComponentForum_PostingAuthorNameOnHeader
|
|
||||||
authorName={e?.Author?.Profile?.name}
|
|
||||||
imagesId={e?.Author?.Profile?.imagesId}
|
|
||||||
tglPublish={e?.createdAt}
|
|
||||||
isMoreButton={true}
|
|
||||||
authorId={e?.Author?.id}
|
|
||||||
postingId={e?.id}
|
|
||||||
statusId={e?.ForumMaster_StatusPosting?.id}
|
|
||||||
userLoginId={userLoginId}
|
|
||||||
setData={setData}
|
|
||||||
/>
|
|
||||||
</Card.Section>
|
|
||||||
<Card.Section
|
|
||||||
sx={{ zIndex: 0 }}
|
|
||||||
p={"lg"}
|
|
||||||
onClick={() => {
|
|
||||||
// console.log("halaman forum");
|
|
||||||
setLoadingDetail(true);
|
|
||||||
router.push(RouterForum.main_detail + e.id);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Text fz={"sm"} lineClamp={4}>
|
|
||||||
<div dangerouslySetInnerHTML={{ __html: e.diskusi }} />
|
|
||||||
</Text>
|
|
||||||
</Card.Section>
|
|
||||||
<Card.Section>
|
|
||||||
<Stack>
|
|
||||||
<Group spacing={"xs"} px={"sm"}>
|
|
||||||
<ActionIcon
|
|
||||||
// loading={loadingKomen ? true : false}
|
|
||||||
variant="transparent"
|
|
||||||
sx={{ zIndex: 1 }}
|
|
||||||
onClick={() => {
|
|
||||||
(e?.ForumMaster_StatusPosting.id as any) === 1
|
|
||||||
? (router.push(RouterForum.komentar + e?.id),
|
|
||||||
setLoadingKomen(true))
|
|
||||||
: router.push(RouterForum.main_detail + e?.id);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{(e?.ForumMaster_StatusPosting?.id as any) === 1 ? (
|
|
||||||
<IconMessageCircle color="gray" size={25} />
|
|
||||||
) : (
|
|
||||||
<IconMessageCircleX color="gray" size={25} />
|
|
||||||
)}
|
|
||||||
</ActionIcon>
|
|
||||||
|
|
||||||
{/* <TotalKomentar postingId={e?.id} /> */}
|
|
||||||
|
|
||||||
<Text c={"gray"}>{e?._count}</Text>
|
|
||||||
</Group>
|
|
||||||
<Divider />
|
|
||||||
</Stack>
|
|
||||||
</Card.Section>
|
|
||||||
</Card>
|
|
||||||
))}
|
|
||||||
</Stack>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,8 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentForum_MainCardView from "../component/main_card_view";
|
|
||||||
import { MODEL_FORUM_POSTING } from "../model/interface";
|
import { MODEL_FORUM_POSTING } from "../model/interface";
|
||||||
import ComponentForum_ForumkuMainCardView from "../component/forumku_component/forumku_view";
|
|
||||||
|
|
||||||
export default function ComponentForum_PostinganPribadi({
|
export default function ComponentForum_PostinganPribadi({
|
||||||
dataPosting,
|
dataPosting,
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import LayoutForum_Create from "./create/layout";
|
|||||||
import LayoutForum_Forumku from "./forumku/layout";
|
import LayoutForum_Forumku from "./forumku/layout";
|
||||||
import Forum_MainDetail from "./detail/main_detail";
|
import Forum_MainDetail from "./detail/main_detail";
|
||||||
import LayoutForum_Detail from "./detail/layout";
|
import LayoutForum_Detail from "./detail/layout";
|
||||||
import Forum_Komentar from "./komentar";
|
|
||||||
import LayoutForum_Komentar from "./komentar/layout";
|
|
||||||
import Forum_EditPosting from "./edit/posting";
|
import Forum_EditPosting from "./edit/posting";
|
||||||
import LayoutForum_EditPosting from "./edit/posting/layout";
|
import LayoutForum_EditPosting from "./edit/posting/layout";
|
||||||
import Forum_ReportPosting from "./report/posting";
|
import Forum_ReportPosting from "./report/posting";
|
||||||
@@ -32,8 +30,6 @@ export {
|
|||||||
LayoutForum_Forumku,
|
LayoutForum_Forumku,
|
||||||
Forum_MainDetail as Forum_Detail,
|
Forum_MainDetail as Forum_Detail,
|
||||||
LayoutForum_Detail,
|
LayoutForum_Detail,
|
||||||
Forum_Komentar,
|
|
||||||
LayoutForum_Komentar,
|
|
||||||
Forum_EditPosting,
|
Forum_EditPosting,
|
||||||
LayoutForum_EditPosting,
|
LayoutForum_EditPosting,
|
||||||
Forum_ReportPosting,
|
Forum_ReportPosting,
|
||||||
|
|||||||
@@ -1,136 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
|
||||||
import {
|
|
||||||
Button,
|
|
||||||
Card,
|
|
||||||
Group,
|
|
||||||
Paper,
|
|
||||||
Stack,
|
|
||||||
Text
|
|
||||||
} from "@mantine/core";
|
|
||||||
import ComponentForum_PostingAuthorNameOnHeader from "../component/header/posting_author_header_name";
|
|
||||||
|
|
||||||
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
|
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
|
||||||
import dynamic from "next/dynamic";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { useState } from "react";
|
|
||||||
import "react-quill/dist/quill.bubble.css";
|
|
||||||
import { forum_funCreateKomentar } from "../fun/create/fun_create_komentar";
|
|
||||||
import { MODEL_FORUM_POSTING } from "../model/interface";
|
|
||||||
const ReactQuill = dynamic(
|
|
||||||
() => {
|
|
||||||
return import("react-quill");
|
|
||||||
},
|
|
||||||
{ ssr: false }
|
|
||||||
);
|
|
||||||
|
|
||||||
export default function Forum_Komentar({
|
|
||||||
dataPosting,
|
|
||||||
userLoginId,
|
|
||||||
}: {
|
|
||||||
dataPosting: MODEL_FORUM_POSTING;
|
|
||||||
userLoginId: any;
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Stack px={"sm"}>
|
|
||||||
<Card>
|
|
||||||
<Card.Section>
|
|
||||||
{/* <pre>{JSON.stringify(dataPosting, null, 2)}</pre> */}
|
|
||||||
<ComponentForum_PostingAuthorNameOnHeader
|
|
||||||
authorId={dataPosting?.Author?.id}
|
|
||||||
authorName={dataPosting?.Author?.Profile?.name}
|
|
||||||
imagesId={dataPosting?.Author?.Profile?.imagesId}
|
|
||||||
postingId={dataPosting?.id}
|
|
||||||
tglPublish={dataPosting?.createdAt}
|
|
||||||
statusId={dataPosting?.ForumMaster_StatusPosting?.id}
|
|
||||||
userLoginId={userLoginId}
|
|
||||||
/>
|
|
||||||
</Card.Section>
|
|
||||||
<Card.Section sx={{ zIndex: 0 }} p={"sm"}>
|
|
||||||
<Stack spacing={"xs"}>
|
|
||||||
<Text fz={"sm"}>
|
|
||||||
{dataPosting?.diskusi ? (
|
|
||||||
<div
|
|
||||||
dangerouslySetInnerHTML={{ __html: dataPosting?.diskusi }}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
|
||||||
</Card.Section>
|
|
||||||
</Card>
|
|
||||||
{dataPosting?.ForumMaster_StatusPosting?.id === "1" ? <CreateKomentar postingId={dataPosting?.id} /> : "" }
|
|
||||||
|
|
||||||
</Stack>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function CreateKomentar({ postingId }: { postingId: string }) {
|
|
||||||
const router = useRouter();
|
|
||||||
const [value, setValue] = useState("");
|
|
||||||
const [loading, setLoading] = useState(false);
|
|
||||||
|
|
||||||
async function onComment() {
|
|
||||||
if (value.length > 500) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
await forum_funCreateKomentar(postingId, value).then((res) => {
|
|
||||||
if (res.status === 201) {
|
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
|
||||||
router.replace(RouterForum.main_detail + postingId, { scroll: false });
|
|
||||||
setLoading(true);
|
|
||||||
router.refresh();
|
|
||||||
} else {
|
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Stack>
|
|
||||||
<Paper withBorder shadow="lg">
|
|
||||||
<ReactQuill
|
|
||||||
theme="bubble"
|
|
||||||
placeholder="Ketik komentar anda?"
|
|
||||||
// style={{ height: 150 }}
|
|
||||||
onChange={(val) => {
|
|
||||||
setValue(val);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Paper>
|
|
||||||
<Group position="right">
|
|
||||||
<ComponentGlobal_InputCountDown
|
|
||||||
maxInput={500}
|
|
||||||
lengthInput={value.length}
|
|
||||||
/>
|
|
||||||
</Group>
|
|
||||||
<Group position="right">
|
|
||||||
<Button
|
|
||||||
disabled={
|
|
||||||
value === "" || value === "<p><br></p>" || value.length > 500
|
|
||||||
? true
|
|
||||||
: false
|
|
||||||
}
|
|
||||||
loaderPosition="center"
|
|
||||||
loading={loading ? true : false}
|
|
||||||
radius={"xl"}
|
|
||||||
style={{
|
|
||||||
transition: "0.5s",
|
|
||||||
}}
|
|
||||||
onClick={() => onComment()}
|
|
||||||
>
|
|
||||||
Balas
|
|
||||||
</Button>
|
|
||||||
</Group>
|
|
||||||
</Stack>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import {
|
|
||||||
ActionIcon,
|
|
||||||
AppShell,
|
|
||||||
Button,
|
|
||||||
Group,
|
|
||||||
Header,
|
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { IconChevronLeft } from "@tabler/icons-react";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import React from "react";
|
|
||||||
import ComponentForum_HeaderTamplate from "../component/header/header_tamplate";
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
|
||||||
|
|
||||||
export default function LayoutForum_Komentar({
|
|
||||||
children,
|
|
||||||
}: {
|
|
||||||
children: React.ReactNode;
|
|
||||||
}) {
|
|
||||||
const router = useRouter();
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<AppComponentGlobal_LayoutTamplate
|
|
||||||
header={
|
|
||||||
<Header height={50} sx={{ borderStyle: "none" }}>
|
|
||||||
<Group h={50} px={"md"}>
|
|
||||||
<ActionIcon
|
|
||||||
variant="transparent"
|
|
||||||
onClick={() => {
|
|
||||||
router.back();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<IconChevronLeft />
|
|
||||||
</ActionIcon>
|
|
||||||
<Title order={5}>Komentar</Title>
|
|
||||||
</Group>
|
|
||||||
</Header>
|
|
||||||
}
|
|
||||||
// header={<ComponentForum_HeaderTamplate title="Komentar" />}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -2,16 +2,6 @@
|
|||||||
|
|
||||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||||
import UIGlobal_SplashScreen from "@/app_modules/_global/ui/ui_splash";
|
import UIGlobal_SplashScreen from "@/app_modules/_global/ui/ui_splash";
|
||||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
|
||||||
import {
|
|
||||||
Avatar,
|
|
||||||
Center,
|
|
||||||
Image,
|
|
||||||
Loader,
|
|
||||||
Paper,
|
|
||||||
Stack,
|
|
||||||
Text,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { IconMessages } from "@tabler/icons-react";
|
import { IconMessages } from "@tabler/icons-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import prisma from "@/app/lib/prisma";
|
|||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
export async function funGetUserProfile( userId: string ) {
|
export async function funGetUserProfile( userId: string ) {
|
||||||
|
|
||||||
const user = await prisma.user.findUnique({
|
const user = await prisma.user.findUnique({
|
||||||
where: {
|
where: {
|
||||||
id: userId,
|
id: userId,
|
||||||
@@ -19,14 +18,8 @@ export async function funGetUserProfile( userId: string ) {
|
|||||||
email: true,
|
email: true,
|
||||||
jenisKelamin: true,
|
jenisKelamin: true,
|
||||||
name: true,
|
name: true,
|
||||||
imagesId: true,
|
imageId: true,
|
||||||
ImageProfile: {
|
imageBackgroundId: true,
|
||||||
select: {
|
|
||||||
url: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
ImagesBackground: true,
|
|
||||||
imagesBackgroundId: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
import { ComponentGlobal_AvatarAndAuthorName, ComponentGlobal_AvatarAndUsername } from "@/app_modules/_global/component";
|
import { ComponentGlobal_AvatarAndUsername } from "@/app_modules/_global/component";
|
||||||
import { MODEL_INVOICE_INVESTASI } from "@/app_modules/investasi/_lib/interface";
|
import { MODEL_INVOICE_INVESTASI } from "@/app_modules/investasi/_lib/interface";
|
||||||
import {
|
import {
|
||||||
Stack,
|
|
||||||
AspectRatio,
|
AspectRatio,
|
||||||
Title,
|
|
||||||
Grid,
|
|
||||||
Box,
|
Box,
|
||||||
SimpleGrid,
|
Grid,
|
||||||
Image,
|
Image,
|
||||||
|
SimpleGrid,
|
||||||
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { Investasi_ComponentStylesCard } from "../../comp_card_border_and_background";
|
import { Investasi_ComponentStylesCard } from "../../comp_card_border_and_background";
|
||||||
import { Investasi_ComponentBoxDaftarBerita } from "../comp_box_daftar_berita";
|
import { Investasi_ComponentBoxDaftarBerita } from "../comp_box_daftar_berita";
|
||||||
|
|||||||
@@ -4,13 +4,10 @@ import {
|
|||||||
NEW_RouterInvestasi,
|
NEW_RouterInvestasi,
|
||||||
RouterInvestasi_OLD,
|
RouterInvestasi_OLD,
|
||||||
} from "@/app/lib/router_hipmi/router_investasi";
|
} from "@/app/lib/router_hipmi/router_investasi";
|
||||||
import { Warna } from "@/app/lib/warna";
|
|
||||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
|
|
||||||
import {
|
import {
|
||||||
AccentColor,
|
AccentColor,
|
||||||
MainColor,
|
MainColor,
|
||||||
} from "@/app_modules/_global/color/color_pallet";
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
import { MODEL_PROFILE_OLD } from "@/app_modules/home/model/user_profile";
|
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
AspectRatio,
|
AspectRatio,
|
||||||
@@ -27,22 +24,16 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
|
import { useLocalStorage } from "@mantine/hooks";
|
||||||
import {
|
import {
|
||||||
IconBookDownload,
|
IconBookDownload,
|
||||||
IconCircleCheck,
|
|
||||||
IconFileDescription,
|
IconFileDescription,
|
||||||
IconSpeakerphone,
|
IconSpeakerphone
|
||||||
IconXboxX,
|
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { MODEL_INVESTASI } from "../_lib/interface";
|
import { MODEL_INVESTASI } from "../_lib/interface";
|
||||||
import { gs_TransferValue } from "../g_state";
|
|
||||||
import { useLocalStorage } from "@mantine/hooks";
|
|
||||||
import ComponentGlobal_AuthorNameAndAvatar from "@/app_modules/_global/author_name_on_header";
|
|
||||||
import { ComponentGlobal_AvatarAndAuthorName } from "@/app_modules/_global/component";
|
|
||||||
|
|
||||||
export default function DetailInvestasi({
|
export default function DetailInvestasi({
|
||||||
dataInvestasi,
|
dataInvestasi,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export default async function getListTransaksiBerhasilInvestasi(
|
|||||||
Profile: {
|
Profile: {
|
||||||
select: {
|
select: {
|
||||||
userId: true,
|
userId: true,
|
||||||
imagesId: true
|
imageId: true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export default async function getOneTransaksiBerhasilByIdInvestasi(
|
|||||||
Profile: {
|
Profile: {
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
imagesId: true,
|
imageId: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,40 +1,24 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
|
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
import {
|
import {
|
||||||
Title,
|
|
||||||
Card,
|
|
||||||
CardSection,
|
|
||||||
Group,
|
|
||||||
Flex,
|
|
||||||
Avatar,
|
|
||||||
AspectRatio,
|
AspectRatio,
|
||||||
Box,
|
Box,
|
||||||
Slider,
|
Card,
|
||||||
|
Center,
|
||||||
Grid,
|
Grid,
|
||||||
Stack,
|
|
||||||
Divider,
|
|
||||||
Badge,
|
|
||||||
Image,
|
Image,
|
||||||
Text,
|
|
||||||
Button,
|
|
||||||
Paper,
|
Paper,
|
||||||
Progress,
|
Progress,
|
||||||
Center,
|
Stack,
|
||||||
SimpleGrid,
|
Text
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconCircleCheck } from "@tabler/icons-react";
|
|
||||||
import moment from "moment";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import dataDummy from "../dummy/data_dummy.json";
|
|
||||||
import { MODEL_Transaksi_Investasi } from "../_lib/interface";
|
|
||||||
import { useState } from "react";
|
|
||||||
import { Warna } from "@/app/lib/warna";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import ComponentInvestasi_IsEmptyData from "../component/is_empty_data";
|
import { useRouter } from "next/navigation";
|
||||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
import { useState } from "react";
|
||||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
import { MODEL_Transaksi_Investasi } from "../_lib/interface";
|
||||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
|
|
||||||
|
|
||||||
export default function InvestasiSahamTerbeli({
|
export default function InvestasiSahamTerbeli({
|
||||||
listTransaksi,
|
listTransaksi,
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
"use server";
|
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
|
||||||
import fs from "fs";
|
|
||||||
import _ from "lodash";
|
|
||||||
import { v4 } from "uuid";
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param formData
|
|
||||||
* @returns upload gambar ke /public/img
|
|
||||||
*/
|
|
||||||
export async function funUploadFoto(formData: FormData, id: string) {
|
|
||||||
const file: any = formData.get("file");
|
|
||||||
const fName = file.name;
|
|
||||||
const fExt = _.lowerCase(file.name.split(".").pop());
|
|
||||||
const fRandomName = v4(fName) + "." + fExt;
|
|
||||||
|
|
||||||
const upload = await prisma.images.create({
|
|
||||||
data: {
|
|
||||||
url: fRandomName,
|
|
||||||
},
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
url: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (upload) {
|
|
||||||
await prisma.profile.update({
|
|
||||||
where: {
|
|
||||||
id: id,
|
|
||||||
},
|
|
||||||
data: {
|
|
||||||
imagesId: upload.id,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const upFolder = Buffer.from(await file.arrayBuffer());
|
|
||||||
fs.writeFileSync(`./public/img/${upload.url}`, upFolder);
|
|
||||||
|
|
||||||
return {
|
|
||||||
success: true,
|
|
||||||
data: upload,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||||
import { MODEL_IMAGES } from "@/app_modules/model_global/interface";
|
|
||||||
|
|
||||||
export interface MODEL_PROFILE {
|
export interface MODEL_PROFILE {
|
||||||
userId: string;
|
userId: string;
|
||||||
@@ -12,10 +11,6 @@ export interface MODEL_PROFILE {
|
|||||||
active: string;
|
active: string;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
ImageProfile: MODEL_IMAGES;
|
|
||||||
imagesId: string;
|
|
||||||
ImagesBackground: MODEL_IMAGES;
|
|
||||||
imagesBackgroundId: string;
|
|
||||||
imageId?: string;
|
imageId?: string;
|
||||||
imageBackgroundId?: string;
|
imageBackgroundId?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +1,26 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterVote } from "@/app/lib/router_hipmi/router_vote";
|
|
||||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
|
|
||||||
import {
|
|
||||||
Card,
|
|
||||||
Stack,
|
|
||||||
Grid,
|
|
||||||
Avatar,
|
|
||||||
Divider,
|
|
||||||
Badge,
|
|
||||||
Group,
|
|
||||||
Text,
|
|
||||||
Title,
|
|
||||||
Box,
|
|
||||||
Center,
|
|
||||||
Progress,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import moment from "moment";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { MODEL_VOTING } from "../model/interface";
|
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
|
||||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
import { toNumber } from "lodash";
|
|
||||||
import { useState } from "react";
|
|
||||||
import {
|
import {
|
||||||
ComponentGlobal_AvatarAndUsername,
|
ComponentGlobal_AvatarAndUsername,
|
||||||
ComponentGlobal_CardLoadingOverlay,
|
ComponentGlobal_CardLoadingOverlay,
|
||||||
ComponentGlobal_CardStyles,
|
ComponentGlobal_CardStyles,
|
||||||
} from "@/app_modules/_global/component";
|
} from "@/app_modules/_global/component";
|
||||||
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
|
import {
|
||||||
|
Avatar,
|
||||||
|
Badge,
|
||||||
|
Box,
|
||||||
|
Center,
|
||||||
|
Grid,
|
||||||
|
Group,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
Title
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { MODEL_VOTING } from "../model/interface";
|
||||||
|
|
||||||
export default function ComponentVote_CardViewPublish({
|
export default function ComponentVote_CardViewPublish({
|
||||||
data,
|
data,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
|
|
||||||
import {
|
import {
|
||||||
AccentColor,
|
AccentColor,
|
||||||
MainColor,
|
MainColor,
|
||||||
} from "@/app_modules/_global/color/color_pallet";
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import { ComponentGlobal_AvatarAndUsername, ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||||
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
@@ -14,13 +14,12 @@ import {
|
|||||||
Badge,
|
Badge,
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
Card,
|
|
||||||
Center,
|
Center,
|
||||||
Group,
|
Group,
|
||||||
Radio,
|
Radio,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
Title,
|
Title
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
@@ -29,8 +28,6 @@ import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_votin
|
|||||||
import { Vote_funCreateHasil } from "../../fun/create/create_hasil";
|
import { Vote_funCreateHasil } from "../../fun/create/create_hasil";
|
||||||
import { voting_funGetOneVotingbyId } from "../../fun/get/fun_get_one_by_id";
|
import { voting_funGetOneVotingbyId } from "../../fun/get/fun_get_one_by_id";
|
||||||
import { MODEL_VOTING } from "../../model/interface";
|
import { MODEL_VOTING } from "../../model/interface";
|
||||||
import { ComponentDonasi_CardStatus } from "@/app_modules/donasi/component/card_view/card_status";
|
|
||||||
import { ComponentGlobal_AvatarAndUsername, ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
|
||||||
|
|
||||||
export default function Vote_MainDetail({
|
export default function Vote_MainDetail({
|
||||||
dataVote,
|
dataVote,
|
||||||
|
|||||||