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='error'
        title='无权限'
        subTitle='您无权限访问当前页面'
        extra={
          <Button type='primary' onClick={onClick}>回到首页</Button>
        }
      />
    </main>
  );
};

export default NotFound;
