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 {
  Block,
  Section,
  Headline,
  Text,
  Container,
  Grid,
  GridItem,
  Image,
  Navigation,
} from "@sc/plugins/webcomponents/v2";
import {
  NavigationLayouts,
  ItemTypes,
} from "@sc/plugins/webcomponents/v2/Navigation/types";

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={6}>
              <Container style={{ maxWidth: 400 }}>
                <Image src={theme.logoIcon} style={{ maxWidth: 50 }} />
                <Text style={style.TEXT}>
                  Working with wireframes may be a collaborative effort since it
                  bridges the information
                </Text>
                <Navigation
                  style={{ marginTop: 40 }}
                  layout={NavigationLayouts.SIX}
                  linkStyle={{
                    paddingRight: 30,
                    display: "inline-block",
                    color: theme.backgroundColor,
                  }}
                  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: "./#",
                    },
                  ]}
                />
              </Container>
            </GridItem>

            <GridItem xs>
              <Container style={{ maxWidth: 800 }}>
                <Grid style={{}}>
                  <GridItem xs={4}>
                    <Container style={{ padding: "0 40px" }}>
                      <Headline style={style.HEADLINE}>Information</Headline>
                      <Navigation
                        layout={NavigationLayouts.FIVE}
                        linkStyle={style.NAVIGATION.linkStyle}
                        items={[
                          {
                            caption: "About Us",
                            href: "./#",
                            type: ItemTypes.TEXT,
                          },
                          {
                            caption: "Contact Us",
                            href: "./#",
                            type: ItemTypes.TEXT,
                          },
                          {
                            caption: "FAQs",
                            href: "./#",
                            type: ItemTypes.TEXT,
                          },
                        ]}
                      />
                    </Container>
                  </GridItem>
                  <GridItem xs={4}>
                    <Container style={{ padding: "0 40px" }}>
                      <Headline style={style.HEADLINE}>About</Headline>
                      <Navigation
                        layout={NavigationLayouts.FIVE}
                        linkStyle={style.NAVIGATION.linkStyle}
                        items={[
                          { caption: "About Us", href: "./#" },
                          { caption: "Contact Us", href: "./#" },
                          { caption: "FAQs", href: "./#" },
                        ]}
                      />
                    </Container>
                  </GridItem>
                  <GridItem xs={4}>
                    <Container style={{ padding: "0 40px" }}>
                      <Headline style={style.HEADLINE}>Catalog</Headline>
                      <Navigation
                        layout={NavigationLayouts.FIVE}
                        linkStyle={style.NAVIGATION.linkStyle}
                        items={[
                          { caption: "About Us", href: "./#" },
                          { caption: "Contact Us", href: "./#" },
                          { caption: "FAQs", href: "./#" },
                        ]}
                      />
                    </Container>
                  </GridItem>
                </Grid>
              </Container>
            </GridItem>
          </Grid>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
