import * as React from "react";
import { get } from "lodash";
// import { AccountCircle } from "@material-ui/icons";

import { style } from "./style";
import { default as defaultData } from "./data.json";

import { doIShow, combineData } from "../../utils";
import theme from "../../theme";

import {
  Block,
  Section,
  Headline,
  Text,
  Container,
  Button,
  Grid,
  GridItem,
  List,
  ListItem,
} from "@sc/plugins/webcomponents/v2";
import { ListItemTypes } from "@sc/plugins/webcomponents/v2/ListItem/types";
import { Icon, IconTypes } from "@sc/plugins/webcomponents/v2/Icon";

import {
  ImagePlaceholder,
  VideoPlaceholder,
  ImagePlaceholderTypes,
} 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"),
          }}
        >
          <Grid spacing={5}>
            <GridItem xs={5}>
              <Container style={{ padding: "50px 100px" }}>
                {doIShow(content, "main_headline") && (
                  <Headline
                    name="Main Headline"
                    id="main_headline"
                    style={{
                      ...style.HEADLINE,
                      ...get(content, "main_headline.style", {}),
                    }}
                  >
                    {get(content, "main_headline.html", "...")}
                  </Headline>
                )}
                {doIShow(content, "sub_headline") && (
                  <Text
                    name="Sub Headline"
                    id="sub_headline"
                    style={{
                      ...style.TEXT,
                      ...get(content, "sub_headline.style", {}),
                    }}
                  >
                    {get(content, "sub_headline.html", "...")}
                  </Text>
                )}
              </Container>
            </GridItem>
            <GridItem xs={7}>
              <Grid spacing={5}>
                <GridItem xs={6}>
                  <List style={style.LIST}>
                    <ListItem
                      icon={IconTypes.AccountCircle}
                      iconStyle={style.LI.iconStyle}
                      style={style.LI.style}
                      type={ListItemTypes.BLOCK}
                    >
                      <Text
                        style={{
                          ...style.HEADLINE,
                          fontSize: "16pt",
                          padding: 0,
                        }}
                      >
                        Proven Strategy
                      </Text>
                      <Text
                        style={{
                          ...style.TEXT,
                          padding: 0,
                        }}
                      >
                        It's true. Getting results is much easier than you
                        think. The truth is
                      </Text>
                    </ListItem>
                    <ListItem
                      icon={IconTypes.AccountCircle}
                      iconStyle={style.LI.iconStyle}
                      style={style.LI.style}
                      type={ListItemTypes.BLOCK}
                    >
                      <Text
                        style={{
                          ...style.HEADLINE,
                          fontSize: "16pt",
                          padding: 0,
                        }}
                      >
                        Proven Strategy
                      </Text>
                      <Text
                        style={{
                          ...style.TEXT,
                          padding: 0,
                        }}
                      >
                        It's true. Getting results is much easier than you
                        think. The truth is
                      </Text>
                    </ListItem>
                  </List>
                </GridItem>
                <GridItem xs={6}>
                  <List style={style.LIST}>
                    <ListItem
                      icon={IconTypes.AccountCircle}
                      iconStyle={style.LI.iconStyle}
                      style={style.LI.style}
                      type={ListItemTypes.BLOCK}
                    >
                      <Text
                        style={{
                          ...style.HEADLINE,
                          fontSize: "16pt",
                          padding: 0,
                        }}
                      >
                        Proven Strategy
                      </Text>
                      <Text
                        style={{
                          ...style.TEXT,
                          padding: 0,
                        }}
                      >
                        It's true. Getting results is much easier than you
                        think. The truth is
                      </Text>
                    </ListItem>
                    <ListItem
                      icon={IconTypes.AccountCircle}
                      iconStyle={style.LI.iconStyle}
                      style={style.LI.style}
                      type={ListItemTypes.BLOCK}
                    >
                      <Text
                        style={{
                          ...style.HEADLINE,
                          fontSize: "16pt",
                          padding: 0,
                        }}
                      >
                        Proven Strategy
                      </Text>
                      <Text
                        style={{
                          ...style.TEXT,
                          padding: 0,
                        }}
                      >
                        It's true. Getting results is much easier than you
                        think. The truth is
                      </Text>
                    </ListItem>
                  </List>
                </GridItem>
              </Grid>
            </GridItem>
          </Grid>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
