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,
  Image,
  Grid,
  GridItem,
  Divider,
} from "@sc/plugins/webcomponents/v2";
import { ImagePlaceholder, 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"),
          }}
        >
          <Headline style={style.HEADLINE}>As Seen In..</Headline>

          <Divider
            style={{ margin: "10px auto", width: 100 }}
            color={theme.backgroundColor}
            size={3}
          />
          <Grid
            spacing={8}
            style={{
              justifyContent: "center",
              marginTop: 10,
            }}
          >
            <GridItem>
              <Image src="logos/forbes.png" />
            </GridItem>
            <GridItem>
              <Image src="logos/los_angeles_times.png" />
            </GridItem>
            <GridItem>
              <Image src="logos/entrepreneur.png" />
            </GridItem>
            <GridItem>
              <Image src="logos/huffington_post.png" />
            </GridItem>
            <GridItem>
              <Image src="logos/usa_today.png" />
            </GridItem>
            <GridItem>
              <Image src="logos/inc.png" />
            </GridItem>
          </Grid>
        </Container>
      </Section>
    </Block>
  );
};

export default Layout;
