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,
} from "@sc/plugins/webcomponents/v2";
import { ImagePlaceholder, ImagePlaceholderTypes } from "../../Placeholders";

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={6}>
              <Container style={{ padding: 30 }}>
                <Text style={style.TEXT}>Jacob McDonald</Text>
                <Headline style={style.HEADLINE}>
                  "Hands down the best process I've seen in the last 11 years.
                  Thank you!! I really appreciate"
                </Headline>
                <Button
                  style={style.BUTTON.style}
                  caption1="See full story"
                  caption1style={style.BUTTON.caption1}
                />
              </Container>
            </GridItem>
            <GridItem xs={6}>
              <ImagePlaceholder
                type={ImagePlaceholderTypes.NONE}
                style={{
                  height: "100%",
                  margin: 30,
                  backgroundColor: theme.backgroundColor,
                }}
              />
            </GridItem>
          </Grid>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
