import { DefaultFooter } from '@ant-design/pro-layout';
import { useIntl } from 'umi';
import UserInfo from '../UserInfo';
import { useWatchPageReadOnly } from '../utils/hooks';

const Footer: React.FC = () => {
  const intl = useIntl();
  useWatchPageReadOnly();
  const defaultMessage = intl.formatMessage({
    id: 'app.copyright.produced',
    defaultMessage: '技术中心-信息安全部-工程和架构组出品',
  });

  const currentYear = new Date().getFullYear();

  return (
    <div>
      <DefaultFooter copyright={`${currentYear} ${defaultMessage}`} />
      <UserInfo />
    </div>
  );
};

export default Footer;
