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,
  Button,
  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"),
          }}
        >
          <Navigation
            layout={NavigationLayouts.TWO}
            logo={theme.logoIcon}
            logoStyle={{ maxWidth: 55, padding: "0 40px" }}
            logoHref="/"
            items={[
              {
                caption: "Shop",
                href: "./about",
                type: ItemTypes.TEXT,
                column: 2,
              },
              {
                caption: "About",
                href: "./features",
                type: ItemTypes.TEXT,
                column: 2,
              },
              {
                caption: "Blog",
                href: "./blog",
                type: ItemTypes.TEXT,
                column: 2,
              },
              {
                caption: "Pricing",
                href: "./team",
                type: ItemTypes.TEXT,
                column: 2,
              },
              {
                caption: "About Us",
                href: "./team",
                type: ItemTypes.TEXT,
                column: 2,
              },

              {
                type: ItemTypes.LISTITEM,
                icon: faTwitter,
                iconSource: IconSource.FONTAWESOME,
                href: "./#",
                column: 3,
              },
              {
                type: ItemTypes.LISTITEM,
                icon: faFacebookF,
                iconSource: IconSource.FONTAWESOME,
                href: "./#",
                column: 3,
              },
              {
                type: ItemTypes.LISTITEM,
                icon: faGoogle,
                iconSource: IconSource.FONTAWESOME,
                href: "./#",
                column: 3,
              },
              {
                type: ItemTypes.LISTITEM,
                icon: faInstagram,
                iconSource: IconSource.FONTAWESOME,
                href: "./#",
                column: 3,
              },
            ]}
            linkStyle={{
              color: "black",
              listStyle: "none",
              display: "inline-block",
              padding: 20,
              fontFamily: "Roboto",
            }}
            style={{ padding: 20 }}
          />
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
