From 1f7b912b524925853a09bcdfbb0838aec7fdf147 Mon Sep 17 00:00:00 2001 From: Sabda Yagra Date: Mon, 17 Nov 2025 12:51:14 +0700 Subject: [PATCH] fix: rollback commit in thursday --- .../content/satker/audio/detail/[id]/page.tsx | 16 - .../content/satker/audio/update/[id]/page.tsx | 17 - .../content/satker/components/columns.tsx | 498 --------------- .../satker/components/table-satker.tsx | 572 ------------------ .../content/satker/create/page.tsx | 15 - .../content/satker/image/detail/[id]/page.tsx | 15 - .../content/satker/image/update/[id]/page.tsx | 16 - .../contributor/content/satker/layout.tsx | 11 - .../contributor/content/satker/page.tsx | 88 --- .../content/satker/teks/detail/[id]/page.tsx | 16 - .../content/satker/teks/update/[id]/page.tsx | 17 - .../content/satker/update-seo/[id]/page.tsx | 18 - .../content/satker/update/[id]/page.tsx | 17 - .../content/satker/video/detail/[id]/page.tsx | 16 - .../content/satker/video/update/[id]/page.tsx | 17 - lib/menus.ts | 14 +- 16 files changed, 7 insertions(+), 1356 deletions(-) delete mode 100644 app/[locale]/(protected)/contributor/content/satker/audio/detail/[id]/page.tsx delete mode 100644 app/[locale]/(protected)/contributor/content/satker/audio/update/[id]/page.tsx delete mode 100644 app/[locale]/(protected)/contributor/content/satker/components/columns.tsx delete mode 100644 app/[locale]/(protected)/contributor/content/satker/components/table-satker.tsx delete mode 100644 app/[locale]/(protected)/contributor/content/satker/create/page.tsx delete mode 100644 app/[locale]/(protected)/contributor/content/satker/image/detail/[id]/page.tsx delete mode 100644 app/[locale]/(protected)/contributor/content/satker/image/update/[id]/page.tsx delete mode 100644 app/[locale]/(protected)/contributor/content/satker/layout.tsx delete mode 100644 app/[locale]/(protected)/contributor/content/satker/page.tsx delete mode 100644 app/[locale]/(protected)/contributor/content/satker/teks/detail/[id]/page.tsx delete mode 100644 app/[locale]/(protected)/contributor/content/satker/teks/update/[id]/page.tsx delete mode 100644 app/[locale]/(protected)/contributor/content/satker/update-seo/[id]/page.tsx delete mode 100644 app/[locale]/(protected)/contributor/content/satker/update/[id]/page.tsx delete mode 100644 app/[locale]/(protected)/contributor/content/satker/video/detail/[id]/page.tsx delete mode 100644 app/[locale]/(protected)/contributor/content/satker/video/update/[id]/page.tsx diff --git a/app/[locale]/(protected)/contributor/content/satker/audio/detail/[id]/page.tsx b/app/[locale]/(protected)/contributor/content/satker/audio/detail/[id]/page.tsx deleted file mode 100644 index c3d08051..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/audio/detail/[id]/page.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import SiteBreadcrumb from "@/components/site-breadcrumb"; -import FormImageDetail from "@/components/form/content/image-detail-form"; -import FormAudioDetail from "@/components/form/content/audio-detail-form"; - -const AudioDetailPage = async () => { - return ( -
- -
- -
-
- ); -}; - -export default AudioDetailPage; diff --git a/app/[locale]/(protected)/contributor/content/satker/audio/update/[id]/page.tsx b/app/[locale]/(protected)/contributor/content/satker/audio/update/[id]/page.tsx deleted file mode 100644 index c0690cb7..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/audio/update/[id]/page.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import SiteBreadcrumb from "@/components/site-breadcrumb"; -import FormImageDetail from "@/components/form/content/image-detail-form"; -import FormImageUpdate from "@/components/form/content/image-update-form"; -import FormAudioUpdate from "@/components/form/content/audio-update-form"; - -const AudioUpdatePage = async () => { - return ( -
- -
- -
-
- ); -}; - -export default AudioUpdatePage; diff --git a/app/[locale]/(protected)/contributor/content/satker/components/columns.tsx b/app/[locale]/(protected)/contributor/content/satker/components/columns.tsx deleted file mode 100644 index 4a2d56da..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/components/columns.tsx +++ /dev/null @@ -1,498 +0,0 @@ -import * as React from "react"; -import { ColumnDef } from "@tanstack/react-table"; - -import { Eye, MoreVertical, SquarePen, Trash2 } from "lucide-react"; -import { cn, getCookiesDecrypt } from "@/lib/utils"; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuTrigger, - DropdownMenuItem, -} from "@/components/ui/dropdown-menu"; -import { Button } from "@/components/ui/button"; -import { Badge } from "@/components/ui/badge"; -import { format } from "date-fns"; -import { Link } from "@/components/navigation"; -import { deleteMedia } from "@/service/content/content"; -import Swal from "sweetalert2"; -import withReactContent from "sweetalert2-react-content"; -import { error } from "@/lib/swal"; -import { useTranslations } from "next-intl"; -import { useRouter } from "@/i18n/routing"; - -const useTableColumns = () => { - const t = useTranslations("Table"); - const MySwal = withReactContent(Swal); - const userLevelId = getCookiesDecrypt("ulie"); - - const columns: ColumnDef[] = [ - { - accessorKey: "no", - header: t("no", { defaultValue: "No" }), - cell: ({ row }) => ( -
-
-

- {row.getValue("no")} -

-
-
- ), - }, - { - accessorKey: "title", - header: t("title", { defaultValue: "Title" }), - cell: ({ row }: { row: { getValue: (key: string) => string } }) => { - const title: string = row.getValue("title"); - return ( - - {title.length > 50 ? `${title.slice(0, 30)}...` : title} - - ); - }, - }, - { - accessorKey: "categoryName", - header: t("category-name", { defaultValue: "Category Name" }), - cell: ({ row }) => ( - - {row.getValue("categoryName")} - - ), - }, - { - accessorKey: "createdAt", - header: t("upload-date", { defaultValue: "Upload Date" }), - cell: ({ row }) => { - const createdAt = row.getValue("createdAt") as - | string - | number - | undefined; - - const formattedDate = - createdAt && !isNaN(new Date(createdAt).getTime()) - ? format(new Date(createdAt), "dd-MM-yyyy HH:mm:ss") - : "-"; - return {formattedDate}; - }, - }, - { - accessorKey: "creatorName", - header: t("creator-group", { defaultValue: "Creator Group" }), - cell: ({ row }) => ( - {row.getValue("creatorName")} - ), - }, - { - accessorKey: "fileTypeId", - header: "Jenis Konten", - cell: ({ row }) => { - const type = Number(row.getValue("fileTypeId")); - const name = row.original.fileTypeName; - - const label = - type === 1 - ? "Image" - : type === 2 - ? "Audio Visual" - : type === 3 - ? "Text" - : type === 4 - ? "Audio" - : name || "-"; - - const color = - type === 1 - ? "bg-blue-100 text-blue-600" - : type === 2 - ? "bg-red-100 text-red-600" - : type === 3 - ? "bg-green-100 text-green-600" - : type === 4 - ? "bg-yellow-100 text-yellow-600" - : "bg-gray-200 text-gray-600"; - - return ( - - {label} - - ); - }, - }, - { - accessorKey: "creatorGroupLevelName", - header: t("source", { defaultValue: "Source" }), - cell: ({ row }) => ( - - {row.getValue("creatorGroupLevelName")} - - ), - }, - { - accessorKey: "publishedOn", - header: t("published", { defaultValue: "Published" }), - cell: ({ row }) => { - const isPublish = row.original.isPublish; - const isPublishOnPolda = row.original.isPublishOnPolda; - const creatorGroupParentLevelId = - row.original.creatorGroupParentLevelId; - - let displayText = "-"; - if (isPublish && !isPublishOnPolda) { - displayText = "Mabes"; - } else if (isPublish && isPublishOnPolda) { - if (Number(creatorGroupParentLevelId) == 761) { - displayText = "Mabes & Satker"; - } else { - displayText = "Mabes & Polda"; - } - } else if (!isPublish && isPublishOnPolda) { - if (Number(creatorGroupParentLevelId) == 761) { - displayText = "Satker"; - } else { - displayText = "Polda"; - } - } - - return ( -
- {displayText} -
- ); - }, - }, - - { - accessorKey: "statusName", - header: "Status", - cell: ({ row }) => { - const statusColors: Record = { - diterima: "bg-green-100 text-green-600", - "menunggu review": "bg-orange-100 text-orange-600", - }; - - const colors = [ - "bg-orange-100 text-orange-600", - "bg-orange-100 text-orange-600", - "bg-green-100 text-green-600", - "bg-blue-100 text-blue-600", - "bg-red-200 text-red-600", - ]; - - const status = - Number(row.original?.statusId) == 2 && - row.original?.reviewedAtLevel !== null && - !row.original?.reviewedAtLevel?.includes(`:${userLevelId}:`) && - Number(row.original?.creatorGroupLevelId) != Number(userLevelId) - ? "1" - : row.original?.statusId; - const statusStyles = - colors[Number(status)] || "bg-red-200 text-red-600"; - // const statusStyles = statusColors[status] || "bg-red-200 text-red-600"; - - return ( - - {(Number(row.original?.statusId) == 2 && - !row.original?.reviewedAtLevel !== null && - !row.original?.reviewedAtLevel?.includes( - `:${Number(userLevelId)}:` - ) && - Number(row.original?.creatorGroupLevelId) != - Number(userLevelId)) || - (Number(row.original?.statusId) == 1 && - Number(row.original?.needApprovalFromLevel) == - Number(userLevelId)) - ? "Menunggu Review" - : row.original?.statusName}{" "} - - ); - }, - }, - - { - id: "actions", - accessorKey: "action", - header: t("action", { defaultValue: "Action" }), - enableHiding: false, - cell: ({ row }) => { - const router = useRouter(); - const MySwal = withReactContent(Swal); - - const typeId = Number(row.original.fileTypeId); - - // mapping route detail - const detailRoute = - typeId === 1 - ? `/contributor/content/satker/image/detail/${row.original.id}` - : typeId === 2 - ? `/contributor/content/satker/video/detail/${row.original.id}` - : typeId === 3 - ? `/contributor/content/satker/text/detail/${row.original.id}` - : typeId === 4 - ? `/contributor/content/satker/audio/detail/${row.original.id}` - : `/contributor/content/satker/detail/${row.original.id}`; - - // mapping route update - const updateRoute = - typeId === 1 - ? `/contributor/content/satker/image/update/${row.original.id}` - : typeId === 2 - ? `/contributor/content/satker/video/update/${row.original.id}` - : typeId === 3 - ? `/contributor/content/satker/text/update/${row.original.id}` - : typeId === 4 - ? `/contributor/content/satker/audio/update/${row.original.id}` - : `/contributor/content/satker/update/${row.original.id}`; - - async function doDelete(id: any) { - const data = { id }; - const response = await deleteMedia(data); - - if (response?.error) { - error(response.message); - return false; - } - success(); - } - - function success() { - MySwal.fire({ - title: "Sukses", - icon: "success", - confirmButtonColor: "#3085d6", - confirmButtonText: "OK", - }).then((result) => { - if (result.isConfirmed) { - window.location.reload(); - } - }); - } - - const handleDeleteMedia = (id: any) => { - MySwal.fire({ - title: "Hapus Data", - text: "", - icon: "warning", - showCancelButton: true, - cancelButtonColor: "#3085d6", - confirmButtonColor: "#d33", - confirmButtonText: "Hapus", - }).then((result) => { - if (result.isConfirmed) { - doDelete(id); - } - }); - }; - - const [isMabesApprover, setIsMabesApprover] = React.useState(false); - const userId = getCookiesDecrypt("uie"); - const userLevelId = getCookiesDecrypt("ulie"); - const roleId = Number(getCookiesDecrypt("urie")); // pastikan jadi number - - React.useEffect(() => { - if (userLevelId !== undefined && roleId !== undefined) { - setIsMabesApprover( - Number(userLevelId) === 216 && Number(roleId) === 3 - ); - } - }, [userLevelId, roleId]); - - const canEdit = - Number(row.original.uploadedById) === Number(userId) || - isMabesApprover || - roleId === 14; - - return ( - - - - - - {/* - - - View - - */} - - - - View - - - - {/* {canEdit && ( - - - - Edit - - - )} */} - {canEdit && ( - - - - Edit - - - )} - - handleDeleteMedia(row.original.id)} - className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none" - > - - Delete - - - - ); - }, - }, - // { - // id: "actions", - // accessorKey: "action", - // header: t("action", { defaultValue: "Action" }), - // enableHiding: false, - // cell: ({ row }) => { - // const MySwal = withReactContent(Swal); - - // async function doDelete(id: any) { - // // loading(); - // const data = { - // id, - // }; - - // const response = await deleteMedia(data); - - // if (response?.error) { - // error(response.message); - // return false; - // } - // success(); - // } - - // function success() { - // MySwal.fire({ - // title: "Sukses", - // icon: "success", - // confirmButtonColor: "#3085d6", - // confirmButtonText: "OK", - // }).then((result) => { - // if (result.isConfirmed) { - // window.location.reload(); - // } - // }); - // } - - // const handleDeleteMedia = (id: any) => { - // MySwal.fire({ - // title: "Hapus Data", - // text: "", - // icon: "warning", - // showCancelButton: true, - // cancelButtonColor: "#3085d6", - // confirmButtonColor: "#d33", - // confirmButtonText: "Hapus", - // }).then((result) => { - // if (result.isConfirmed) { - // doDelete(id); - // } - // }); - // }; - - // const [isMabesApprover, setIsMabesApprover] = React.useState(false); - // const userId = getCookiesDecrypt("uie"); - // const userLevelId = getCookiesDecrypt("ulie"); - // const roleId = getCookiesDecrypt("urie"); - - // React.useEffect(() => { - // if (userLevelId !== undefined && roleId !== undefined) { - // setIsMabesApprover( - // Number(userLevelId) == 216 && Number(roleId) == 3 - // ); - // } - // }, [userLevelId, roleId]); - - // return ( - // - // - // - // - // - // - // - // - // View - // - // - // {/* - // - // - // Edit - // - // */} - // {(Number(row.original.uploadedById) === Number(userId) || - // isMabesApprover) && ( - // - // - // - // Edit - // - // - // )} - // handleDeleteMedia(row.original.id)} - // className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none" - // > - // - // Delete - // - // {/* {(row.original.uploadedById === userId || isMabesApprover) && ( - // handleDeleteMedia(row.original.id)} - // className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none" - // > - // - // Hapus - // - // )} */} - // - // - // ); - // }, - // }, - ]; - - return columns; -}; - -export default useTableColumns; diff --git a/app/[locale]/(protected)/contributor/content/satker/components/table-satker.tsx b/app/[locale]/(protected)/contributor/content/satker/components/table-satker.tsx deleted file mode 100644 index 2a6df941..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/components/table-satker.tsx +++ /dev/null @@ -1,572 +0,0 @@ -"use client"; - -import * as React from "react"; -import { - ColumnFiltersState, - PaginationState, - SortingState, - VisibilityState, - flexRender, - getCoreRowModel, - getFilteredRowModel, - getPaginationRowModel, - getSortedRowModel, - useReactTable, -} from "@tanstack/react-table"; -import { - Table, - TableBody, - TableCell, - TableHead, - TableHeader, - TableRow, -} from "@/components/ui/table"; -import { Button } from "@/components/ui/button"; -import { - DropdownMenu, - DropdownMenuCheckboxItem, - DropdownMenuContent, - DropdownMenuRadioGroup, - DropdownMenuRadioItem, - DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu"; -import { ChevronDown, Search } from "lucide-react"; -import { getCookiesDecrypt } from "@/lib/utils"; -import { Input } from "@/components/ui/input"; -import { InputGroup, InputGroupText } from "@/components/ui/input-group"; -import TablePagination from "@/components/table/table-pagination"; -import { listDataAll, listDataSatker, listEnableCategory } from "@/service/content/content"; -import Swal from "sweetalert2"; -import withReactContent from "sweetalert2-react-content"; -import { format } from "date-fns"; -import useTableColumns from "./columns"; -import { Label } from "@/components/ui/label"; -import { useRouter } from "@/i18n/routing"; -import { useSearchParams } from "next/navigation"; - -const TableSatker = () => { - const router = useRouter(); - const searchParams = useSearchParams(); - const MySwal = withReactContent(Swal); - const [dataTable, setDataTable] = React.useState([]); - const [totalData, setTotalData] = React.useState(1); - const [totalPage, setTotalPage] = React.useState(1); - const [sorting, setSorting] = React.useState([]); - const [columnFilters, setColumnFilters] = React.useState( - [] - ); - const [columnVisibility, setColumnVisibility] = - React.useState({}); - const [rowSelection, setRowSelection] = React.useState({}); - const [showData, setShowData] = React.useState("10"); - const [page, setPage] = React.useState(1); - const [search, setSearch] = React.useState(""); - const searchTimeoutRef = React.useRef(null); - const [categories, setCategories] = React.useState([]); - const [selectedCategories, setSelectedCategories] = React.useState( - [] - ); - const [categoryFilter, setCategoryFilter] = React.useState(""); - const [statusFilter, setStatusFilter] = React.useState([]); - const [startDate, setStartDate] = React.useState(""); - const [endDate, setEndDate] = React.useState(""); - const [filterByCreator, setFilterByCreator] = React.useState(""); - const [filterBySource, setFilterBySource] = React.useState(""); - const [filterByCreatorGroup, setFilterByCreatorGroup] = React.useState(""); - const [typeId, setTypeId] = React.useState(""); - - const userLevelId = getCookiesDecrypt("ulie"); - const roleId = getCookiesDecrypt("urie"); - - const columns = useTableColumns(); - - const [pagination, setPagination] = React.useState({ - pageIndex: 0, - pageSize: Number(showData), - }); - - const table = useReactTable({ - data: dataTable, - columns, - onSortingChange: setSorting, - onColumnFiltersChange: setColumnFilters, - getCoreRowModel: getCoreRowModel(), - getPaginationRowModel: getPaginationRowModel(), - getSortedRowModel: getSortedRowModel(), - getFilteredRowModel: getFilteredRowModel(), - onColumnVisibilityChange: setColumnVisibility, - onRowSelectionChange: setRowSelection, - onPaginationChange: setPagination, - state: { - sorting, - columnFilters, - columnVisibility, - rowSelection, - pagination, - }, - }); - - // Sync page dari URL (?page=) - React.useEffect(() => { - const pageFromUrl = searchParams?.get("page"); - if (pageFromUrl) setPage(Number(pageFromUrl)); - }, [searchParams]); - - // Ambil kategori sekali di awal - React.useEffect(() => { - getCategories(); - }, []); - - // Fetch data ketika filter/pagination berubah - React.useEffect(() => { - fetchData(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [ - categoryFilter, - statusFilter, - startDate, - endDate, - showData, - page, - typeId, - filterByCreatorGroup, - ]); - - async function getCategories() { - try { - // ini mengikuti kode awal, type "2" (misal: kategori video) - const category = await listEnableCategory("2"); - const resCategory = category?.data?.data?.content; - setCategories(resCategory || []); - } catch (error) { - console.error("Error fetching categories:", error); - } - } - - async function fetchData(showLoader = false, customSearch?: string) { - const formattedStartDate = startDate - ? format(new Date(startDate), "yyyy-MM-dd") - : ""; - const formattedEndDate = endDate - ? format(new Date(endDate), "yyyy-MM-dd") - : ""; - - try { - if (showLoader) { - MySwal.fire({ - title: "Memuat data...", - html: "Mohon tunggu sebentar", - allowOutsideClick: false, - didOpen: () => MySwal.showLoading(), - }); - } - - const isForSelf = Number(roleId) === 4; - const isApproval = !isForSelf; - - const res = await listDataSatker( - isForSelf, - isApproval, - page - 1, // page (0-based) - parseInt(showData) || 10, // limit - search, // search (kalau diperlukan di backend) - typeId, // typeId: 1=image, 2=video, 3=text, 4=audio - statusFilter?.join(","), // statusId - statusFilter?.join(",")?.includes("1") ? userLevelId : "", - filterByCreator, - filterBySource, - formattedStartDate, - formattedEndDate, - customSearch ?? search // title - ); - - const data = res?.data?.data; - const contentData = data?.content || []; - const newData = contentData.map((item: any, index: number) => ({ - ...item, - no: (page - 1) * Number(showData) + index + 1, - })); - - setDataTable([...newData]); - setTotalData(data?.totalElements || 0); - setTotalPage(data?.totalPages || 1); - } catch (error) { - console.error("Error fetching data:", error); - } finally { - MySwal.close(); - } - } - - // === HANDLERS === - const handleCheckboxChange = (categoryId: number) => { - setSelectedCategories((prev) => - prev.includes(categoryId) - ? prev.filter((id) => id !== categoryId) - : [...prev, categoryId] - ); - - setCategoryFilter((prev) => { - const updated = prev.split(",").filter(Boolean).map(Number); - const newList = updated.includes(categoryId) - ? updated.filter((id) => id !== categoryId) - : [...updated, categoryId]; - return newList.join(","); - }); - }; - - function handleStatusCheckboxChange(value: any) { - setStatusFilter((prev: any) => - prev.includes(value) - ? prev.filter((status: any) => status !== value) - : [...prev, value] - ); - } - - // Search dengan debounce 2 detik - const handleSearch = (e: React.ChangeEvent) => { - const value = e.target.value; - setSearch(value); - - if (searchTimeoutRef.current) { - clearTimeout(searchTimeoutRef.current); - } - - searchTimeoutRef.current = setTimeout(() => { - // setiap kali search, reset ke page 1 - setPage(1); - fetchData(true, value); - }, 2000); - }; - - const handleSearchFilterByCreator = ( - e: React.ChangeEvent - ) => { - const value = e.target.value; - setFilterByCreator(value); - setPage(1); - fetchData(true); - }; - - const handleSearchFilterBySource = ( - e: React.ChangeEvent - ) => { - const value = e.target.value; - setFilterBySource(value); - setPage(1); - fetchData(true); - }; - - // ๐Ÿงน Reset semua filter - const handleResetFilters = () => { - setSelectedCategories([]); - setCategoryFilter(""); - setStatusFilter([]); - setStartDate(""); - setEndDate(""); - setFilterByCreator(""); - setFilterBySource(""); - setFilterByCreatorGroup(""); - setTypeId(""); - setPage(1); - fetchData(true); - }; - - return ( -
-
- {/* ๐Ÿ” Search bar */} -
- - - - - - -
- - {/* Filter & Columns & ShowData */} -
- {/* Show Data Dropdown */} -
- - - - - - { - setShowData(value); - setPagination((prev) => ({ - ...prev, - pageSize: Number(value), - pageIndex: 0, - })); - setPage(1); - }} - > - - 10 Data - - - 50 Data - - - 100 Data - - - 250 Data - - - - -
- - {/* Jenis Konten (typeId) */} - - - - - - { - setTypeId(value); - setPage(1); - fetchData(true); - }} - > - - Semua Jenis - - - Gambar / Image - - - Video - - - Teks / Artikel - - - Audio - - - - - - {/* Filter Dropdown */} - - - - - - {/* ๐Ÿงน Reset All Button */} -
- -
- - - {categories.length > 0 ? ( - categories.map((category) => ( -
- handleCheckboxChange(category.id)} - /> - -
- )) - ) : ( -

- Tidak ada kategori. -

- )} - -
- - { - setStartDate(e.target.value); - setPage(1); - }} - /> -
-
- - { - setEndDate(e.target.value); - setPage(1); - }} - /> -
- -
- - -
- -
- - -
- - - {[1, 2, 3, 4].map((id) => { - const label = - id === 1 - ? "Menunggu Review" - : id === 2 - ? "Diterima" - : id === 3 - ? "Minta Update" - : "Ditolak"; - return ( -
- handleStatusCheckboxChange(id)} - /> - -
- ); - })} -
-
- - {/* Columns Toggle */} - - - - - - {table - .getAllColumns() - .filter((column) => column.getCanHide()) - .map((column) => ( - - column.toggleVisibility(!!value) - } - > - {column.id} - - ))} - - -
-
- - {/* === TABLE === */} - - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => ( - - {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext() - )} - - ))} - - ))} - - - - {table.getRowModel().rows?.length ? ( - table.getRowModel().rows.map((row) => ( - - {row.getVisibleCells().map((cell) => ( - - {flexRender( - cell.column.columnDef.cell, - cell.getContext() - )} - - ))} - - )) - ) : ( - - - Tidak ada hasil ditemukan. - - - )} - -
- - -
- ); -}; - -export default TableSatker; diff --git a/app/[locale]/(protected)/contributor/content/satker/create/page.tsx b/app/[locale]/(protected)/contributor/content/satker/create/page.tsx deleted file mode 100644 index 089cc55f..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/create/page.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import FormVideo from "@/components/form/content/video-form"; -import SiteBreadcrumb from "@/components/site-breadcrumb"; - -const VideoCreatePage = async () => { - return ( -
- -
- -
-
- ); -}; - -export default VideoCreatePage; diff --git a/app/[locale]/(protected)/contributor/content/satker/image/detail/[id]/page.tsx b/app/[locale]/(protected)/contributor/content/satker/image/detail/[id]/page.tsx deleted file mode 100644 index c4c3a5ac..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/image/detail/[id]/page.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import SiteBreadcrumb from "@/components/site-breadcrumb"; -import FormImageDetail from "@/components/form/content/image-detail-form"; - -const ImageDetailPage = async () => { - return ( -
- -
- -
-
- ); -}; - -export default ImageDetailPage; diff --git a/app/[locale]/(protected)/contributor/content/satker/image/update/[id]/page.tsx b/app/[locale]/(protected)/contributor/content/satker/image/update/[id]/page.tsx deleted file mode 100644 index 1adea644..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/image/update/[id]/page.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import SiteBreadcrumb from "@/components/site-breadcrumb"; -import FormImageDetail from "@/components/form/content/image-detail-form"; -import FormImageUpdate from "@/components/form/content/image-update-form"; - -const ImageUpdatePage = async () => { - return ( -
- -
- -
-
- ); -}; - -export default ImageUpdatePage; diff --git a/app/[locale]/(protected)/contributor/content/satker/layout.tsx b/app/[locale]/(protected)/contributor/content/satker/layout.tsx deleted file mode 100644 index 6e956709..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/layout.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Metadata } from "next"; - -export const metadata: Metadata = { - title: "Media Hub | POLRI", - description: "Media Hub merupakan situs resmi milik Divisi Humas Polri di mana di dalamnya berisi konten-konten yang dapat diakses secara gratis oleh Internal Polri, Jurnalis, Masyarakat Umum, dan KSP.", -}; -const Layout = ({ children }: { children: React.ReactNode }) => { - return <>{children}; -}; - -export default Layout; diff --git a/app/[locale]/(protected)/contributor/content/satker/page.tsx b/app/[locale]/(protected)/contributor/content/satker/page.tsx deleted file mode 100644 index 9c8a3a74..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/page.tsx +++ /dev/null @@ -1,88 +0,0 @@ -"use client"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; -import SiteBreadcrumb from "@/components/site-breadcrumb"; -import TableImage from "./components/table-satker"; -import { UploadIcon } from "lucide-react"; -import { Button } from "@/components/ui/button"; -import { Icon } from "@iconify/react/dist/iconify.js"; -import TableVideo from "./components/table-satker"; -import { Link } from "@/components/navigation"; -import { useTranslations } from "next-intl"; - -const ReactTableVideoPage = () => { - const t = useTranslations("AnalyticsDashboard"); - return ( -
- -
- -
-
-
- -
-
-

- {t("average", { defaultValue: "Average" })} :0 -

-

- {t("Hasil_unggah_disetujui_hari_ini", { defaultValue: "Hasil Unggah Disetujui Hari Ini" })} -

-
-
-
-
- -
-
-

- {t("average", { defaultValue: "Average" })} :0 -

-

{t("Hasil_unggah_direvisi_hari_ini", { defaultValue: "Hasil Unggah Direvisi Hari Ini" })}

-
-
-
-
- -
-
-

- {t("average", { defaultValue: "Average" })} :0 -

-

{t("Hasil_unggah_ditolak_hari_ini", { defaultValue: "Hasil Unggah Ditolak Hari Ini" })}

-
-
-
-
- - - -
-
- Satker -
-
- {/* - - */} - {/* */} -
-
-
-
- - - -
-
-
- ); -}; - -export default ReactTableVideoPage; diff --git a/app/[locale]/(protected)/contributor/content/satker/teks/detail/[id]/page.tsx b/app/[locale]/(protected)/contributor/content/satker/teks/detail/[id]/page.tsx deleted file mode 100644 index 1245c0a1..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/teks/detail/[id]/page.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import SiteBreadcrumb from "@/components/site-breadcrumb"; -import FormImageDetail from "@/components/form/content/image-detail-form"; -import FormTeksDetail from "@/components/form/content/teks-detail-form"; - -const TeksDetailPage = async () => { - return ( -
- -
- -
-
- ); -}; - -export default TeksDetailPage; diff --git a/app/[locale]/(protected)/contributor/content/satker/teks/update/[id]/page.tsx b/app/[locale]/(protected)/contributor/content/satker/teks/update/[id]/page.tsx deleted file mode 100644 index c7b8dfec..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/teks/update/[id]/page.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import SiteBreadcrumb from "@/components/site-breadcrumb"; -import FormImageDetail from "@/components/form/content/image-detail-form"; -import FormImageUpdate from "@/components/form/content/image-update-form"; -import FormTeksUpdate from "@/components/form/content/teks-update-form"; - -const TeksUpdatePage = async () => { - return ( -
- -
- -
-
- ); -}; - -export default TeksUpdatePage; diff --git a/app/[locale]/(protected)/contributor/content/satker/update-seo/[id]/page.tsx b/app/[locale]/(protected)/contributor/content/satker/update-seo/[id]/page.tsx deleted file mode 100644 index 260e06f2..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/update-seo/[id]/page.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import SiteBreadcrumb from "@/components/site-breadcrumb"; -import FormImageDetail from "@/components/form/content/image-detail-form"; -import FormImageUpdate from "@/components/form/content/image-update-form"; -import FormVideoUpdate from "@/components/form/content/video-update-form"; -import FormVideoSeo from "@/components/form/content/video-update-seo"; - -const VideoUpdatePage = async () => { - return ( -
- -
- -
-
- ); -}; - -export default VideoUpdatePage; diff --git a/app/[locale]/(protected)/contributor/content/satker/update/[id]/page.tsx b/app/[locale]/(protected)/contributor/content/satker/update/[id]/page.tsx deleted file mode 100644 index 1b0a481c..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/update/[id]/page.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import SiteBreadcrumb from "@/components/site-breadcrumb"; -import FormImageDetail from "@/components/form/content/image-detail-form"; -import FormImageUpdate from "@/components/form/content/image-update-form"; -import FormVideoUpdate from "@/components/form/content/video-update-form"; - -const VideoUpdatePage = async () => { - return ( -
- -
- -
-
- ); -}; - -export default VideoUpdatePage; diff --git a/app/[locale]/(protected)/contributor/content/satker/video/detail/[id]/page.tsx b/app/[locale]/(protected)/contributor/content/satker/video/detail/[id]/page.tsx deleted file mode 100644 index 377c0a87..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/video/detail/[id]/page.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import SiteBreadcrumb from "@/components/site-breadcrumb"; -import FormImageDetail from "@/components/form/content/image-detail-form"; -import FormVideoDetail from "@/components/form/content/video-detail-form"; - -const VideoDetailPage = async () => { - return ( -
- -
- -
-
- ); -}; - -export default VideoDetailPage; diff --git a/app/[locale]/(protected)/contributor/content/satker/video/update/[id]/page.tsx b/app/[locale]/(protected)/contributor/content/satker/video/update/[id]/page.tsx deleted file mode 100644 index 1b0a481c..00000000 --- a/app/[locale]/(protected)/contributor/content/satker/video/update/[id]/page.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import SiteBreadcrumb from "@/components/site-breadcrumb"; -import FormImageDetail from "@/components/form/content/image-detail-form"; -import FormImageUpdate from "@/components/form/content/image-update-form"; -import FormVideoUpdate from "@/components/form/content/video-update-form"; - -const VideoUpdatePage = async () => { - return ( -
- -
- -
-
- ); -}; - -export default VideoUpdatePage; diff --git a/lib/menus.ts b/lib/menus.ts index 95bba4a9..00088138 100644 --- a/lib/menus.ts +++ b/lib/menus.ts @@ -100,13 +100,13 @@ export function getMenuList(pathname: string, t: any): Group[] { }, ...(!hideForRole14 ? [ - { - href: "/contributor/content/satker", - label: "satker", - active: pathname.includes("/content/satker"), - icon: "heroicons:credit-card", - children: [], - }, + // { + // href: "/contributor/content/satker", + // label: "satker", + // active: pathname.includes("/content/satker"), + // icon: "heroicons:credit-card", + // children: [], + // }, { href: "/contributor/content/spit", label: "spit",