import React, { Component, ReactChildren } from 'react' import context from './context' export interface ConfirmProps { confirmText: string cancelText: string onConfirmClick: () => void onCancelClick: () => void content: string isPad: boolean children: ReactChildren } class Confirm extends Component { public static defaultProps = { onConfirmClick: () => {}, onCancelClick: () => {}, cancelText: '取消', confirmText: '确定', content: '' } public render() { return ( {({ cancelText, confirmText, onConfirmClick, onCancelClick, content, children }: any) => (
{children ? children : content}
{cancelText}
{confirmText}
)}
) } } export default Confirm