mediahub-fe/components/landing-page/area-coverage-and-work-unit...

89 lines
3.9 KiB
TypeScript
Raw Normal View History

2025-03-05 10:05:44 +00:00
"use client";
import React, { useEffect, useState } from "react";
2025-06-02 01:00:01 +00:00
import { Dialog, DialogClose, DialogContent, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
2025-03-05 10:05:44 +00:00
import Image from "next/image";
import Coverage from "./coverage";
2025-03-07 12:32:47 +00:00
import Division from "./division";
2025-03-05 10:05:44 +00:00
const AreaCoverageWorkUnits = () => {
const [openPolda, setOpenPolda] = useState(false);
const [openSatker, setOpenSatker] = useState(false);
useEffect(() => {
if (openPolda || openSatker) {
document.body.classList.add("overflow-hidden");
} else {
document.body.classList.remove("overflow-hidden");
}
return () => {
document.body.classList.remove("overflow-hidden");
};
}, [openPolda, openSatker]);
2025-03-05 10:05:44 +00:00
return (
2025-06-02 01:00:01 +00:00
<div className="mx-auto px-4 lg:px-0 py-6">
<h2 className="text-start text-lg md:text-xl font-bold text-[#bb3523] border-b-2 border-[#bb3523] mb-4 uppercase">
2025-06-02 01:00:01 +00:00
Liputan <span className="text-[#bb3523]">Wilayah</span> & <span className="text-[#bb3523]">Satker</span>
2025-03-05 10:05:44 +00:00
</h2>
2025-05-12 14:46:56 +00:00
<div className="flex flex-col justify-center lg:flex-row gap-8 ">
2025-03-05 10:05:44 +00:00
{/* POLDA */}
2025-05-12 14:46:56 +00:00
<Dialog open={openPolda} onOpenChange={setOpenPolda}>
<DialogTrigger asChild>
2025-06-02 01:00:01 +00:00
<button onClick={() => setOpenPolda(true)} className="flex flex-col gap-2 justify-center items-center shadow-lg group rounded-xl py-5 w-full border-2 border-transparent hover:border-[#bb3523] transition-all duration-300">
<Image width={1920} height={1080} alt="indo" src="/assets/indo.png" className="h-32 w-32 group-hover:scale-110 group-hover:border-[#bb3523] " />
<p className="text-base font-bold">Polda Jajaran</p>
</button>
2025-03-05 10:05:44 +00:00
</DialogTrigger>
<DialogContent size="md" className="max-h-[90vh] overflow-y-auto flex flex-col ">
2025-03-05 10:05:44 +00:00
<DialogHeader className="flex flex-col justify-center">
<DialogTitle>
<p className="text-center">Polda Jajaran</p>
</DialogTitle>
<DialogTitle>
<div className="h-1 w-[150px] bg-[#bb3523] mx-auto mb-6 rounded"></div>
</DialogTitle>
</DialogHeader>
<div className="overflow-y-auto px-1 flex-1">
<Coverage />
</div>
2025-03-05 10:05:44 +00:00
<div className="text-right mt-4">
<DialogClose asChild>
<button className="text-[#bb3523] font-bold">Tutup</button>
</DialogClose>
</div>
</DialogContent>
</Dialog>
{/* SATKER */}
<Dialog open={openSatker} onOpenChange={setOpenSatker}>
2025-06-02 01:00:01 +00:00
<DialogTrigger asChild>
<button className="flex flex-col gap-2 justify-center items-center shadow-lg group rounded-xl py-5 w-full border-2 border-transparent hover:border-[#bb3523] transition-all duration-300">
<Image width={1920} height={1080} alt="polri" src="/assets/logo-polri.png" className="h-32 w-32 group-hover:scale-110 group-hover:border-[#bb3523] transition-transform duration-300" />
<p className="text-base font-bold">Satuan Kerja Polri</p>
</button>
2025-03-05 10:05:44 +00:00
</DialogTrigger>
2025-03-07 12:32:47 +00:00
<DialogContent size="md">
2025-03-05 10:05:44 +00:00
<DialogHeader className="flex flex-col justify-center">
<DialogTitle>
<p className="text-center">Satuan Kerja Polri</p>
</DialogTitle>
<DialogTitle>
<div className="h-1 w-[150px] bg-[#bb3523] mx-auto mb-6 rounded"></div>
</DialogTitle>
</DialogHeader>
2025-03-07 12:32:47 +00:00
<Division />
2025-03-05 10:05:44 +00:00
<div className="text-right mt-4">
<DialogClose asChild>
<button className="text-[#bb3523] font-bold">Tutup</button>
</DialogClose>
</div>
</DialogContent>
</Dialog>
</div>
</div>
);
};
export default AreaCoverageWorkUnits;