"use client";
import { Box, Button, Paper, Radio, Stack, Text, Title } from "@mantine/core";
import { MODEL_FORUM_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";
import { useRouter } from "next/navigation";
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
import { RouterForum } from "@/app/lib/router_hipmi/router_forum";
export default function Forum_ReportPosting({
postingId,
listReport,
}: {
postingId: string;
listReport: MODEL_FORUM_REPORT[];
}) {
const [reportValue, setReportValue] = useState("Kebencian");
return (
<>
{listReport.map((e) => (
{e.title}}
/>
{e.deskripsi}
))}
>
);
}
function ButtonAction({
value,
postingId,
}: {
value: string;
postingId: string;
}) {
const router = useRouter();
const [loading, setLoading] = useState(false);
async function onReport() {
await forum_funCreateReportPosting(postingId, value).then((res) => {
if (res.status === 201) {
ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
setLoading(true);
router.back();
} else {
ComponentGlobal_NotifikasiGagal(res.message);
}
});
}
return (
<>
>
);
}