import * as React from "react" import type { ColumnDef, Row } from "@tanstack/react-table" import { DataTableRowActions, type DataTableRowAction, } from "@/components/data-table/data-table-row-actions" import { cn, stopInteractivePropagation } from "@/lib/utils" export type DataTableActionsColumnOptions = { id?: string size?: number header?: React.ReactNode headerClassName?: string cellClassName?: string actions?: DataTableRowAction[] getActions?: (row: Row, original: TData) => DataTableRowAction[] label?: React.ReactNode emptyLabel?: React.ReactNode } export type DataTableActionsColumn = ( props?: DataTableActionsColumnOptions ) => ColumnDef function createDataTableActionsColumn({ id = "actions", size = 56, header, headerClassName, cellClassName, actions, getActions, label, emptyLabel, }: DataTableActionsColumnOptions = {}): ColumnDef { return { id, size, enableSorting: false, enableHiding: false, header: () => header ? (
{header}
) : null, cell: ({ row }) => (
), } } export { createDataTableActionsColumn }