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,
  Grid,
  GridItem,
  Image,
} 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")
            maxWidth: 900,
          }}
        >
          <Container style={{ maxWidth: 800, margin: "0 auto" }}>
            <Headline style={{ ...style.HEADLINE }}>
              Yes Kyle! I'm Ready to Join 10 Minute Funnels Today!
            </Headline>
          </Container>
          <Grid spacing={2}>
            <GridItem xs={2}>
              <Image src="https://www.onlygfx.com/wp-content/uploads/2016/04/hand-drawn-arrow-1-300x276.png" />
            </GridItem>
            <GridItem xs>
              <Button
                style={style.BUTTON.style}
                caption1="Get Your Membership Now!"
                caption1style={style.BUTTON.caption1}
                caption2="...and beginning building your first funnel in minutes"
                caption2style={style.BUTTON.caption2}
              />
            </GridItem>
            <GridItem xs={2}>
              <Image
                style={{ transform: `scaleX(-1)` }}
                src="https://www.onlygfx.com/wp-content/uploads/2016/04/hand-drawn-arrow-1-300x276.png"
              />
            </GridItem>
          </Grid>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
