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 { VideoPlaceholder } from "../../Placeholders";

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

import {
  Block,
  Section,
  Headline,
  Text,
  Container,
  Button,
  FacebookComments,
  GridItem,
  Grid,
} 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"),
          }}
        >
          <Grid spacing={5}>
            <GridItem xs>
              <Headline style={style.HEADLINE}>
                Say Hello &amp; Share Your Insights
              </Headline>
              <FacebookComments
                style={{ marginTop: 20 }}
                href="http://twitter.com"
              />
            </GridItem>
            <GridItem>
              <VideoPlaceholder
                style={{
                  ...style.VIDEO,
                  padding: "70px 100px",
                  marginBottom: 15,
                }}
                playIconStyle={{ fontSize: "28pt" }}
              />
              <Text style={style.TEXT}>
                {startCase(lorem.generateWords(3))}
              </Text>
              <VideoPlaceholder
                style={{
                  ...style.VIDEO,
                  padding: "70px 100px",
                  marginBottom: 15,
                }}
                playIconStyle={{ fontSize: "28pt" }}
              />
              <Text style={style.TEXT}>
                {startCase(lorem.generateWords(3))}
              </Text>
              <VideoPlaceholder
                style={{
                  ...style.VIDEO,
                  padding: "70px 100px",
                  marginBottom: 15,
                }}
                playIconStyle={{ fontSize: "28pt" }}
              />
              <Text style={style.TEXT}>
                {startCase(lorem.generateWords(3))}
              </Text>
              <VideoPlaceholder
                style={{
                  ...style.VIDEO,
                  padding: "70px 100px",
                  marginBottom: 15,
                }}
                playIconStyle={{ fontSize: "28pt" }}
              />
              <Text style={style.TEXT}>
                {startCase(lorem.generateWords(3))}
              </Text>
            </GridItem>
          </Grid>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
