import {HOME_PATH} from '@routes';
import css from './index.module.css';
import {Button, Result} from 'antd';
import classNames from 'classnames';
import {FC} from 'react';
import {useNavigate} from 'react-router-dom';

const NotFound: FC = function() {
  const navigate = useNavigate();
  function onClick() {
    navigate(HOME_PATH, {replace: true});
  }

  return (
    <main className={classNames(['container', css.main])}>
      <Result
        className={css.result}
        status='404'
        title='404'
        subTitle='没有找到页面~'
        extra={
          <Button type='primary' onClick={onClick}>回到首页</Button>
        }
      />
    </main>
  );
};

export default NotFound;
