index.js 889 Bytes
Newer Older
1 2 3
import React from 'react';
import classNames from 'classnames';
import { Button } from 'antd';
afc163's avatar
afc163 committed
4
import { Link } from 'dva/router';
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
import config from './typeConfig';
import styles from './index.less';


export default ({ className, type, title, desc, img, actions }) => {
  const pageType = type in config ? type : '404';
  const clsString = classNames(styles.exception, className);
  return (
    <div className={clsString}>
      <div className={styles.imgBlock}>
        <img src={img || config[pageType].img} alt="" />
      </div>
      <div className={styles.content}>
        <h1>{title || config[pageType].title}</h1>
        <div className={styles.desc}>{desc || config[pageType].desc}</div>
        <div className={styles.actions}>
          {actions || <Link to="/"><Button size="large" type="primary">θΏ”ε›žι¦–ι‘΅</Button></Link>}
        </div>
      </div>
    </div>
  );
};