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 { IconTypes } from "@sc/plugins/webcomponents/v2/Icon";
import { VideoPlaceholder } from "../../Placeholders";

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

import {
  Block,
  Section,
  Headline,
  Text,
  Container,
  Button,
  Grid,
  GridItem,
  FormField,
  List,
} 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={{ backgroundColor: theme.highlightColor, padding: 15 }}
          >
            <Headline
              style={{ ...style.HEADLINE, color: theme.foregroundColor }}
            >
              Next Step... {startCase(lorem.generateWords(4))}
            </Headline>
          </Container>
          <Container style={{ padding: 40 }}>
            <Grid spacing={5}>
              <GridItem xs={6}>
                <Headline style={style.HEADLINE}>
                  Free Video Reveals The {startCase(lorem.generateWords(6))}!
                </Headline>
                <List
                  data={[
                    {
                      caption: lorem.generateSentences(2),
                      style: style.LISTITEM.style,
                      iconStyle: style.LISTITEM.iconStyle,
                      contentStyle: style.LISTITEM.contentStyle,
                      icon: IconTypes.CheckCircleOutline,
                    },
                    {
                      caption: lorem.generateSentences(2),
                      style: style.LISTITEM.style,
                      iconStyle: style.LISTITEM.iconStyle,
                      contentStyle: style.LISTITEM.contentStyle,
                      icon: IconTypes.CheckCircleOutline,
                    },
                    {
                      caption: lorem.generateSentences(2),
                      style: style.LISTITEM.style,
                      iconStyle: style.LISTITEM.iconStyle,
                      contentStyle: style.LISTITEM.contentStyle,
                      icon: IconTypes.CheckCircleOutline,
                    },
                  ]}
                />
              </GridItem>
              <GridItem xs={6}>
                <Headline style={style.SUBHEADLINE}>
                  Where Should I Send Your Video?
                </Headline>
                <VideoPlaceholder style={{ color: "white" }} />
                <FormField
                  type="Text"
                  name="email"
                  placeholder="Enter Your Email"
                  style={style.FORMFIELD.style}
                  inputStyle={{
                    ...style.FORMFIELD.inputStyle,
                    paddingLeft: 50,
                  }}
                  icon={IconTypes.Email}
                  iconStyle={{ padding: 15, color: theme.backgroundColor }}
                />
                <Button
                  style={style.BUTTON.style}
                  caption1="Send The Video Here"
                  caption1style={style.BUTTON.caption1}
                  icon={IconTypes.ArrowForward}
                />
              </GridItem>
            </Grid>
          </Container>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
