diff --git a/app/dashboard/layout.tsx b/app/dashboard/layout.tsx index 3a6a94c..4a2173f 100644 --- a/app/dashboard/layout.tsx +++ b/app/dashboard/layout.tsx @@ -1,5 +1,5 @@ import { AppSidebar } from "@/components/ui/app-sidebar" -import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar" +import { SidebarProvider } from "@/components/ui/sidebar" export default function DashboardLayout({ children, diff --git a/app/dashboard/spesific-target/page.tsx b/app/dashboard/spesific-target/page.tsx new file mode 100644 index 0000000..f20077d --- /dev/null +++ b/app/dashboard/spesific-target/page.tsx @@ -0,0 +1,16 @@ +"use client" +import SpesificTargetTable from "@/components/table/spesific-target/spesific-target-table" +import dynamic from "next/dynamic" + +const Navbar = dynamic(() => import("@/components/ui/navbar"), { + ssr: false, +}) + +export default function SpesificTarget() { + return ( +
+ + +
+ ) +} diff --git a/components/table/spesific-target/spesific-target-table.tsx b/components/table/spesific-target/spesific-target-table.tsx new file mode 100644 index 0000000..d4ab50a --- /dev/null +++ b/components/table/spesific-target/spesific-target-table.tsx @@ -0,0 +1,252 @@ +"use client" + +import { ReloadIcon } from "@/components/icons" +import { Button } from "@/components/ui/button" +import { Checkbox } from "@/components/ui/checkbox" +import { Input } from "@/components/ui/input" +import { + InputGroup, + InputGroupAddon, + InputGroupInput, +} from "@/components/ui/input-group" +import { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select" +import { + Table, + TableBody, + TableCell, + TableFooter, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table" +import { ChevronLeft, ChevronRight, PlusIcon, SearchIcon } from "lucide-react" +import { useEffect, useState } from "react" +import { + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog" + +const dummyData = [ + { + id: "1", + name: "POLRI - DIV Humas", + status: 1, + }, + { + id: "2", + name: "POLRI - Korlantas", + status: 2, + }, + { + id: "3", + name: "TNI", + status: 3, + }, + { + id: "4", + name: "DPR", + status: 4, + }, +] + +export default function SpesificTargetTable() { + const [selectedTarget, setSelectedTarget] = useState("") + const [search, setSearch] = useState("") + const [limit, setLimit] = useState("5") + const [page, setPage] = useState(1) + // const [totalPage, setTotalPage] = useState(1) + const [selectedDataTable, setSelectedDataTable] = useState([]) + const [isOpen, setIsOpen] = useState(false) + const [formStatus, setFormStatus] = useState<"create" | "edit">("create") + + const getData = async () => { + const req = { + search: search, + page: page, + limit: limit, + } + console.log("request", req) + } + useEffect(() => { + getData() + }, [page, limit]) + + const resetFilter = () => { + setSearch("") + setPage(1) + getData() + } + + return ( +
+
+

Spesific Target

+

+ Manage your Spesific Target +

+ +
+
+

Search

+ + setSearch(e.target.value)} + id="inline-end-input" + type="text" + placeholder="Search e.g name" + /> + + setViewPassword(!viewPassword)} + > + + + + +
+ + + +
+
+ + +
+ + + + NO + Name + + Action + + + + {dummyData.map((target, index) => ( + + {index + 1} + {target.name} + + + + + + + ))} + + + + +
+

ROWS PER PAGE:

+ + + + + + + +
+
+
+
+
+
+ + + + + {formStatus == "create" + ? "Add New Spesific Target" + : "Edit Spesific Target"} + + +
+

name

+ setSelectedTarget(e.target.value)} + className="h-10 rounded-lg border border-violet-300 bg-transparent text-black outline-none focus:border-transparent focus:ring-0 focus:outline-none" + /> +
+ + + + + + + +
+
+
+ ) +}