import React from 'react' ; import classnames from 'classnames' ; import { cssClasses } from './constants' ; import Button , { ButtonProps } from '@material/react-button' ; type Omit < T , K extends keyof T > = Pick < T , Exclude < keyof T , K > > ; type ButtonTypes = HTMLAnchorElement | HTMLButtonElement ; export interface DialogButtonProps < T extends ButtonTypes > extends Omit < ButtonProps < T > , 'initRipple' > { action : string ; className ? : string ; isDefault ? : boolean ; } const DialogButton = ( { action , className = '' , children , isDefault = false , ... otherProps } ) => ( < Button className = { classnames ( className , cssClasses . BUTTON , { [ cssClasses . DEFAULT_BUTTON ] : isDefault , } ) } data - mdc - dialog - action = { action } { ... otherProps } > { children } < /Button>); type DialogButton < T extends ButtonTypes > = React . ReactElement < DialogButtonProps < T > > ; export default DialogButton ;