import * as React from "react";
import { get } from "lodash";

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,
  GridItem,
  Grid,
} from "@sc/plugins/webcomponents/v2";

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"),
          }}
        >
          <Headline style={style.HEADLINE}>
            Do You Make These Mistakes In Your Business?
          </Headline>
          <Text style={style.TEXT}>
            It's true. Getting results is much easier than you think. The truth
            is most people simply don't know the correct steps to take so they
            become frustrated and quit
          </Text>
          <Container style={{ marginTop: 50 }}>
            <Grid spacing={5}>
              <GridItem xs={4}>
                <Headline
                  style={{ ...style.HEADLINE, fontSize: "18pt", padding: 0 }}
                >
                  Headline
                </Headline>
                <Text style={style.TEXT}>
                  The FOUR tried and true secrets to the having your best year
                  yet!
                </Text>
              </GridItem>
              <GridItem xs={4}>
                <Headline
                  style={{ ...style.HEADLINE, fontSize: "18pt", padding: 0 }}
                >
                  Headline
                </Headline>
                <Text style={style.TEXT}>How Search Engines Work</Text>
              </GridItem>
              <GridItem xs={4}>
                <Headline
                  style={{ ...style.HEADLINE, fontSize: "18pt", padding: 0 }}
                >
                  Headline
                </Headline>
                <Text style={style.TEXT}>
                  The FIVE Essential Sales Techniques for mastering your
                </Text>
              </GridItem>
            </Grid>
          </Container>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
