import * as React from "react";
import { get } from "lodash";

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,
  List,
  ListItem,
  Grid,
  GridItem,
} from "@sc/plugins/webcomponents/v2";
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={5}>
            <GridItem xs={6}>
              <Container
                style={{
                  // backgroundColor: theme.backgroundColor,
                  borderRadius: 5,
                  padding: "0 30px",
                }}
              >
                <Text style={style.TEXT}>
                  "Hands down the best process I've seen in the last 11 years.
                  Thank you!! I really value your approach"
                </Text>
                <List
                  style={{
                    paddingLeft: 0,
                    margin: "0 auto",
                    maxWidth: 200,
                    marginTop: 30,
                  }}
                >
                  <ListItem
                    icon={IconTypes.AccountCircle}
                    iconStyle={{
                      padding: 5,
                      paddingRight: 15,
                      fontSize: "28pt",
                      // color: theme.foregroundColor
                    }}
                  >
                    <Text
                      style={{ ...style.TEXT, padding: 0, textAlign: "left" }}
                    >
                      Jacob McDonald
                    </Text>
                    <Text
                      style={{
                        ...style.TEXT,
                        fontSize: "10pt",
                        padding: 0,
                        textAlign: "left",
                      }}
                    >
                      VP Marketing
                    </Text>
                  </ListItem>
                </List>
              </Container>
            </GridItem>
            <GridItem xs={6}>
              <Container
                style={{
                  // backgroundColor: theme.backgroundColor,
                  // borderRadius: 5,
                  padding: "0 30px",
                }}
              >
                <Text style={style.TEXT}>
                  "Hands down the best process I've seen in the last 11 years.
                  Thank you!! I really value your approach"
                </Text>
                <List
                  style={{
                    paddingLeft: 0,
                    margin: "0 auto",
                    maxWidth: 200,
                    marginTop: 30,
                  }}
                >
                  <ListItem
                    icon={IconTypes.AccountCircle}
                    iconStyle={{
                      padding: 5,
                      paddingRight: 15,
                      fontSize: "28pt",
                      // color: theme.foregroundColor
                    }}
                  >
                    <Text
                      style={{ ...style.TEXT, padding: 0, textAlign: "left" }}
                    >
                      Jacob McDonald
                    </Text>
                    <Text
                      style={{
                        ...style.TEXT,
                        fontSize: "10pt",
                        padding: 0,
                        textAlign: "left",
                      }}
                    >
                      VP Marketing
                    </Text>
                  </ListItem>
                </List>
              </Container>
            </GridItem>
          </Grid>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
