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,
  Grid,
  GridItem,
} 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.HEADLINE}>
            {startCase(lorem.generateWords(7))}
          </Headline>
          <Text style={style.TEXT}>{lorem.generateSentences(2)}</Text>

          <Grid spacing={2}>
            <GridItem xs>
              <VideoPlaceholder style={{ ...style.VIDEO, height: 105 }} />
            </GridItem>
            <GridItem>
              <VideoPlaceholder
                style={{
                  ...style.VIDEO,
                  padding: "40px 70px",
                  marginBottom: 15,
                }}
                playIconStyle={{ fontSize: "28pt" }}
              />
              <VideoPlaceholder
                style={{
                  ...style.VIDEO,
                  padding: "40px 70px",
                  marginBottom: 15,
                }}
                playIconStyle={{ fontSize: "28pt" }}
              />
              <VideoPlaceholder
                style={{
                  ...style.VIDEO,
                  padding: "40px 70px",
                  marginBottom: 15,
                }}
                playIconStyle={{ fontSize: "28pt" }}
              />
              <VideoPlaceholder
                style={{
                  ...style.VIDEO,
                  padding: "40px 70px",
                  marginBottom: 15,
                }}
                playIconStyle={{ fontSize: "28pt" }}
              />
            </GridItem>
          </Grid>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
