2024-12-11 18:28:57 +00:00
|
|
|
import * as React from "react";
|
|
|
|
|
import { ColumnDef } from "@tanstack/react-table";
|
|
|
|
|
|
|
|
|
|
import { Eye, MoreVertical, SquarePen, Trash2 } from "lucide-react";
|
2025-06-07 05:36:19 +00:00
|
|
|
import { cn, getCookiesDecrypt } from "@/lib/utils";
|
2024-12-11 18:28:57 +00:00
|
|
|
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";
|
2025-01-03 19:35:50 +00:00
|
|
|
import { Link } from "@/components/navigation";
|
2025-01-15 19:02:28 +00:00
|
|
|
import { error } from "@/lib/swal";
|
|
|
|
|
import { deleteMedia } from "@/service/content/content";
|
|
|
|
|
import withReactContent from "sweetalert2-react-content";
|
|
|
|
|
import Swal from "sweetalert2";
|
2025-03-06 08:18:31 +00:00
|
|
|
import { useTranslations } from "next-intl";
|
2025-09-24 14:53:34 +00:00
|
|
|
import { useRouter } from "@/i18n/routing";
|
2024-12-11 18:28:57 +00:00
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
const useTableColumns = () => {
|
2025-07-21 09:19:02 +00:00
|
|
|
const t = useTranslations("Table");
|
2025-03-06 08:18:31 +00:00
|
|
|
const MySwal = withReactContent(Swal);
|
2025-06-07 05:36:19 +00:00
|
|
|
const userLevelId = getCookiesDecrypt("ulie");
|
|
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
const columns: ColumnDef<any>[] = [
|
|
|
|
|
{
|
|
|
|
|
accessorKey: "no",
|
2025-07-06 09:23:45 +00:00
|
|
|
header: t("no", { defaultValue: "No" }),
|
2025-03-06 08:18:31 +00:00
|
|
|
cell: ({ row }) => (
|
|
|
|
|
<div className="flex items-center gap-5">
|
|
|
|
|
<div className="flex-1 text-start">
|
|
|
|
|
<h4 className="text-sm font-medium text-default-600 whitespace-nowrap mb-1">
|
|
|
|
|
{row.getValue("no")}
|
|
|
|
|
</h4>
|
|
|
|
|
</div>
|
2024-12-11 18:28:57 +00:00
|
|
|
</div>
|
2025-03-06 08:18:31 +00:00
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
accessorKey: "title",
|
2025-07-06 09:23:45 +00:00
|
|
|
header: t("title", { defaultValue: "Title" }),
|
2025-03-06 08:18:31 +00:00
|
|
|
cell: ({ row }: { row: { getValue: (key: string) => string } }) => {
|
|
|
|
|
const title: string = row.getValue("title");
|
|
|
|
|
return (
|
|
|
|
|
<span className="whitespace-nowrap">
|
|
|
|
|
{title.length > 50 ? `${title.slice(0, 30)}...` : title}
|
|
|
|
|
</span>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
accessorKey: "categoryName",
|
2025-07-06 09:23:45 +00:00
|
|
|
header: t("category-name", { defaultValue: "Category Name" }),
|
2025-03-06 08:18:31 +00:00
|
|
|
cell: ({ row }) => (
|
2024-12-11 18:28:57 +00:00
|
|
|
<span className="whitespace-nowrap">
|
2025-03-06 08:18:31 +00:00
|
|
|
{row.getValue("categoryName")}
|
2024-12-11 18:28:57 +00:00
|
|
|
</span>
|
2025-03-06 08:18:31 +00:00
|
|
|
),
|
2024-12-11 18:28:57 +00:00
|
|
|
},
|
2025-03-06 08:18:31 +00:00
|
|
|
{
|
|
|
|
|
accessorKey: "createdAt",
|
2025-07-06 09:23:45 +00:00
|
|
|
header: t("upload-date", { defaultValue: "Upload Date" }),
|
2025-03-06 08:18:31 +00:00
|
|
|
cell: ({ row }) => {
|
|
|
|
|
const createdAt = row.getValue("createdAt") as
|
|
|
|
|
| string
|
|
|
|
|
| number
|
|
|
|
|
| undefined;
|
2024-12-11 18:28:57 +00:00
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
const formattedDate =
|
|
|
|
|
createdAt && !isNaN(new Date(createdAt).getTime())
|
|
|
|
|
? format(new Date(createdAt), "dd-MM-yyyy HH:mm:ss")
|
|
|
|
|
: "-";
|
|
|
|
|
return <span className="whitespace-nowrap">{formattedDate}</span>;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
accessorKey: "creatorName",
|
2025-07-06 09:23:45 +00:00
|
|
|
header: t("creator-group", { defaultValue: "Creator Group" }),
|
2025-03-06 08:18:31 +00:00
|
|
|
cell: ({ row }) => (
|
|
|
|
|
<span className="whitespace-nowrap">{row.getValue("creatorName")}</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
accessorKey: "creatorGroupLevelName",
|
2025-07-06 09:23:45 +00:00
|
|
|
header: t("source", { defaultValue: "Source" }),
|
2025-03-06 08:18:31 +00:00
|
|
|
cell: ({ row }) => (
|
|
|
|
|
<span className="whitespace-nowrap">
|
|
|
|
|
{row.getValue("creatorGroupLevelName")}
|
|
|
|
|
</span>
|
|
|
|
|
),
|
2024-12-11 18:28:57 +00:00
|
|
|
},
|
2025-03-06 08:18:31 +00:00
|
|
|
{
|
|
|
|
|
accessorKey: "publishedOn",
|
2025-07-06 09:23:45 +00:00
|
|
|
header: t("published", { defaultValue: "Published" }),
|
2025-03-06 08:18:31 +00:00
|
|
|
cell: ({ row }) => {
|
|
|
|
|
const isPublish = row.original.isPublish;
|
|
|
|
|
const isPublishOnPolda = row.original.isPublishOnPolda;
|
2025-07-21 09:19:02 +00:00
|
|
|
const creatorGroupParentLevelId =
|
|
|
|
|
row.original.creatorGroupParentLevelId;
|
2024-12-11 18:28:57 +00:00
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
let displayText = "-";
|
|
|
|
|
if (isPublish && !isPublishOnPolda) {
|
|
|
|
|
displayText = "Mabes";
|
|
|
|
|
} else if (isPublish && isPublishOnPolda) {
|
2025-08-05 04:19:33 +00:00
|
|
|
if (Number(creatorGroupParentLevelId) == 771) {
|
2025-06-20 09:57:25 +00:00
|
|
|
displayText = "Mabes & Satker";
|
|
|
|
|
} else {
|
|
|
|
|
displayText = "Mabes & Polda";
|
|
|
|
|
}
|
2025-03-06 08:18:31 +00:00
|
|
|
} else if (!isPublish && isPublishOnPolda) {
|
2025-08-05 04:19:33 +00:00
|
|
|
if (Number(creatorGroupParentLevelId) == 771) {
|
2025-06-20 09:57:25 +00:00
|
|
|
displayText = "Satker";
|
|
|
|
|
} else {
|
|
|
|
|
displayText = "Polda";
|
|
|
|
|
}
|
2025-03-06 08:18:31 +00:00
|
|
|
}
|
2024-12-11 18:28:57 +00:00
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
return (
|
|
|
|
|
<div className="text-center whitespace-nowrap" title={displayText}>
|
|
|
|
|
{displayText}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
},
|
2024-12-11 18:28:57 +00:00
|
|
|
},
|
|
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
{
|
|
|
|
|
accessorKey: "statusName",
|
|
|
|
|
header: "Status",
|
|
|
|
|
cell: ({ row }) => {
|
|
|
|
|
const statusColors: Record<string, string> = {
|
|
|
|
|
diterima: "bg-green-100 text-green-600",
|
|
|
|
|
"menunggu review": "bg-orange-100 text-orange-600",
|
|
|
|
|
};
|
2025-01-05 08:18:48 +00:00
|
|
|
|
2025-06-07 05:36:19 +00:00
|
|
|
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",
|
|
|
|
|
];
|
2025-05-26 12:14:15 +00:00
|
|
|
|
|
|
|
|
const status =
|
2025-06-07 05:36:19 +00:00
|
|
|
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";
|
2025-01-05 08:18:48 +00:00
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
return (
|
|
|
|
|
<Badge
|
|
|
|
|
className={cn(
|
|
|
|
|
"rounded-full px-5 w-full whitespace-nowrap",
|
|
|
|
|
statusStyles
|
|
|
|
|
)}
|
|
|
|
|
>
|
2025-06-07 05:36:19 +00:00
|
|
|
{(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}{" "}
|
2025-03-06 08:18:31 +00:00
|
|
|
</Badge>
|
|
|
|
|
);
|
|
|
|
|
},
|
2024-12-11 18:28:57 +00:00
|
|
|
},
|
2025-09-24 14:53:34 +00:00
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
{
|
|
|
|
|
id: "actions",
|
|
|
|
|
accessorKey: "action",
|
2025-07-06 09:23:45 +00:00
|
|
|
header: t("action", { defaultValue: "Action" }),
|
2025-03-06 08:18:31 +00:00
|
|
|
enableHiding: false,
|
|
|
|
|
cell: ({ row }) => {
|
2025-09-24 14:53:34 +00:00
|
|
|
const router = useRouter();
|
2025-03-06 08:18:31 +00:00
|
|
|
const MySwal = withReactContent(Swal);
|
2025-01-15 19:02:28 +00:00
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
async function doDelete(id: any) {
|
2025-09-24 14:53:34 +00:00
|
|
|
const data = { id };
|
2025-03-06 08:18:31 +00:00
|
|
|
const response = await deleteMedia(data);
|
2025-01-15 19:02:28 +00:00
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
if (response?.error) {
|
|
|
|
|
error(response.message);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
success();
|
2025-01-15 19:02:28 +00:00
|
|
|
}
|
|
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
function success() {
|
|
|
|
|
MySwal.fire({
|
|
|
|
|
title: "Sukses",
|
|
|
|
|
icon: "success",
|
|
|
|
|
confirmButtonColor: "#3085d6",
|
|
|
|
|
confirmButtonText: "OK",
|
|
|
|
|
}).then((result) => {
|
|
|
|
|
if (result.isConfirmed) {
|
|
|
|
|
window.location.reload();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-01-15 19:02:28 +00:00
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
2025-07-21 09:19:02 +00:00
|
|
|
|
|
|
|
|
const [isMabesApprover, setIsMabesApprover] = React.useState(false);
|
|
|
|
|
const userId = getCookiesDecrypt("uie");
|
|
|
|
|
const userLevelId = getCookiesDecrypt("ulie");
|
2025-09-24 14:53:34 +00:00
|
|
|
const roleId = Number(getCookiesDecrypt("urie")); // pastikan jadi number
|
2025-07-21 09:19:02 +00:00
|
|
|
|
|
|
|
|
React.useEffect(() => {
|
|
|
|
|
if (userLevelId !== undefined && roleId !== undefined) {
|
|
|
|
|
setIsMabesApprover(
|
2025-09-24 14:53:34 +00:00
|
|
|
Number(userLevelId) === 216 && Number(roleId) === 3
|
2025-07-21 09:19:02 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}, [userLevelId, roleId]);
|
|
|
|
|
|
2025-09-24 14:53:34 +00:00
|
|
|
const canEdit =
|
|
|
|
|
Number(row.original.uploadedById) === Number(userId) ||
|
|
|
|
|
isMabesApprover ||
|
|
|
|
|
roleId === 14;
|
|
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
return (
|
|
|
|
|
<DropdownMenu>
|
|
|
|
|
<DropdownMenuTrigger asChild>
|
|
|
|
|
<Button
|
|
|
|
|
size="icon"
|
|
|
|
|
className="bg-transparent ring-offset-transparent hover:bg-transparent hover:ring-0 hover:ring-transparent"
|
|
|
|
|
>
|
|
|
|
|
<span className="sr-only">Open menu</span>
|
|
|
|
|
<MoreVertical className="h-4 w-4 text-default-800" />
|
|
|
|
|
</Button>
|
|
|
|
|
</DropdownMenuTrigger>
|
|
|
|
|
<DropdownMenuContent className="p-0" align="end">
|
|
|
|
|
<Link
|
|
|
|
|
href={`/contributor/content/teks/detail/${row.original.id}`}
|
|
|
|
|
>
|
|
|
|
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
|
|
|
|
<Eye className="w-4 h-4 me-1.5" />
|
|
|
|
|
View
|
|
|
|
|
</DropdownMenuItem>
|
|
|
|
|
</Link>
|
2025-09-24 14:53:34 +00:00
|
|
|
|
|
|
|
|
{canEdit && (
|
2025-07-21 09:19:02 +00:00
|
|
|
<Link
|
|
|
|
|
href={`/contributor/content/teks/update/${row.original.id}`}
|
|
|
|
|
>
|
|
|
|
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
|
|
|
|
<SquarePen className="w-4 h-4 me-1.5" />
|
|
|
|
|
Edit
|
|
|
|
|
</DropdownMenuItem>
|
|
|
|
|
</Link>
|
|
|
|
|
)}
|
2025-09-24 14:53:34 +00:00
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
<DropdownMenuItem
|
|
|
|
|
onClick={() => handleDeleteMedia(row.original.id)}
|
|
|
|
|
className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none"
|
|
|
|
|
>
|
|
|
|
|
<Trash2 className="w-4 h-4 me-1.5" />
|
|
|
|
|
Delete
|
2025-01-03 19:35:50 +00:00
|
|
|
</DropdownMenuItem>
|
2025-03-06 08:18:31 +00:00
|
|
|
</DropdownMenuContent>
|
|
|
|
|
</DropdownMenu>
|
|
|
|
|
);
|
|
|
|
|
},
|
2024-12-11 18:28:57 +00:00
|
|
|
},
|
2025-09-24 14:53:34 +00:00
|
|
|
// {
|
|
|
|
|
// 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 (
|
|
|
|
|
// <DropdownMenu>
|
|
|
|
|
// <DropdownMenuTrigger asChild>
|
|
|
|
|
// <Button
|
|
|
|
|
// size="icon"
|
|
|
|
|
// className="bg-transparent ring-offset-transparent hover:bg-transparent hover:ring-0 hover:ring-transparent"
|
|
|
|
|
// >
|
|
|
|
|
// <span className="sr-only">Open menu</span>
|
|
|
|
|
// <MoreVertical className="h-4 w-4 text-default-800" />
|
|
|
|
|
// </Button>
|
|
|
|
|
// </DropdownMenuTrigger>
|
|
|
|
|
// <DropdownMenuContent className="p-0" align="end">
|
|
|
|
|
// <Link
|
|
|
|
|
// href={`/contributor/content/teks/detail/${row.original.id}`}
|
|
|
|
|
// >
|
|
|
|
|
// <DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
|
|
|
|
// <Eye className="w-4 h-4 me-1.5" />
|
|
|
|
|
// View
|
|
|
|
|
// </DropdownMenuItem>
|
|
|
|
|
// </Link>
|
|
|
|
|
// {(Number(row.original.uploadedById) === Number(userId) ||
|
|
|
|
|
// isMabesApprover) && (
|
|
|
|
|
// <Link
|
|
|
|
|
// href={`/contributor/content/teks/update/${row.original.id}`}
|
|
|
|
|
// >
|
|
|
|
|
// <DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
|
|
|
|
// <SquarePen className="w-4 h-4 me-1.5" />
|
|
|
|
|
// Edit
|
|
|
|
|
// </DropdownMenuItem>
|
|
|
|
|
// </Link>
|
|
|
|
|
// )}
|
|
|
|
|
// {/* <Link
|
|
|
|
|
// href={`/contributor/content/teks/update/${row.original.id}`}
|
|
|
|
|
// >
|
|
|
|
|
// <DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
|
|
|
|
// <SquarePen className="w-4 h-4 me-1.5" />
|
|
|
|
|
// Edit
|
|
|
|
|
// </DropdownMenuItem>
|
|
|
|
|
// </Link> */}
|
|
|
|
|
// <DropdownMenuItem
|
|
|
|
|
// onClick={() => handleDeleteMedia(row.original.id)}
|
|
|
|
|
// className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none"
|
|
|
|
|
// >
|
|
|
|
|
// <Trash2 className="w-4 h-4 me-1.5" />
|
|
|
|
|
// Delete
|
|
|
|
|
// </DropdownMenuItem>
|
|
|
|
|
// {/* {(row.original.uploadedById === userId || isMabesApprover) && (
|
|
|
|
|
// <DropdownMenuItem
|
|
|
|
|
// onClick={() => handleDeleteMedia(row.original.id)}
|
|
|
|
|
// className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none"
|
|
|
|
|
// >
|
|
|
|
|
// <Trash2 className="w-4 h-4 me-1.5" />
|
|
|
|
|
// Hapus
|
|
|
|
|
// </DropdownMenuItem>
|
|
|
|
|
// )} */}
|
|
|
|
|
// </DropdownMenuContent>
|
|
|
|
|
// </DropdownMenu>
|
|
|
|
|
// );
|
|
|
|
|
// },
|
|
|
|
|
// },
|
2025-03-06 08:18:31 +00:00
|
|
|
];
|
|
|
|
|
return columns;
|
|
|
|
|
};
|
2024-12-11 18:28:57 +00:00
|
|
|
|
2025-03-06 08:18:31 +00:00
|
|
|
export default useTableColumns;
|