/* eslint-disable @next/next/no-img-element */
import React from "react";
// @Next
import Head from "next/head";
import Link from "next/link";
import { GetServerSideProps } from "next/types";
// @Antd
import { Button, Carousel, Col, Row, Card } from "antd";
import { MessageOutlined, ReadOutlined, TeamOutlined } from "@ant-design/icons";
// @i18n
import { useTranslation } from "next-i18next";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
// @Imagenes
import {
  ElderlyWoman,
  BackgroundFill,
  SlideGoldenHispanicHome,
} from "../public/images/index";

// @Layout
import { LayoutWrapper } from "../src/components/layouts/wrapper";
// @Styled
import styles from "../src/components/pages/home/index.module.less";

const CarouselSlider = [
  SlideGoldenHispanicHome.SlideGoldenHispanic1,
  SlideGoldenHispanicHome.SlideGoldenHispanic2,
  SlideGoldenHispanicHome.SlideGoldenHispanic3,
  SlideGoldenHispanicHome.SlideGoldenHispanic4,
];

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

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

  return (
    <main className={"container ".concat(styles.wrapper__page)}>
      <Head>
        <title>Golden Hispanic Foundation | GHF</title>
        <meta name="description" content={t("home:objetives")} key="desc" />
      </Head>
      <section>
        <Carousel autoplay>
          {CarouselSlider?.map((src, index: number) => {
            return (
              <Row key={index.toString()}>
                <Col>
                  <img className={styles.carousel__slide} src={src} alt="" />
                </Col>
              </Row>
            );
          })}
        </Carousel>
      </section>
      <section
        style={{
          background: `url(${BackgroundFill})`,
          backgroundSize: "cover",
        }}
      >
        <Row className="wrapper__content">
          <Col className="wrapper__content--horizontal">
            <div className={styles.wrapper__objectives}>
              <div className={styles["objectives__content--image"]}>
                <img
                  className={styles.objectives__image}
                  src={ElderlyWoman}
                  alt=""
                />
              </div>
              <div className={styles.objectives__content}>
                <h2 className={styles.objectives__title}>
                  {t("home:objetives")}
                </h2>
              </div>
            </div>
              <div className={styles.objectives__content}>
                <h2 className={styles.objectives__title}>{t("home:introduction:titleone")}</h2>
                <h3 className={styles.objectives__title}>{t("home:introduction:one")}</h3>
              </div>
              <div className={styles.objectives__content}  style={{ padding: 0 }}>
                <h2 className={styles.objectives__title}>{t("home:introduction:titletwo")}</h2>
                <h3 className={styles.objectives__title}>{t("home:introduction:two")}</h3>
              </div>
              <div className={styles.objectives__content} >
                <h2 className={styles.objectives__title}>{t("home:introduction:three")}</h2>
              </div>
          </Col>
        </Row>
      </section>
      <section>
        <Row
          className="wrapper__content wrapper__content--round"
          align="middle"
          justify="space-between"
        >
          <Col xs={8} sm={8} md={8} lg={8}>
            <div className={styles.wrapper__round}>
              <div className={styles.round__icon}>
                <Link href="/acerca-de-nosotros" passHref>
                  <a className={styles.round__link}>
                    <TeamOutlined className={styles["round__icon--link"]} />
                    <p className={styles["round__icon--text"]}>
                      {t("home:sections:about-us")}
                    </p>
                  </a>
                </Link>
              </div>
            </div>
          </Col>
          <Col xs={8} sm={8} md={8} lg={8}>
            <div className={styles.wrapper__round}>
              <div className={styles.round__icon}>
                <Link href="/news" passHref>
                  <a className={styles.round__link}>
                    <ReadOutlined className={styles["round__icon--link"]} />
                    <p className={styles["round__icon--text"]}>
                      {t("home:sections:news")}
                    </p>
                  </a>
                </Link>
              </div>
            </div>
          </Col>
          <Col xs={8} sm={8} md={8} lg={8}>
            <div className={styles.wrapper__round}>
              <div className={styles.round__icon}>
                <Link href="/contactanos" passHref>
                  <a className={styles.round__link}>
                    <MessageOutlined className={styles["round__icon--link"]} />
                    <p className={styles["round__icon--text"]}>
                      {t("home:sections:contact-us")}
                    </p>
                  </a>
                </Link>
              </div>
            </div>
          </Col>
        </Row>
      </section>
    </main>
  );
}

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