import React from 'react'; import classNames from 'classnames'; import { Icon } from 'antd'; import styles from './index.less'; export interface ResultProps { actions?: React.ReactNode; className?: string; description?: React.ReactNode; extra?: React.ReactNode; style?: React.CSSProperties; title?: React.ReactNode; type: 'success' | 'error'; } const Result: React.SFC = ({ className, type, title, description, extra, actions, ...restProps }) => { const iconMap = { error: , success: , }; const clsString = classNames(styles.result, className); return (
{iconMap[type]}
{title}
{description &&
{description}
} {extra &&
{extra}
} {actions &&
{actions}
}
); }; export default Result;