import * as React from "react";
import { get, startCase, uniqueId } 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,
} from "@sc/plugins/webcomponents/v2";
import { VideoPlaceholder } 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"),
          }}
        >
          <Headline style={style.SUBHEADLINE}>
            Do You Know {startCase(lorem.generateWords(3))}?
          </Headline>
          <Headline style={style.HEADLINE}>
            Introducing: {startCase(lorem.generateWords(7))}
          </Headline>
          <Headline style={style.SUBHEADLINE}>
            {startCase(lorem.generateSentences(3))}
          </Headline>
          <VideoPlaceholder
            style={{ height: 400, color: theme.foregroundColor, marginTop: 40 }}
          />
          <Button
            style={style.BUTTON.style}
            caption1="Yes - Add to Cart!"
            caption1style={style.BUTTON.caption1}
          />
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
