import { Dialog, DialogTrigger, DialogClose, DialogDescription, DialogContent, DialogTitle, DialogHeader, DialogFooter } from "@/components/ui/dialog" import { Button } from "@/components/ui/button" import { ContextMenuContent, ContextMenuItem, ContextMenuSubTrigger, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent } from "@/components/ui/context-menu" import { deleteRecord } from "app/lib/del" import { Trash2 } from "lucide-react" import Link from "next/link" import { ComponentProps } from "react" import { Row, Table, TableState } from "@tanstack/react-table" import { letterCase } from "app/lib/functions" import { tableNameToItemName } from "app/lib/nameMaps" export default function FormContextMenu({ table, row }: ComponentProps<"div"> & { table: Table, row: Row }) { const pathname = table.options.meta.pathname const selectedRows = table.getSelectedRowModel().flatRows return ( {pathname !== "/submission" && selectedRows.length <= 1 ? <> Inspect : "" } { selectedRows.length > 0 ? { table.resetRowSelection() }}>Deselect : "" } Delete Are you sure? Deleting a {tableNameToItemName(table.options.meta.tableName)} cannot be undone! ) }