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 { ImagePlaceholder, ImagePlaceholderTypes } from "../../Placeholders";
import theme from "../../theme";

import {
  Block,
  Section,
  Headline,
  Text,
  Container,
  Grid,
  GridItem,
} 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"),
          }}
        >
          <Grid spacing={10}>
            <GridItem xs={5}>
              <ImagePlaceholder
                type={ImagePlaceholderTypes.NONE}
                style={{
                  height: "100%",
                  backgroundColor: theme.backgroundColor,
                  // maxWidth: 400,
                  margin: "0 auto",
                }}
              />
            </GridItem>
            <GridItem xs={7}>
              <Container style={{ padding: "0 50px" }}>
                <Text style={style.TEXT}>Actual images</Text>
                <Headline style={style.HEADLINE}>
                  Free report reveals how to get the most out of your ability to
                  include actual images.
                </Headline>
                <Container style={{ marginTop: 40 }}>
                  <Grid spacing={10}>
                    <GridItem xs={6}>
                      <Headline style={{ ...style.HEADLINE, fontSize: "16pt" }}>
                        Yellow
                      </Headline>
                      <Text style={style.TEXT}>
                        It's true. Getting results is much easier than the
                        relationship between the links it contains
                      </Text>
                    </GridItem>
                    <GridItem xs={6}>
                      <Headline style={{ ...style.HEADLINE, fontSize: "16pt" }}>
                        Yellow
                      </Headline>
                      <Text style={style.TEXT}>
                        It's true. Getting results is much easier than the
                        relationship between the links it contains
                      </Text>
                    </GridItem>
                    <GridItem xs={6}>
                      <Headline style={{ ...style.HEADLINE, fontSize: "16pt" }}>
                        Yellow
                      </Headline>
                      <Text style={style.TEXT}>
                        It's true. Getting results is much easier than the
                        relationship between the links it contains
                      </Text>
                    </GridItem>
                    <GridItem xs={6}>
                      <Headline style={{ ...style.HEADLINE, fontSize: "16pt" }}>
                        Yellow
                      </Headline>
                      <Text style={style.TEXT}>
                        It's true. Getting results is much easier than the
                        relationship between the links it contains
                      </Text>
                    </GridItem>
                  </Grid>
                </Container>
              </Container>
            </GridItem>
          </Grid>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
