fix build

This commit is contained in:
Rama Priyanto 2025-02-13 11:53:53 +07:00
parent 58d831a94c
commit 5a34f19488
17 changed files with 1624 additions and 1526 deletions

View File

@ -1,7 +1,8 @@
import FormApplication from '@/components/form/form-permohonan-informasi'
import FormApplication from "@/components/form/form-permohonan-informasi";
export default function ApplicationPage() {
return (
<FormApplication />
)
return (
<div></div>
// <FormApplication />
);
}

View File

@ -1,8 +1,9 @@
import FormObjectionRequest from '@/components/form/form-permohonan-keberatan'
import React from 'react'
import FormObjectionRequest from "@/components/form/form-permohonan-keberatan";
import React from "react";
export default function PermohonanKeberanatan() {
return (
<FormObjectionRequest />
)
return (
<div></div>
// <FormObjectionRequest />
);
}

View File

@ -1,8 +1,9 @@
import FormApplication from '@/components/form/form-permohonan-informasi'
import React from 'react'
import FormApplication from "@/components/form/form-permohonan-informasi";
import React from "react";
export default function RegistrasiPage() {
return (
<FormApplication />
)
return (
<div></div>
// <FormApplication />
);
}

View File

@ -60,9 +60,9 @@ export default function HumasNavbarWrapper({ children }: Props) {
<DropdownItem key="logout" color="danger">
Log Out
</DropdownItem>
<DropdownItem>
{/* <DropdownItem>
<ThemeSwitch />
</DropdownItem>
</DropdownItem> */}
</DropdownMenu>
</Dropdown>
</NavbarContent>

View File

@ -185,6 +185,7 @@ export default function NavbarHumas(props: { size: string }) {
}}
>
<DropdownItem
key="SP2HP"
onPress={() =>
window.open(
"https://sp2hp.bareskrim.polri.go.id/",
@ -203,7 +204,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</div>
</DropdownItem>
<DropdownItem>
<DropdownItem key="Formulir Permohonan Informasi">
<div className="flex flex-row gap-2">
<img src="pm2.png" className="w-[35px]" />
<div className="flex flex-col ">
@ -217,6 +218,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key={"SIM"}
onPress={() =>
window.open(
"https://www.digitalkorlantas.id/sim/",
@ -236,6 +238,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key={"erikkes"}
onPress={() => window.open("https://erikkes.id/", "_blank")}
>
<div className="flex flex-row gap-2">
@ -252,6 +255,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key={"eppsi"}
onPress={() => window.open("https://eppsi.id/", "_blank")}
>
<div className="flex flex-row gap-2">
@ -267,6 +271,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key={"eavis"}
onPress={() =>
window.open(
"https://e-avis.korlantas.polri.go.id/",
@ -285,6 +290,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key={"samsat"}
onPress={() =>
window.open("https://samsatdigital.id/", "_blank")
}
@ -302,6 +308,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key={"skck"}
onPress={() =>
window.open("https://skck.polri.go.id/", "_blank")
}
@ -317,6 +324,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key={"propam"}
onPress={() =>
window.open(
"https://play.google.com/store/apps/details?id=com.stk.pengaduanpropam&pli=1",
@ -338,6 +346,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key={"dumas"}
onPress={() =>
window.open("https://dumaspresisi.polri.go.id/", "_blank")
}
@ -356,6 +365,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key={"binmas"}
onPress={() =>
window.open("https://bos.polri.go.id/login", "_blank")
}
@ -372,6 +382,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key={"ccpolri"}
onPress={() =>
window.open(
"https://play.google.com/store/apps/details?id=id.go.ssdmpolri.pengaduanappsbarupolri2",
@ -432,7 +443,7 @@ export default function NavbarHumas(props: { size: string }) {
base: "w-[350px]",
}}
>
<DropdownItem>
<DropdownItem key={"humas"}>
<Link
href="/static/humas-polri"
className="flex justify-between"
@ -441,7 +452,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"profil"}>
<Link
href="/static/profile-kapolri"
className="flex justify-between"
@ -450,7 +461,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"struktur"}>
<Link
href="/static/struktur-mabes"
className="flex justify-between"
@ -459,7 +470,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"visimisi"}>
<Link
href="/static/visi-misi-polri"
className="flex justify-between"
@ -468,7 +479,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"fungsi"}>
<Link
href="/static/tugas-dan-fungsi-polri"
className="flex justify-between"
@ -477,7 +488,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"logo"}>
<Link href="/static/logo" className="flex justify-between">
Logo
<ChevronRightIcon />
@ -516,7 +527,7 @@ export default function NavbarHumas(props: { size: string }) {
base: "w-[350px]",
}}
>
<DropdownItem>
<DropdownItem key={"humas"}>
<Link
href="/static/humas-polri"
className="flex justify-between"
@ -525,7 +536,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"profil"}>
<Link
href="/static/profile-kapolri"
className="flex justify-between"
@ -534,7 +545,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"struktur"}>
<Link
href="/static/struktur-mabes"
className="flex justify-between"
@ -543,7 +554,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"visimisi"}>
<Link
href="/static/visi-misi-polri"
className="flex justify-between"
@ -552,7 +563,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"fungsi"}>
<Link
href="/static/tugas-dan-fungsi-polri"
className="flex justify-between"
@ -561,7 +572,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"logo"}>
<Link href="/static/logo" className="flex justify-between">
Logo
<ChevronRightIcon />
@ -600,7 +611,7 @@ export default function NavbarHumas(props: { size: string }) {
base: "w-[350px]",
}}
>
<DropdownItem>
<DropdownItem key={"humas"}>
<Link
href="/static/humas-polri"
className="flex justify-between"
@ -609,7 +620,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"profil"}>
<Link
href="/static/profile-kapolri"
className="flex justify-between"
@ -618,7 +629,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"struktur"}>
<Link
href="/static/struktur-mabes"
className="flex justify-between"
@ -627,7 +638,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"visimisi"}>
<Link
href="/static/visi-misi-polri"
className="flex justify-between"
@ -636,7 +647,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"fungsi"}>
<Link
href="/static/tugas-dan-fungsi-polri"
className="flex justify-between"
@ -645,7 +656,7 @@ export default function NavbarHumas(props: { size: string }) {
<ChevronRightIcon />
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key={"logo"}>
<Link href="/static/logo" className="flex justify-between">
Logo
<ChevronRightIcon />
@ -682,6 +693,7 @@ export default function NavbarHumas(props: { size: string }) {
}}
>
<DropdownItem
key="superapp"
onPress={() =>
window.open(
"https://play.google.com/store/apps/details?id=superapps.polri.presisi.presisi&hl=en_US&gl=US",
@ -701,6 +713,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="mediahub"
onPress={() =>
window.open(
"https://play.google.com/store/apps/details?id=com.mediahub.mediahub_mobile",
@ -719,6 +732,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="polisiku"
onPress={() =>
window.open(
"https://play.google.com/store/apps/details?id=id.co.qlue.polisiku&hl=id&gl=ID",
@ -738,6 +752,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="sp2hp"
onPress={() =>
window.open(
"https://sp2hp.bareskrim.polri.go.id/",
@ -756,6 +771,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="polritv"
onPress={() =>
window.open(
"https://play.google.com/store/apps/details?id=com.polritv",
@ -774,6 +790,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="polriradio"
onPress={() =>
window.open(
"https://play.google.com/store/apps/details?id=com.polritv",
@ -792,6 +809,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="eavis"
onPress={() =>
window.open(
"https://e-avis.korlantas.polri.go.id/",
@ -810,6 +828,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="erikkes"
onPress={() => window.open("https://erikkes.id/", "_blank")}
>
<div className="flex flex-row gap-2">
@ -825,6 +844,7 @@ export default function NavbarHumas(props: { size: string }) {
</DropdownItem>
<DropdownItem
key="eppsi"
onPress={() => window.open("https://eppsi.id/", "_blank")}
>
<div className="flex flex-row gap-2">
@ -838,6 +858,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="bos"
onPress={() =>
window.open("https://bos.polri.go.id/login", "_blank")
}
@ -854,6 +875,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="signal"
onPress={() =>
window.open(
"https://play.google.com/store/apps/details?id=app.signal.id",
@ -872,6 +894,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="skck"
onPress={() =>
window.open("https://skck.polri.go.id/", "_blank")
}
@ -887,6 +910,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="propam"
onPress={() =>
window.open(
"https://play.google.com/store/apps/details?id=com.stk.pengaduanpropam",
@ -906,6 +930,7 @@ export default function NavbarHumas(props: { size: string }) {
</DropdownItem>
<DropdownItem
key="presisi"
onPress={() =>
window.open(
"https://play.google.com/store/apps/details?id=com.stk.pengaduanpropam",
@ -927,6 +952,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="sdm"
onPress={() =>
window.open("https://penerimaan.polri.go.id/", "_blank")
}
@ -944,6 +970,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="wbs"
onPress={() =>
window.open(
"https://pengaduan-penerimaan.polri.go.id/",
@ -964,6 +991,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="dumas"
onPress={() =>
window.open(
"https://play.google.com/store/apps/details?id=com.admasolusi.monitoringpresisi",
@ -983,6 +1011,7 @@ export default function NavbarHumas(props: { size: string }) {
</DropdownItem>
<DropdownItem
key="ccpolri"
onPress={() =>
window.open(
"https://play.google.com/store/apps/details?id=id.go.ssdmpolri.pengaduanappsbarupolri2",
@ -1003,6 +1032,7 @@ export default function NavbarHumas(props: { size: string }) {
</div>
</DropdownItem>
<DropdownItem
key="korlantas"
onPress={() =>
window.open(
"https://www.digitalkorlantas.id/sim/",

View File

@ -97,7 +97,7 @@ export default function NavbarPPID() {
base: "w-[350px]",
}}
>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="ism">
<Link
href="/portal-ppid/informasi-publik/informasi-serta-merta"
color="foreground"
@ -105,7 +105,7 @@ export default function NavbarPPID() {
Informasi Serta Merta
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="ib">
<Link
href="/portal-ppid/informasi-publik/informasi-berkala"
color="foreground"
@ -113,7 +113,7 @@ export default function NavbarPPID() {
Informasi Berkala
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="iss">
<Link
href="/portal-ppid/informasi-publik/informasi-setiap-saat"
color="foreground"
@ -121,7 +121,7 @@ export default function NavbarPPID() {
Informasi Setiap Saat
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="ik">
<Link
href="/portal-ppid/informasi-publik/informasi-dikecualikan"
color="foreground"
@ -129,7 +129,7 @@ export default function NavbarPPID() {
Informasi Dikecualikan
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="ps">
<Link
href="/portal-ppid/informasi-publik/penerangan-satuan"
color="foreground"
@ -137,7 +137,7 @@ export default function NavbarPPID() {
Penerangan Satuan
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="uu">
<Link
href="/portal-ppid/informasi-publik/uu-dan-peraturan"
color="foreground"
@ -177,7 +177,7 @@ export default function NavbarPPID() {
base: "w-[350px]",
}}
>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="history">
<Link
href="/portal-ppid/profile/sejarah-ppid-polri"
color="foreground"
@ -185,7 +185,7 @@ export default function NavbarPPID() {
Sejarah PPID Polri
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="profile">
<Link
href="/portal-ppid/profile/profile-singkat-ppid"
color="foreground"
@ -193,7 +193,7 @@ export default function NavbarPPID() {
Profile Singkat PPID
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="fungsi">
<Link
href="/portal-ppid/profile/tugas-dan-fungsi-ppid"
color="foreground"
@ -201,7 +201,7 @@ export default function NavbarPPID() {
Tugas dan Fungsi PPID
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="struktur">
<Link
href="/portal-ppid/profile/struktur-ppid"
color="foreground"
@ -209,7 +209,7 @@ export default function NavbarPPID() {
Struktur PPID
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="visi">
<Link
href="/portal-ppid/profile/visi-dan-misi-ppid"
color="foreground"
@ -249,7 +249,7 @@ export default function NavbarPPID() {
base: "w-[350px]",
}}
>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="regis">
<Link
href="/portal-ppid/layanan-informasi/registrasi-permohonan"
color="foreground"
@ -257,7 +257,10 @@ export default function NavbarPPID() {
Registrasi Permohonan
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem
endContent={<ChevronRightIcon />}
key="p-informasi"
>
<Link
href="/portal-ppid/layanan-informasi/permohonan-informasi"
color="foreground"
@ -265,7 +268,10 @@ export default function NavbarPPID() {
Permohonan Informasi
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem
endContent={<ChevronRightIcon />}
key="p-keberatan"
>
<Link
href="/portal-ppid/layanan-informasi/permohonan-keberatan"
color="foreground"
@ -273,7 +279,7 @@ export default function NavbarPPID() {
Permohonan Keberatan
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="statistik">
<Link
href="/portal-ppid/layanan-informasi/statistik-rekapitulasi"
color="foreground"
@ -281,7 +287,7 @@ export default function NavbarPPID() {
Statistik / Rekapitulasi
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="laporan">
<Link
href="/portal-ppid/layanan-informasi/ppid-laporan-tahunan"
color="foreground"
@ -321,7 +327,10 @@ export default function NavbarPPID() {
base: "w-[350px]",
}}
>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem
endContent={<ChevronRightIcon />}
key="pelauyanan"
>
<Link
href="/portal-ppid/standar-layanan/alur-pelayanan-informasi-publik"
color="foreground"
@ -329,7 +338,10 @@ export default function NavbarPPID() {
Alur Pelayanan Informasi Publik Polri
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem
endContent={<ChevronRightIcon />}
key="permohonan"
>
<Link
href="/portal-ppid/standar-layanan/tata-cara-permohonan-informasi"
color="foreground"
@ -337,7 +349,7 @@ export default function NavbarPPID() {
Tata Cara Permohonan Informasi
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="keberatan">
<Link
href="/portal-ppid/standar-layanan/mekanisme-keberatan"
color="foreground"
@ -345,7 +357,7 @@ export default function NavbarPPID() {
Mekanisme Keberatan
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="sengketa">
<Link
href="/portal-ppid/standar-layanan/mekanisme-permohonan-penyelesaian-sengketa"
color="foreground"
@ -353,7 +365,10 @@ export default function NavbarPPID() {
Mekanisme Permohonan Penyelesainan Sengketa
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem
endContent={<ChevronRightIcon />}
key="waktu-pelayanan"
>
<Link
href="/portal-ppid/standar-layanan/waktu-pelayanan"
color="foreground"
@ -361,7 +376,7 @@ export default function NavbarPPID() {
Waktu Pelayanan
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="sbp">
<Link
href="/portal-ppid/standar-layanan/standar-biaya-pelayanan"
color="foreground"
@ -369,7 +384,7 @@ export default function NavbarPPID() {
Standar Biaya Pelayanan
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="maklumat">
<Link
href="/portal-ppid/standar-layanan/maklumat-pelayanan"
color="foreground"

View File

@ -121,7 +121,7 @@ export default function NavbarSatker() {
base: "w-[350px]",
}}
>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="ism">
<Link
href={
isPolda
@ -133,7 +133,7 @@ export default function NavbarSatker() {
Informasi Serta Merta
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="ib">
<Link
href={
isPolda
@ -145,7 +145,7 @@ export default function NavbarSatker() {
Informasi Berkala
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="iss">
<Link
href={
isPolda
@ -157,7 +157,7 @@ export default function NavbarSatker() {
Informasi Setiap Saat
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="ik">
<Link
href={
isPolda
@ -169,7 +169,7 @@ export default function NavbarSatker() {
Informasi Dikecualikan
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="ps">
<Link
href={
isPolda
@ -181,7 +181,7 @@ export default function NavbarSatker() {
Penerangan Satuan
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="uu">
<Link
href={
isPolda
@ -225,7 +225,7 @@ export default function NavbarSatker() {
base: "w-[350px]",
}}
>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="history">
<Link
href={
isPolda
@ -237,7 +237,7 @@ export default function NavbarSatker() {
Sejarah PPID Polri
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="profile">
<Link
href={
isPolda
@ -249,7 +249,7 @@ export default function NavbarSatker() {
Profile Singkat PPID
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="fungsi">
<Link
href={
isPolda
@ -261,7 +261,7 @@ export default function NavbarSatker() {
Tugas dan Fungsi PPID
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="struktur">
<Link
href={
isPolda
@ -273,7 +273,7 @@ export default function NavbarSatker() {
Struktur PPID
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="visi">
<Link
href={
isPolda
@ -317,7 +317,7 @@ export default function NavbarSatker() {
base: "w-[350px]",
}}
>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="regis">
<Link
href={
isPolda
@ -329,7 +329,10 @@ export default function NavbarSatker() {
Registrasi Permohonan
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem
endContent={<ChevronRightIcon />}
key="p-informasi"
>
<Link
href={
isPolda
@ -341,7 +344,10 @@ export default function NavbarSatker() {
Permohonan Informasi
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem
endContent={<ChevronRightIcon />}
key="p-keberatan"
>
<Link
href={
isPolda
@ -353,7 +359,7 @@ export default function NavbarSatker() {
Permohonan Keberatan
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="statistik">
<Link
href={
isPolda
@ -365,7 +371,7 @@ export default function NavbarSatker() {
Statistik / Rekapitulasi
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="laporan">
<Link
href={
isPolda
@ -409,7 +415,7 @@ export default function NavbarSatker() {
base: "w-[350px]",
}}
>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="pelayana">
<Link
href={
isPolda
@ -421,7 +427,10 @@ export default function NavbarSatker() {
Alur Pelayanan Informasi Publik Polri
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem
endContent={<ChevronRightIcon />}
key="permohonan"
>
<Link
href={
isPolda
@ -433,7 +442,7 @@ export default function NavbarSatker() {
Tata Cara Permohonan Informasi
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="keberatan">
<Link
href={
isPolda
@ -445,7 +454,7 @@ export default function NavbarSatker() {
Mekanisme Keberatan
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="sengketa">
<Link
href={
isPolda
@ -457,7 +466,7 @@ export default function NavbarSatker() {
Mekanisme Permohonan Penyelesainan Sengketa
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="pelayanan">
<Link
href={
isPolda
@ -469,7 +478,7 @@ export default function NavbarSatker() {
Waktu Pelayanan
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="sbp">
<Link
href={
isPolda
@ -481,7 +490,7 @@ export default function NavbarSatker() {
Standar Biaya Pelayanan
</Link>
</DropdownItem>
<DropdownItem endContent={<ChevronRightIcon />}>
<DropdownItem endContent={<ChevronRightIcon />} key="maklumat">
<Link
href={
isPolda

File diff suppressed because it is too large Load Diff

View File

@ -175,19 +175,22 @@ export default function ArticleTable() {
</Button>
</DropdownTrigger>
<DropdownMenu>
<DropdownItem>
<DropdownItem key="detail">
<Link href={`/admin/article/detail/${article.id}`}>
<EyeIconMdi className="inline mr-2 mb-1" />
Detail
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key="edit">
<Link href={`/admin/article/edit/${article.id}`}>
<CreateIconIon className="inline mr-2 mb-1" />
Edit
</Link>
</DropdownItem>
<DropdownItem onClick={() => handleDelete(article.id)}>
<DropdownItem
key="delete"
onClick={() => handleDelete(article.id)}
>
<DeleteIcon
color="red"
width={20}

View File

@ -177,19 +177,22 @@ export default function MagazineTable() {
</Button>
</DropdownTrigger>
<DropdownMenu>
<DropdownItem>
<DropdownItem key="detail">
<Link href={`/admin/magazine/detail/${article.id}`}>
<EyeIconMdi className="inline mr-2 mb-1" />
Detail
</Link>
</DropdownItem>
<DropdownItem>
<DropdownItem key="edit">
<Link href={`/admin/magazine/edit/${article.id}`}>
<CreateIconIon className="inline mr-2 mb-1" />
Edit
</Link>
</DropdownItem>
<DropdownItem onClick={() => handleDelete(article.id)}>
<DropdownItem
key="delete"
onClick={() => handleDelete(article.id)}
>
<DeleteIcon
color="red"
width={20}

View File

@ -248,15 +248,24 @@ export default function CategoriesTable(props: { triggerRefresh: boolean }) {
</Button>
</DropdownTrigger>
<DropdownMenu>
<DropdownItem onClick={() => openModal(category.id, true)}>
<DropdownItem
key="Detail"
onClick={() => openModal(category.id, true)}
>
<EyeIconMdi className="inline mr-2 mb-1" />
Detail
</DropdownItem>
<DropdownItem onClick={() => openModal(category.id, false)}>
<DropdownItem
key="Edit"
onClick={() => openModal(category.id, false)}
>
<CreateIconIon className="inline mr-2 mb-1" />
Edit
</DropdownItem>
<DropdownItem onClick={() => handleDelete(category.id)}>
<DropdownItem
key="Delete"
onClick={() => handleDelete(category.id)}
>
<DeleteIcon
color="red"
size={20}

View File

@ -208,7 +208,7 @@ export default function MasterRoleTable() {
</Button>
</DropdownTrigger>
<DropdownMenu>
<DropdownItem>
<DropdownItem key="detail">
<Link href={`/admin/master-role/detail/${role.id}`}>
<EyeIconMdi className="inline mr-2 mb-1" />
Detail
@ -220,7 +220,10 @@ export default function MasterRoleTable() {
Edit
</Link>
</DropdownItem> */}
<DropdownItem onClick={() => handleDelete(role.id)}>
<DropdownItem
key="delete"
onClick={() => handleDelete(role.id)}
>
<DeleteIcon
color="red"
width={20}

View File

@ -147,13 +147,16 @@ export default function MasterUserTable() {
</Button>
</DropdownTrigger>
<DropdownMenu>
<DropdownItem>
<DropdownItem key="Edit">
<Link href={`/admin/master-user/edit/${user.id}`}>
<CreateIconIon className="inline mr-2 mb-1" />
Edit
</Link>
</DropdownItem>
<DropdownItem onClick={() => handleDelete(user.id)}>
<DropdownItem
key="Delete"
onClick={() => handleDelete(user.id)}
>
<DeleteIcon
color="red"
width={20}

View File

@ -1,231 +1,221 @@
"use client";
import {
TableCell,
TableRow,
Table,
TableHeader,
TableColumn,
TableBody,
Pagination,
Dropdown,
DropdownTrigger,
DropdownMenu,
DropdownItem,
Input,
User,
Card,
Divider,
Chip,
ChipProps,
TableCell,
TableRow,
Table,
TableHeader,
TableColumn,
TableBody,
Pagination,
Dropdown,
DropdownTrigger,
DropdownMenu,
DropdownItem,
Input,
User,
Card,
Divider,
Chip,
ChipProps,
} from "@nextui-org/react";
import { Button } from "@nextui-org/button";
import React, { Key, useCallback, useMemo, useState } from "react";
import {
AddIcon,
CreateIconIon,
DeleteIcon,
DotsYIcon,
EyeFilledIcon,
EyeIconMdi,
AddIcon,
CreateIconIon,
DeleteIcon,
DotsYIcon,
EyeFilledIcon,
EyeIconMdi,
} from "@/components/icons";
import Link from "next/link";
type UserObject = {
id: number;
name: string;
status: string;
description: string;
moduleName: string;
pathUrl: string;
id: number;
name: string;
status: string;
description: string;
moduleName: string;
pathUrl: string;
};
const statusColorMap = {
active: "success",
paused: "danger",
vacation: "warning",
active: "success",
paused: "danger",
vacation: "warning",
};
export default function MenuDataTable() {
type TableRow = (typeof menuDataTable)[0];
type TableRow = (typeof menuDataTable)[0];
const columns = [
{ name: "No", uid: "no" },
{ name: "Name", uid: "name" },
{ name: "Description", uid: "description" },
{ name: "Module Name", uid: "moduleName" },
{ name: "Path URL", uid: "pathUrl" },
{ name: "Status", uid: "status" },
{ name: "Action", uid: "actions" },
];
const columns = [
{ name: "No", uid: "no" },
{ name: "Name", uid: "name" },
{ name: "Description", uid: "description" },
{ name: "Module Name", uid: "moduleName" },
{ name: "Path URL", uid: "pathUrl" },
{ name: "Status", uid: "status" },
{ name: "Action", uid: "actions" },
];
const menuDataTable = [
{
id: 1,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
moduleName: "Multipool Acts",
pathUrl: "/admin/acts",
},
{
id: 2,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
moduleName: "Multipool Acts",
pathUrl: "/admin/acts",
},
{
id: 3,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
moduleName: "Multipool Acts",
pathUrl: "/admin/acts",
},
{
id: 4,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
moduleName: "Multipool Acts",
pathUrl: "/admin/acts",
},
{
id: 5,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
moduleName: "Multipool Acts",
pathUrl: "/admin/acts",
},
];
const menuDataTable = [
{
id: 1,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
moduleName: "Multipool Acts",
pathUrl: "/admin/acts",
},
{
id: 2,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
moduleName: "Multipool Acts",
pathUrl: "/admin/acts",
},
{
id: 3,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
moduleName: "Multipool Acts",
pathUrl: "/admin/acts",
},
{
id: 4,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
moduleName: "Multipool Acts",
pathUrl: "/admin/acts",
},
{
id: 5,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
moduleName: "Multipool Acts",
pathUrl: "/admin/acts",
},
];
const renderCell = useCallback((menuData: TableRow, columnKey: Key) => {
const cellValue = menuData[columnKey as keyof UserObject];
const statusColorMap: Record<string, ChipProps["color"]> = {
active: "success",
cancel: "danger",
pending: "warning",
};
const renderCell = useCallback((menuData: TableRow, columnKey: Key) => {
const cellValue = menuData[columnKey as keyof UserObject];
const statusColorMap: Record<string, ChipProps["color"]> = {
active: "success",
cancel: "danger",
pending: "warning",
};
switch (columnKey) {
case "no":
return (
<div>{menuData.id}</div>
)
switch (columnKey) {
case "no":
return <div>{menuData.id}</div>;
case "name":
return (
<div className="w-[150px]">{menuData.name}</div>
)
case "name":
return <div className="w-[150px]">{menuData.name}</div>;
case "description":
return (
<div className="">{menuData.description}</div>
)
case "description":
return <div className="">{menuData.description}</div>;
case "status":
return (
<Chip
className="capitalize "
color={statusColorMap[menuData.status]}
size="lg"
variant="flat"
>
<div className="flex flex-row items-center gap-2 justify-center">
{cellValue}
</div>
</Chip>
);
case "actions":
return (
<div className="relative flex justify-star items-center gap-2">
<Dropdown className="lg:min-w-[150px] bg-black text-white shadow border ">
<DropdownTrigger>
<Button isIconOnly size="lg" variant="light">
<DotsYIcon className="text-default-300" />
</Button>
</DropdownTrigger>
<DropdownMenu>
<DropdownItem
>
<Link
href={`/admin/magazine/detail`}
>
<EyeIconMdi className="inline mr-2 mb-1" />
Detail
</Link>
</DropdownItem>
<DropdownItem
>
<Link
href={`#`}
>
<CreateIconIon className="inline mr-2 mb-1" />
Edit
</Link>
</DropdownItem>
<DropdownItem
>
<Link
href={`#`}
>
<DeleteIcon
width={20}
height={16}
className="inline mr-2 mb-1"
/>
Delete
</Link>
</DropdownItem>
</DropdownMenu>
</Dropdown>
</div>
);
default:
return cellValue;
}
}, []);
return (
<>
<div className="mx-3 my-5">
<Link href="/admin/master/master-menu/menu-data/create" >
<Button className="my-3 bg-blue-600 text-white" ><CreateIconIon />Add Master Menu</Button>
</Link>
<div className="flex flex-col items-center rounded-2xl">
<Table
// selectionMode="multiple"
aria-label="micro issue table"
className="rounded-xl"
classNames={{
th: "bg-white dark:bg-black text-black dark:text-white border-b-1 text-md",
base: "bg-white dark:bg-black border",
wrapper: "min-h-[50px] bg-transpararent text-black dark:text-white ",
}}
>
<TableHeader columns={columns}>
{(column) => (
<TableColumn key={column.uid}>{column.name}</TableColumn>
)}
</TableHeader>
<TableBody items={menuDataTable} emptyContent={"No data to display."}>
{(item) => (
<TableRow key={item.id}>
{(columnKey) => (
<TableCell>{renderCell(item, columnKey)}</TableCell>
)}
</TableRow>
)}
</TableBody>
</Table>
</div>
case "status":
return (
<Chip
className="capitalize "
color={statusColorMap[menuData.status]}
size="lg"
variant="flat"
>
<div className="flex flex-row items-center gap-2 justify-center">
{cellValue}
</div>
</Chip>
);
</>
);
case "actions":
return (
<div className="relative flex justify-star items-center gap-2">
<Dropdown className="lg:min-w-[150px] bg-black text-white shadow border ">
<DropdownTrigger>
<Button isIconOnly size="lg" variant="light">
<DotsYIcon className="text-default-300" />
</Button>
</DropdownTrigger>
<DropdownMenu>
<DropdownItem key={"Detail"}>
<Link href={`/admin/magazine/detail`}>
<EyeIconMdi className="inline mr-2 mb-1" />
Detail
</Link>
</DropdownItem>
<DropdownItem key={"Edit"}>
<Link href={`#`}>
<CreateIconIon className="inline mr-2 mb-1" />
Edit
</Link>
</DropdownItem>
<DropdownItem key={"Delete"}>
<Link href={`#`}>
<DeleteIcon
width={20}
height={16}
className="inline mr-2 mb-1"
/>
Delete
</Link>
</DropdownItem>
</DropdownMenu>
</Dropdown>
</div>
);
default:
return cellValue;
}
}, []);
return (
<>
<div className="mx-3 my-5">
<Link href="/admin/master/master-menu/menu-data/create">
<Button className="my-3 bg-blue-600 text-white">
<CreateIconIon />
Add Master Menu
</Button>
</Link>
<div className="flex flex-col items-center rounded-2xl">
<Table
// selectionMode="multiple"
aria-label="micro issue table"
className="rounded-xl"
classNames={{
th: "bg-white dark:bg-black text-black dark:text-white border-b-1 text-md",
base: "bg-white dark:bg-black border",
wrapper:
"min-h-[50px] bg-transpararent text-black dark:text-white ",
}}
>
<TableHeader columns={columns}>
{(column) => (
<TableColumn key={column.uid}>{column.name}</TableColumn>
)}
</TableHeader>
<TableBody
items={menuDataTable}
emptyContent={"No data to display."}
>
{(item) => (
<TableRow key={item.id}>
{(columnKey) => (
<TableCell>{renderCell(item, columnKey)}</TableCell>
)}
</TableRow>
)}
</TableBody>
</Table>
</div>
</div>
</>
);
}

View File

@ -1,224 +1,214 @@
"use client";
import {
TableCell,
TableRow,
Table,
TableHeader,
TableColumn,
TableBody,
Pagination,
Dropdown,
DropdownTrigger,
DropdownMenu,
DropdownItem,
Input,
User,
Card,
Divider,
Chip,
ChipProps,
TableCell,
TableRow,
Table,
TableHeader,
TableColumn,
TableBody,
Pagination,
Dropdown,
DropdownTrigger,
DropdownMenu,
DropdownItem,
Input,
User,
Card,
Divider,
Chip,
ChipProps,
} from "@nextui-org/react";
import { Button } from "@nextui-org/button";
import React, { Key, useCallback, useMemo, useState } from "react";
import {
AddIcon,
CreateIconIon,
DeleteIcon,
DotsYIcon,
EyeFilledIcon,
EyeIconMdi,
AddIcon,
CreateIconIon,
DeleteIcon,
DotsYIcon,
EyeFilledIcon,
EyeIconMdi,
} from "@/components/icons";
import Link from "next/link";
type UserObject = {
id: number;
name: string;
status: string;
description: string;
pathUrl: string;
id: number;
name: string;
status: string;
description: string;
pathUrl: string;
};
const statusColorMap = {
active: "success",
paused: "danger",
vacation: "warning",
active: "success",
paused: "danger",
vacation: "warning",
};
export default function MasterModuleTable() {
type TableRow = (typeof masterModuleTable)[0];
type TableRow = (typeof masterModuleTable)[0];
const columns = [
{ name: "No", uid: "no" },
{ name: "Name", uid: "name" },
{ name: "Description", uid: "description" },
{ name: "Path URL", uid: "pathUrl" },
{ name: "Status", uid: "status" },
{ name: "Action", uid: "actions" },
];
const columns = [
{ name: "No", uid: "no" },
{ name: "Name", uid: "name" },
{ name: "Description", uid: "description" },
{ name: "Path URL", uid: "pathUrl" },
{ name: "Status", uid: "status" },
{ name: "Action", uid: "actions" },
];
const masterModuleTable = [
{
id: 1,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
pathUrl: "/admin/acts",
},
{
id: 2,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
pathUrl: "/admin/acts",
},
{
id: 3,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
pathUrl: "/admin/acts",
},
{
id: 4,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
pathUrl: "/admin/acts",
},
{
id: 5,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
pathUrl: "/admin/acts",
},
];
const masterModuleTable = [
{
id: 1,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
pathUrl: "/admin/acts",
},
{
id: 2,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
pathUrl: "/admin/acts",
},
{
id: 3,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
pathUrl: "/admin/acts",
},
{
id: 4,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
pathUrl: "/admin/acts",
},
{
id: 5,
name: "AI Journalist ",
status: "active",
description: "AI Journalist",
pathUrl: "/admin/acts",
},
];
const renderCell = useCallback((masterModule: TableRow, columnKey: Key) => {
const cellValue = masterModule[columnKey as keyof UserObject];
const statusColorMap: Record<string, ChipProps["color"]> = {
active: "success",
cancel: "danger",
pending: "warning",
};
const renderCell = useCallback((masterModule: TableRow, columnKey: Key) => {
const cellValue = masterModule[columnKey as keyof UserObject];
const statusColorMap: Record<string, ChipProps["color"]> = {
active: "success",
cancel: "danger",
pending: "warning",
};
switch (columnKey) {
case "no":
return (
<div>{masterModule.id}</div>
)
switch (columnKey) {
case "no":
return <div>{masterModule.id}</div>;
case "name":
return (
<div className="w-[150px]">{masterModule.name}</div>
)
case "name":
return <div className="w-[150px]">{masterModule.name}</div>;
case "description":
return (
<div className="">{masterModule.description}</div>
)
case "description":
return <div className="">{masterModule.description}</div>;
case "status":
return (
<Chip
className="capitalize "
color={statusColorMap[masterModule.status]}
size="lg"
variant="flat"
>
<div className="flex flex-row items-center gap-2 justify-center">
{cellValue}
</div>
</Chip>
);
case "actions":
return (
<div className="relative flex justify-star items-center gap-2">
<Dropdown className="lg:min-w-[150px] bg-black text-white shadow border ">
<DropdownTrigger>
<Button isIconOnly size="lg" variant="light">
<DotsYIcon className="text-default-300" />
</Button>
</DropdownTrigger>
<DropdownMenu>
<DropdownItem
>
<Link
href={`/admin/magazine/detail`}
>
<EyeIconMdi className="inline mr-2 mb-1" />
Detail
</Link>
</DropdownItem>
<DropdownItem
>
<Link
href={`#`}
>
<CreateIconIon className="inline mr-2 mb-1" />
Edit
</Link>
</DropdownItem>
<DropdownItem
>
<Link
href={`#`}
>
<DeleteIcon
width={20}
height={16}
className="inline mr-2 mb-1"
/>
Delete
</Link>
</DropdownItem>
</DropdownMenu>
</Dropdown>
</div>
);
default:
return cellValue;
}
}, []);
return (
<>
<div className="mx-3 my-5">
<Link href="/admin/master/master-module/create" >
<Button className="my-3 bg-blue-600 text-white" ><CreateIconIon />Add Master Module</Button>
</Link>
<div className="flex flex-col items-center rounded-2xl">
<Table
// selectionMode="multiple"
aria-label="micro issue table"
className="rounded-xl"
classNames={{
th: "bg-white dark:bg-black text-black dark:text-white border-b-1 text-md",
base: "bg-white dark:bg-black border",
wrapper: "min-h-[50px] bg-transpararent text-black dark:text-white ",
}}
>
<TableHeader columns={columns}>
{(column) => (
<TableColumn key={column.uid}>{column.name}</TableColumn>
)}
</TableHeader>
<TableBody items={masterModuleTable} emptyContent={"No data to display."}>
{(item) => (
<TableRow key={item.id}>
{(columnKey) => (
<TableCell>{renderCell(item, columnKey)}</TableCell>
)}
</TableRow>
)}
</TableBody>
</Table>
</div>
case "status":
return (
<Chip
className="capitalize "
color={statusColorMap[masterModule.status]}
size="lg"
variant="flat"
>
<div className="flex flex-row items-center gap-2 justify-center">
{cellValue}
</div>
</Chip>
);
</>
);
case "actions":
return (
<div className="relative flex justify-star items-center gap-2">
<Dropdown className="lg:min-w-[150px] bg-black text-white shadow border ">
<DropdownTrigger>
<Button isIconOnly size="lg" variant="light">
<DotsYIcon className="text-default-300" />
</Button>
</DropdownTrigger>
<DropdownMenu>
<DropdownItem key="Detail">
<Link href={`/admin/magazine/detail`}>
<EyeIconMdi className="inline mr-2 mb-1" />
Detail
</Link>
</DropdownItem>
<DropdownItem key="Edit">
<Link href={`#`}>
<CreateIconIon className="inline mr-2 mb-1" />
Edit
</Link>
</DropdownItem>
<DropdownItem key="Delete">
<Link href={`#`}>
<DeleteIcon
width={20}
height={16}
className="inline mr-2 mb-1"
/>
Delete
</Link>
</DropdownItem>
</DropdownMenu>
</Dropdown>
</div>
);
default:
return cellValue;
}
}, []);
return (
<>
<div className="mx-3 my-5">
<Link href="/admin/master/master-module/create">
<Button className="my-3 bg-blue-600 text-white">
<CreateIconIon />
Add Master Module
</Button>
</Link>
<div className="flex flex-col items-center rounded-2xl">
<Table
// selectionMode="multiple"
aria-label="micro issue table"
className="rounded-xl"
classNames={{
th: "bg-white dark:bg-black text-black dark:text-white border-b-1 text-md",
base: "bg-white dark:bg-black border",
wrapper:
"min-h-[50px] bg-transpararent text-black dark:text-white ",
}}
>
<TableHeader columns={columns}>
{(column) => (
<TableColumn key={column.uid}>{column.name}</TableColumn>
)}
</TableHeader>
<TableBody
items={masterModuleTable}
emptyContent={"No data to display."}
>
{(item) => (
<TableRow key={item.id}>
{(columnKey) => (
<TableCell>{renderCell(item, columnKey)}</TableCell>
)}
</TableRow>
)}
</TableBody>
</Table>
</div>
</div>
</>
);
}

View File

@ -1,241 +1,233 @@
"use client";
import {
TableCell,
TableRow,
Table,
TableHeader,
TableColumn,
TableBody,
Pagination,
Dropdown,
DropdownTrigger,
DropdownMenu,
DropdownItem,
Input,
User,
Card,
Divider,
Chip,
ChipProps,
TableCell,
TableRow,
Table,
TableHeader,
TableColumn,
TableBody,
Pagination,
Dropdown,
DropdownTrigger,
DropdownMenu,
DropdownItem,
Input,
User,
Card,
Divider,
Chip,
ChipProps,
} from "@nextui-org/react";
import { Button } from "@nextui-org/button";
import React, { Key, useCallback, useEffect, useMemo, useState } from "react";
import {
AddIcon,
CreateIconIon,
DeleteIcon,
DotsYIcon,
EyeFilledIcon,
EyeIconMdi,
AddIcon,
CreateIconIon,
DeleteIcon,
DotsYIcon,
EyeFilledIcon,
EyeIconMdi,
} from "@/components/icons";
import Link from "next/link";
import { getAllUserLevels } from "@/services/user-levels/user-levels-service";
type UserObject = {
id: number;
name: string;
levelNumber: string;
aliasName: string;
parentLevelId: string;
provinceId: string;
status: string;
id: number;
name: string;
levelNumber: string;
aliasName: string;
parentLevelId: string;
provinceId: string;
status: string;
};
const statusColorMap = {
active: "success",
paused: "danger",
vacation: "warning",
active: "success",
paused: "danger",
vacation: "warning",
};
export default function MasterUserLevelTable() {
const [totalPage, setTotalPage] = useState(1);
const [masterUserLevelTable, setmasterUserLevel] = useState<UserObject[]>([]);
const [totalPage, setTotalPage] = useState(1);
const [masterUserLevelTable, setmasterUserLevel] = useState<UserObject[]>([]);
type TableRow = (typeof masterUserLevelTable)[0];
type TableRow = (typeof masterUserLevelTable)[0];
const columns = [
{ name: "No", uid: "no" },
{ name: "Name", uid: "name" },
{ name: "User Name", uid: "alias_name" },
{ name: "Level Number", uid: "level_number" },
{ name: "Parent Level", uid: "parent_level_id" },
{ name: "Province", uid: "province_id" },
{ name: "Status", uid: "is_active" },
{ name: "Action", uid: "actions" },
];
const columns = [
{ name: "No", uid: "no" },
{ name: "Name", uid: "name" },
{ name: "User Name", uid: "alias_name" },
{ name: "Level Number", uid: "level_number" },
{ name: "Parent Level", uid: "parent_level_id" },
{ name: "Province", uid: "province_id" },
{ name: "Status", uid: "is_active" },
{ name: "Action", uid: "actions" },
];
const [page, setPage] = useState(1);
const [page, setPage] = useState(1);
useEffect(() => {
fetchData();
}, []);
useEffect(() => {
fetchData();
}, []);
async function fetchData() {
const request = {
page: page,
limit: 10,
async function fetchData() {
const request = {
page: page,
limit: 10,
};
const res = await getAllUserLevels(request);
const data = res?.data?.data;
setTotalPage(Math.ceil(res?.data?.total / 10));
initUserData(10, data);
}
};
const res = await getAllUserLevels(request);
const data = res?.data?.data;
setTotalPage(Math.ceil(res?.data?.total / 10));
initUserData(10, data);
function initUserData(limit: number, data?: any) {
if (data) {
console.log(data);
const startIndex = limit * (page - 1);
let iterate = 0;
const newData = data.map((value: any) => {
iterate++;
value.no = startIndex + iterate;
return value;
});
console.log("Data ::", newData);
setmasterUserLevel(newData);
}
}
function initUserData(limit: number, data?: any) {
if (data) {
console.log(data);
const startIndex = limit * (page - 1);
let iterate = 0;
const newData = data.map((value: any) => {
iterate++;
value.no = startIndex + iterate;
return value;
});
console.log("Data ::", newData);
setmasterUserLevel(newData);
}
}
const renderCell = useCallback(
(masterUserLevel: TableRow, columnKey: Key) => {
const cellValue = masterUserLevel[columnKey as keyof UserObject];
const statusColorMap: Record<string, ChipProps["color"]> = {
active: "success",
cancel: "danger",
pending: "warning",
};
const renderCell = useCallback((masterUserLevel: TableRow, columnKey: Key) => {
const cellValue = masterUserLevel[columnKey as keyof UserObject];
const statusColorMap: Record<string, ChipProps["color"]> = {
active: "success",
cancel: "danger",
pending: "warning",
};
switch (columnKey) {
case "no":
return <div>{masterUserLevel.id}</div>;
switch (columnKey) {
case "no":
return (
<div>{masterUserLevel.id}</div>
)
case "name":
return <div className="w-[150px]">{masterUserLevel.name}</div>;
case "name":
return (
<div className="w-[150px]">{masterUserLevel.name}</div>
)
case "alias_Name":
return <div className="">{masterUserLevel.aliasName}</div>;
case "is_active":
return (
<Chip
className="capitalize "
color={statusColorMap[masterUserLevel.status]}
size="lg"
variant="flat"
>
<div className="flex flex-row items-center gap-2 justify-center">
{cellValue}
</div>
</Chip>
);
case "alias_Name":
return (
<div className="">{masterUserLevel.aliasName}</div>
)
case "is_active":
return (
<Chip
className="capitalize "
color={statusColorMap[masterUserLevel.status]}
size="lg"
variant="flat"
>
<div className="flex flex-row items-center gap-2 justify-center">
{cellValue}
</div>
</Chip>
);
case "actions":
return (
<div className="relative flex justify-star items-center gap-2">
<Dropdown className="lg:min-w-[150px] bg-black text-white shadow border ">
<DropdownTrigger>
<Button isIconOnly size="lg" variant="light">
<DotsYIcon className="text-default-300" />
</Button>
</DropdownTrigger>
<DropdownMenu>
<DropdownItem
>
<Link
href={`/admin/magazine/detail`}
>
<EyeIconMdi className="inline mr-2 mb-1" />
Detail
</Link>
</DropdownItem>
<DropdownItem
>
<Link
href={`#`}
>
<CreateIconIon className="inline mr-2 mb-1" />
Edit
</Link>
</DropdownItem>
<DropdownItem
>
<Link
href={`#`}
>
<DeleteIcon
width={20}
height={16}
className="inline mr-2 mb-1"
/>
Delete
</Link>
</DropdownItem>
</DropdownMenu>
</Dropdown>
</div>
);
default:
return cellValue;
}
}, []);
return (
<>
<div className="mx-3 my-5">
<Link href="/admin/master/master-user-level/create" >
<Button className="my-3 bg-blue-600 text-white" ><CreateIconIon />Create New User Level</Button>
</Link>
<div className="flex flex-col items-center rounded-2xl">
<Table
// selectionMode="multiple"
aria-label="micro issue table"
className="rounded-xl"
classNames={{
th: "bg-white dark:bg-black text-black dark:text-white border-b-1 text-md",
base: "bg-white dark:bg-black border",
wrapper: "min-h-[50px] bg-transpararent text-black dark:text-white ",
}}
>
<TableHeader columns={columns}>
{(column) => (
<TableColumn key={column.uid}>{column.name}</TableColumn>
)}
</TableHeader>
<TableBody items={masterUserLevelTable} emptyContent={"No data to display."}>
{(item) => (
<TableRow key={item.id}>
{(columnKey) => (
<TableCell>{renderCell(item, columnKey)}</TableCell>
)}
</TableRow>
)}
</TableBody>
</Table>
<div className="mt-2">
<Pagination
isCompact
showControls
showShadow
color="primary"
classNames={{
base: "bg-transparent",
wrapper: "bg-transparent",
}}
page={page}
total={totalPage}
onChange={(page) => setPage(page)}
/>
</div>
</div>
case "actions":
return (
<div className="relative flex justify-star items-center gap-2">
<Dropdown className="lg:min-w-[150px] bg-black text-white shadow border ">
<DropdownTrigger>
<Button isIconOnly size="lg" variant="light">
<DotsYIcon className="text-default-300" />
</Button>
</DropdownTrigger>
<DropdownMenu>
<DropdownItem key="Detail">
<Link href={`/admin/magazine/detail`}>
<EyeIconMdi className="inline mr-2 mb-1" />
Detail
</Link>
</DropdownItem>
<DropdownItem key="Edit">
<Link href={`#`}>
<CreateIconIon className="inline mr-2 mb-1" />
Edit
</Link>
</DropdownItem>
<DropdownItem key="Delete">
<Link href={`#`}>
<DeleteIcon
width={20}
height={16}
className="inline mr-2 mb-1"
/>
Delete
</Link>
</DropdownItem>
</DropdownMenu>
</Dropdown>
</div>
);
</>
);
default:
return cellValue;
}
},
[]
);
return (
<>
<div className="mx-3 my-5">
<Link href="/admin/master/master-user-level/create">
<Button className="my-3 bg-blue-600 text-white">
<CreateIconIon />
Create New User Level
</Button>
</Link>
<div className="flex flex-col items-center rounded-2xl">
<Table
// selectionMode="multiple"
aria-label="micro issue table"
className="rounded-xl"
classNames={{
th: "bg-white dark:bg-black text-black dark:text-white border-b-1 text-md",
base: "bg-white dark:bg-black border",
wrapper:
"min-h-[50px] bg-transpararent text-black dark:text-white ",
}}
>
<TableHeader columns={columns}>
{(column) => (
<TableColumn key={column.uid}>{column.name}</TableColumn>
)}
</TableHeader>
<TableBody
items={masterUserLevelTable}
emptyContent={"No data to display."}
>
{(item) => (
<TableRow key={item.id}>
{(columnKey) => (
<TableCell>{renderCell(item, columnKey)}</TableCell>
)}
</TableRow>
)}
</TableBody>
</Table>
<div className="mt-2">
<Pagination
isCompact
showControls
showShadow
color="primary"
classNames={{
base: "bg-transparent",
wrapper: "bg-transparent",
}}
page={page}
total={totalPage}
onChange={(page) => setPage(page)}
/>
</div>
</div>
</div>
</>
);
}

View File

@ -157,13 +157,16 @@ export default function StaticPageTable() {
Detail
</Link>
</DropdownItem> */}
<DropdownItem>
<DropdownItem key={"edit"}>
<Link href={`/admin/static-page/edit/${article.id}`}>
<CreateIconIon className="inline mr-2 mb-1" size={20} />
Edit
</Link>
</DropdownItem>
<DropdownItem onClick={() => handleDelete(article.id)}>
<DropdownItem
key={"delete"}
onClick={() => handleDelete(article.id)}
>
<DeleteIcon
color="red"
width={20}