import * as React from "react";
import { get } from "lodash";
import {
  faFacebookF,
  faGoogle,
  faTwitter,
  faInstagram,
} from "@fortawesome/free-brands-svg-icons";

import { style } from "./style";
import { default as defaultData } from "./data.json";

import { doIShow, combineData } from "../../utils";

import theme from "../../theme";
import {
  NavigationLayouts,
  ItemTypes,
} from "@sc/plugins/webcomponents/v2/Navigation/types";

import {
  Block,
  Section,
  Text,
  Container,
  Grid,
  GridItem,
  Image,
  Navigation,
} from "@sc/plugins/webcomponents/v2";
import { IconSource } from "@sc/plugins/webcomponents/v2/Icon/types";

type LayoutProps = {
  data: any;
};

const Layout: React.FC<LayoutProps> = ({ data }) => {
  const initialContent = {
    main_headline: {
      html: "Headline Goes Here",
    },
    sub_headline: {
      html: "Sub Headline Text Content Goes Here",
    },
  };

  const content = combineData(initialContent, defaultData, data);

  return (
    <Block>
      <Section style={style.SECTION}>
        <Container
          style={{
            ...style.SECTION_INNER,
            maxWidth: get(data, "section.pageMargin"),
          }}
        >
          <Grid>
            <GridItem xs={7}>
              <Container style={{ maxWidth: 350 }}>
                <Grid spacing={7}>
                  <GridItem xs={3}>
                    <Image src={theme.logoIcon} />
                  </GridItem>
                  <GridItem xs>
                    <Text style={style.TEXT}>
                      Working with wireframes may be a collaborative effort
                      since it bridges the information
                    </Text>
                  </GridItem>
                </Grid>
              </Container>
            </GridItem>
            <GridItem xs={5}>
              <Grid>
                <GridItem xs={6}>
                  <Text style={{ ...style.TEXT, fontWeight: "bold" as "bold" }}>
                    Office
                  </Text>
                  <Text style={style.TEXT}>
                    359 Hidden Valley
                    <br />
                    Road, NY
                  </Text>
                </GridItem>
                <GridItem xs={6}>
                  <Text style={{ ...style.TEXT, fontWeight: "bold" as "bold" }}>
                    Contacts
                  </Text>
                  <Text style={style.TEXT}>hello@gmail.com</Text>
                </GridItem>
              </Grid>
            </GridItem>
          </Grid>
          <Navigation
            layout={NavigationLayouts.FOUR}
            style={{ marginTop: 60 }}
            linkStyle={style.NAVIGATION.linkStyle}
            items={[
              {
                type: ItemTypes.LISTITEM,
                icon: faTwitter,
                iconSource: IconSource.FONTAWESOME,
                href: "./#",
              },
              {
                type: ItemTypes.LISTITEM,
                icon: faFacebookF,
                iconSource: IconSource.FONTAWESOME,
                href: "./#",
              },
              {
                type: ItemTypes.LISTITEM,
                icon: faGoogle,
                iconSource: IconSource.FONTAWESOME,
                href: "./#",
              },
              {
                type: ItemTypes.LISTITEM,
                icon: faInstagram,
                iconSource: IconSource.FONTAWESOME,
                href: "./#",
              },
            ]}
            copyrightStyle={{
              fontFamily: theme.fontFamily,
              fontSize: "10pt",
            }}
          />
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
