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,
  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"),
          }}
        >
          <Container
            style={{ textAlign: "center", margin: "0 auto", maxWidth: 600 }}
          >
            <Image
              style={{ width: 150, padding: 50 }}
              src="https://logos-download.com/wp-content/uploads/2016/03/Airbnb_logo.png"
            />
            <Headline style={style.HEADLINE}>
              "Hands down the best process I've seen in the last 11 years. Thank
              you!!"
            </Headline>
            <Text style={style.TEXT}>Jacob McDonald, VP Marketing</Text>
          </Container>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
