"use client"; import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, } from "@nextui-org/react"; import { ColumnDef } from "@tanstack/react-table"; import { add } from "date-fns"; import { VerticalDotsIcon } from "@/components/icons"; import { StatusBadge } from "@/components/ui"; import { ProviderProps } from "@/types"; import { CheckConnectionProvider } from "../CheckConnectionProvider"; import { DateWithTime } from "../DateWithTime"; import { DeleteProvider } from "../DeleteProvider"; import { ProviderInfo } from "../ProviderInfo"; const getProviderData = (row: { original: ProviderProps }) => { return row.original; }; export const ColumnsProvider: ColumnDef[] = [ { header: "ID", cell: ({ row }) =>

{row.index + 1}

, }, { accessorKey: "account", header: "Account", cell: ({ row }) => { const { attributes: { connection, provider, alias, provider_id }, } = getProviderData(row); return ( ); }, }, { accessorKey: "status", header: "Scan Status", cell: () => { // Temporarily overwriting the value until the API is functional. return ; }, }, { accessorKey: "lastScan", header: "Last Scan", cell: ({ row }) => { const { attributes: { updated_at }, } = getProviderData(row); return ; }, }, { accessorKey: "nextScan", header: "Next Scan", cell: ({ row }) => { const { attributes: { updated_at }, } = getProviderData(row); const nextDay = add(new Date(updated_at), { hours: 24, }); return ; }, }, { accessorKey: "resources", header: "Resources", cell: () => { // Temporarily overwriting the value until the API is functional. return

{288}

; }, }, { accessorKey: "added", header: "Added", cell: ({ row }) => { const { attributes: { inserted_at }, } = getProviderData(row); return ; }, }, { accessorKey: "actions", header: () =>
Actions
, id: "actions", cell: ({ row }) => { const { id } = getProviderData(row); return (
); }, }, ];