@cerberus-design/react
Version:
The Cerberus Design React component library.
31 lines (30 loc) • 846 B
TypeScript
import { MouseEventHandler, ReactNode } from 'react';
/**
* This module provide utility functions for the cta modal.
* @module 'react/cta-modal/utils'
*/
export type CTAButtonAction = {
/**
* The text of the button.
*/
text: string;
/**
* The onClick handler for the button.
*/
handleClick: MouseEventHandler<HTMLButtonElement>;
};
export type CTAModalAction = (CTAButtonAction | ReactNode)[];
export interface CTAModalActionReturn {
/**
* The type of the action content.
*/
type: 'reactNode' | 'btnAction';
/**
* The actions for the cta modal. Max of 2 actions.
*/
_actions: CTAModalAction;
}
/**
* Creates the action data to pass to the cta modal `show` method.
*/
export declare function createCTAModalActions(providedActions: CTAModalAction): CTAModalActionReturn;