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,
  Divider,
} 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={{
              border: `3px dashed ${theme.backgroundColor}`,
              padding: 50,
            }}
          >
            <Headline style={style.HEADLINE}>
              Yes! I want to Join You and 234 others at this Live Training!
            </Headline>
            <Divider
              style={style.DIVIDER}
              color={theme.backgroundColor}
              size={3}
            />
            <Headline style={style.SUBHEADLINE}>
              Reserve Your Ticket Today!
            </Headline>
            <Button
              style={style.BUTTON.style}
              caption1="RSVP Now!"
              caption1style={style.BUTTON.caption1}
            />
          </Container>

          <Text style={style.TEXT}>
            <a href="#">No Thanks! I don't want access to this product</a>
          </Text>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
