"use client"; import type { RouterOutputs } from "@openstatus/api"; import type { ColumnDef } from "@tanstack/react-table"; import Link from "next/link"; import { DataTableColumnHeader } from "@/components/ui/data-table/data-table-column-header"; import { TableCellBadge } from "../table-cell-badge"; import { TableCellDate } from "../table-cell-date"; import { DataTableRowActions } from "./data-table-row-actions"; type PrivateLocation = RouterOutputs["privateLocation"]["list"][number]; export const columns: ColumnDef[] = [ { accessorKey: "name", header: ({ column }) => ( ), enableHiding: false, }, { accessorKey: "lastSeenAt", header: ({ column }) => ( ), enableHiding: false, cell: ({ row }) => { const value = row.getValue("lastSeenAt"); return ; }, }, { accessorKey: "monitors", header: "Monitors", enableSorting: false, enableHiding: false, cell: ({ row }) => { const value = row.getValue("monitors"); if (Array.isArray(value) && value.length > 0 && "name" in value[0]) { return (
{value.map((m) => ( ))}
); } return -; }, meta: { cellClassName: "tabular-nums font-mono", }, }, { id: "actions", cell: ({ row }) => , meta: { cellClassName: "w-8", }, }, ];