UNPKG

react-antd-admin-panel

Version:

Modern TypeScript-first React admin panel builder with Ant Design 6

50 lines 1.49 kB
import React from 'react'; import { Action } from './Action'; import type { Formula } from '../formula/Formula'; /** * Props for ActionButton component */ export interface ActionButtonProps { /** The Action model to render */ action: Action; /** Formula to submit (for 'submit' type actions) */ formula?: Formula; /** Additional arguments to pass to callback */ args?: unknown; /** Navigate function for 'link' type actions */ navigate?: (path: string) => void; /** Override disabled state */ disabled?: boolean; /** Additional className */ className?: string; /** Button size */ size?: 'small' | 'middle' | 'large'; } /** * ActionButton - Renders an Action as an Ant Design Button * * Handles confirmation dialogs, loading states, and access control. * * @example * ```tsx * const deleteAction = new Action() * .label('Delete') * .danger(true) * .confirm('Are you sure?') * .callback(async () => { * await api.deleteUser(id); * }); * * <ActionButton action={deleteAction} /> * * // With formula submission * const saveAction = new Action() * .label('Save') * .buttonType('primary'); * * <ActionButton action={saveAction} formula={formula} /> * ``` */ export declare function ActionButton({ action, formula, args, navigate, disabled: disabledProp, className, size, }: ActionButtonProps): React.ReactElement | null; export default ActionButton; //# sourceMappingURL=ActionButton.d.ts.map