import * as React from 'react'; import * as Styled from './ConfirmModal.style' export default class ConfirmModal extends React.Component { public constructor() { super(); this.handleCancel = this.handleCancel.bind(this); this.handleOk = this.handleOk.bind(this); } public handleCancel() { this.props.config.onCancel && this.props.config.onCancel(); } public handleOk() { this.props.config.onOk && this.props.config.onOk(); } public render() { const {title, content, cancelText, okText} = this.props.config; return (
{title && (

{title}

)}
{this.props.children}
{cancelText || '取消'} {okText || '确定'}
) } }