import { useLocation } from 'react-router-dom';

function Footer() {
  const location = useLocation();
  if (location.pathname !== '/') return <footer data-testid='footer' />;

  const eNamadId = '486556';
  const eNamadCode = 'KOfWnHX6MPAGXu9vMNY9i2avACZHFtyQ';

  /* eslint-disable react/jsx-no-target-blank */
  return (
    <footer data-testid='footer' className='z-50 w-screen'>
      <div className='flex justify-end'>
        <div id='samandehi' className='m-3 h-[75px] w-[75px]'></div>
        <div id='e-namad' className=' m-3 h-[75px] w-[75px]'>
          <a
            referrerPolicy='origin'
            target='_blank'
            href={`https://trustseal.enamad.ir/?id=${eNamadId}&Code=${eNamadCode}`}
          >
            <img
              id={eNamadCode}
              referrerPolicy='origin'
              src={`https://trustseal.enamad.ir/logo.aspx?id=${eNamadId}&Code=${eNamadCode}`}
              alt='e-namad'
              width='75px'
              height='75px'
              className='cursor-pointer'
            />
          </a>
        </div>
      </div>
    </footer>
  );
}

export default Footer;
