2024-12-12 18:38:15 +00:00
|
|
|
"use client";
|
2024-12-24 15:44:47 +00:00
|
|
|
|
2024-12-03 02:14:51 +00:00
|
|
|
import { StatisticsBlock } from "@/components/blocks/statistics-block";
|
|
|
|
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
|
|
|
import DashboardDropdown from "@/components/dashboard-dropdown";
|
|
|
|
|
import { useTranslations } from "next-intl";
|
|
|
|
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
|
import { UploadIcon } from "lucide-react";
|
2024-12-23 07:57:32 +00:00
|
|
|
|
2024-12-12 18:38:15 +00:00
|
|
|
import Cookies from "js-cookie";
|
|
|
|
|
import { useEffect } from "react";
|
|
|
|
|
import { getCookiesDecrypt } from "@/lib/utils";
|
|
|
|
|
import DashboardVisualization from "@/components/visualization/dashboard-viz";
|
2024-12-13 04:10:59 +00:00
|
|
|
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
2024-12-13 00:39:20 +00:00
|
|
|
import TaskTable from "../contributor/task/components/task-table";
|
|
|
|
|
import PressConferenceTable from "../contributor/schedule/press-release/components/pressrilis-table";
|
|
|
|
|
import BlogTable from "../contributor/blog/components/blog-table";
|
2024-12-16 01:25:47 +00:00
|
|
|
import ContentTable from "./routine-task/components/content-table";
|
2024-12-16 01:28:53 +00:00
|
|
|
import RecentActivity from "./routine-task/components/recent-activity";
|
2024-12-17 14:27:47 +00:00
|
|
|
import { Link } from "@/components/navigation";
|
2025-04-13 12:30:26 +00:00
|
|
|
import ReportTable from "../contributor/report/components/report-table";
|
2024-12-03 02:14:51 +00:00
|
|
|
|
|
|
|
|
const DashboardPage = () => {
|
|
|
|
|
const t = useTranslations("AnalyticsDashboard");
|
2024-12-12 18:38:15 +00:00
|
|
|
const roleId = getCookiesDecrypt("urie");
|
2026-01-29 11:38:34 +00:00
|
|
|
const levelNumber = Number(getCookiesDecrypt("ulne"));
|
2024-12-12 18:38:15 +00:00
|
|
|
|
|
|
|
|
return Number(roleId) == 2 || Number(roleId) == 11 || Number(roleId) == 12 ? (
|
|
|
|
|
<div>
|
2024-12-13 04:10:59 +00:00
|
|
|
<SiteBreadcrumb />
|
|
|
|
|
<DashboardVisualization />
|
2024-12-12 18:38:15 +00:00
|
|
|
</div>
|
|
|
|
|
) : (
|
2024-12-03 02:14:51 +00:00
|
|
|
<div>
|
|
|
|
|
<div className="my-3">
|
|
|
|
|
<Tabs defaultValue="routine-task" className="w-full">
|
|
|
|
|
<Card className="py-3 px-2 my-4">
|
|
|
|
|
<TabsList className="flex-wrap">
|
|
|
|
|
<TabsTrigger
|
|
|
|
|
value="routine-task"
|
|
|
|
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
|
|
|
|
>
|
2025-07-06 09:23:45 +00:00
|
|
|
{t("task-routine", { defaultValue: "Task Routine" })}
|
2024-12-03 02:14:51 +00:00
|
|
|
</TabsTrigger>
|
|
|
|
|
<TabsTrigger
|
|
|
|
|
value="task"
|
|
|
|
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
|
|
|
|
>
|
2025-07-06 09:23:45 +00:00
|
|
|
{t("task", { defaultValue: "Task" })}
|
2024-12-03 02:14:51 +00:00
|
|
|
</TabsTrigger>
|
|
|
|
|
<TabsTrigger
|
|
|
|
|
value="schedule"
|
|
|
|
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
|
|
|
|
>
|
2025-07-06 09:23:45 +00:00
|
|
|
{t("schedule", { defaultValue: "Schedule" })}
|
2024-12-03 02:14:51 +00:00
|
|
|
</TabsTrigger>
|
2026-01-29 11:38:34 +00:00
|
|
|
{levelNumber !== 3 && (
|
|
|
|
|
<>
|
|
|
|
|
<TabsTrigger
|
|
|
|
|
value="indeks"
|
|
|
|
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
|
|
|
|
>
|
|
|
|
|
{t("indeks", { defaultValue: "Indeks" })}
|
|
|
|
|
</TabsTrigger>
|
|
|
|
|
|
|
|
|
|
<TabsTrigger
|
|
|
|
|
value="report"
|
|
|
|
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
|
|
|
|
>
|
|
|
|
|
{t("report", { defaultValue: "Report" })}
|
|
|
|
|
</TabsTrigger>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
2024-12-03 02:14:51 +00:00
|
|
|
</TabsList>
|
|
|
|
|
</Card>
|
|
|
|
|
<TabsContent value="routine-task">
|
|
|
|
|
<div className="grid grid-cols-12 items-center gap-5 mb-5">
|
|
|
|
|
<div className="2xl:col-span-12 lg:col-span-12 col-span-12">
|
|
|
|
|
<Card>
|
|
|
|
|
<CardContent className="p-4">
|
|
|
|
|
<div className="grid md:grid-cols-3 gap-4">
|
|
|
|
|
<StatisticsBlock
|
2026-01-29 11:38:34 +00:00
|
|
|
title={t("Hasil_unggah_disetujui_hari_ini", {
|
|
|
|
|
defaultValue: "Hasil Unggah Disetujui Hari Ini",
|
|
|
|
|
})}
|
2024-12-03 02:14:51 +00:00
|
|
|
total="3,564"
|
|
|
|
|
className="bg-info/10 border-none shadow-none"
|
|
|
|
|
/>
|
|
|
|
|
<StatisticsBlock
|
2026-01-29 11:38:34 +00:00
|
|
|
title={t("Hasil_unggah_direvisi_hari_ini", {
|
|
|
|
|
defaultValue: "Hasil Unggah Direvisi Hari Ini",
|
|
|
|
|
})}
|
2024-12-03 02:14:51 +00:00
|
|
|
total="564"
|
|
|
|
|
className="bg-warning/10 border-none shadow-none"
|
|
|
|
|
chartColor="#FB8F65"
|
|
|
|
|
/>
|
|
|
|
|
<StatisticsBlock
|
2026-01-29 11:38:34 +00:00
|
|
|
title={t("Hasil_unggah_ditolak_hari_ini", {
|
|
|
|
|
defaultValue: "Hasil Unggah Ditolak Hari Ini",
|
|
|
|
|
})}
|
2024-12-03 02:14:51 +00:00
|
|
|
total="+5.0%"
|
|
|
|
|
className="bg-primary/10 border-none shadow-none"
|
|
|
|
|
chartColor="#2563eb"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="grid grid-cols-12 gap-5">
|
|
|
|
|
<div className="lg:col-span-4 col-span-12">
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader className="flex flex-row items-center">
|
|
|
|
|
<CardTitle className="flex-1 text-lg">
|
2026-01-29 11:38:34 +00:00
|
|
|
{t("Total-Content-Production", {
|
|
|
|
|
defaultValue: "Total Content Production",
|
|
|
|
|
})}
|
2024-12-03 02:14:51 +00:00
|
|
|
</CardTitle>
|
|
|
|
|
<DashboardDropdown />
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent>
|
|
|
|
|
<RecentActivity />
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="lg:col-span-8 col-span-12">
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader className="flex flex-row items-center">
|
2026-01-29 11:38:34 +00:00
|
|
|
<CardTitle className="flex-1">
|
|
|
|
|
{t("tabel", { defaultValue: "Tabel" })}
|
|
|
|
|
</CardTitle>
|
2025-04-07 16:37:19 +00:00
|
|
|
{/* <DashboardDropdown /> */}
|
2024-12-03 02:14:51 +00:00
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="p-0">
|
2024-12-16 01:25:47 +00:00
|
|
|
<ContentTable />
|
2024-12-03 02:14:51 +00:00
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</TabsContent>
|
|
|
|
|
<TabsContent value="task">
|
|
|
|
|
<div className="grid grid-cols-12 gap-5">
|
|
|
|
|
<div className="lg:col-span-12 col-span-12">
|
|
|
|
|
<Card>
|
|
|
|
|
<Card className="py-4 px-3">
|
|
|
|
|
<div className="flex flex-row justify-between items-center">
|
|
|
|
|
<div className="flex-1 text-xl font-medium text-default-900">
|
2025-02-20 11:29:08 +00:00
|
|
|
Tabel Penugasan
|
2024-12-03 02:14:51 +00:00
|
|
|
</div>
|
2026-01-29 11:38:34 +00:00
|
|
|
{Number(levelNumber) !== 3 && (
|
|
|
|
|
<div className="flex-none">
|
|
|
|
|
<Link href="/contributor/task/create">
|
|
|
|
|
<Button color="primary" className="text-white">
|
|
|
|
|
<UploadIcon size={18} className="mr-2" />
|
|
|
|
|
{t("create-task", {
|
|
|
|
|
defaultValue: "Create Task",
|
|
|
|
|
})}
|
|
|
|
|
</Button>
|
|
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
{/* <div>
|
2024-12-17 14:27:47 +00:00
|
|
|
<Link href={"/contributor/task/create"}>
|
|
|
|
|
<Button color="primary" className="text-white">
|
|
|
|
|
<UploadIcon />
|
|
|
|
|
Buat Penugasan
|
|
|
|
|
</Button>
|
|
|
|
|
</Link>
|
2026-01-29 11:38:34 +00:00
|
|
|
</div> */}
|
2024-12-03 02:14:51 +00:00
|
|
|
</div>
|
|
|
|
|
</Card>
|
2024-12-17 14:27:47 +00:00
|
|
|
<CardContent className="p-0 mt-3">
|
2024-12-03 02:14:51 +00:00
|
|
|
<TaskTable />
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</TabsContent>
|
|
|
|
|
<TabsContent value="schedule">
|
|
|
|
|
<div className="grid grid-cols-12 gap-5">
|
|
|
|
|
<div className="lg:col-span-12 col-span-12">
|
|
|
|
|
<Card>
|
2024-12-17 14:27:47 +00:00
|
|
|
<CardContent className="p-0 ">
|
2024-12-03 02:14:51 +00:00
|
|
|
<PressConferenceTable />
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</TabsContent>
|
|
|
|
|
<TabsContent value="indeks">
|
|
|
|
|
<div className="grid grid-cols-12 gap-5">
|
|
|
|
|
<div className="lg:col-span-12 col-span-12">
|
|
|
|
|
<Card>
|
2025-04-13 12:30:26 +00:00
|
|
|
{/* <Card className="py-4 px-3">
|
2025-02-20 11:29:08 +00:00
|
|
|
<div className="flex flex-col md:flex-row md:justify-between md:items-center lg:flex-row lg:justify-between lg:items-center">
|
|
|
|
|
<div className="flex-1 text-xl font-medium text-default-900 mb-2">
|
2024-12-03 02:14:51 +00:00
|
|
|
Table Indeks
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
2024-12-17 14:27:47 +00:00
|
|
|
<Link href={"/contributor/blog/create"}>
|
|
|
|
|
<Button color="primary" className="text-white">
|
|
|
|
|
<UploadIcon />
|
|
|
|
|
Tambah Indeks
|
|
|
|
|
</Button>
|
|
|
|
|
</Link>
|
2024-12-03 02:14:51 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-13 12:30:26 +00:00
|
|
|
</Card> */}
|
2024-12-17 14:27:47 +00:00
|
|
|
<CardContent className="p-0 mt-3">
|
2024-12-03 02:14:51 +00:00
|
|
|
<BlogTable />
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</TabsContent>
|
2025-04-13 12:30:26 +00:00
|
|
|
<TabsContent value="report">
|
|
|
|
|
<div className="grid grid-cols-12 gap-5">
|
|
|
|
|
<div className="lg:col-span-12 col-span-12">
|
|
|
|
|
<Card>
|
|
|
|
|
<CardContent className="p-0 mt-3">
|
|
|
|
|
<ReportTable />
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</TabsContent>
|
2024-12-03 02:14:51 +00:00
|
|
|
</Tabs>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default DashboardPage;
|