diff --git a/components/landing/banner-new.tsx b/components/landing/banner-new.tsx
index b169213..85d56d7 100644
--- a/components/landing/banner-new.tsx
+++ b/components/landing/banner-new.tsx
@@ -410,7 +410,10 @@ export default function BannerHumasNew() {
-
+
@@ -166,8 +167,9 @@ export default function FooterNew(props: { margin?: boolean }) {
diff --git a/components/main/dashboard/dashboard-container.tsx b/components/main/dashboard/dashboard-container.tsx
index 4bed547..02eca33 100644
--- a/components/main/dashboard/dashboard-container.tsx
+++ b/components/main/dashboard/dashboard-container.tsx
@@ -15,7 +15,12 @@ import {
Calendar,
Checkbox,
CheckboxGroup,
+ CheckboxIcon,
Image,
+ Modal,
+ ModalBody,
+ ModalContent,
+ ModalHeader,
Pagination,
Popover,
PopoverContent,
@@ -24,13 +29,14 @@ import {
SelectItem,
SelectSection,
Skeleton,
+ useDisclosure,
} from "@heroui/react";
import ApexChartColumn from "./chart/column-chart";
import ApexChartDonut from "./chart/donut-chart";
import ApexChartLineArea from "./chart/line-area-chart";
import Cookies from "js-cookie";
import Link from "next/link";
-import { useEffect, useState } from "react";
+import { Fragment, useEffect, useState } from "react";
import {
getListArticle,
getListArticleAdminPage,
@@ -47,6 +53,7 @@ import {
textEllipsis,
} from "@/utils/global";
import { parseDate, getLocalTimeZone } from "@internationalized/date";
+import { Input } from "@heroui/input";
type ArticleData = Article & {
no: number;
@@ -68,6 +75,8 @@ interface PostCount {
}
export default function DashboardContainer() {
+ const { isOpen, onOpen, onOpenChange } = useDisclosure();
+
const username = Cookies.get("username");
const fullname = Cookies.get("ufne");
const [page, setPage] = useState(1);
@@ -75,6 +84,7 @@ export default function DashboardContainer() {
const [topPagespage, setTopPagesPage] = useState(1);
const [topPagesTotalPage, setTopPagesTotalPage] = useState(1);
const [article, setArticle] = useState
([]);
+ const [selectedCategory, setSelectedCategory] = useState("polda");
const [analyticsView, setAnalyticView] = useState([
"comment",
"view",
@@ -109,7 +119,9 @@ export default function DashboardContainer() {
const [postCount, setPostCount] = useState([]);
const [polresData, setPolresData] = useState({});
const [selectedAccordion, setSelectedAccordion] = useState(new Set([]));
-
+ const [recapArticleList, setRecapArticleList] = useState([]);
+ const [timeValue, setTimeValue] = useState("--:--");
+ const [selectedUnit, setSelectedUnit] = useState("");
const roleId = Cookies.get("urie");
useEffect(() => {
@@ -287,6 +299,21 @@ export default function DashboardContainer() {
}
};
+ const openModalArticle = async (limit: number) => {
+ const req = {
+ limit: `${limit}`,
+ page: topPagespage,
+ search: "",
+ sort: "desc",
+ startDate: getDate(topContentDate.startDate),
+ endDate: getDate(topContentDate.endDate),
+ };
+ const res = await getTopArticles(req);
+ setRecapArticleList(getTableNumber(10, res.data?.data));
+ // setTopPagesTotalPage(res?.data?.meta?.totalPage);
+ onOpen();
+ };
+
return (
@@ -348,7 +375,7 @@ export default function DashboardContainer() {
Rekapitulasi Post Berita Polda/Polres Pada Website
-
+
+
+
+
+ }
+ classNames={{
+ inputWrapper: [
+ "border-none rounded-lg !h-[30px] lg:h-[40px]",
+ "dark:group-data-[focused=false]:bg-transparent border-none",
+ ],
+ }}
+ />
-
+
NO
-
POLDA/POLRES
+
+ {Number(roleId) < 3 ? (
+
+ ) : (
+ "POLDA/POLRES"
+ )}
+
JUMLAH POST BERITA
@@ -423,9 +493,9 @@ export default function DashboardContainer() {
{list?.no}
{list?.userLevelName}
{list?.totalArticle}
@@ -449,14 +519,20 @@ export default function DashboardContainer() {
{child?.userLevelName}
-
{
+ if (list?.totalArticle !== 0) {
+ setSelectedUnit(child?.userLevelName);
+ openModalArticle(list?.totalArticle);
+ }
+ }}
+ className={`w-[10%] text-start cursor-pointer ${
list?.totalArticle === 0 &&
- "bg-red-600 text-white"
+ "bg-red-600 text-white cursor-default"
}`}
>
{child?.totalArticle}
-
+
)
)
@@ -711,6 +787,44 @@ export default function DashboardContainer() {
+
+
+ {(onClose) => (
+ <>
+
+ {selectedUnit} List Content
+
+
+
+
No
+
Judul
+
Dibuat
+
+ {recapArticleList?.length > 0 &&
+ recapArticleList?.map((list: any) => (
+
+ {list.no}
+
+
+ {textEllipsis(list.title, 80)}
+
+
+
+ {convertDateFormat(list?.createdAt)}
+
+
+ ))}
+
+
+
+ >
+ )}
+
+
);
}
diff --git a/components/page/detail-news.tsx b/components/page/detail-news.tsx
index 2ced954..e60a371 100644
--- a/components/page/detail-news.tsx
+++ b/components/page/detail-news.tsx
@@ -157,29 +157,33 @@ export default function DetailNews(props: { data: any; listArticle: any }) {
- {data.files[0].file_name.split(".")[1].includes("doc") ||
- data.files[0].file_name.split(".")[1].includes("pdf") ? (
-
- ) : (
- data?.files?.length > 0 && (
+ {data?.files ? (
+ data?.files[0]?.file_name.split(".")[1].includes("doc") ||
+ data?.files[0]?.file_name.split(".")[1].includes("pdf") ? (
+ ) : (
+ data?.files?.length > 0 && (
+
+ )
)
+ ) : (
+ ""
)}
{data?.files?.length > 0 &&
diff --git a/config/site.ts b/config/site.ts
index bab68cf..76c96af 100644
--- a/config/site.ts
+++ b/config/site.ts
@@ -89,14 +89,14 @@ export const siteConfig = {
},
{
label: "Pelayanan Propam Presisi",
- href: "https://play.google.com/store/apps/details?id=com.stk.pengaduanpropam&pli=1",
+ href: "https://apps.apple.com/id/app/propam-presisi/id1560263690?l=id",
img: "/pm9.png",
blank: true,
desc: "Pelayanan Untuk Masyarakat Agar Mudah Melaporkan Sesuatu Kejadian atau Kejahatan",
},
{
label: "Pelayanan Dumas Presisi",
- href: "https://dumaspresisi.polri.go.id/",
+ href: "https://play.google.com/store/apps/details?id=superapps.polri.presisi.presisi",
img: "/pm10.png",
blank: true,
desc: "Layanan Pengaduan Masyarakat Terintegrasi Berbasis Online",
@@ -229,7 +229,7 @@ export const siteConfig = {
},
{
label: "Polisiku",
- href: "https://play.google.com/store/apps/details?id=id.co.qlue.polisiku&hl=id&gl=ID",
+ href: "https://play.google.com/store/apps/details?id=superapps.polri.presisi.presisi",
img: "/at3.png",
blank: true,
desc: "Membantu anggota Kepolisian untuk mengindetifikasi masalah di lapangan",
@@ -299,14 +299,14 @@ export const siteConfig = {
},
{
label: "Propam Presisi",
- href: "https://play.google.com/store/apps/details?id=com.stk.pengaduanpropam",
+ href: "https://apps.apple.com/id/app/propam-presisi/id1560263690?l=id",
img: "/pm9.png",
blank: true,
desc: "Aplikasi Pelayanan Masyarakat untuk Melapor Secara Mudah",
},
{
label: "Monitoring Presisi",
- href: "https://play.google.com/store/apps/details?id=com.stk.pengaduanpropam",
+ href: "https://play.google.com/store/apps/details?id=superapps.polri.presisi.presisi",
img: "/at14.png",
blank: true,
desc: "Aplikasi Anggota Binmas dan Satpam Polda Metro Jaya Melaporkan Tugas",
@@ -320,14 +320,14 @@ export const siteConfig = {
},
{
label: "Whistle Blowing System",
- href: "https://pengaduan-penerimaan.polri.go.id/",
+ href: "https://wbs.polri.go.id/",
img: "/at16.png",
blank: true,
desc: "Website untuk Pengaduan Penerimaan Anggota POLRI",
},
{
label: "Dumas Presisi",
- href: "https://play.google.com/store/apps/details?id=com.admasolusi.monitoringpresisi",
+ href: "https://play.google.com/store/apps/details?id=superapps.polri.presisi.presisi",
img: "/pm10.png",
blank: true,
desc: "Website Layanan Pengaduan Masyarakat Terintegrasi",