# Forum
- Tampilan admin untuk komentar - Hapus komentar - Hapus postingan - Lihat report - Search topik forum ## feat ### No issue
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
Group,
|
||||
ThemeIcon,
|
||||
ActionIcon,
|
||||
Badge,
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import moment from "moment";
|
||||
@@ -31,14 +32,18 @@ export default function ComponentForum_DetailOnHeaderAuthorName({
|
||||
authorName,
|
||||
username,
|
||||
isPembatas,
|
||||
userLoginId,
|
||||
statusId,
|
||||
}: {
|
||||
authorId?: string
|
||||
authorId?: string;
|
||||
postingId?: string;
|
||||
imagesId?: string;
|
||||
authorName?: string;
|
||||
username?: string;
|
||||
tglPublish?: Date;
|
||||
isPembatas?: boolean;
|
||||
statusId: string;
|
||||
userLoginId: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -73,40 +78,21 @@ export default function ComponentForum_DetailOnHeaderAuthorName({
|
||||
<Text lineClamp={1} fz={"sm"} fw={"bold"}>
|
||||
{authorName ? authorName : "Nama author "}
|
||||
</Text>
|
||||
<Text lineClamp={1} fz={"xs"} c={"gray"}>
|
||||
{username ? `@${username}` : "@username "}
|
||||
</Text>
|
||||
<Badge
|
||||
w={70}
|
||||
variant="light"
|
||||
color={(statusId as any) === 1 ? "green" : "red"}
|
||||
>
|
||||
<Text fz={10}>{(statusId as any) === 1 ? "Open" : "Close"}</Text>
|
||||
</Badge>
|
||||
</Stack>
|
||||
|
||||
{/* <Stack justify="center" h={"100%"}>
|
||||
<Grid>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text lineClamp={1} fz={"sm"} fw={"bold"}>
|
||||
{authorName ? authorName : "Nama author "}
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text lineClamp={1} fz={"sm"} c={"gray"}>
|
||||
{username ? username : "@username "}
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Group spacing={3}>
|
||||
<IconCircle size={5} color="gray" />
|
||||
<Text c={"gray"} fz={"sm"}>
|
||||
{skrng.toLocaleDateString(["id-ID"], {
|
||||
dateStyle: "medium",
|
||||
})}
|
||||
</Text>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Stack> */}
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"content"}>
|
||||
<ComponentForum_DetailMoreButton
|
||||
postingId={postingId}
|
||||
authorId={authorId}
|
||||
userLoginId={userLoginId}
|
||||
statusId={statusId}
|
||||
/>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { Stack, Grid, Avatar, Divider, Text, Group } from "@mantine/core";
|
||||
import {
|
||||
Stack,
|
||||
Grid,
|
||||
Avatar,
|
||||
Divider,
|
||||
Text,
|
||||
Group,
|
||||
Badge,
|
||||
Loader,
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import moment from "moment";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
@@ -19,6 +28,7 @@ import { IoIosMore } from "react-icons/io";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { useState } from "react";
|
||||
import ComponentForum_PostingButtonMore from "../more_button/posting_button_more";
|
||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
|
||||
|
||||
export default function ComponentForum_PostingAuthorNameOnHeader({
|
||||
authorId,
|
||||
@@ -28,6 +38,8 @@ export default function ComponentForum_PostingAuthorNameOnHeader({
|
||||
tglPublish,
|
||||
isPembatas,
|
||||
isMoreButton,
|
||||
statusId,
|
||||
userLoginId,
|
||||
}: {
|
||||
authorId?: string;
|
||||
postingId?: string;
|
||||
@@ -36,8 +48,12 @@ export default function ComponentForum_PostingAuthorNameOnHeader({
|
||||
tglPublish?: Date;
|
||||
isPembatas?: boolean;
|
||||
isMoreButton?: boolean;
|
||||
statusId?: string;
|
||||
userLoginId: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack spacing={"xs"}>
|
||||
@@ -46,43 +62,52 @@ export default function ComponentForum_PostingAuthorNameOnHeader({
|
||||
span={"content"}
|
||||
onClick={() => {
|
||||
if (authorId) {
|
||||
setLoading(true);
|
||||
router.push(RouterForum.forumku + authorId);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Avatar
|
||||
size={30}
|
||||
sx={{ borderStyle: "solid", borderWidth: "0.5px" }}
|
||||
radius={"xl"}
|
||||
bg={"gray.1"}
|
||||
src={
|
||||
imagesId
|
||||
? RouterProfile.api_foto_profile + imagesId
|
||||
: "/aset/global/avatar.png"
|
||||
}
|
||||
/>
|
||||
{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%"}>
|
||||
<Stack justify="center" h={"100%"} spacing={0}>
|
||||
<Grid>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text lineClamp={1} fz={"sm"} fw={"bold"}>
|
||||
{authorName
|
||||
? authorName
|
||||
: "Nama author coba di berikan panjang "}
|
||||
{authorName ? authorName : "Nama author "}
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
{/* <Grid.Col span={"auto"}>
|
||||
<Text lineClamp={1} fz={"sm"} c={"gray"}>
|
||||
{username ? username : "@username "}
|
||||
</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}>
|
||||
@@ -108,6 +133,8 @@ export default function ComponentForum_PostingAuthorNameOnHeader({
|
||||
<ComponentForum_PostingButtonMore
|
||||
authorId={authorId}
|
||||
postingId={postingId as any}
|
||||
statusId={statusId}
|
||||
userLoginId={userLoginId}
|
||||
/>
|
||||
</Group>
|
||||
) : (
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
|
||||
import { Stack, Card, Group, ActionIcon, Divider, Text } from "@mantine/core";
|
||||
import { IconMessageCircle } from "@tabler/icons-react";
|
||||
import { IconMessageCircle, IconMessageCircleOff } from "@tabler/icons-react";
|
||||
|
||||
import ComponentForum_PostingAuthorNameOnHeader from "./header/posting_author_header_name";
|
||||
import { MODEL_FORUM_POSTING } from "../model/interface";
|
||||
@@ -12,23 +12,28 @@ import { useRouter } from "next/navigation";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_forum_total_komentar } from "../global_state";
|
||||
import { forum_countOneTotalKomentarById } from "../fun/count/count_one_total_komentar_by_id";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
import { IconMessageCircleX } from "@tabler/icons-react";
|
||||
|
||||
export default function ComponentForum_MainCardView({
|
||||
data,
|
||||
setLoadingKomen,
|
||||
setLoadingDetail,
|
||||
userLoginId,
|
||||
}: {
|
||||
data: MODEL_FORUM_POSTING[];
|
||||
setLoadingKomen: any;
|
||||
setLoadingDetail: any;
|
||||
userLoginId: any
|
||||
}) {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<Stack spacing={"xl"}>
|
||||
{data.map((e, i) => (
|
||||
<Card key={i}>
|
||||
<Card.Section>
|
||||
{/* <pre>{JSON.stringify( typeof e.ForumMaster_StatusPosting.id)}</pre> */}
|
||||
<ComponentForum_PostingAuthorNameOnHeader
|
||||
authorName={e?.Author?.Profile?.name}
|
||||
imagesId={e?.Author?.Profile?.imagesId}
|
||||
@@ -36,22 +41,22 @@ export default function ComponentForum_MainCardView({
|
||||
isMoreButton={true}
|
||||
authorId={e?.Author?.id}
|
||||
postingId={e?.id}
|
||||
statusId={e?.ForumMaster_StatusPosting?.id}
|
||||
userLoginId={userLoginId}
|
||||
/>
|
||||
</Card.Section>
|
||||
<Card.Section
|
||||
sx={{ zIndex: 0 }}
|
||||
p={"sm"}
|
||||
p={"lg"}
|
||||
onClick={() => {
|
||||
// console.log("halaman forum");
|
||||
setLoadingDetail(true);
|
||||
router.push(RouterForum.main_detail + e.id);
|
||||
}}
|
||||
>
|
||||
<Stack spacing={"xs"}>
|
||||
<Text fz={"sm"} lineClamp={4}>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.diskusi }} />
|
||||
</Text>
|
||||
</Stack>
|
||||
<Text fz={"sm"} lineClamp={4}>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.diskusi }} />
|
||||
</Text>
|
||||
</Card.Section>
|
||||
<Card.Section>
|
||||
<Stack>
|
||||
@@ -61,11 +66,17 @@ export default function ComponentForum_MainCardView({
|
||||
variant="transparent"
|
||||
sx={{ zIndex: 1 }}
|
||||
onClick={() => {
|
||||
setLoadingKomen(true);
|
||||
router.push(RouterForum.komentar + e.id);
|
||||
(e?.ForumMaster_StatusPosting.id as any) === 1
|
||||
? (router.push(RouterForum.komentar + e?.id),
|
||||
setLoadingKomen(true))
|
||||
: router.push(RouterForum.main_detail + e?.id);
|
||||
}}
|
||||
>
|
||||
<IconMessageCircle color="gray" size={25} />
|
||||
{(e?.ForumMaster_StatusPosting?.id as any) === 1 ? (
|
||||
<IconMessageCircle color="gray" size={25} />
|
||||
) : (
|
||||
<IconMessageCircleX color="gray" size={25} />
|
||||
)}
|
||||
</ActionIcon>
|
||||
|
||||
{/* <TotalKomentar postingId={e?.id} /> */}
|
||||
@@ -81,18 +92,3 @@ export default function ComponentForum_MainCardView({
|
||||
</>
|
||||
);
|
||||
}
|
||||
function TotalKomentar({ postingId }: { postingId: string }) {
|
||||
const [value, setValue] = useState(0)
|
||||
|
||||
useShallowEffect(() => {
|
||||
forum_countOneTotalKomentarById(postingId).then((res) => {
|
||||
setValue(res);
|
||||
});
|
||||
}, [postingId]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Text c={"gray"}>{value}</Text>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,13 @@ import {
|
||||
Loader,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
||||
import { IconTrash, IconEdit, IconFlag3, IconDots } from "@tabler/icons-react";
|
||||
import {
|
||||
IconTrash,
|
||||
IconEdit,
|
||||
IconFlag3,
|
||||
IconDots,
|
||||
IconSquareRoundedX,
|
||||
} from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
@@ -29,18 +35,24 @@ import ComponentForum_LoadingDrawer from "../loading_drawer";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { IconSquareCheck } from "@tabler/icons-react";
|
||||
import { forum_funEditStatusPostingById } from "../../fun/edit/fun_edit_status_posting_by_id";
|
||||
|
||||
export default function ComponentForum_DetailMoreButton({
|
||||
authorId,
|
||||
postingId,
|
||||
statusId,
|
||||
userLoginId,
|
||||
}: {
|
||||
authorId: any;
|
||||
postingId?: any;
|
||||
statusId: any;
|
||||
userLoginId: any;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [openDel, setOpenDel] = useState(false);
|
||||
const [userLoginId, setUserLoginId] = useState("");
|
||||
const [openStatusClose, setOpenStatusClose] = useState(false);
|
||||
|
||||
// loading
|
||||
const [loadingEdit, setLoadingEdit] = useState(false);
|
||||
@@ -48,15 +60,6 @@ export default function ComponentForum_DetailMoreButton({
|
||||
|
||||
// if (loadingEdit) return <ComponentGlobal_V2_LoadingPage />;
|
||||
|
||||
useShallowEffect(() => {
|
||||
getUserLoginId();
|
||||
}, []);
|
||||
|
||||
async function getUserLoginId() {
|
||||
const getUserLoginId = await User_getUserId();
|
||||
setUserLoginId(getUserLoginId);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Drawer
|
||||
@@ -73,6 +76,28 @@ export default function ComponentForum_DetailMoreButton({
|
||||
""
|
||||
) : (
|
||||
<Stack>
|
||||
<Grid
|
||||
onClick={() => {
|
||||
close();
|
||||
setOpenStatusClose(true);
|
||||
}}
|
||||
>
|
||||
<Grid.Col span={"content"}>
|
||||
{statusId === 1 ? (
|
||||
<IconSquareRoundedX color="red" />
|
||||
) : (
|
||||
<IconSquareCheck />
|
||||
)}
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
{statusId === 1 ? (
|
||||
<Text c={"red"}>Tutup forum</Text>
|
||||
) : (
|
||||
<Text>Buka forum</Text>
|
||||
)}
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
|
||||
<Grid
|
||||
onClick={() => {
|
||||
close();
|
||||
@@ -146,6 +171,19 @@ export default function ComponentForum_DetailMoreButton({
|
||||
<ButtonDelete postingId={postingId} setOpenDel={setOpenDel} />
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
opened={openStatusClose}
|
||||
onClose={() => setOpenStatusClose(false)}
|
||||
centered
|
||||
withCloseButton={false}
|
||||
>
|
||||
<ButtonStatus
|
||||
postingId={postingId}
|
||||
setOpenStatus={setOpenStatusClose}
|
||||
statusId={statusId}
|
||||
/>
|
||||
</Modal>
|
||||
|
||||
<ActionIcon variant="transparent" onClick={() => open()}>
|
||||
<IconDots size={20} />
|
||||
</ActionIcon>
|
||||
@@ -201,3 +239,84 @@ function ButtonDelete({
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonStatus({
|
||||
postingId,
|
||||
setOpenStatus,
|
||||
statusId,
|
||||
}: {
|
||||
postingId?: string;
|
||||
setOpenStatus: any;
|
||||
statusId?: any;
|
||||
}) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
async function onTutupForum() {
|
||||
setOpenStatus(false);
|
||||
|
||||
await forum_funEditStatusPostingById(postingId as any, 2).then((res) => {
|
||||
if (res.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil(`Forum Ditutup`, 2000);
|
||||
setLoading(true);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function onBukaForum() {
|
||||
setOpenStatus(false);
|
||||
|
||||
await forum_funEditStatusPostingById(postingId as any, 1).then((res) => {
|
||||
if (res.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil(`Forum Dibuka`, 2000);
|
||||
setLoading(true);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{statusId === 1 ? (
|
||||
<Title order={6}>Yakin menutup forum ini ?</Title>
|
||||
) : (
|
||||
<Title order={6}>Yakin membuka forum ini ?</Title>
|
||||
)}
|
||||
<Group position="center">
|
||||
<Button radius={"xl"} onClick={() => setOpenStatus(false)}>
|
||||
Batal
|
||||
</Button>
|
||||
|
||||
{statusId === 1 ? (
|
||||
<Button
|
||||
loaderPosition="center"
|
||||
loading={loading ? true : false}
|
||||
color="red"
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onTutupForum();
|
||||
}}
|
||||
>
|
||||
Hapus
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
loaderPosition="center"
|
||||
loading={loading ? true : false}
|
||||
color="green"
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onBukaForum();
|
||||
}}
|
||||
>
|
||||
Buka
|
||||
</Button>
|
||||
)}
|
||||
</Group>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,14 @@ import {
|
||||
Loader,
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
||||
import { IconTrash, IconEdit, IconFlag3, IconDots } from "@tabler/icons-react";
|
||||
import {
|
||||
IconTrash,
|
||||
IconEdit,
|
||||
IconFlag3,
|
||||
IconDots,
|
||||
IconSquareRoundedX,
|
||||
IconSquareCheck,
|
||||
} from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
@@ -29,18 +36,25 @@ import ComponentForum_LoadingDrawer from "../loading_drawer";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { forum_funEditStatusPostingById } from "../../fun/edit/fun_edit_status_posting_by_id";
|
||||
|
||||
export default function ComponentForum_PostingButtonMore({
|
||||
authorId,
|
||||
postingId,
|
||||
statusId,
|
||||
userLoginId,
|
||||
}: {
|
||||
authorId: any;
|
||||
postingId?: any;
|
||||
statusId?: any;
|
||||
userLoginId: any;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
|
||||
// modal & drawer
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [openDel, setOpenDel] = useState(false);
|
||||
const [userLoginId, setUserLoginId] = useState("");
|
||||
const [openStatusClose, setOpenStatusClose] = useState(false);
|
||||
|
||||
// loading
|
||||
const [loadingEdit, setLoadingEdit] = useState(false);
|
||||
@@ -48,15 +62,6 @@ export default function ComponentForum_PostingButtonMore({
|
||||
|
||||
// if (loadingEdit) return <ComponentGlobal_V2_LoadingPage />;
|
||||
|
||||
useShallowEffect(() => {
|
||||
getUserLoginId();
|
||||
}, []);
|
||||
|
||||
async function getUserLoginId() {
|
||||
const getUserLoginId = await User_getUserId();
|
||||
setUserLoginId(getUserLoginId);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Drawer
|
||||
@@ -73,6 +78,28 @@ export default function ComponentForum_PostingButtonMore({
|
||||
""
|
||||
) : (
|
||||
<Stack>
|
||||
<Grid
|
||||
onClick={() => {
|
||||
close();
|
||||
setOpenStatusClose(true);
|
||||
}}
|
||||
>
|
||||
<Grid.Col span={"content"}>
|
||||
{statusId === 1 ? (
|
||||
<IconSquareRoundedX color="red" />
|
||||
) : (
|
||||
<IconSquareCheck />
|
||||
)}
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
{statusId === 1 ? (
|
||||
<Text c={"red"}>Tutup forum</Text>
|
||||
) : (
|
||||
<Text>Buka forum</Text>
|
||||
)}
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
|
||||
<Grid
|
||||
onClick={() => {
|
||||
close();
|
||||
@@ -146,6 +173,19 @@ export default function ComponentForum_PostingButtonMore({
|
||||
<ButtonDelete postingId={postingId} setOpenDel={setOpenDel} />
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
opened={openStatusClose}
|
||||
onClose={() => setOpenStatusClose(false)}
|
||||
centered
|
||||
withCloseButton={false}
|
||||
>
|
||||
<ButtonStatus
|
||||
postingId={postingId}
|
||||
setOpenStatus={setOpenStatusClose}
|
||||
statusId={statusId}
|
||||
/>
|
||||
</Modal>
|
||||
|
||||
<ActionIcon variant="transparent" onClick={() => open()}>
|
||||
<IconDots size={20} />
|
||||
</ActionIcon>
|
||||
@@ -160,18 +200,18 @@ function ButtonDelete({
|
||||
postingId?: string;
|
||||
setOpenDel: any;
|
||||
}) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
async function onDelete() {
|
||||
setOpenDel(false);
|
||||
await forum_funDeletePostingById(postingId as any).then((res) => {
|
||||
if (res.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil(`Postingan Terhapus`, 2000);
|
||||
setLoading(true)
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
await forum_funDeletePostingById(postingId as any).then((res) => {
|
||||
if (res.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil(`Postingan Terhapus`, 2000);
|
||||
setLoading(true);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
return (
|
||||
<>
|
||||
@@ -197,3 +237,84 @@ function ButtonDelete({
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ButtonStatus({
|
||||
postingId,
|
||||
setOpenStatus,
|
||||
statusId,
|
||||
}: {
|
||||
postingId?: string;
|
||||
setOpenStatus: any;
|
||||
statusId?: any;
|
||||
}) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
async function onTutupForum() {
|
||||
setOpenStatus(false);
|
||||
|
||||
await forum_funEditStatusPostingById(postingId as any, 2).then((res) => {
|
||||
if (res.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil(`Forum Ditutup`, 2000);
|
||||
setLoading(true);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function onBukaForum() {
|
||||
setOpenStatus(false);
|
||||
|
||||
await forum_funEditStatusPostingById(postingId as any, 1).then((res) => {
|
||||
if (res.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil(`Forum Dibuka`, 2000);
|
||||
setLoading(true);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
{statusId === 1 ? (
|
||||
<Title order={6}>Yakin menutup forum ini ?</Title>
|
||||
) : (
|
||||
<Title order={6}>Yakin membuka forum ini ?</Title>
|
||||
)}
|
||||
<Group position="center">
|
||||
<Button radius={"xl"} onClick={() => setOpenStatus(false)}>
|
||||
Batal
|
||||
</Button>
|
||||
|
||||
{statusId === 1 ? (
|
||||
<Button
|
||||
loaderPosition="center"
|
||||
loading={loading ? true : false}
|
||||
color="red"
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onTutupForum();
|
||||
}}
|
||||
>
|
||||
Hapus
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
loaderPosition="center"
|
||||
loading={loading ? true : false}
|
||||
color="green"
|
||||
radius={"xl"}
|
||||
onClick={() => {
|
||||
onBukaForum();
|
||||
}}
|
||||
>
|
||||
Buka
|
||||
</Button>
|
||||
)}
|
||||
</Group>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -44,15 +44,26 @@ export default function Forum_Detail({
|
||||
dataPosting: MODEL_FORUM_POSTING;
|
||||
listKomentar: MODEL_FORUM_KOMENTAR[];
|
||||
totalKomentar: number;
|
||||
userLoginId: string
|
||||
userLoginId: string;
|
||||
}) {
|
||||
const [komentar, setKomentar] = useState(listKomentar);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack px={"xs"}>
|
||||
<ForumView dataPosting={dataPosting} totalKomentar={totalKomentar} />
|
||||
<CreateKomentar postingId={dataPosting?.id} setKomentar={setKomentar} />
|
||||
<ForumView
|
||||
dataPosting={dataPosting}
|
||||
totalKomentar={totalKomentar}
|
||||
userLoginId={userLoginId}
|
||||
/>
|
||||
{(dataPosting?.ForumMaster_StatusPosting?.id as any) === 1 ? (
|
||||
<CreateKomentar
|
||||
postingId={dataPosting?.id}
|
||||
setKomentar={setKomentar}
|
||||
/>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
<KomentarView
|
||||
listKomentar={komentar}
|
||||
setKomentar={setKomentar}
|
||||
@@ -67,15 +78,17 @@ export default function Forum_Detail({
|
||||
function ForumView({
|
||||
dataPosting,
|
||||
totalKomentar,
|
||||
userLoginId,
|
||||
}: {
|
||||
dataPosting: MODEL_FORUM_POSTING;
|
||||
totalKomentar: number
|
||||
totalKomentar: number;
|
||||
userLoginId: string;
|
||||
}) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card style={{ position: "relative", width: "100%" }}>
|
||||
<Card.Section>
|
||||
{/* <pre>{JSON.stringify(dataPosting, null, 2)}</pre> */}
|
||||
<ComponentForum_DetailOnHeaderAuthorName
|
||||
authorId={dataPosting?.Author?.id}
|
||||
authorName={dataPosting?.Author?.Profile?.name}
|
||||
@@ -83,6 +96,8 @@ function ForumView({
|
||||
imagesId={dataPosting?.Author?.Profile?.imagesId}
|
||||
postingId={dataPosting?.id}
|
||||
tglPublish={dataPosting?.createdAt}
|
||||
userLoginId={userLoginId}
|
||||
statusId={dataPosting?.ForumMaster_StatusPosting?.id}
|
||||
/>
|
||||
</Card.Section>
|
||||
<Card.Section sx={{ zIndex: 0 }} py={"sm"}>
|
||||
@@ -202,7 +217,7 @@ function KomentarView({
|
||||
listKomentar: MODEL_FORUM_KOMENTAR[];
|
||||
setKomentar: any;
|
||||
postingId: string;
|
||||
userLoginId: string
|
||||
userLoginId: string;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -30,6 +30,7 @@ import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loadi
|
||||
import { MODEL_FORUM_POSTING } from "../model/interface";
|
||||
import ComponentForum_MainCardView from "../component/main_card_view";
|
||||
import { useWindowScroll } from "@mantine/hooks";
|
||||
import _ from "lodash";
|
||||
|
||||
export default function Forum_Forumku({
|
||||
auhtorSelectedData,
|
||||
@@ -77,7 +78,15 @@ export default function Forum_Forumku({
|
||||
auhtorSelectedData={auhtorSelectedData}
|
||||
totalPosting={totalPosting}
|
||||
/>
|
||||
<ForumPosting dataPosting={dataPosting} />
|
||||
{_.isEmpty(dataPosting) ? (
|
||||
<Center>
|
||||
<Text fw={"bold"} fz={"xs"} c={"gray"}>
|
||||
Belum ada posting
|
||||
</Text>
|
||||
</Center>
|
||||
) : (
|
||||
<ForumPosting dataPosting={dataPosting} userLoginId={userLoginId} />
|
||||
)}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
@@ -160,7 +169,13 @@ function ForumProfile({
|
||||
);
|
||||
}
|
||||
|
||||
function ForumPosting({ dataPosting }: { dataPosting: MODEL_FORUM_POSTING[] }) {
|
||||
function ForumPosting({
|
||||
dataPosting,
|
||||
userLoginId,
|
||||
}: {
|
||||
dataPosting: MODEL_FORUM_POSTING[];
|
||||
userLoginId: any;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
|
||||
const [loadingDetail, setLoadingDetail] = useState(false);
|
||||
@@ -174,6 +189,7 @@ function ForumPosting({ dataPosting }: { dataPosting: MODEL_FORUM_POSTING[] }) {
|
||||
data={dataPosting}
|
||||
setLoadingKomen={setLoadingKomen}
|
||||
setLoadingDetail={setLoadingDetail}
|
||||
userLoginId={userLoginId}
|
||||
/>
|
||||
|
||||
{/* <Stack>
|
||||
|
||||
@@ -11,6 +11,7 @@ export async function forum_funCreate(value: string) {
|
||||
data: {
|
||||
diskusi: value,
|
||||
authorId: AuthorId,
|
||||
forumMaster_StatusPostingId: 1
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function forum_funEditStatusPostingById(
|
||||
postingId: string,
|
||||
statusId: number
|
||||
) {
|
||||
const updt = await prisma.forum_Posting.update({
|
||||
where: {
|
||||
id: postingId,
|
||||
},
|
||||
data: {
|
||||
forumMaster_StatusPostingId: statusId,
|
||||
},
|
||||
});
|
||||
|
||||
if (!updt) return { status: 400, message: "Gagal update posting" };
|
||||
revalidatePath("/dev/forum/main");
|
||||
revalidatePath("/dev/forum/detail");
|
||||
revalidatePath("/dev/forum/forumku");
|
||||
return { status: 200, message: "Berhasil update posting" };
|
||||
}
|
||||
@@ -7,11 +7,17 @@ import { forum_countTotalKomenById } from "../count/count_total_komentar_by_id";
|
||||
|
||||
export async function forum_getListAllPosting() {
|
||||
const get = await prisma.forum_Posting.findMany({
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
orderBy: [
|
||||
// {
|
||||
// forumMaster_StatusPostingId: "asc",
|
||||
// },
|
||||
{
|
||||
createdAt: "desc",
|
||||
},
|
||||
],
|
||||
where: {
|
||||
isActive: true,
|
||||
// forumMaster_StatusPostingId: 1
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
@@ -30,6 +36,7 @@ export async function forum_getListAllPosting() {
|
||||
isActive: true,
|
||||
},
|
||||
},
|
||||
ForumMaster_StatusPosting: true,
|
||||
// _count: {
|
||||
// select: {
|
||||
// Forum_Komentar: true,
|
||||
@@ -38,17 +45,10 @@ export async function forum_getListAllPosting() {
|
||||
},
|
||||
});
|
||||
|
||||
// const data = get.map((v) => ({
|
||||
// ..._.omit(v, ['Forum_Komentar']),
|
||||
// total_coment: v.Forum_Komentar.filter((v) => v.isActive).length,
|
||||
// }));
|
||||
|
||||
const data = get.map((val) => ({
|
||||
..._.omit(val, ["Forum_Komentar"]),
|
||||
_count: val.Forum_Komentar.length,
|
||||
}));
|
||||
|
||||
// console.log(JSON.stringify(data, null, 2));
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ export async function forum_getListPostingByAuhtorId(authorId: string) {
|
||||
isActive: true,
|
||||
},
|
||||
},
|
||||
ForumMaster_StatusPosting: true
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ export async function forum_getOnePostingById(postingId: string) {
|
||||
Forum_Komentar: true,
|
||||
},
|
||||
},
|
||||
ForumMaster_StatusPosting: true
|
||||
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
50
src/app_modules/forum/fun/search/fun_search_list_posting.ts
Normal file
50
src/app_modules/forum/fun/search/fun_search_list_posting.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
"use server"
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import _ from "lodash"
|
||||
|
||||
export async function forum_funSearchListPosting(text:string) {
|
||||
const get = await prisma.forum_Posting.findMany({
|
||||
orderBy: [
|
||||
// {
|
||||
// forumMaster_StatusPostingId: "asc",
|
||||
// },
|
||||
{
|
||||
createdAt: "desc",
|
||||
},
|
||||
],
|
||||
take: 10,
|
||||
where: {
|
||||
diskusi: {
|
||||
contains: text,
|
||||
mode: "insensitive",
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
diskusi: true,
|
||||
createdAt: true,
|
||||
isActive: true,
|
||||
authorId: true,
|
||||
Author: {
|
||||
select: {
|
||||
id: true,
|
||||
Profile: true,
|
||||
},
|
||||
},
|
||||
Forum_Komentar: {
|
||||
where: {
|
||||
isActive: true,
|
||||
},
|
||||
},
|
||||
ForumMaster_StatusPosting: true,
|
||||
},
|
||||
});
|
||||
|
||||
const data = get.map((val) => ({
|
||||
..._.omit(val, ["Forum_Komentar"]),
|
||||
_count: val.Forum_Komentar.length,
|
||||
}));
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -30,20 +30,25 @@ import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/
|
||||
|
||||
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"}>
|
||||
@@ -76,8 +81,8 @@ function CreateKomentar({ postingId }: { postingId: string }) {
|
||||
if (res.status === 201) {
|
||||
setLoading(true);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
router.replace(RouterForum.main_detail + postingId, {scroll: false});
|
||||
router.refresh()
|
||||
router.replace(RouterForum.main_detail + postingId, { scroll: false });
|
||||
router.refresh();
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
|
||||
@@ -14,12 +14,16 @@ import {
|
||||
Divider,
|
||||
Group,
|
||||
Box,
|
||||
TextInput,
|
||||
Center,
|
||||
} from "@mantine/core";
|
||||
import { useShallowEffect, useTimeout, useWindowScroll } from "@mantine/hooks";
|
||||
import {
|
||||
IconCirclePlus,
|
||||
IconMessageCircle,
|
||||
IconPencilPlus,
|
||||
IconSearch,
|
||||
IconSearchOff,
|
||||
} from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import ComponentForum_PostingAuthorNameOnHeader from "../component/header/posting_author_header_name";
|
||||
@@ -29,13 +33,19 @@ import { useAtom } from "jotai";
|
||||
import { gs_forum_loading_edit_posting } from "../global_state";
|
||||
import { MODEL_FORUM_POSTING } from "../model/interface";
|
||||
import ComponentForum_MainCardView from "../component/main_card_view";
|
||||
import { forum_getListAllPosting } from "../fun/get/get_list_all_posting";
|
||||
import { forum_funSearchListPosting } from "../fun/search/fun_search_list_posting";
|
||||
import _ from "lodash";
|
||||
|
||||
export default function Forum_Beranda({
|
||||
listForum,
|
||||
userLoginId,
|
||||
}: {
|
||||
listForum: MODEL_FORUM_POSTING[];
|
||||
userLoginId: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [data, setData] = useState(listForum);
|
||||
const [scroll, scrollTo] = useWindowScroll();
|
||||
|
||||
const [loadingCreate, setLoadingCreate] = useState(false);
|
||||
@@ -45,9 +55,15 @@ export default function Forum_Beranda({
|
||||
if (loadingDetail) return <ComponentGlobal_V2_LoadingPage />;
|
||||
if (loadingKomen) return <ComponentGlobal_V2_LoadingPage />;
|
||||
|
||||
async function onSearch(text: string) {
|
||||
await forum_funSearchListPosting(text).then((res: any) => {
|
||||
setData(res);
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* <pre>{JSON.stringify(listForum, null, 2)}</pre> */}
|
||||
{/* <pre>{JSON.stringify(listForum, null, 2)}</pre> */}
|
||||
<Affix position={{ bottom: rem(100), right: rem(30) }}>
|
||||
<ActionIcon
|
||||
loading={loadingCreate ? true : false}
|
||||
@@ -68,67 +84,35 @@ export default function Forum_Beranda({
|
||||
</ActionIcon>
|
||||
</Affix>
|
||||
|
||||
<Box px={"sm"}>
|
||||
<ComponentForum_MainCardView
|
||||
data={listForum}
|
||||
setLoadingKomen={setLoadingKomen}
|
||||
setLoadingDetail={setLoadingDetail}
|
||||
<Stack px={"sm"} spacing={"xl"}>
|
||||
<TextInput
|
||||
radius={"xl"}
|
||||
placeholder="Topik forum apa yang anda cari hari ini ?"
|
||||
onChange={(val) => {
|
||||
onSearch(val.currentTarget.value);
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
{/* <Stack px={"sm"}>
|
||||
{listForum.map((e, i) => (
|
||||
<Card key={i}>
|
||||
<Card.Section>
|
||||
<ComponentForum_PostingAuthorNameOnHeader
|
||||
authorName={e?.Author?.Profile?.name}
|
||||
imagesId={e?.Author?.Profile?.imagesId}
|
||||
tglPublish={e?.createdAt}
|
||||
isMoreButton={true}
|
||||
authorId={e?.Author?.id}
|
||||
postingId={e?.id}
|
||||
/>
|
||||
</Card.Section>
|
||||
<Card.Section
|
||||
sx={{ zIndex: 0 }}
|
||||
p={"sm"}
|
||||
onClick={() => {
|
||||
// console.log("halaman forum");
|
||||
setLoadingDetail(true);
|
||||
router.push(RouterForum.main_detail + e.id);
|
||||
}}
|
||||
>
|
||||
<Stack spacing={"xs"}>
|
||||
<Text fz={"sm"} lineClamp={4}>
|
||||
<div dangerouslySetInnerHTML={{ __html: e.diskusi }} />
|
||||
</Text>
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
<Card.Section>
|
||||
<Stack>
|
||||
<Group spacing={"xs"} px={"sm"}>
|
||||
<ActionIcon
|
||||
// loading={loadingKomen ? true : false}
|
||||
variant="transparent"
|
||||
sx={{ zIndex: 1 }}
|
||||
onClick={() => {
|
||||
setLoadingKomen(true);
|
||||
router.push(RouterForum.komentar + e.id);
|
||||
}}
|
||||
>
|
||||
<IconMessageCircle color="gray" size={25} />
|
||||
</ActionIcon>
|
||||
|
||||
<TotalKomentar postingId={e?.id} />
|
||||
</Group>
|
||||
<Divider />
|
||||
</Stack>
|
||||
</Card.Section>
|
||||
</Card>
|
||||
))}
|
||||
</Stack> */}
|
||||
{_.isEmpty(data) ? (
|
||||
<Stack align="center" justify="center" h={"80vh"}>
|
||||
<IconSearchOff size={80} color="gray" />
|
||||
<Stack spacing={0} align="center">
|
||||
<Text c={"gray"} fw={"bold"} fz={"xs"}>
|
||||
Forum tidak ditemukan
|
||||
</Text>
|
||||
<Text c={"gray"} fw={"bold"} fz={"xs"}>
|
||||
Coba masukan kata yang bebeda
|
||||
</Text>
|
||||
</Stack>
|
||||
</Stack>
|
||||
) : (
|
||||
<ComponentForum_MainCardView
|
||||
data={data}
|
||||
setLoadingKomen={setLoadingKomen}
|
||||
setLoadingDetail={setLoadingDetail}
|
||||
userLoginId={userLoginId}
|
||||
/>
|
||||
)}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ export interface MODEL_FORUM_POSTING {
|
||||
authorId: string;
|
||||
Author: MODEL_USER;
|
||||
_count: number;
|
||||
Forum_Komentar: MODEL_FORUM_KOMENTAR[];
|
||||
Forum_ReportPosting: MODEL_FORUM_MASTER_REPORT[];
|
||||
ForumMaster_StatusPosting: MODEL_FORUM_MASTER_STATUS;
|
||||
}
|
||||
|
||||
export interface MODEL_FORUM_KOMENTAR {
|
||||
@@ -21,9 +24,10 @@ export interface MODEL_FORUM_KOMENTAR {
|
||||
forum_PostingId: string;
|
||||
authorId: string;
|
||||
Author: MODEL_USER;
|
||||
Forum_ReportKomentar: MODEL_FORUM_MASTER_REPORT[];
|
||||
}
|
||||
|
||||
export interface MODEL_FORUM_REPORT {
|
||||
export interface MODEL_FORUM_MASTER_REPORT {
|
||||
id: string;
|
||||
isActive: boolean;
|
||||
createdAt: Date;
|
||||
@@ -31,3 +35,22 @@ export interface MODEL_FORUM_REPORT {
|
||||
title: string;
|
||||
deskripsi: string;
|
||||
}
|
||||
|
||||
export interface MODEL_FORUM_MASTER_STATUS {
|
||||
id: string;
|
||||
isActive: boolean;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
status: string;
|
||||
}
|
||||
|
||||
export interface MODEL_FORUM_REPORT {
|
||||
id: string;
|
||||
isActive: boolean;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
deskripsi: string;
|
||||
ForumMaster_KategoriReport: MODEL_FORUM_MASTER_REPORT;
|
||||
forumMaster_KategoriReportId: string;
|
||||
User: MODEL_USER;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { Box, Button, Paper, Radio, Stack, Text, Title } from "@mantine/core";
|
||||
import { MODEL_FORUM_REPORT } from "../../model/interface";
|
||||
import { MODEL_FORUM_MASTER_REPORT } from "../../model/interface";
|
||||
import { useState } from "react";
|
||||
import { forum_funCreateReportPosting } from "../../fun/create/fun_create_report_posting";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
@@ -15,7 +15,7 @@ export default function Forum_ReportKomentar({
|
||||
listReport,
|
||||
}: {
|
||||
komentarId: string;
|
||||
listReport: MODEL_FORUM_REPORT[];
|
||||
listReport: MODEL_FORUM_MASTER_REPORT[];
|
||||
}) {
|
||||
const [reportValue, setReportValue] = useState("Kebencian");
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { Box, Button, Paper, Radio, Stack, Text, Title } from "@mantine/core";
|
||||
import { MODEL_FORUM_REPORT } from "../../model/interface";
|
||||
import { MODEL_FORUM_MASTER_REPORT } from "../../model/interface";
|
||||
import { useState } from "react";
|
||||
import { forum_funCreateReportPosting } from "../../fun/create/fun_create_report_posting";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
@@ -14,7 +14,7 @@ export default function Forum_ReportPosting({
|
||||
listReport,
|
||||
}: {
|
||||
postingId: string;
|
||||
listReport: MODEL_FORUM_REPORT[];
|
||||
listReport: MODEL_FORUM_MASTER_REPORT[];
|
||||
}) {
|
||||
const [reportValue, setReportValue] = useState("Kebencian");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user