import type { ReactNode } from 'react'; import type { WDesignColor } from '@worldprinter/wdesign-core'; export type DataTableContextMenuItemProps = ({ /** * Unique item key */ key: string; } & ({ /** * If true, insert an actions divider */ divider: true; icon?: never; title?: never; color?: never; hidden?: never; disabled?: never; onClick?: never; } | { divider?: never; /** * Item icon */ icon?: ReactNode; /** * Item title; if not present, one will be generated by "humanizing" * the provided item key * (i.e. `viewRecord` -> `View record`) */ title?: ReactNode; /** * Item color */ color?: WDesignColor; /** * if true, the menu item will not be shown */ hidden?: boolean; /** * if true, the menu item will be disabled */ disabled?: boolean; /** * Function to call when the menu item is clicked */ onClick: () => void; }));