Merge branch 'main' of https://gitlab.com/hanifsalafi/mediahub_redesign into prod
This commit is contained in:
commit
6871934fe6
|
|
@ -106,7 +106,7 @@ const columns: ColumnDef<any>[] = [
|
|||
<DropdownMenuContent className="p-0" align="end">
|
||||
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||
<Link
|
||||
href={`/admin/broadcast/campaign-list/account-list/edit/${row.original.id}`}
|
||||
href={`/admin/broadcast/campaign-list/account-list/edit/${row.original.mediaBlastAccountId}`}
|
||||
>
|
||||
Edit
|
||||
</Link>
|
||||
|
|
|
|||
|
|
@ -37,46 +37,74 @@ import { Checkbox } from "@/components/ui/checkbox";
|
|||
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||
import { useParams } from "next/navigation";
|
||||
import { useEffect } from "react";
|
||||
import {
|
||||
getUserById,
|
||||
saveUserInternal,
|
||||
} from "@/service/management-user/management-user";
|
||||
|
||||
// const FormSchema = z.object({
|
||||
// fullname: z.string({
|
||||
// required_error: "Required",
|
||||
// }),
|
||||
// // accountType: z
|
||||
// // .array(z.string())
|
||||
// // .refine((value) => value.some((item) => item), {
|
||||
// // message: "Required",
|
||||
// // }),
|
||||
// // accountCategory: z.enum(["polri", "jurnalis", "umum", "ksp"], {
|
||||
// // required_error: "Required",
|
||||
// // }),
|
||||
// email: z.string({
|
||||
// required_error: "Required",
|
||||
// }),
|
||||
// phoneNumber: z.string({
|
||||
// required_error: "Required",
|
||||
// }),
|
||||
// });
|
||||
|
||||
const FormSchema = z.object({
|
||||
name: z.string({
|
||||
required_error: "Required",
|
||||
}),
|
||||
accountType: z
|
||||
.array(z.string())
|
||||
.refine((value) => value.some((item) => item), {
|
||||
message: "Required",
|
||||
}),
|
||||
accountCategory: z.enum(["polri", "jurnalis", "umumu", "ksp"], {
|
||||
required_error: "Required",
|
||||
}),
|
||||
email: z.string({
|
||||
required_error: "Required",
|
||||
}),
|
||||
whatsapp: z.string({
|
||||
required_error: "Required",
|
||||
}),
|
||||
fullname: z.string({ required_error: "Required" }),
|
||||
email: z.string({ required_error: "Required" }),
|
||||
phoneNumber: z.string({ required_error: "Required" }),
|
||||
username: z.string().optional(),
|
||||
role: z.string().optional(),
|
||||
level: z.string().optional(),
|
||||
nrp: z.string().optional(),
|
||||
address: z.string().optional(),
|
||||
password: z.string().optional(),
|
||||
confirmPassword: z.string().optional(),
|
||||
});
|
||||
|
||||
export default function EditAccountForBroadcast() {
|
||||
const id = useParams()?.id;
|
||||
|
||||
const MySwal = withReactContent(Swal);
|
||||
const router = useRouter();
|
||||
const form = useForm<z.infer<typeof FormSchema>>({
|
||||
resolver: zodResolver(FormSchema),
|
||||
defaultValues: { accountType: [] },
|
||||
// defaultValues: { accountType: [] },
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
async function getDetailData() {
|
||||
const response = await getMediaBlastAccount(String(id));
|
||||
const response = await getUserById(String(id));
|
||||
const details = response?.data?.data;
|
||||
// console.log("new", details);
|
||||
form.setValue("name", details.accountName);
|
||||
form.setValue("email", details?.emailAddress);
|
||||
form.setValue("whatsapp", details?.whatsappNumber);
|
||||
form.setValue("accountCategory", details?.accountCategory);
|
||||
form.setValue("accountType", details?.accountType.split(","));
|
||||
console.log("Response full:", response);
|
||||
form.setValue("fullname", details?.fullname);
|
||||
form.setValue("username", details?.username);
|
||||
form.setValue("phoneNumber", details?.phoneNumber);
|
||||
// form.setValue("nrp", details?.memberIdentity);
|
||||
// form.setValue("address", details?.address);
|
||||
form.setValue("email", details?.email);
|
||||
form.setValue("role", details?.role?.code);
|
||||
// form.setValue("level", String(details?.userLevelId));
|
||||
// form.setValue("name", details?.accountName);
|
||||
// form.setValue("fullname", details?.fullname);
|
||||
// form.setValue("email", details?.email);
|
||||
// form.setValue("phoneNumber", details?.phoneNumber);
|
||||
// form.setValue("whatsapp", details?.whatsappNumber);
|
||||
// form.setValue("accountCategory", details?.accountCategory);
|
||||
// form.setValue("accountType", details?.accountType.split(","));
|
||||
}
|
||||
|
||||
getDetailData();
|
||||
|
|
@ -106,7 +134,7 @@ export default function EditAccountForBroadcast() {
|
|||
confirmButtonText: "OK",
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
router.push("/admin/broadcast/campaign-list/account-list");
|
||||
router.push("/admin/broadcast/campaign-list");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -114,15 +142,24 @@ export default function EditAccountForBroadcast() {
|
|||
const save = async (data: z.infer<typeof FormSchema>) => {
|
||||
const reqData = {
|
||||
id: String(id),
|
||||
accountName: data.name,
|
||||
accountType: data.accountType.join(","),
|
||||
accountCategory: data.accountCategory,
|
||||
emailAddress: data.email,
|
||||
whatsappNumber: data.whatsapp,
|
||||
// accountName: data.fullname,
|
||||
// accountType: data.accountType.join(","),
|
||||
// accountCategory: data.accountCategory,
|
||||
// emailAddress: data.email,
|
||||
phoneNumber: data.phoneNumber,
|
||||
firstName: data.fullname,
|
||||
username: data.username,
|
||||
roleId: data.role,
|
||||
// userLevelId: Number(data.level),
|
||||
// memberIdentity: data.nrp,
|
||||
// address: data.address,
|
||||
email: data.email,
|
||||
isDefault: false,
|
||||
isAdmin: true,
|
||||
};
|
||||
// console.log("data", data);
|
||||
|
||||
const response = await saveMediaBlastAccount(reqData);
|
||||
const response = await saveUserInternal(reqData);
|
||||
if (response?.error) {
|
||||
error(response.message);
|
||||
return false;
|
||||
|
|
@ -141,7 +178,7 @@ export default function EditAccountForBroadcast() {
|
|||
<p className="fonnt-semibold">Account</p>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name"
|
||||
name="fullname"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Nama</FormLabel>
|
||||
|
|
@ -155,7 +192,7 @@ export default function EditAccountForBroadcast() {
|
|||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
{/* <FormField
|
||||
control={form.control}
|
||||
name="accountType"
|
||||
render={() => (
|
||||
|
|
@ -227,8 +264,8 @@ export default function EditAccountForBroadcast() {
|
|||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
/> */}
|
||||
{/* <FormField
|
||||
control={form.control}
|
||||
name="accountCategory"
|
||||
render={({ field }) => (
|
||||
|
|
@ -269,13 +306,13 @@ export default function EditAccountForBroadcast() {
|
|||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
/> */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="email"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Nama</FormLabel>
|
||||
<FormLabel>Email</FormLabel>
|
||||
<Input
|
||||
type="email"
|
||||
value={field.value}
|
||||
|
|
@ -289,14 +326,14 @@ export default function EditAccountForBroadcast() {
|
|||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="whatsapp"
|
||||
name="phoneNumber"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Nama</FormLabel>
|
||||
<FormLabel>Nomor Whatsapp</FormLabel>
|
||||
<Input
|
||||
type="number"
|
||||
value={field.value}
|
||||
placeholder="Masukkan whatsapp"
|
||||
placeholder="Masukkan nomor whatsapp"
|
||||
onChange={field.onChange}
|
||||
/>
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import {
|
|||
} from "@/components/ui/dropdown-menu";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
|
||||
import { Link, useRouter } from "@/i18n/routing";
|
||||
import { close, error, loading, success } from "@/config/swal";
|
||||
import { deleteMediaBlastCampaign } from "@/service/broadcast/broadcast";
|
||||
|
|
@ -62,38 +61,47 @@ const columns: ColumnDef<any>[] = [
|
|||
|
||||
{
|
||||
id: "actions",
|
||||
accessorKey: "action",
|
||||
header: "Actions",
|
||||
enableHiding: false,
|
||||
cell: ({ row }) => {
|
||||
cell: ({ row, onDeleteSuccess }: any) => {
|
||||
const MySwal = withReactContent(Swal);
|
||||
|
||||
const handleDelete = (id: any) => {
|
||||
const handleDelete = (id: number) => {
|
||||
MySwal.fire({
|
||||
title: "Apakah anda ingin menghapus data?",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#dc3545",
|
||||
confirmButtonText: "Iya",
|
||||
cancelButtonText: "Tidak",
|
||||
}).then((result: any) => {
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
doDeleteAccount(id);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
async function doDeleteAccount(id: any) {
|
||||
async function doDeleteAccount(id: number) {
|
||||
loading();
|
||||
const response = await deleteMediaBlastCampaign(id);
|
||||
close();
|
||||
|
||||
if (response.error) {
|
||||
error(response.message);
|
||||
return false;
|
||||
}
|
||||
// success();
|
||||
console.log("Delete response:", response);
|
||||
|
||||
MySwal.fire({
|
||||
icon: "success",
|
||||
title: "Berhasil!",
|
||||
text: "Data berhasil dihapus.",
|
||||
confirmButtonColor: "#3085d6",
|
||||
timer: 2000,
|
||||
timerProgressBar: true,
|
||||
});
|
||||
// ✅ panggil callback dari parent
|
||||
onDeleteSuccess?.(id);
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
|
|
@ -119,14 +127,99 @@ const columns: ColumnDef<any>[] = [
|
|||
Edit
|
||||
</DropdownMenuItem>
|
||||
</Link>
|
||||
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none cursor-pointer">
|
||||
<a>Delete</a>
|
||||
<DropdownMenuItem
|
||||
onClick={() => handleDelete(row.original.id)}
|
||||
className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none cursor-pointer"
|
||||
>
|
||||
Delete
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
// {
|
||||
// id: "actions",
|
||||
// accessorKey: "action",
|
||||
// header: "Actions",
|
||||
// enableHiding: false,
|
||||
// cell: ({ row, onDeleteSuccess }: any) => {
|
||||
// const MySwal = withReactContent(Swal);
|
||||
|
||||
// const handleDelete = (id: any) => {
|
||||
// MySwal.fire({
|
||||
// title: "Apakah anda ingin menghapus data?",
|
||||
// showCancelButton: true,
|
||||
// confirmButtonColor: "#dc3545",
|
||||
// confirmButtonText: "Iya",
|
||||
// cancelButtonText: "Tidak",
|
||||
// }).then((result: any) => {
|
||||
// if (result.isConfirmed) {
|
||||
// doDeleteAccount(id);
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
// async function doDeleteAccount(id: any) {
|
||||
// loading();
|
||||
// const response = await deleteMediaBlastCampaign(id);
|
||||
// close();
|
||||
|
||||
// if (response.error) {
|
||||
// error(response.message);
|
||||
// return false;
|
||||
// }
|
||||
// console.log("Delete response:", response);
|
||||
|
||||
// MySwal.fire({
|
||||
// icon: "success",
|
||||
// title: "Berhasil!",
|
||||
// text: "Data berhasil dihapus.",
|
||||
// confirmButtonColor: "#3085d6",
|
||||
// timer: 2000,
|
||||
// timerProgressBar: true,
|
||||
// });
|
||||
// // ✅ langsung hapus dari state
|
||||
// onDeleteSuccess?.(id);
|
||||
// }
|
||||
|
||||
// return (
|
||||
// <DropdownMenu>
|
||||
// <DropdownMenuTrigger asChild>
|
||||
// <Button
|
||||
// size="icon"
|
||||
// className="bg-transparent ring-offset-transparent hover:bg-transparent hover:ring-0 hover:ring-transparent"
|
||||
// >
|
||||
// <MoreVertical className="h-4 w-4 text-default-800" />
|
||||
// </Button>
|
||||
// </DropdownMenuTrigger>
|
||||
// <DropdownMenuContent className="p-0" align="end">
|
||||
// <Link
|
||||
// href={`/admin/broadcast/campaign-list/detail/${row.original.id}`}
|
||||
// >
|
||||
// <DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none cursor-pointer">
|
||||
// Detail
|
||||
// </DropdownMenuItem>
|
||||
// </Link>
|
||||
// <Link
|
||||
// href={`//admin/broadcast/campaign-list/edit/${row.original.id}`}
|
||||
// >
|
||||
// <DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none cursor-pointer">
|
||||
// Edit
|
||||
// </DropdownMenuItem>
|
||||
// </Link>
|
||||
// <DropdownMenuItem
|
||||
// onClick={() => handleDelete(row.original.id)}
|
||||
// className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none cursor-pointer"
|
||||
// >
|
||||
// Delete
|
||||
// </DropdownMenuItem>
|
||||
// </DropdownMenuContent>
|
||||
// </DropdownMenu>
|
||||
// );
|
||||
// },
|
||||
// },
|
||||
];
|
||||
|
||||
export default columns;
|
||||
|
|
|
|||
|
|
@ -89,6 +89,11 @@ const CampaignListTable = () => {
|
|||
|
||||
const [page, setPage] = React.useState(1);
|
||||
const [totalPage, setTotalPage] = React.useState(1);
|
||||
|
||||
function handleDeleteSuccess(id: number) {
|
||||
setDataTable((prev) => prev.filter((item) => item.id !== id));
|
||||
}
|
||||
|
||||
const table = useReactTable({
|
||||
data: dataTable,
|
||||
columns,
|
||||
|
|
@ -189,7 +194,15 @@ const CampaignListTable = () => {
|
|||
>
|
||||
{row.getVisibleCells().map((cell) => (
|
||||
<TableCell key={cell.id}>
|
||||
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
||||
{/* {flexRender(cell.column.columnDef.cell, cell.getContext())} */}
|
||||
{flexRender(cell.column.columnDef.cell, {
|
||||
...cell.getContext(),
|
||||
onDeleteSuccess: (id: number) => {
|
||||
setDataTable((prev) =>
|
||||
prev.filter((item) => item.id !== id)
|
||||
);
|
||||
},
|
||||
})}
|
||||
</TableCell>
|
||||
))}
|
||||
</TableRow>
|
||||
|
|
|
|||
|
|
@ -221,7 +221,6 @@ export default function EditUserForm() {
|
|||
form.setValue("level", String(res?.userLevelId));
|
||||
} else {
|
||||
initFetch();
|
||||
// console.log("sadad", res?.role?.code);
|
||||
form.setValue("fullname", res?.fullname);
|
||||
form.setValue("username", res?.username);
|
||||
form.setValue("phoneNumber", res?.phoneNumber);
|
||||
|
|
|
|||
|
|
@ -10,15 +10,34 @@ export default function StatusToogle(props: {
|
|||
}) {
|
||||
const { id, initValue } = props;
|
||||
const router = useRouter();
|
||||
// const publishCategory = async (id: number, status: string) => {
|
||||
// const response = await publishUnpublishCategory(id, status);
|
||||
// console.log(response);
|
||||
// if (response?.error) {
|
||||
// error(response.message);
|
||||
// return false;
|
||||
// }
|
||||
// router.push("/admin/settings/category?dataChange=true");
|
||||
// };
|
||||
const publishCategory = async (id: number, status: string) => {
|
||||
const response = await publishUnpublishCategory(id, status);
|
||||
// console.log(response);
|
||||
console.log("API Response:", response);
|
||||
|
||||
// cek error interceptor
|
||||
if (response?.error) {
|
||||
error(response.message);
|
||||
error(response.message || "Terjadi kesalahan");
|
||||
return false;
|
||||
}
|
||||
|
||||
// cek flag success asli dari backend
|
||||
if (response?.data?.success === false) {
|
||||
error(response?.data?.message || "Terjadi kesalahan");
|
||||
return false;
|
||||
}
|
||||
|
||||
router.push("/admin/settings/category?dataChange=true");
|
||||
};
|
||||
|
||||
return (
|
||||
<Switch
|
||||
id={String(id)}
|
||||
|
|
|
|||
|
|
@ -27,22 +27,10 @@ import {
|
|||
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import TablePagination from "@/components/table/table-pagination";
|
||||
import columns from "./column";
|
||||
|
||||
import { listEnableCategory } from "@/service/content/content";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { close, loading } from "@/config/swal";
|
||||
import { Link, useRouter } from "@/i18n/routing";
|
||||
import { NewCampaignIcon } from "@/components/icon";
|
||||
import { getCategories } from "@/service/settings/settings";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from "@/components/ui/dialog";
|
||||
import { useTranslations } from "next-intl";
|
||||
import {
|
||||
Popover,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,186 @@
|
|||
import AllContentPage from "@/components/landing-page/all-content-page";
|
||||
|
||||
const regions = [
|
||||
{ name: "Polda Aceh", slug: "aceh", logo: "/logo/polda/polda-aceh.png" },
|
||||
{ name: "Polda Bali", slug: "bali", logo: "/logo/polda/polda-bali.png" },
|
||||
{
|
||||
name: "Polda Bangka Belitung",
|
||||
slug: "bangka-belitung",
|
||||
logo: "/logo/polda/polda-bangka-belitung.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Banten",
|
||||
slug: "banten",
|
||||
logo: "/logo/polda/polda-banten.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Bengkulu",
|
||||
slug: "bengkulu",
|
||||
logo: "/logo/polda/polda-bengkulu.png",
|
||||
},
|
||||
{
|
||||
name: "Polda DIY",
|
||||
slug: "jogja",
|
||||
logo: "/logo/polda/polda-jogja.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Gorontalo",
|
||||
slug: "gorontalo",
|
||||
logo: "/logo/polda/polda-gorontalo.png",
|
||||
},
|
||||
{ name: "Polda Jambi", slug: "jambi", logo: "/logo/polda/polda-jambi.png" },
|
||||
{
|
||||
name: "Polda Jawa Barat",
|
||||
slug: "jawa-barat",
|
||||
logo: "/logo/polda/polda-jawa-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Jawa Tengah",
|
||||
slug: "jawa-tengah",
|
||||
logo: "/logo/polda/polda-jawa-tengah.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Jawa Timur",
|
||||
slug: "jawa-timur",
|
||||
logo: "/logo/polda/polda-jawa-timur.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Barat",
|
||||
slug: "kalimantan-barat",
|
||||
logo: "/logo/polda/polda-kalimantan-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Selatan",
|
||||
slug: "kalimantan-selatan",
|
||||
logo: "/logo/polda/polda-kalimantan-selatan.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Tengah",
|
||||
slug: "kalimantan-tengah",
|
||||
logo: "/logo/polda/polda-kalimantan-tengah.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Timur",
|
||||
slug: "kalimantan-timur",
|
||||
logo: "/logo/polda/polda-kalimantan-timur.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Utara",
|
||||
slug: "kalimantan-utara",
|
||||
logo: "/logo/polda/polda-kalimantan-utara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kepulauan Riau",
|
||||
slug: "kepulauan-riau",
|
||||
logo: "/logo/polda/polda-kepulauan-riau.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Lampung",
|
||||
slug: "lampung",
|
||||
logo: "/logo/polda/polda-lampung.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Maluku",
|
||||
slug: "maluku",
|
||||
logo: "/logo/polda/polda-maluku.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Maluku Utara",
|
||||
slug: "maluku-utara",
|
||||
logo: "/logo/polda/polda-maluku-utara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Metro Jaya",
|
||||
slug: "metro-jaya",
|
||||
logo: "/logo/polda/polda-metro-jaya.png",
|
||||
},
|
||||
{
|
||||
name: "Polda NTB",
|
||||
slug: "ntb",
|
||||
logo: "/logo/polda/polda-ntb.png",
|
||||
},
|
||||
{
|
||||
name: "Polda NTT",
|
||||
slug: "ntt",
|
||||
logo: "/logo/polda/polda-ntt.png",
|
||||
},
|
||||
{ name: "Polda Papua", slug: "papua", logo: "/logo/polda/polda-papua.png" },
|
||||
{
|
||||
name: "Polda Papua Barat",
|
||||
slug: "papua-barat",
|
||||
logo: "/logo/polda/polda-papua-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Papua Barat Daya",
|
||||
slug: "papua-barat-daya",
|
||||
logo: "/logo/polda/polda-papua-barat-daya.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Papua Tengah",
|
||||
slug: "papua-tengah",
|
||||
logo: "/logo/polda/polda-papua-tengah.png",
|
||||
},
|
||||
{ name: "Polda Riau", slug: "riau", logo: "/logo/polda/polda-riau.png" },
|
||||
{
|
||||
name: "Polda Sulawesi Barat",
|
||||
slug: "sulawesi-barat",
|
||||
logo: "/logo/polda/polda-sulawesi-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Selatan",
|
||||
slug: "sulawesi-selatan",
|
||||
logo: "/logo/polda/polda-sulawesi-selatan.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Tengah",
|
||||
slug: "sulawesi-tengah",
|
||||
logo: "/logo/polda/polda-sulawesi-tengah.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Tenggara",
|
||||
slug: "sulawesi-tenggara",
|
||||
logo: "/logo/polda/polda-sulawesi-tenggara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Utara",
|
||||
slug: "sulawesi-utara",
|
||||
logo: "/logo/polda/polda-sulawesi-utara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sumatera Barat",
|
||||
slug: "sumatera-barat",
|
||||
logo: "/logo/polda/polda-sumatera-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sumatera Selatan",
|
||||
slug: "sumatera-selatan",
|
||||
logo: "/logo/polda/polda-sumatera-selatan.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sumatera Utara",
|
||||
slug: "sumatera-utara",
|
||||
logo: "/logo/polda/polda-sumatera-utara.png",
|
||||
},
|
||||
// {
|
||||
// name: "Satuan Kerja POLRI",
|
||||
// slug: "satker-polri",
|
||||
// logo: "/logo/satker/SATUAN-KERJA-POLRI.png",
|
||||
// },
|
||||
// {
|
||||
// name: "Internasional",
|
||||
// slug: "internasional",
|
||||
// logo: "/assets/polda/internasional.png",
|
||||
// },
|
||||
];
|
||||
|
||||
export default function PoldaAllAudioPage() {
|
||||
return (
|
||||
<AllContentPage
|
||||
typeId="4"
|
||||
title="Semua Konten Audio per Polda"
|
||||
basePath="audio"
|
||||
mode="polda"
|
||||
dataList={regions}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,186 @@
|
|||
import AllContentPage from "@/components/landing-page/all-content-page";
|
||||
|
||||
const regions = [
|
||||
{ name: "Polda Aceh", slug: "aceh", logo: "/logo/polda/polda-aceh.png" },
|
||||
{ name: "Polda Bali", slug: "bali", logo: "/logo/polda/polda-bali.png" },
|
||||
{
|
||||
name: "Polda Bangka Belitung",
|
||||
slug: "bangka-belitung",
|
||||
logo: "/logo/polda/polda-bangka-belitung.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Banten",
|
||||
slug: "banten",
|
||||
logo: "/logo/polda/polda-banten.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Bengkulu",
|
||||
slug: "bengkulu",
|
||||
logo: "/logo/polda/polda-bengkulu.png",
|
||||
},
|
||||
{
|
||||
name: "Polda DIY",
|
||||
slug: "jogja",
|
||||
logo: "/logo/polda/polda-jogja.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Gorontalo",
|
||||
slug: "gorontalo",
|
||||
logo: "/logo/polda/polda-gorontalo.png",
|
||||
},
|
||||
{ name: "Polda Jambi", slug: "jambi", logo: "/logo/polda/polda-jambi.png" },
|
||||
{
|
||||
name: "Polda Jawa Barat",
|
||||
slug: "jawa-barat",
|
||||
logo: "/logo/polda/polda-jawa-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Jawa Tengah",
|
||||
slug: "jawa-tengah",
|
||||
logo: "/logo/polda/polda-jawa-tengah.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Jawa Timur",
|
||||
slug: "jawa-timur",
|
||||
logo: "/logo/polda/polda-jawa-timur.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Barat",
|
||||
slug: "kalimantan-barat",
|
||||
logo: "/logo/polda/polda-kalimantan-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Selatan",
|
||||
slug: "kalimantan-selatan",
|
||||
logo: "/logo/polda/polda-kalimantan-selatan.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Tengah",
|
||||
slug: "kalimantan-tengah",
|
||||
logo: "/logo/polda/polda-kalimantan-tengah.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Timur",
|
||||
slug: "kalimantan-timur",
|
||||
logo: "/logo/polda/polda-kalimantan-timur.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Utara",
|
||||
slug: "kalimantan-utara",
|
||||
logo: "/logo/polda/polda-kalimantan-utara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kepulauan Riau",
|
||||
slug: "kepulauan-riau",
|
||||
logo: "/logo/polda/polda-kepulauan-riau.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Lampung",
|
||||
slug: "lampung",
|
||||
logo: "/logo/polda/polda-lampung.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Maluku",
|
||||
slug: "maluku",
|
||||
logo: "/logo/polda/polda-maluku.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Maluku Utara",
|
||||
slug: "maluku-utara",
|
||||
logo: "/logo/polda/polda-maluku-utara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Metro Jaya",
|
||||
slug: "metro-jaya",
|
||||
logo: "/logo/polda/polda-metro-jaya.png",
|
||||
},
|
||||
{
|
||||
name: "Polda NTB",
|
||||
slug: "ntb",
|
||||
logo: "/logo/polda/polda-ntb.png",
|
||||
},
|
||||
{
|
||||
name: "Polda NTT",
|
||||
slug: "ntt",
|
||||
logo: "/logo/polda/polda-ntt.png",
|
||||
},
|
||||
{ name: "Polda Papua", slug: "papua", logo: "/logo/polda/polda-papua.png" },
|
||||
{
|
||||
name: "Polda Papua Barat",
|
||||
slug: "papua-barat",
|
||||
logo: "/logo/polda/polda-papua-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Papua Barat Daya",
|
||||
slug: "papua-barat-daya",
|
||||
logo: "/logo/polda/polda-papua-barat-daya.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Papua Tengah",
|
||||
slug: "papua-tengah",
|
||||
logo: "/logo/polda/polda-papua-tengah.png",
|
||||
},
|
||||
{ name: "Polda Riau", slug: "riau", logo: "/logo/polda/polda-riau.png" },
|
||||
{
|
||||
name: "Polda Sulawesi Barat",
|
||||
slug: "sulawesi-barat",
|
||||
logo: "/logo/polda/polda-sulawesi-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Selatan",
|
||||
slug: "sulawesi-selatan",
|
||||
logo: "/logo/polda/polda-sulawesi-selatan.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Tengah",
|
||||
slug: "sulawesi-tengah",
|
||||
logo: "/logo/polda/polda-sulawesi-tengah.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Tenggara",
|
||||
slug: "sulawesi-tenggara",
|
||||
logo: "/logo/polda/polda-sulawesi-tenggara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Utara",
|
||||
slug: "sulawesi-utara",
|
||||
logo: "/logo/polda/polda-sulawesi-utara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sumatera Barat",
|
||||
slug: "sumatera-barat",
|
||||
logo: "/logo/polda/polda-sumatera-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sumatera Selatan",
|
||||
slug: "sumatera-selatan",
|
||||
logo: "/logo/polda/polda-sumatera-selatan.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sumatera Utara",
|
||||
slug: "sumatera-utara",
|
||||
logo: "/logo/polda/polda-sumatera-utara.png",
|
||||
},
|
||||
// {
|
||||
// name: "Satuan Kerja POLRI",
|
||||
// slug: "satker-polri",
|
||||
// logo: "/logo/satker/SATUAN-KERJA-POLRI.png",
|
||||
// },
|
||||
// {
|
||||
// name: "Internasional",
|
||||
// slug: "internasional",
|
||||
// logo: "/assets/polda/internasional.png",
|
||||
// },
|
||||
];
|
||||
|
||||
export default function PoldaAllDocumentPage() {
|
||||
return (
|
||||
<AllContentPage
|
||||
typeId="3"
|
||||
title="Semua Konten Teks per Polda"
|
||||
basePath="document"
|
||||
mode="polda"
|
||||
dataList={regions}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,186 @@
|
|||
import AllContentPage from "@/components/landing-page/all-content-page";
|
||||
|
||||
const regions = [
|
||||
{ name: "Polda Aceh", slug: "aceh", logo: "/logo/polda/polda-aceh.png" },
|
||||
{ name: "Polda Bali", slug: "bali", logo: "/logo/polda/polda-bali.png" },
|
||||
{
|
||||
name: "Polda Bangka Belitung",
|
||||
slug: "bangka-belitung",
|
||||
logo: "/logo/polda/polda-bangka-belitung.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Banten",
|
||||
slug: "banten",
|
||||
logo: "/logo/polda/polda-banten.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Bengkulu",
|
||||
slug: "bengkulu",
|
||||
logo: "/logo/polda/polda-bengkulu.png",
|
||||
},
|
||||
{
|
||||
name: "Polda DIY",
|
||||
slug: "jogja",
|
||||
logo: "/logo/polda/polda-jogja.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Gorontalo",
|
||||
slug: "gorontalo",
|
||||
logo: "/logo/polda/polda-gorontalo.png",
|
||||
},
|
||||
{ name: "Polda Jambi", slug: "jambi", logo: "/logo/polda/polda-jambi.png" },
|
||||
{
|
||||
name: "Polda Jawa Barat",
|
||||
slug: "jawa-barat",
|
||||
logo: "/logo/polda/polda-jawa-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Jawa Tengah",
|
||||
slug: "jawa-tengah",
|
||||
logo: "/logo/polda/polda-jawa-tengah.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Jawa Timur",
|
||||
slug: "jawa-timur",
|
||||
logo: "/logo/polda/polda-jawa-timur.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Barat",
|
||||
slug: "kalimantan-barat",
|
||||
logo: "/logo/polda/polda-kalimantan-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Selatan",
|
||||
slug: "kalimantan-selatan",
|
||||
logo: "/logo/polda/polda-kalimantan-selatan.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Tengah",
|
||||
slug: "kalimantan-tengah",
|
||||
logo: "/logo/polda/polda-kalimantan-tengah.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Timur",
|
||||
slug: "kalimantan-timur",
|
||||
logo: "/logo/polda/polda-kalimantan-timur.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Utara",
|
||||
slug: "kalimantan-utara",
|
||||
logo: "/logo/polda/polda-kalimantan-utara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kepulauan Riau",
|
||||
slug: "kepulauan-riau",
|
||||
logo: "/logo/polda/polda-kepulauan-riau.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Lampung",
|
||||
slug: "lampung",
|
||||
logo: "/logo/polda/polda-lampung.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Maluku",
|
||||
slug: "maluku",
|
||||
logo: "/logo/polda/polda-maluku.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Maluku Utara",
|
||||
slug: "maluku-utara",
|
||||
logo: "/logo/polda/polda-maluku-utara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Metro Jaya",
|
||||
slug: "metro-jaya",
|
||||
logo: "/logo/polda/polda-metro-jaya.png",
|
||||
},
|
||||
{
|
||||
name: "Polda NTB",
|
||||
slug: "ntb",
|
||||
logo: "/logo/polda/polda-ntb.png",
|
||||
},
|
||||
{
|
||||
name: "Polda NTT",
|
||||
slug: "ntt",
|
||||
logo: "/logo/polda/polda-ntt.png",
|
||||
},
|
||||
{ name: "Polda Papua", slug: "papua", logo: "/logo/polda/polda-papua.png" },
|
||||
{
|
||||
name: "Polda Papua Barat",
|
||||
slug: "papua-barat",
|
||||
logo: "/logo/polda/polda-papua-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Papua Barat Daya",
|
||||
slug: "papua-barat-daya",
|
||||
logo: "/logo/polda/polda-papua-barat-daya.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Papua Tengah",
|
||||
slug: "papua-tengah",
|
||||
logo: "/logo/polda/polda-papua-tengah.png",
|
||||
},
|
||||
{ name: "Polda Riau", slug: "riau", logo: "/logo/polda/polda-riau.png" },
|
||||
{
|
||||
name: "Polda Sulawesi Barat",
|
||||
slug: "sulawesi-barat",
|
||||
logo: "/logo/polda/polda-sulawesi-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Selatan",
|
||||
slug: "sulawesi-selatan",
|
||||
logo: "/logo/polda/polda-sulawesi-selatan.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Tengah",
|
||||
slug: "sulawesi-tengah",
|
||||
logo: "/logo/polda/polda-sulawesi-tengah.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Tenggara",
|
||||
slug: "sulawesi-tenggara",
|
||||
logo: "/logo/polda/polda-sulawesi-tenggara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Utara",
|
||||
slug: "sulawesi-utara",
|
||||
logo: "/logo/polda/polda-sulawesi-utara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sumatera Barat",
|
||||
slug: "sumatera-barat",
|
||||
logo: "/logo/polda/polda-sumatera-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sumatera Selatan",
|
||||
slug: "sumatera-selatan",
|
||||
logo: "/logo/polda/polda-sumatera-selatan.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sumatera Utara",
|
||||
slug: "sumatera-utara",
|
||||
logo: "/logo/polda/polda-sumatera-utara.png",
|
||||
},
|
||||
// {
|
||||
// name: "Satuan Kerja POLRI",
|
||||
// slug: "satker-polri",
|
||||
// logo: "/logo/satker/SATUAN-KERJA-POLRI.png",
|
||||
// },
|
||||
// {
|
||||
// name: "Internasional",
|
||||
// slug: "internasional",
|
||||
// logo: "/assets/polda/internasional.png",
|
||||
// },
|
||||
];
|
||||
|
||||
export default function PoldaAllImagePage() {
|
||||
return (
|
||||
<AllContentPage
|
||||
typeId="1"
|
||||
title="Semua Foto per Polda"
|
||||
basePath="image"
|
||||
mode="polda"
|
||||
dataList={regions}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,186 @@
|
|||
import AllContentPage from "@/components/landing-page/all-content-page";
|
||||
|
||||
const regions = [
|
||||
{ name: "Polda Aceh", slug: "aceh", logo: "/logo/polda/polda-aceh.png" },
|
||||
{ name: "Polda Bali", slug: "bali", logo: "/logo/polda/polda-bali.png" },
|
||||
{
|
||||
name: "Polda Bangka Belitung",
|
||||
slug: "bangka-belitung",
|
||||
logo: "/logo/polda/polda-bangka-belitung.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Banten",
|
||||
slug: "banten",
|
||||
logo: "/logo/polda/polda-banten.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Bengkulu",
|
||||
slug: "bengkulu",
|
||||
logo: "/logo/polda/polda-bengkulu.png",
|
||||
},
|
||||
{
|
||||
name: "Polda DIY",
|
||||
slug: "jogja",
|
||||
logo: "/logo/polda/polda-jogja.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Gorontalo",
|
||||
slug: "gorontalo",
|
||||
logo: "/logo/polda/polda-gorontalo.png",
|
||||
},
|
||||
{ name: "Polda Jambi", slug: "jambi", logo: "/logo/polda/polda-jambi.png" },
|
||||
{
|
||||
name: "Polda Jawa Barat",
|
||||
slug: "jawa-barat",
|
||||
logo: "/logo/polda/polda-jawa-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Jawa Tengah",
|
||||
slug: "jawa-tengah",
|
||||
logo: "/logo/polda/polda-jawa-tengah.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Jawa Timur",
|
||||
slug: "jawa-timur",
|
||||
logo: "/logo/polda/polda-jawa-timur.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Barat",
|
||||
slug: "kalimantan-barat",
|
||||
logo: "/logo/polda/polda-kalimantan-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Selatan",
|
||||
slug: "kalimantan-selatan",
|
||||
logo: "/logo/polda/polda-kalimantan-selatan.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Tengah",
|
||||
slug: "kalimantan-tengah",
|
||||
logo: "/logo/polda/polda-kalimantan-tengah.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Timur",
|
||||
slug: "kalimantan-timur",
|
||||
logo: "/logo/polda/polda-kalimantan-timur.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kalimantan Utara",
|
||||
slug: "kalimantan-utara",
|
||||
logo: "/logo/polda/polda-kalimantan-utara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Kepulauan Riau",
|
||||
slug: "kepulauan-riau",
|
||||
logo: "/logo/polda/polda-kepulauan-riau.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Lampung",
|
||||
slug: "lampung",
|
||||
logo: "/logo/polda/polda-lampung.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Maluku",
|
||||
slug: "maluku",
|
||||
logo: "/logo/polda/polda-maluku.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Maluku Utara",
|
||||
slug: "maluku-utara",
|
||||
logo: "/logo/polda/polda-maluku-utara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Metro Jaya",
|
||||
slug: "metro-jaya",
|
||||
logo: "/logo/polda/polda-metro-jaya.png",
|
||||
},
|
||||
{
|
||||
name: "Polda NTB",
|
||||
slug: "ntb",
|
||||
logo: "/logo/polda/polda-ntb.png",
|
||||
},
|
||||
{
|
||||
name: "Polda NTT",
|
||||
slug: "ntt",
|
||||
logo: "/logo/polda/polda-ntt.png",
|
||||
},
|
||||
{ name: "Polda Papua", slug: "papua", logo: "/logo/polda/polda-papua.png" },
|
||||
{
|
||||
name: "Polda Papua Barat",
|
||||
slug: "papua-barat",
|
||||
logo: "/logo/polda/polda-papua-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Papua Barat Daya",
|
||||
slug: "papua-barat-daya",
|
||||
logo: "/logo/polda/polda-papua-barat-daya.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Papua Tengah",
|
||||
slug: "papua-tengah",
|
||||
logo: "/logo/polda/polda-papua-tengah.png",
|
||||
},
|
||||
{ name: "Polda Riau", slug: "riau", logo: "/logo/polda/polda-riau.png" },
|
||||
{
|
||||
name: "Polda Sulawesi Barat",
|
||||
slug: "sulawesi-barat",
|
||||
logo: "/logo/polda/polda-sulawesi-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Selatan",
|
||||
slug: "sulawesi-selatan",
|
||||
logo: "/logo/polda/polda-sulawesi-selatan.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Tengah",
|
||||
slug: "sulawesi-tengah",
|
||||
logo: "/logo/polda/polda-sulawesi-tengah.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Tenggara",
|
||||
slug: "sulawesi-tenggara",
|
||||
logo: "/logo/polda/polda-sulawesi-tenggara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sulawesi Utara",
|
||||
slug: "sulawesi-utara",
|
||||
logo: "/logo/polda/polda-sulawesi-utara.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sumatera Barat",
|
||||
slug: "sumatera-barat",
|
||||
logo: "/logo/polda/polda-sumatera-barat.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sumatera Selatan",
|
||||
slug: "sumatera-selatan",
|
||||
logo: "/logo/polda/polda-sumatera-selatan.png",
|
||||
},
|
||||
{
|
||||
name: "Polda Sumatera Utara",
|
||||
slug: "sumatera-utara",
|
||||
logo: "/logo/polda/polda-sumatera-utara.png",
|
||||
},
|
||||
// {
|
||||
// name: "Satuan Kerja POLRI",
|
||||
// slug: "satker-polri",
|
||||
// logo: "/logo/satker/SATUAN-KERJA-POLRI.png",
|
||||
// },
|
||||
// {
|
||||
// name: "Internasional",
|
||||
// slug: "internasional",
|
||||
// logo: "/assets/polda/internasional.png",
|
||||
// },
|
||||
];
|
||||
|
||||
export default function PoldaAllVideoPage() {
|
||||
return (
|
||||
<AllContentPage
|
||||
typeId="2"
|
||||
title="Semua Konten Audio Visual per Polda"
|
||||
basePath="video"
|
||||
mode="polda"
|
||||
dataList={regions}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
@ -451,6 +451,7 @@ export default function FormImage() {
|
|||
""
|
||||
);
|
||||
const articleImagesData = articleData?.imagesUrl?.split(",");
|
||||
setArticleBody(cleanArticleBody || "");
|
||||
setValue("description", cleanArticleBody || "");
|
||||
setDetailData(articleData);
|
||||
setSelectedArticleId(id);
|
||||
|
|
@ -1738,7 +1739,7 @@ export default function FormImage() {
|
|||
{/* <Button type="submit" color="primary">
|
||||
{t("submit", { defaultValue: "Submit" })}
|
||||
</Button> */}
|
||||
{levelNumber !== "2" && levelNumber !== "3" && (
|
||||
{levelNumber !== "2" && (
|
||||
<Button type="submit" color="primary">
|
||||
{t("submit", { defaultValue: "Submit" })}
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@ import { useParams, useRouter } from "next/navigation";
|
|||
import { useTranslations } from "next-intl";
|
||||
import dynamic from "next/dynamic";
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
// UI Components
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Label } from "@/components/ui/label";
|
||||
|
|
@ -26,8 +24,6 @@ import {
|
|||
} from "@/components/ui/select";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||
|
||||
// Icons
|
||||
import {
|
||||
AlertCircle,
|
||||
FileText,
|
||||
|
|
@ -44,8 +40,6 @@ import {
|
|||
CheckCircle,
|
||||
XCircle,
|
||||
} from "lucide-react";
|
||||
|
||||
// Swiper
|
||||
import { Swiper, SwiperSlide } from "swiper/react";
|
||||
import { Swiper as SwiperType } from "swiper";
|
||||
import "swiper/css";
|
||||
|
|
@ -54,8 +48,6 @@ import "swiper/css/navigation";
|
|||
import "swiper/css/pagination";
|
||||
import "swiper/css/thumbs";
|
||||
import { FreeMode, Navigation, Pagination, Thumbs } from "swiper/modules";
|
||||
|
||||
// Services
|
||||
import {
|
||||
convertSPIT,
|
||||
deleteSPIT,
|
||||
|
|
@ -64,15 +56,12 @@ import {
|
|||
listEnableCategory,
|
||||
} from "@/service/content/content";
|
||||
import { generateDataRewrite, getDetailArticle } from "@/service/content/ai";
|
||||
|
||||
// Utils
|
||||
import { getCookiesDecrypt } from "@/lib/utils";
|
||||
import { error } from "@/lib/swal";
|
||||
import Swal from "sweetalert2";
|
||||
import withReactContent from "sweetalert2-react-content";
|
||||
import { close, loading } from "@/config/swal";
|
||||
|
||||
// Types
|
||||
interface Category {
|
||||
id: number;
|
||||
name: string;
|
||||
|
|
@ -289,9 +278,7 @@ export default function FormConvertSPIT() {
|
|||
try {
|
||||
const response = await getTagsBySubCategoryId(categoryId);
|
||||
if (response?.data?.data?.length > 0) {
|
||||
// Extract tag names from the response objects
|
||||
const apiTags = response?.data?.data?.map((tag: any) => tag.tagName);
|
||||
// Merge with existing tags, ensuring uniqueness
|
||||
const tagsMerge = Array.from(new Set([...tags, ...apiTags]));
|
||||
setTags(tagsMerge);
|
||||
}
|
||||
|
|
@ -313,7 +300,6 @@ export default function FormConvertSPIT() {
|
|||
|
||||
setDetail(details);
|
||||
|
||||
// <-- use API contentList objects directly -->
|
||||
const contentList: FileType[] = (details.contentList || []).map(
|
||||
(it: any) => ({
|
||||
contentId: it.contentId,
|
||||
|
|
@ -329,11 +315,9 @@ export default function FormConvertSPIT() {
|
|||
setFiles(contentList);
|
||||
setDetailThumb(contentList);
|
||||
|
||||
// Initialize file placements
|
||||
const fileCount = contentList.length || 0;
|
||||
setFilePlacements(Array(fileCount).fill([]));
|
||||
|
||||
// Set form values
|
||||
setValue("contentTitle", details.contentTitle || "");
|
||||
setValue("contentDescription", details.contentDescription || "");
|
||||
setValue("contentCreator", details.contentCreator || "");
|
||||
|
|
@ -342,16 +326,16 @@ export default function FormConvertSPIT() {
|
|||
(details as any).contentRewriteDescription || ""
|
||||
);
|
||||
|
||||
// Set category and load category tags
|
||||
if (details.categoryId) {
|
||||
setSelectedCategoryId(details.categoryId);
|
||||
await loadTags(details.categoryId);
|
||||
}
|
||||
|
||||
// Set content tags and merge with category tags
|
||||
if (details.contentTag) {
|
||||
const contentTags = details.contentTag.split(",").map((tag: string) => tag.trim());
|
||||
setTags(prev => Array.from(new Set([...prev, ...contentTags])));
|
||||
const contentTags = details.contentTag
|
||||
.split(",")
|
||||
.map((tag: string) => tag.trim());
|
||||
setTags((prev) => Array.from(new Set([...prev, ...contentTags])));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to load detail:", error);
|
||||
|
|
@ -552,14 +536,24 @@ export default function FormConvertSPIT() {
|
|||
);
|
||||
};
|
||||
|
||||
const getPlacementData = () => {
|
||||
const getPlacementData = (type: string) => {
|
||||
const placementData: PlacementData[] = [];
|
||||
for (let i = 0; i < filePlacements.length; i++) {
|
||||
if (filePlacements[i].length > 0) {
|
||||
const placements = filePlacements[i];
|
||||
if (type == "mabes") {
|
||||
for (let i = 0; i < filePlacements.length; i++) {
|
||||
if (filePlacements[i].length > 0) {
|
||||
const placements = filePlacements[i];
|
||||
placementData.push({
|
||||
mediaFileId: files[i].contentId,
|
||||
placements: placements.join(","),
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
|
||||
placementData.push({
|
||||
mediaFileId: files[i].contentId,
|
||||
placements: placements.join(","),
|
||||
placements: "polda",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -578,7 +572,6 @@ export default function FormConvertSPIT() {
|
|||
return temp;
|
||||
};
|
||||
|
||||
// Form submission
|
||||
const onSubmit = async (data: FormData) => {
|
||||
const pnmhTags = tags.filter((tag) => tag.toLowerCase().includes("pnmh"));
|
||||
|
||||
|
|
@ -624,7 +617,9 @@ export default function FormConvertSPIT() {
|
|||
categoryId: selectedCategoryId,
|
||||
publishedFor: publishedFor.join(","),
|
||||
creator: data.contentCreator,
|
||||
files: isUserMabesApprover ? getPlacementData() : [],
|
||||
files: isUserMabesApprover
|
||||
? getPlacementData("mabes")
|
||||
: getPlacementData("polda"),
|
||||
};
|
||||
|
||||
await convertSPIT(requestData);
|
||||
|
|
@ -978,7 +973,10 @@ export default function FormConvertSPIT() {
|
|||
centeredSlides={true}
|
||||
>
|
||||
{detailThumb.map((item) => (
|
||||
<SwiperSlide key={item.contentId} className="!w-full">
|
||||
<SwiperSlide
|
||||
key={item.contentId}
|
||||
className="!w-full"
|
||||
>
|
||||
{item.contentType === "VIDEO" ? (
|
||||
<div className="relative w-full h-96 overflow-hidden rounded-lg">
|
||||
<video
|
||||
|
|
@ -989,8 +987,8 @@ export default function FormConvertSPIT() {
|
|||
poster={item.thumbnailFileUrl || undefined}
|
||||
title={`Video ${item.contentId}`}
|
||||
onError={(e) => {
|
||||
console.error('Video load error:', e);
|
||||
e.currentTarget.style.display = 'none';
|
||||
console.error("Video load error:", e);
|
||||
e.currentTarget.style.display = "none";
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -1000,10 +998,13 @@ export default function FormConvertSPIT() {
|
|||
src={item.contentFile}
|
||||
alt={`Media ${item.contentId}`}
|
||||
className="max-w-full max-h-full object-contain rounded-lg"
|
||||
style={{ maxWidth: '100%', maxHeight: '100%' }}
|
||||
style={{
|
||||
maxWidth: "100%",
|
||||
maxHeight: "100%",
|
||||
}}
|
||||
onError={(e) => {
|
||||
console.error('Image load error:', e);
|
||||
e.currentTarget.style.display = 'none';
|
||||
console.error("Image load error:", e);
|
||||
e.currentTarget.style.display = "none";
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -1047,7 +1048,10 @@ export default function FormConvertSPIT() {
|
|||
preventClicksPropagation={false}
|
||||
>
|
||||
{detailThumb.map((item) => (
|
||||
<SwiperSlide key={`thumb-${item.contentId}`} className="!w-auto flex-shrink-0">
|
||||
<SwiperSlide
|
||||
key={`thumb-${item.contentId}`}
|
||||
className="!w-auto flex-shrink-0"
|
||||
>
|
||||
{item.contentType === "VIDEO" ? (
|
||||
<div className="relative w-20 h-16 rounded cursor-pointer overflow-hidden flex-shrink-0">
|
||||
{/* use preload metadata so browser doesn't download full video */}
|
||||
|
|
@ -1059,8 +1063,11 @@ export default function FormConvertSPIT() {
|
|||
playsInline
|
||||
tabIndex={-1}
|
||||
onError={(e) => {
|
||||
console.error('Thumbnail video load error:', e);
|
||||
e.currentTarget.style.display = 'none';
|
||||
console.error(
|
||||
"Thumbnail video load error:",
|
||||
e
|
||||
);
|
||||
e.currentTarget.style.display = "none";
|
||||
}}
|
||||
/>
|
||||
<div className="absolute inset-0 flex items-center justify-center bg-black/30 pointer-events-none">
|
||||
|
|
@ -1081,8 +1088,11 @@ export default function FormConvertSPIT() {
|
|||
alt={`Thumbnail ${item.contentId}`}
|
||||
className="w-full h-full object-cover"
|
||||
onError={(e) => {
|
||||
console.error('Thumbnail image load error:', e);
|
||||
e.currentTarget.style.display = 'none';
|
||||
console.error(
|
||||
"Thumbnail image load error:",
|
||||
e
|
||||
);
|
||||
e.currentTarget.style.display = "none";
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -1138,7 +1148,6 @@ export default function FormConvertSPIT() {
|
|||
key={file.contentId}
|
||||
className="flex gap-4 p-4 border rounded-lg"
|
||||
>
|
||||
{/* show thumbnail or video preview */}
|
||||
{file.contentType === "VIDEO" ? (
|
||||
<video
|
||||
src={file.contentFile}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,211 @@
|
|||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { listDataRegional } from "@/service/landing/landing";
|
||||
import {
|
||||
Carousel,
|
||||
CarouselContent,
|
||||
CarouselItem,
|
||||
CarouselNext,
|
||||
CarouselPrevious,
|
||||
} from "@/components/ui/carousel";
|
||||
|
||||
interface ContentItem {
|
||||
id: number;
|
||||
slug: string;
|
||||
title: string;
|
||||
thumbnailLink?: string;
|
||||
categoryName?: string;
|
||||
}
|
||||
|
||||
interface RegionOrSatker {
|
||||
name: string;
|
||||
slug: string;
|
||||
logo: string;
|
||||
}
|
||||
|
||||
interface AllContentPageProps {
|
||||
typeId: string; // 1 = image, 2 = video, 3 = text, 4 = audio
|
||||
title: string;
|
||||
basePath: "image" | "video" | "document" | "audio";
|
||||
mode: "polda" | "satker";
|
||||
dataList: RegionOrSatker[];
|
||||
}
|
||||
|
||||
export default function AllContentPage({
|
||||
typeId,
|
||||
title,
|
||||
basePath,
|
||||
mode,
|
||||
dataList,
|
||||
}: AllContentPageProps) {
|
||||
const [contents, setContents] = useState<Record<string, ContentItem[]>>({});
|
||||
|
||||
useEffect(() => {
|
||||
async function fetchData() {
|
||||
const promises = dataList.map(async (region) => {
|
||||
try {
|
||||
const res = await listDataRegional(
|
||||
typeId,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
10,
|
||||
0,
|
||||
"createdAt"
|
||||
);
|
||||
return { slug: region.slug, data: res?.data?.data?.content || [] };
|
||||
} catch {
|
||||
return { slug: region.slug, data: [] };
|
||||
}
|
||||
});
|
||||
|
||||
const resultsArray = await Promise.all(promises);
|
||||
const results: Record<string, ContentItem[]> = {};
|
||||
resultsArray.forEach((r) => {
|
||||
results[r.slug] = r.data;
|
||||
});
|
||||
setContents(results);
|
||||
}
|
||||
|
||||
fetchData();
|
||||
}, [typeId, dataList]);
|
||||
|
||||
function renderCard(item: ContentItem, regionSlug: string) {
|
||||
const href = `/${mode}/${regionSlug}/${basePath}/detail/${item.slug}`;
|
||||
|
||||
// 🖼 Image & 🎥 Video sama
|
||||
if (basePath === "image" || basePath === "video") {
|
||||
return (
|
||||
<Link
|
||||
href={href}
|
||||
className="block border rounded-md overflow-hidden hover:shadow-md transition"
|
||||
>
|
||||
{item.thumbnailLink && (
|
||||
<Image
|
||||
src={item.thumbnailLink}
|
||||
alt={item.title}
|
||||
width={400}
|
||||
height={250}
|
||||
className="w-full h-40 object-cover"
|
||||
/>
|
||||
)}
|
||||
<div className="p-2 text-sm font-medium truncate">{item.title}</div>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
// 📄 Document
|
||||
if (basePath === "document") {
|
||||
return (
|
||||
<Link
|
||||
href={href}
|
||||
className="cursor-pointer rounded-lg shadow-md overflow-hidden bg-white dark:bg-black dark:border dark:border-gray-500 block"
|
||||
>
|
||||
<div className="bg-[#e0c350] flex items-center justify-center h-[170px] text-white">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="80"
|
||||
height="80"
|
||||
viewBox="0 0 16 16"
|
||||
>
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M5 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V5.4a1.5 1.5 0 0 0-.44-1.06L9.6 1.4A1.5 1.5 0 0 0 8.6 1z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div className="p-4">
|
||||
<div className="text-[12px] font-bold text-red-600 uppercase">
|
||||
{item.categoryName?.toUpperCase() ?? "Document"}
|
||||
</div>
|
||||
<div className="font-semibold text-gray-900 dark:text-white text-xl leading-snug line-clamp-3">
|
||||
{item.title}
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
// 🎧 Audio
|
||||
if (basePath === "audio") {
|
||||
return (
|
||||
<Link
|
||||
href={href}
|
||||
className="cursor-pointer bg-white dark:bg-black dark:border dark:border-gray-500 rounded-xl shadow-md hover:shadow-lg transition overflow-hidden block"
|
||||
>
|
||||
<div className="flex items-center justify-center bg-[#bb3523] w-full h-[170px] text-white">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="80"
|
||||
height="80"
|
||||
viewBox="0 0 20 20"
|
||||
>
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M14.7 2.2A1 1 0 0 1 16 3.2v6L8 11v6.5a2.5 2.5 0 1 1-1-2V5.4a1 1 0 0 1 .7-1z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div className="p-4">
|
||||
<p className="text-[12px] font-bold text-[#bb3523] uppercase mb-1">
|
||||
{item.categoryName?.toUpperCase() ?? "Audio"}
|
||||
</p>
|
||||
<p className="text-xl font-semibold text-black dark:text-white line-clamp-3">
|
||||
{item.title}
|
||||
</p>
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="max-w-7xl mx-auto px-4 py-8">
|
||||
<h1 className="text-2xl font-bold mb-6">{title}</h1>
|
||||
|
||||
{dataList.map((region) => (
|
||||
<div key={region.slug} className="mb-12">
|
||||
{/* Header */}
|
||||
<div className="flex items-center gap-3 mb-4">
|
||||
<Image
|
||||
src={region.logo}
|
||||
alt={region.name}
|
||||
width={40}
|
||||
height={40}
|
||||
className="rounded-full"
|
||||
/>
|
||||
<h2 className="text-lg font-semibold">{region.name}</h2>
|
||||
</div>
|
||||
|
||||
{/* Carousel Konten */}
|
||||
{contents[region.slug]?.length > 0 ? (
|
||||
<Carousel className="w-full">
|
||||
<CarouselContent>
|
||||
{contents[region.slug].map((item) => (
|
||||
<CarouselItem
|
||||
key={item.id}
|
||||
className="basis-2/3 md:basis-1/3 lg:basis-1/4"
|
||||
>
|
||||
{renderCard(item, region.slug)}
|
||||
</CarouselItem>
|
||||
))}
|
||||
</CarouselContent>
|
||||
<CarouselPrevious />
|
||||
<CarouselNext />
|
||||
</Carousel>
|
||||
) : (
|
||||
<p className="text-gray-500">Tidak ada konten di {region.name}</p>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -196,6 +196,24 @@ export default function FilterAudioComponent(props: {
|
|||
}
|
||||
}
|
||||
|
||||
const basePath = asPath.includes("/polda/")
|
||||
? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
: "";
|
||||
|
||||
const type = group || asPath.includes("/polda/") ? "regional?" : "filter?";
|
||||
|
||||
const sort = sortByOpt === "popular" ? "sortBy=popular" : "sortBy=latest";
|
||||
|
||||
const titleParam = title ? `&title=${title?.toLowerCase()}` : "";
|
||||
|
||||
const categoryParam = categorie ? `&category=${categorie}` : "";
|
||||
|
||||
const fullQuery = `${type}${sort}${titleParam}${categoryParam}${
|
||||
startDateString ? `&startDate=${startDateString}` : ""
|
||||
}${endDateString ? `&endDate=${endDateString}` : ""}`;
|
||||
|
||||
const href = `${basePath}/image/${fullQuery}`;
|
||||
|
||||
return newContent?.length > 0 ? (
|
||||
<div className="flex flex-col gap-3">
|
||||
<p>{`Audio (${totalContent})`}</p>
|
||||
|
|
@ -287,17 +305,18 @@ export default function FilterAudioComponent(props: {
|
|||
</Carousel>
|
||||
<div className="flex justify-center mt-1 mb-6">
|
||||
<Link
|
||||
href={
|
||||
`${
|
||||
asPath.includes("/polda/")
|
||||
? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
: ""
|
||||
}/audio/` +
|
||||
`${group ? "regional?" : "filter?"}` +
|
||||
`sortBy=${sortBy === "popular" ? "popular" : "latest"}` +
|
||||
`${title ? `&title=${title.toLowerCase()}` : ""}` +
|
||||
`${categorie ? `&category=${categorie}` : ""}`
|
||||
}
|
||||
// href={
|
||||
// `${
|
||||
// asPath.includes("/polda/")
|
||||
// ? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
// : ""
|
||||
// }/audio/` +
|
||||
// `${group ? "regional?" : "filter?"}` +
|
||||
// `sortBy=${sortBy === "popular" ? "popular" : "latest"}` +
|
||||
// `${title ? `&title=${title.toLowerCase()}` : ""}` +
|
||||
// `${categorie ? `&category=${categorie}` : ""}`
|
||||
// }
|
||||
href={isRegional ? `/regional/all-polda/audio/all` : href}
|
||||
className="border border-red-500 text-red-500 hover:bg-red-500 hover:text-white transition-colors duration-200 px-4 py-2 rounded-md text-sm"
|
||||
>
|
||||
Lihat Semua
|
||||
|
|
|
|||
|
|
@ -153,6 +153,24 @@ export default function FilterDocumentComponent(props: {
|
|||
setTotalContent(data?.totalElements);
|
||||
}
|
||||
|
||||
const basePath = asPath.includes("/polda/")
|
||||
? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
: "";
|
||||
|
||||
const type = group || asPath.includes("/polda/") ? "regional?" : "filter?";
|
||||
|
||||
const sort = sortByOpt === "popular" ? "sortBy=popular" : "sortBy=latest";
|
||||
|
||||
const titleParam = title ? `&title=${title?.toLowerCase()}` : "";
|
||||
|
||||
const categoryParam = categorie ? `&category=${categorie}` : "";
|
||||
|
||||
const fullQuery = `${type}${sort}${titleParam}${categoryParam}${
|
||||
startDateString ? `&startDate=${startDateString}` : ""
|
||||
}${endDateString ? `&endDate=${endDateString}` : ""}`;
|
||||
|
||||
const href = `${basePath}/image/${fullQuery}`;
|
||||
|
||||
return newContent?.length > 0 ? (
|
||||
<div className="flex flex-col gap-3">
|
||||
<p>{`Document (${totalContent})`}</p>
|
||||
|
|
@ -214,7 +232,7 @@ export default function FilterDocumentComponent(props: {
|
|||
{newContent?.map((text: any) => (
|
||||
<CarouselItem key={text?.id} className="md:basis-1/2 lg:basis-1/3">
|
||||
<Link
|
||||
href={`${prefixPath}/document/detail/${text?.slug
|
||||
href={`${prefixPath}/document/detail/${text?.slug
|
||||
?.split("/")
|
||||
.pop()}`}
|
||||
// href={`${prefixPath}/document/detail/${text?.slug}`}
|
||||
|
|
@ -260,15 +278,17 @@ export default function FilterDocumentComponent(props: {
|
|||
</Carousel>
|
||||
<div className="flex justify-center mt-1 mb-6">
|
||||
<Link
|
||||
href={`${
|
||||
asPath.includes("/polda/")
|
||||
? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
: ""
|
||||
}/document/${group ? "filter" : "regional"}?sortBy=${
|
||||
sortBy || "latest"
|
||||
}${title ? `&title=${title.toLowerCase()}` : ""}${
|
||||
categorie ? `&category=${categorie}` : ""
|
||||
}${group ? `&group=${group}` : ""}`}
|
||||
// href={`${
|
||||
// asPath.includes("/polda/")
|
||||
// ? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
// : ""
|
||||
// }/document/${group ? "filter" : "regional"}?sortBy=${
|
||||
// sortBy || "latest"
|
||||
// }${title ? `&title=${title.toLowerCase()}` : ""}${
|
||||
// categorie ? `&category=${categorie}` : ""
|
||||
// }${group ? `&group=${group}` : ""}`}
|
||||
|
||||
href={isRegional ? `/regional/all-polda/document/all` : href}
|
||||
className="border border-red-500 text-red-500 hover:bg-red-500 hover:text-white transition-colors duration-200 px-4 py-2 rounded-md text-sm"
|
||||
>
|
||||
Lihat Semua
|
||||
|
|
|
|||
|
|
@ -149,12 +149,17 @@ export default function FilterImageComponent(props: {
|
|||
: "";
|
||||
|
||||
const type = group || asPath.includes("/polda/") ? "regional?" : "filter?";
|
||||
|
||||
const sort = sortByOpt === "popular" ? "sortBy=popular" : "sortBy=latest";
|
||||
|
||||
const titleParam = title ? `&title=${title?.toLowerCase()}` : "";
|
||||
|
||||
const categoryParam = categorie ? `&category=${categorie}` : "";
|
||||
|
||||
const fullQuery = `${type}${sort}${titleParam}${categoryParam}${
|
||||
startDateString ? `&startDate=${startDateString}` : ""
|
||||
}${endDateString ? `&endDate=${endDateString}` : ""}`;
|
||||
|
||||
const href = `${basePath}/image/${fullQuery}`;
|
||||
|
||||
let prefixPath = poldaName
|
||||
|
|
@ -284,7 +289,7 @@ export default function FilterImageComponent(props: {
|
|||
</Carousel>
|
||||
<div className="flex justify-center mt-1 mb-6">
|
||||
<Link
|
||||
href={href}
|
||||
href={isRegional ? `/regional/all-polda/image/all` : href}
|
||||
className="border border-red-500 text-red-500 hover:bg-red-500 text-sm hover:text-white px-4 py-2 rounded transition duration-200"
|
||||
>
|
||||
Lihat Semua
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ export default function IndeksCarouselComponent(props: {
|
|||
try {
|
||||
loading();
|
||||
const response = await getIndeksDataFilter(
|
||||
"4",
|
||||
"",
|
||||
name,
|
||||
filter,
|
||||
12,
|
||||
|
|
|
|||
|
|
@ -153,6 +153,24 @@ export default function FilterVideoComponent(props: {
|
|||
setTotalContent(response?.data?.data?.totalElements);
|
||||
}
|
||||
|
||||
const basePath = asPath.includes("/polda/")
|
||||
? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
: "";
|
||||
|
||||
const type = group || asPath.includes("/polda/") ? "regional?" : "filter?";
|
||||
|
||||
const sort = sortByOpt === "popular" ? "sortBy=popular" : "sortBy=latest";
|
||||
|
||||
const titleParam = title ? `&title=${title?.toLowerCase()}` : "";
|
||||
|
||||
const categoryParam = categorie ? `&category=${categorie}` : "";
|
||||
|
||||
const fullQuery = `${type}${sort}${titleParam}${categoryParam}${
|
||||
startDateString ? `&startDate=${startDateString}` : ""
|
||||
}${endDateString ? `&endDate=${endDateString}` : ""}`;
|
||||
|
||||
const href = `${basePath}/image/${fullQuery}`;
|
||||
|
||||
return newContent?.length > 0 ? (
|
||||
<div className="flex flex-col gap-3">
|
||||
<p>{`Audio Visual (${totalContent})`}</p>
|
||||
|
|
@ -240,25 +258,27 @@ export default function FilterVideoComponent(props: {
|
|||
</Carousel>
|
||||
<div className="flex justify-center mt-1 mb-6">
|
||||
<Link
|
||||
href={`${
|
||||
asPath.includes("/polda/")
|
||||
? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
: ""
|
||||
}/video/${
|
||||
group || asPath.includes("/polda/") ? "regional?" : "filter?"
|
||||
}${sortByOpt === "popular" ? "sortBy=popular" : "sortBy=latest"}${
|
||||
title ? `&title=${title.toLowerCase()}` : ""
|
||||
}${categorie ? `&category=${categorie}` : ""}${
|
||||
startDateString ? `&startDate=${startDateString}` : ""
|
||||
}${endDateString ? `&endDate=${endDateString}` : ""}${
|
||||
monthYearFilter
|
||||
? `&month=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]}`
|
||||
: ""
|
||||
}${
|
||||
monthYearFilter
|
||||
? `&year=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[1]}`
|
||||
: ""
|
||||
}`}
|
||||
// href={`${
|
||||
// asPath.includes("/polda/")
|
||||
// ? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
// : ""
|
||||
// }/video/${
|
||||
// group || asPath.includes("/polda/") ? "regional?" : "filter?"
|
||||
// }${sortByOpt === "popular" ? "sortBy=popular" : "sortBy=latest"}${
|
||||
// title ? `&title=${title.toLowerCase()}` : ""
|
||||
// }${categorie ? `&category=${categorie}` : ""}${
|
||||
// startDateString ? `&startDate=${startDateString}` : ""
|
||||
// }${endDateString ? `&endDate=${endDateString}` : ""}${
|
||||
// monthYearFilter
|
||||
// ? `&month=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]}`
|
||||
// : ""
|
||||
// }${
|
||||
// monthYearFilter
|
||||
// ? `&year=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[1]}`
|
||||
// : ""
|
||||
// }`}
|
||||
|
||||
href={isRegional ? `/regional/all-polda/video/all` : href}
|
||||
className="border border-red-500 text-red-500 hover:bg-red-500 hover:text-white px-4 py-2 text-sm rounded transition duration-200"
|
||||
>
|
||||
Lihat Semua
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ export async function getMediaBlastCampaignList() {
|
|||
|
||||
export async function deleteMediaBlastCampaign(id: string | number): Promise<any> {
|
||||
const url = `media/blast/campaign?id=${id}`;
|
||||
return httpDeleteInterceptor({ url });
|
||||
return httpDeleteInterceptor( url );
|
||||
}
|
||||
|
||||
export async function detailMediaSummary(id: string) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue