import React, { useState, useEffect } from "react";
import PropTypes from 'prop-types';
import './FooterSection.css';
import moment from "moment";

import Footer_Social_X_icon from '../../img_new_design_2025/Footer_social_i_X.png';
import Social_Link_icon from '../../img_new_design_2025/social_i_Link.png';
import Footer_Social_Fa_icon from '../../img_new_design_2025/Footer_social_i_Fa.png';

import logo_footer from '../../img_new_design_2025/logo_footer.png';


const FooterSection = ({ logoSrc, address, email, phone }) => {

  const [current_year, setcurrent_year] = useState("");

  useEffect(() => {
    var date2 = new Date();
    const format2 = "YYYY";
    var dateTime2 = moment(date2).format(format2);
    setcurrent_year(dateTime2)

  }, []);

  return (
    <div className="footer_automatic_files">
      <footer className="footer_new_2025">
        <div className="footer-content">
          <div className="logo-address">
            <img src={logo_footer} alt="Logo MySy" className="logo" />
            <p className="address">
              Adresse : {address}<br />
              <a href="mailto:contact@mysy-training.com" target="_blank" style={{ textDecoration: 'none', color: 'inherit' }}> E-mail : {email} </a><br />
              Téléphone fixe : {phone}
            </p>
          </div>

          <div className="footer-links">
            <div className="link-column">
              <a href="#">Qui sommes-nous ?</a>

              <a href="#">Fonctionnaltiés</a>
              <nav onClick={(e) => {
                e.preventDefault();
                window.open("/tarif/#debut", "_self");
              }}
                style={{ cursor: 'pointer', opacity: '0.8' }}>Tarifs</nav>

              <a href="#">Blog</a>

              <nav onClick={(e) => {
                e.preventDefault();
                window.open("/contact/#debut", "_self");
              }}
                style={{ cursor: 'pointer', opacity: '0.8' }}> Nous contacter</nav>
            </div>

            <div className="link-column">
              <a href="#">Services</a>
              <a href="#">Intégrations</a>
              <a href="#">Assistance</a>
              <a href="#">FAQ</a>
              <a href="#">Carrières</a>
            </div>

            <div className="link-column">
              <a href="#">Solutions</a>
              <a href="#">Partenariats</a>
              <a href="#">Support</a>
              <a href="#">Communauté</a>
              <a href="#">Aide</a>
            </div>
          </div>
        </div>

        <div className="footer-divider"></div>

        <div className="footer-bottom">
          <div className="legal-links">
            <a href='/sample/MYSY_POLITIQUE_CONFIDENTIALITE.pdf' download target="_blank">| Confidentialité | Cookies | données personnelles &nbsp; </a>
            <a href='/sample/MYSY_MENTIONS_LEGALES.pdf' download target="_blank">| Mentions légales </a>
            <a href='/sample/MYSY_CGU.pdf' download target="_blank">| CGU  </a>
            <a href='/sample/Conditions_Generales-Vente_CGV.pdf' download target="_blank">| CGV </a>
            <span className="copyright">Copyright © {current_year} MySy Training Technology. Tous droits réservés.</span>
          </div>

          <div className="social-icons">
            <a href="https://www.linkedin.com/company/mysy-training/" target="_blank"><img src={Social_Link_icon} alt="social Mysy Training LinkedIn" /></a>
            <a href="https://www.facebook.com/people/MySy-Training-Technology/100083219647910/" target="_blank"><img src={Footer_Social_X_icon} alt="social Mysy Training Facebook" /></a>
            <a href="https://twitter.com/mysy_training" target="_blank"> <img src={Footer_Social_Fa_icon} alt="social Mysy Training X (twitter)" /></a>
          </div>
        </div>
      </footer>
    </div>
  );
};

FooterSection.propTypes = {
  logoSrc: PropTypes.string,
  address: PropTypes.string,
  email: PropTypes.string,
  phone: PropTypes.string,
};

FooterSection.defaultProps = {
  logoSrc: 'https://dashboard.codeparrot.ai/api/image/Z5NbKPA8XwfbJQBF/logo-my-s.png',
  address: '1 Cr du Havre, 75008 Paris',
  email: 'contact@mysy-training.com',
  phone: '+331 77 00 38 57',
};

export default FooterSection;

