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,
  Navigation,
  Image,
  Grid,
  GridItem,
} from "@sc/plugins/webcomponents/v2";
import {
  NavigationLayouts,
  ItemTypes,
} from "@sc/plugins/webcomponents/v2/xNavigation/types";
import { themeSettings, folder } from "@sc/plugins/webcomponents/v2/theme";
import { IconTypes } from "@sc/plugins/webcomponents/v2/Icon";

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={2}>
            <GridItem xs>
              <Container style={{ padding: 20 }}>
                <Image src={theme.logoDark} style={{ maxWidth: 200 }} />
              </Container>
            </GridItem>
            <GridItem>
              <Grid spacing={2}>
                <GridItem xs={3}>
                  <VideoPlaceholder
                    style={style.VIDEO}
                    playIconStyle={{ fontSize: "32pt" }}
                  />
                  <Text style={style.TEXT}>
                    "{startCase(lorem.generateWords(3))}"
                  </Text>
                </GridItem>
                <GridItem xs={3}>
                  <VideoPlaceholder
                    style={style.VIDEO}
                    playIconStyle={{ fontSize: "32pt" }}
                  />
                  <Text style={style.TEXT}>
                    "{startCase(lorem.generateWords(3))}"
                  </Text>
                </GridItem>
                <GridItem xs={3}>
                  <VideoPlaceholder
                    style={style.VIDEO}
                    playIconStyle={{ fontSize: "32pt" }}
                  />
                  <Text style={style.TEXT}>
                    "{startCase(lorem.generateWords(3))}"
                  </Text>
                </GridItem>
                <GridItem xs={3}>
                  <VideoPlaceholder
                    style={style.VIDEO}
                    playIconStyle={{ fontSize: "32pt" }}
                  />
                  <Text style={style.TEXT}>
                    "{startCase(lorem.generateWords(3))}"
                  </Text>
                </GridItem>
              </Grid>
            </GridItem>
          </Grid>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
