import React from "react";
import styled from "styled-components";
import { Link } from "@components/index";
import colors from "@theme/colors";
import breakpoints from "@theme/breakpoints";

const Columns = styled.div`
  display: flex;
  justify-content: space-between;
  & > div > div {
    margin-bottom: 1rem;
  }
`;

const Content = styled.div`
  display: flex;

  & > div:first-of-type {
    padding: 3rem 0;
    flex: 2 1;

    & > * {
      padding: 0 1.5rem;
    }
  }

  h4 {
    color: ${colors.lightBlue};
    padding: 1.5rem 0;
  }

  a {
    color: ${colors.white};
    display: block;
    text-decoration: underline;
    padding: 0.4rem 0;
    font-size: 0.8rem;

    &:hover {
      text-decoration: none;
    }
  }

  p {
    color: ${colors.white};
    margin: 0;
    padding: 0.4rem 0;
    font-size: 0.8rem;
  }
`;

const MarginSpace = styled.div`
  max-width: 67%;
  margin: auto;
`;

const Map = styled.div`
  flex: 1;
  @media screen and (max-width: ${breakpoints.mobile}) {
    display: none;
  }
  iframe {
    border: none;
  }
`;

const FooterContent: React.FC = () => (
  <Content>
    <div>
      <MarginSpace>
        <h4>Aalto-yliopiston Sähköinsinöörikilta ry</h4>
        <Columns>
          <div>
            <div>
              <p>TUAS-Talo</p>
              <p>Maarintie 8</p>
              <p>PL 15500, 00076 Aalto</p>
            </div>
            <div>
              <p>Y-tunnus: 1627010-1</p>
              <p>hallitus@sahkoinsinoorikilta.fi</p>
              <Link to="/yhteystiedot">Yhteystiedot</Link>
            </div>
          </div>
          <div>
            <Link to="https://api.sahkoinsinoorikilta.fi/members/application/">Jäseneksi</Link>
            <Link to="mailto:hallitus@sahkoinsinoorikilta.fi">Palaute</Link>
            <Link to="https://static.sahkoinsinoorikilta.fi">Dokumenttiarkisto</Link>
            <Link to="https://sik.kuvat.fi">Kuvagalleria</Link>
            <Link to="https://static.sahkoinsinoorikilta.fi/logot-ja-grafiikka/">Logot ja grafiikka</Link>
          </div>
        </Columns>
      </MarginSpace>
    </div>

    <Map>
      <iframe
        title="Maarintalo 8 on Google Maps"
        // eslint-disable-next-line max-len
        src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d1983.6122518000927!2d24.81667815176689!3d60.187150048900186!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x468df5eb3cb4ecf1%3A0x3480cbfeedcc07b6!2sMaarintie+8%2C+02150+Espoo!5e0!3m2!1sfi!2sfi!4v1542413548247"
        width="100%"
        height="100%"
      />
    </Map>
  </Content>
);

export default FooterContent;
