import React from "react" import _ from "lodash" import ModalPopupComponent from "./ModalPopupComponent" export interface ActionCancelModalComponentProps { /** Title of modal */ title?: React.ReactNode /** Action button. Defaults to "Save" */ actionLabel?: React.ReactNode /** Cancel button. Defaults to "Cancel" if action, "Close" otherwise */ cancelLabel?: React.ReactNode /** Label of delete button. Default "Delete" */ deleteLabel?: React.ReactNode /** Called when action button is clicked */ onAction?: () => void /** Called when cancel is clicked */ onCancel?: () => void /** Big red destuctive action in footer. Not present if null */ onDelete?: () => void /** "large" for large, "full" for full width */ size?: "large" | "full" | "normal" | "small" | "x-large" /** True for action button to show spinner and be disabled */ actionBusy?: boolean /** True for delete button to show spinner and be disabled */ deleteBusy?: boolean /** True for action button to be disabled */ actionDisabled?: boolean /** Children to display in modal */ children?: React.ReactNode } // Modal with action and cancel buttons export default class ActionCancelModalComponent extends React.Component { render() { return ( {this.props.deleteBusy ? ( <>   ) : null} {this.props.deleteLabel || T`Delete`} ) : undefined, this.props.onAction ? ( ) : undefined, ]} > {this.props.children} ) } }