table-reuse
Version:
A reusable table built on top of Antd ProTable
21 lines (20 loc) • 698 B
TypeScript
import type { NavigateFunction } from "react-router-dom";
import type { TClickAction } from "action-view";
export type TCrudActionLabels = {
createLabel?: string;
viewLabel?: string;
editLabel?: string;
deleteLabel?: string;
cloneLabel?: string;
};
export type TGetCrudActionsParams = {
rowKey: string;
basePath: string;
labels: TCrudActionLabels;
navigate: NavigateFunction;
apiDelete?: (rowId: string) => Promise<void>;
};
export declare function getCrudActions<TItem>({ basePath, navigate, labels, rowKey, apiDelete, }: TGetCrudActionsParams): {
pageActions: TClickAction[];
buildRowActions: (row: TItem) => TClickAction[];
};