import React, { useState } from "react"; import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { Button } from "@/components/ui/button"; import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; import { ControllerTableItems } from "@/constants"; import Link from "next/link"; import { Decrypt, convertDate } from "@/lib/utils"; import useData from "@/store/useData"; import { Label } from "./ui/label"; import { Input } from "./ui/input"; import { useRouter } from "next/navigation"; import { toast } from "sonner"; import { ScrollArea } from "./ui/scroll-area"; import secureLocalStorage from "react-secure-storage"; import { Checkbox } from "./ui/checkbox"; import { Skeleton } from "./ui/skeleton"; interface Complaint { id: string; trackingNumber: string; title: string; category: { id: string; title: string; description: string; }; complaintOrganization: { id: string; title: string; description: string; }; status: number; registeredAt: string; lastChanged: string; lastActor: number; cipherKeyInspector: string; } export default function TableController({ data, pageSize, currentPage }: { data: Complaint[]; pageSize: number; currentPage: number; }) { const router = useRouter(); return (