/* eslint-disable @next/next/no-img-element */
import React from "react";
import Head from "next/head";
import { GetServerSideProps } from "next/types";
// @Antd
import { Button, Col, Form, notification, Input, Row } from "antd";
// @i18n
import { useTranslation } from "next-i18next";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
// @Images
import { BackgroundFill } from "../../public/images";
// @Layout
import { LayoutWrapper } from "../../src/components/layouts/wrapper";
import { Map } from "../../src/components/less/maps";
// @Styled
import styles from "../../src/components/pages/contact/index.module.less";
import {
  Donations,
} from "../../public/images";

export const getServerSideProps: GetServerSideProps = async ({ locale }) => {
  return {
    props: {
      ...(await serverSideTranslations(locale as string, [
        "common",
        "donations",
      ])),
    },
  };
};

export default function Contact() {
  const { t } = useTranslation();

  return (
    <main className={"container ".concat(styles.wrapper__page)}>
      <Head>
        <title>{t("donations:title")} | GHF</title>
        <meta name="description" content={t("donations:body")} key="desc" />
      </Head>
      <section
        style={{
          background: `url(${BackgroundFill})`,
          backgroundSize: "cover",
          backgroundPosition: "10px",
          minHeight: "100vh",
        }}
      >
        <Row className="wrapper__content">
          <Col className="wrapper__content--horizontal">
            <h1 className={styles.contact__title}>{t("donations:title")}</h1>
            <Row>
              <Col sm={24} lg={16}>
                <div>
                  <p className={styles.contact__subtitle}>
                    {t("donations:caption")}
                  </p>
                  <p className={styles.contact__subtitle}>
                    {t("donations:body")}
                  </p>
                </div>
              </Col>
              <Col sm={24} lg={8} style={{display: "flex", alignContent: "flex-end" }}>
                <div>
                  <img src={Donations} className={styles.image} alt="" />
                </div>
              </Col>
              </Row>
              <Row>
              <Col sm={24} lg={16} style={{ display: "flex", alignContent: "flex-start" }}>
                <div >
                  <form
                    action="https://www.paypal.com/donate/?hosted_button_id=H49FY4B6D5FKA"
                    method="post"
                    target="_top"
                  >
                    <input
                      type="hidden"
                      name="business"
                      value="H49FY4B6D5FKA"
                    />
                    <input type="hidden" name="amount" value="50" />
                    <input type="hidden" name="no_recurring" value="0" />
                    <input
                      type="hidden"
                      name="item_name"
                      value="Mensaje Provisional"
                    />
                    <input type="hidden" name="currency_code" value="USD" />
                    <input
                      type="image"
                      src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif"
                      name="submit"
                      title="PayPal - The safer, easier way to pay online!"
                      alt="Donate with PayPal button"
                    />
                    <img
                      alt=""
                      src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif"
                      width="1"
                      height="1"
                    />
                  </form>
                </div>
              </Col>
              </Row>
          </Col>
        </Row>
      </section>
    </main>
  );
}

Contact.getLayout = function getLayout(page: React.ReactElement) {
  return <LayoutWrapper>{page}</LayoutWrapper>;
};
