import "./Footer.scss";
import logo from "../../shared/assets/logo.svg";
import Link from "next/link";
import Image from "next/image";
import { LINKS } from "@/shared/variables/links";
import youtube from "./icons/youtube.svg";
import facebook from "./icons/facebook.svg";
import instagram from "./icons/instagram.svg";
import app_store_btn from "./icons/app-store-btn.svg";
import play_market_btn from "./icons/play-market-btn.svg";

const Footer = () => {

  const netKgFooterScript =`
  <!-- WWW.NET.KG , code for http://kgroad.org -->
  <script language="javascript" type="text/javascript">
   java="1.0";
   java1=""+"refer="+escape(document.referrer)+"&amp;page="+escape(window.location.href);
   document.cookie="astratop=1; path=/";
   java1+="&amp;c="+(document.cookie?"yes":"now");
  </script>
  <script language="javascript1.1" type="text/javascript">
   java="1.1";
   java1+="&amp;java="+(navigator.javaEnabled()?"yes":"now");
  </script>
  <script language="javascript1.2" type="text/javascript">
   java="1.2";
   java1+="&amp;razresh="+screen.width+'x'+screen.height+"&amp;cvet="+
   (((navigator.appName.substring(0,3)=="Mic"))?
   screen.colorDepth:screen.pixelDepth);
  </script>
  <script language="javascript1.3" type="text/javascript">java="1.3"</script>
  <script language="javascript" type="text/javascript">
   java1+="&amp;jscript="+java+"&amp;rand="+Math.random();
   document.write("<a href='http://www.net.kg/stat.php?id=7235&amp;fromsite=7235' target='_blank'>"+
   "<img src='http://www.net.kg/img.php?id=7235&amp;"+java1+
   "' border='0' alt='WWW.NET.KG' width='88' height='31' /></a>");
  </script>
  <noscript>
   <a href='http://www.net.kg/stat.php?id=7235&amp;fromsite=7235' target='_blank'><img
    src="http://www.net.kg/img.php?id=7235" border='0' alt='WWW.NET.KG' width='88'
    height='31' /></a>
  </noscript>
  <!-- /WWW.NET.KG -->
  
  `

  return (
    <footer className="footer">
      <Link href="/">
        <Image src={logo} alt="Logo" />
      </Link>
      <div className="footer__links">
        <h4>Навигация</h4>
        <ul>
          {LINKS.map((link) => (
            <li key={link.id}>
              <Link href={link.pathname} key={link.id}>
                {link.pagename}
              </Link>
            </li>
          ))}
        </ul>
        <div dangerouslySetInnerHTML={{ __html: netKgFooterScript }} />
      </div>

      <div className="footer__contacts">
        <h4>Контакты</h4>
        <ul>
          <li>admin@kgroad.org</li>
          <li>+9960312394038</li>
          <li>
            {[youtube, facebook, instagram].map((net, i) => (
              <Link key={i} href="#">
                <Image src={net} alt="Net Icon" key={net} />
              </Link>
            ))}
          </li>
        </ul>
        <p className="text-white">Photo By ThomasG, CC BY-SA 3.0</p>
      </div>
      {/*
      <div className="footer__apps">
        <h4>Скачивай наше приложение</h4>
        <div className="footer__apps-btns">
          {[app_store_btn, play_market_btn].map((app, i) => (
            <Link key={i} href="#">
              <Image src={app} alt="App Button" key={app} />
            </Link>
          ))}
        </div>
      </div>
          */}
    </footer>
  );
};

export default Footer;
