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,
} 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"),
          }}
        >
          <Text style={{ ...style.TEXT, fontSize: "16pt" }}>
            Yes! I would like to choose the one time payment option of the
            almost insane investment of $97
          </Text>
          <Button
            style={style.BUTTON.style}
            caption1="Add to Cart"
            caption1style={style.BUTTON.caption1}
          />
          <Text
            style={{
              ...style.TEXT,
            }}
          >
            <span
              style={{
                padding: 10,
                backgroundColor: "yellow",
                fontWeight: "bold" as "bold",
              }}
            >
              <a href="#">Add to Cart: One-Time Payment</a>
            </span>
          </Text>
          <Text style={style.TEXT}>
            <a href="#">
              No thanks, I realize I will never get this opportunity again.
            </a>
          </Text>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
