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

import { style } from "./style";
import { default as defaultData } from "./data.json";

import { doIShow, combineData, lorem } from "../../utils";

import theme from "../../theme";

import {
  Block,
  Section,
  Headline,
  Text,
  Container,
  Button,
  Image,
} from "@sc/plugins/webcomponents/v2";
import {
  Shape,
  ShapeTypes,
} from "@sc/plugins/webcomponents/v2/Shapes/component";

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, backgroundColor: theme.backgroundColor }}
      >
        <Container
          style={{
            ...style.SECTION_INNER,
            // maxWidth: get(data, "section.pageMargin")
            maxWidth: 700,
          }}
        >
          <Container
            style={{ backgroundColor: theme.foregroundColor, padding: 50 }}
          >
            <Container style={{ textAlign: "center" }}>
              <Image
                style={{ maxWidth: 220, margin: "0 auto" }}
                src="https://svgsilh.com/svg/1771694.svg"
              />
            </Container>
            <Headline style={{ ...style.HEADLINE, marginTop: 10 }}>
              100% Money Back Guarantee
            </Headline>
            <Text style={style.TEXT}>{startCase(lorem.generateWords(7))}</Text>
            <Text style={{ ...style.TEXT, textAlign: "left" }}>
              {lorem.generateParagraphs(1)}
              <br />
              <br />
              {lorem.generateParagraphs(1)}
            </Text>
          </Container>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
