import { DefaultFooter } from '@ant-design/pro-components';
import { useIntl } from '@umijs/max';
import packageJson from '../../../package.json';
import './style.less';
const Footer = () => {
  const intl = useIntl();

  const defaultMessage = intl.formatMessage({
    id: 'app.copyright.produced',
    defaultMessage: 'by SMATEC Team',
  });
  const getDomainVersion = () => {
    switch (process.env.DOMAIN_ENV) {
      case 'gms':
        return packageJson['gms-version'];
      case 'sgw':
        return packageJson['sgw-version'];
      case 'spole':
        return packageJson['spole-version'];
      default:
        return '-';
    }
  };

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

  return (
    <DefaultFooter
      style={{
        background: 'none',
      }}
      copyright={`${currentYear} ${defaultMessage} v${getDomainVersion()}`}
      links={
        [
          // {
          //   key: 'smatec',
          //   title: 'Smatec JSC',
          //   href: 'https://smatec.com.vn',
          //   blankTarget: true,
          // }
        ]
      }
    />
  );
};

export default Footer;
