Fix: Db Profile
Deskripsi: - Menghapus field imagesId dan imagesBackgroundId - Menhapus table backgroundImage - Menghapus component avatar dan header card yang lama ## No Issue
@@ -80,23 +80,19 @@ model KodeOtp {
|
||||
}
|
||||
|
||||
model Profile {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
email String @unique
|
||||
alamat String
|
||||
jenisKelamin String
|
||||
active Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
User User? @relation(fields: [userId], references: [id])
|
||||
userId String? @unique
|
||||
ImageProfile Images? @relation(fields: [imagesId], references: [id])
|
||||
imagesId String? @unique
|
||||
Portofolio Portofolio[]
|
||||
ImagesBackground ImagesBackground? @relation(fields: [imagesBackgroundId], references: [id])
|
||||
imagesBackgroundId String? @unique
|
||||
imageId String?
|
||||
imageBackgroundId String?
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
email String @unique
|
||||
alamat String
|
||||
jenisKelamin String
|
||||
active Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
User User? @relation(fields: [userId], references: [id])
|
||||
userId String? @unique
|
||||
Portofolio Portofolio[]
|
||||
imageId String?
|
||||
imageBackgroundId String?
|
||||
}
|
||||
|
||||
model Images {
|
||||
@@ -106,7 +102,6 @@ model Images {
|
||||
active Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
Profile Profile?
|
||||
Investasi Investasi?
|
||||
BeritaInvestasi BeritaInvestasi[]
|
||||
Donasi Donasi?
|
||||
@@ -118,16 +113,6 @@ model Images {
|
||||
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 {
|
||||
id String @id @default(cuid())
|
||||
id_Portofolio String @unique
|
||||
@@ -232,8 +217,7 @@ model Investasi {
|
||||
masterProgresInvestasiId String?
|
||||
Investasi_Invoice Investasi_Invoice[]
|
||||
|
||||
// imageId String?
|
||||
// prospektusId String?
|
||||
imageId String?
|
||||
}
|
||||
|
||||
model MasterPencarianInvestor {
|
||||
@@ -281,6 +265,9 @@ model ProspektusInvestasi {
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
investasi Investasi? @relation(fields: [investasiId], references: [id])
|
||||
investasiId String? @unique
|
||||
|
||||
fileId String?
|
||||
title String?
|
||||
}
|
||||
|
||||
model DokumenInvestasi {
|
||||
@@ -292,6 +279,8 @@ model DokumenInvestasi {
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
investasi Investasi? @relation(fields: [investasiId], references: [id])
|
||||
investasiId String?
|
||||
|
||||
fileId String?
|
||||
}
|
||||
|
||||
model BeritaInvestasi {
|
||||
@@ -305,6 +294,8 @@ model BeritaInvestasi {
|
||||
imagesId String?
|
||||
investasi Investasi @relation(fields: [investasiId], references: [id])
|
||||
investasiId String
|
||||
|
||||
imageId String?
|
||||
}
|
||||
|
||||
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 { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
|
||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||
const dataUser = await funGetUserProfile(dataInvestasi?.authorId as any);
|
||||
// console.log(dataUser)
|
||||
|
||||
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";
|
||||
|
||||
export default async function Layout({
|
||||
@@ -8,8 +7,6 @@ export default async function Layout({
|
||||
children: any;
|
||||
params: { id: string };
|
||||
}) {
|
||||
let profileId = params.id;
|
||||
|
||||
return (
|
||||
<>
|
||||
<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 { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let profileId = params.id
|
||||
const data = await funGetUserProfile(params.id);
|
||||
const dataProfile = await Profile_getOneProfileAndUserById(profileId)
|
||||
|
||||
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_BoxInformation from "./box_information";
|
||||
import ComponentGlobal_AvatarAndAuthorName from "./comp_author_name_and_avatar";
|
||||
import { ComponentGlobal_AvatarAndUsername } from "./comp_avatar_and_username";
|
||||
import { ComponentGlobal_BoxUploadImage } from "./comp_box_upload_image";
|
||||
import { ComponentGlobal_CardStyles } from "./comp_card_box_and_background";
|
||||
@@ -16,7 +15,6 @@ import ComponentGlobal_InputCountDown from "./input_countdown";
|
||||
|
||||
export { ComponentGlobal_TampilanRupiah };
|
||||
export { ComponentGlobal_TampilanAngkaRatusan };
|
||||
export { ComponentGlobal_AvatarAndAuthorName };
|
||||
export { ComponentGlobal_CardLoadingOverlay };
|
||||
export { ComponentGlobal_BoxInformation };
|
||||
export { ComponentGlobal_InputCountDown };
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Box,
|
||||
Center,
|
||||
Group,
|
||||
LoadingOverlay,
|
||||
Skeleton,
|
||||
Text,
|
||||
Text
|
||||
} from "@mantine/core";
|
||||
import { MainColor } from "./color/color_pallet";
|
||||
|
||||
export default function ComponentGlobal_V2_LoadingPage() {
|
||||
const listhHuruf = [
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import {
|
||||
MODEL_EVENT,
|
||||
@@ -23,14 +24,12 @@ import {
|
||||
TextInput,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { IconCircleCheck, IconSearch } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
||||
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({
|
||||
listRiwayat,
|
||||
@@ -49,8 +48,6 @@ export default function AdminEvent_Riwayat({
|
||||
|
||||
function DetailRiwayat({ listRiwayat }: { listRiwayat: any }) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [peserta, setPeserta] = useState<MODEL_EVENT_PESERTA[]>();
|
||||
const [eventId, setEventId] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
@@ -89,14 +86,6 @@ function DetailRiwayat({ listRiwayat }: { listRiwayat: any }) {
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
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
|
||||
@@ -146,16 +135,6 @@ function DetailRiwayat({ listRiwayat }: { listRiwayat: any }) {
|
||||
</tr>
|
||||
));
|
||||
|
||||
// useShallowEffect(() => {
|
||||
// getAllPeserta(eventId);
|
||||
// }, [eventId]);
|
||||
|
||||
// async function getAllPeserta(eventId: string) {
|
||||
// await adminEvent_getListPesertaById(eventId).then((res: any) =>
|
||||
// setPeserta(res)
|
||||
// );
|
||||
// }
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack spacing={"xs"} h={"100%"}>
|
||||
@@ -229,46 +208,6 @@ function DetailRiwayat({ listRiwayat }: { listRiwayat: any }) {
|
||||
</Center>
|
||||
</Paper>
|
||||
</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 }) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [data, setData] = useState<MODEL_EVENT[]>(listPublish.data);
|
||||
const [isNPage, setNPage] = useState(listPublish.nPage);
|
||||
const [isActivePage, setActivePage] = useState(1);
|
||||
const [isSearch, setSearch] = useState("");
|
||||
|
||||
const [peserta, setPeserta] = useState<MODEL_EVENT_PESERTA[]>();
|
||||
const [eventId, setEventId] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
@@ -132,14 +129,6 @@ function TableStatus({ listPublish }: { listPublish: any }) {
|
||||
radius={"xl"}
|
||||
onClick={async () => {
|
||||
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
|
||||
@@ -221,46 +210,6 @@ function TableStatus({ listPublish }: { listPublish: any }) {
|
||||
</Center>
|
||||
</Paper>
|
||||
</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: {
|
||||
select: {
|
||||
name: true,
|
||||
imagesId: true,
|
||||
imageId: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
import { RouterAdminForum } from "@/app/lib/router_admin/router_admin_forum";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
|
||||
import {
|
||||
MODEL_FORUM_REPORT_KOMENTAR,
|
||||
MODEL_FORUM_REPORT_POSTING,
|
||||
MODEL_FORUM_REPORT_KOMENTAR
|
||||
} from "@/app_modules/forum/model/interface";
|
||||
import {
|
||||
Badge,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
@@ -20,18 +18,15 @@ import {
|
||||
Table,
|
||||
Text,
|
||||
TextInput,
|
||||
Title,
|
||||
Title
|
||||
} from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { IconFlag3, IconSearch } from "@tabler/icons-react";
|
||||
import { isEmpty } from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
|
||||
import 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 { useShallowEffect } from "@mantine/hooks";
|
||||
|
||||
export default function AdminForum_TableReportKomentar({
|
||||
listData,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { pathAssetImage, RouterImagePreview } from "@/app/lib";
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import {
|
||||
MODEL_VOTE_KONTRIBUTOR,
|
||||
@@ -72,7 +73,8 @@ export default function ComponentAdminVote_DetailHasil({
|
||||
span={2}
|
||||
onClick={() =>
|
||||
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"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
e
|
||||
? RouterProfile.api_foto_profile +
|
||||
e?.Author?.Profile?.imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
src={pathAssetImage.avatar}
|
||||
/>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={5}>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { Card, Group, Stack, Text, Title } from "@mantine/core";
|
||||
import { Group, Stack, Text, Title } from "@mantine/core";
|
||||
|
||||
import {
|
||||
ComponentGlobal_AvatarAndUsername,
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
"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 {
|
||||
ComponentGlobal_AvatarAndUsername,
|
||||
ComponentGlobal_CardStyles,
|
||||
} from "@/app_modules/_global/component";
|
||||
import { Grid, Stack, Text, Title } from "@mantine/core";
|
||||
import { MODEL_EVENT } from "../../model/interface";
|
||||
|
||||
export default function ComponentEvent_DetailMainData({
|
||||
data,
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
"use client";
|
||||
|
||||
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||
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 { Stack, Tabs } from "@mantine/core";
|
||||
|
||||
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 { 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({
|
||||
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"
|
||||
|
||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import ComponentForum_MainCardView from "../component/main_card_view";
|
||||
import { MODEL_FORUM_POSTING } from "../model/interface";
|
||||
import ComponentForum_ForumkuMainCardView from "../component/forumku_component/forumku_view";
|
||||
|
||||
export default function ComponentForum_PostinganPribadi({
|
||||
dataPosting,
|
||||
|
||||
@@ -7,8 +7,6 @@ import LayoutForum_Create from "./create/layout";
|
||||
import LayoutForum_Forumku from "./forumku/layout";
|
||||
import Forum_MainDetail from "./detail/main_detail";
|
||||
import LayoutForum_Detail from "./detail/layout";
|
||||
import Forum_Komentar from "./komentar";
|
||||
import LayoutForum_Komentar from "./komentar/layout";
|
||||
import Forum_EditPosting from "./edit/posting";
|
||||
import LayoutForum_EditPosting from "./edit/posting/layout";
|
||||
import Forum_ReportPosting from "./report/posting";
|
||||
@@ -32,8 +30,6 @@ export {
|
||||
LayoutForum_Forumku,
|
||||
Forum_MainDetail as Forum_Detail,
|
||||
LayoutForum_Detail,
|
||||
Forum_Komentar,
|
||||
LayoutForum_Komentar,
|
||||
Forum_EditPosting,
|
||||
LayoutForum_EditPosting,
|
||||
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 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 { IconMessages } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
@@ -3,7 +3,6 @@ import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function funGetUserProfile( userId: string ) {
|
||||
|
||||
const user = await prisma.user.findUnique({
|
||||
where: {
|
||||
id: userId,
|
||||
@@ -19,14 +18,8 @@ export async function funGetUserProfile( userId: string ) {
|
||||
email: true,
|
||||
jenisKelamin: true,
|
||||
name: true,
|
||||
imagesId: true,
|
||||
ImageProfile: {
|
||||
select: {
|
||||
url: true,
|
||||
},
|
||||
},
|
||||
ImagesBackground: true,
|
||||
imagesBackgroundId: true,
|
||||
imageId: true,
|
||||
imageBackgroundId: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
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 {
|
||||
Stack,
|
||||
AspectRatio,
|
||||
Title,
|
||||
Grid,
|
||||
Box,
|
||||
SimpleGrid,
|
||||
Grid,
|
||||
Image,
|
||||
SimpleGrid,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { Investasi_ComponentStylesCard } from "../../comp_card_border_and_background";
|
||||
import { Investasi_ComponentBoxDaftarBerita } from "../comp_box_daftar_berita";
|
||||
|
||||
@@ -4,13 +4,10 @@ import {
|
||||
NEW_RouterInvestasi,
|
||||
RouterInvestasi_OLD,
|
||||
} 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 {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { MODEL_PROFILE_OLD } from "@/app_modules/home/model/user_profile";
|
||||
import {
|
||||
ActionIcon,
|
||||
AspectRatio,
|
||||
@@ -27,22 +24,16 @@ import {
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useLocalStorage } from "@mantine/hooks";
|
||||
import {
|
||||
IconBookDownload,
|
||||
IconCircleCheck,
|
||||
IconFileDescription,
|
||||
IconSpeakerphone,
|
||||
IconXboxX,
|
||||
IconSpeakerphone
|
||||
} from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import moment from "moment";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
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({
|
||||
dataInvestasi,
|
||||
|
||||
@@ -23,7 +23,7 @@ export default async function getListTransaksiBerhasilInvestasi(
|
||||
Profile: {
|
||||
select: {
|
||||
userId: true,
|
||||
imagesId: true
|
||||
imageId: true
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -19,7 +19,7 @@ export default async function getOneTransaksiBerhasilByIdInvestasi(
|
||||
Profile: {
|
||||
select: {
|
||||
id: true,
|
||||
imagesId: true,
|
||||
imageId: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,40 +1,24 @@
|
||||
"use client";
|
||||
|
||||
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 {
|
||||
Title,
|
||||
Card,
|
||||
CardSection,
|
||||
Group,
|
||||
Flex,
|
||||
Avatar,
|
||||
AspectRatio,
|
||||
Box,
|
||||
Slider,
|
||||
Card,
|
||||
Center,
|
||||
Grid,
|
||||
Stack,
|
||||
Divider,
|
||||
Badge,
|
||||
Image,
|
||||
Text,
|
||||
Button,
|
||||
Paper,
|
||||
Progress,
|
||||
Center,
|
||||
SimpleGrid,
|
||||
Stack,
|
||||
Text
|
||||
} 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 ComponentInvestasi_IsEmptyData from "../component/is_empty_data";
|
||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_Transaksi_Investasi } from "../_lib/interface";
|
||||
|
||||
export default function InvestasiSahamTerbeli({
|
||||
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_IMAGES } from "@/app_modules/model_global/interface";
|
||||
|
||||
export interface MODEL_PROFILE {
|
||||
userId: string;
|
||||
@@ -12,10 +11,6 @@ export interface MODEL_PROFILE {
|
||||
active: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
ImageProfile: MODEL_IMAGES;
|
||||
imagesId: string;
|
||||
ImagesBackground: MODEL_IMAGES;
|
||||
imagesBackgroundId: string;
|
||||
imageId?: string;
|
||||
imageBackgroundId?: string;
|
||||
}
|
||||
|
||||
@@ -1,33 +1,26 @@
|
||||
"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 { toNumber } from "lodash";
|
||||
import { useState } from "react";
|
||||
import {
|
||||
ComponentGlobal_AvatarAndUsername,
|
||||
ComponentGlobal_CardLoadingOverlay,
|
||||
ComponentGlobal_CardStyles,
|
||||
} from "@/app_modules/_global/component";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import {
|
||||
Avatar,
|
||||
Badge,
|
||||
Box,
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
Stack,
|
||||
Text,
|
||||
Title
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_VOTING } from "../model/interface";
|
||||
|
||||
export default function ComponentVote_CardViewPublish({
|
||||
data,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} 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_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
@@ -14,13 +14,12 @@ import {
|
||||
Badge,
|
||||
Box,
|
||||
Button,
|
||||
Card,
|
||||
Center,
|
||||
Group,
|
||||
Radio,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
Title
|
||||
} from "@mantine/core";
|
||||
import _ from "lodash";
|
||||
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 { voting_funGetOneVotingbyId } from "../../fun/get/fun_get_one_by_id";
|
||||
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({
|
||||
dataVote,
|
||||
|
||||