import * as React from "react";
import { GRP } from "storybook/GRP";
import { withKnobs, text, boolean, number } from "@storybook/addon-knobs";
import Layout from "../Layout";
import { ContentLayouts } from "./types";

import {
  settings01,
  settings02,
  settings03,
  settings04,
  settings05,
  settings06,
  settings07,
  settings08,
  settings09,
  settings10,
  settings11,
  settings12,
  settings13,
  settings14,
  settings15,
  settings16,
  settings17,
  settings18,
  settings19,
} from "./";

import {
  EditorWithCustomData,
  buildContentData,
  mobileStateData,
} from "@sc/modules/page/Builder/Builder.stories";

import theme from "../theme";

export default {
  title: "Plugins|Web Layouts/Content",
  decorators: [withKnobs],
};

export const Content01: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.ONE}>
          <Layout type={ContentLayouts.ONE} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec1c9c74649fb_Text%2012.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings01.default])}
        />
      )}
    </>
  );
};

export const Content02: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.TWO}>
          <Layout type={ContentLayouts.TWO} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec1e385464a07_Text%2016.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings02.default])}
        />
      )}
    </>
  );
};

export const Content03: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.THREE}>
          <Layout type={ContentLayouts.THREE} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec166074649ef_Text%2010.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings03.default])}
        />
      )}
    </>
  );
};

export const Content04: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.FOUR}>
          <Layout type={ContentLayouts.FOUR} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec19b0b4649fd_Text%2014.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings04.default])}
        />
      )}
    </>
  );
};

export const Content05: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.FIVE}>
          <Layout type={ContentLayouts.FIVE} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec10c644649f5_Text%2015.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings05.default])}
        />
      )}
    </>
  );
};

export const Content06: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.SIX}>
          <Layout type={ContentLayouts.SIX} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec154fb464a04_Text%209.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings06.default])}
        />
      )}
    </>
  );
};

export const Content07: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.SEVEN}>
          <Layout type={ContentLayouts.SEVEN} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec18401464a0a_Text%2011.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings07.default])}
        />
      )}
    </>
  );
};

export const Content08: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.EIGHT}>
          <Layout type={ContentLayouts.EIGHT} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec1016e4649ff_Text%207.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings08.default])}
        />
      )}
    </>
  );
};

export const Content09: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.NINE}>
          <Layout type={ContentLayouts.NINE} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec16bc6464a00_Text%208.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings09.default])}
        />
      )}
    </>
  );
};

export const Content10: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.TEN}>
          <Layout type={ContentLayouts.TEN} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec1be31464a02_Text%203.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings10.default])}
        />
      )}
    </>
  );
};

export const Content11: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.ELEVEN}>
          <Layout type={ContentLayouts.ELEVEN} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec18520464a09_Text%204.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings11.default])}
        />
      )}
    </>
  );
};

export const Content13: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.THIRTEEN}>
          <Layout type={ContentLayouts.THIRTEEN} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec1aa39464a0c_Text%201.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings13.default])}
        />
      )}
    </>
  );
};

export const Content14: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.FOURTEEN}>
          <Layout type={ContentLayouts.FOURTEEN} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec116c44649f8_Text%2013.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings14.default])}
        />
      )}
    </>
  );
};

export const Content15: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.FIFTEEN}>
          <Layout type={ContentLayouts.FIFTEEN} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec19cea4649f9_Text%2017.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings15.default])}
        />
      )}
    </>
  );
};

export const Content16: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.SIXTEEN}>
          <Layout type={ContentLayouts.SIXTEEN} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="http://ambid-backups.s3.amazonaws.com/screenshots/sandcastle/placeholders/Content/16.png"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings16.default])}
        />
      )}
    </>
  );
};

export const Content17: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.SEVENTEEN}>
          <Layout type={ContentLayouts.SEVENTEEN} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="http://ambid-backups.s3.amazonaws.com/screenshots/sandcastle/placeholders/Content/17.png"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings17.default])}
        />
      )}
    </>
  );
};

export const Content18: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.EIGHTEEN}>
          <Layout type={ContentLayouts.EIGHTEEN} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="http://ambid-backups.s3.amazonaws.com/screenshots/sandcastle/placeholders/Content/18.png"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings18.default])}
        />
      )}
    </>
  );
};

export const Content19: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={ContentLayouts.NINETEEN}>
          <Layout type={ContentLayouts.NINETEEN} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="http://ambid-backups.s3.amazonaws.com/screenshots/sandcastle/placeholders/Content/19.png"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings19.default])}
        />
      )}
    </>
  );
};

export const InTheEditor: React.FC = () => {
  return (
    <EditorWithCustomData
      defaultMobileState={mobileStateData.desktop}
      content={buildContentData([
        settings01.default,
        settings02.default,
        settings03.default,
        settings04.default,
        settings05.default,
        settings06.default,
        settings07.default,
        settings08.default,
        settings09.default,
        settings10.default,
        settings11.default,
        settings12.default,
        settings13.default,
        settings14.default,
        settings15.default,
        settings16.default,
        settings17.default,
        settings18.default,
        settings19.default,
      ])}
    />
  );
};

export const All: React.FC = () => {
  const data = {
    section: {
      pageMargin: number("Page Margin", 980, {
        range: true,
        min: 500,
        max: 2000,
      }),
    },
    main_headline: {
      html: text("Main Headline Text", "I have overrided the text"),
      render: boolean("Show Main Headline", true),
    },
    sub_headline: {
      render: boolean("Show Sub Headline", true),
    },
    hero_video: {
      render: boolean("Show Hero Video", true),
    },
    cta_button: {
      render: boolean("Show Button (If Present)", true),
    },
  };

  return (
    <div>
      <GRP title={ContentLayouts.ONE}>
        <Layout type={ContentLayouts.ONE} data={data} />
      </GRP>

      <GRP title={ContentLayouts.TWO}>
        <Layout type={ContentLayouts.TWO} data={data} />
      </GRP>

      <GRP title={ContentLayouts.THREE}>
        <Layout type={ContentLayouts.THREE} data={data} />
      </GRP>

      <GRP title={ContentLayouts.FOUR}>
        <Layout type={ContentLayouts.FOUR} data={data} />
      </GRP>

      <GRP title={ContentLayouts.FIVE}>
        <Layout type={ContentLayouts.FIVE} data={data} />
      </GRP>

      <GRP title={ContentLayouts.SIX}>
        <Layout type={ContentLayouts.SIX} data={data} />
      </GRP>

      <GRP title={ContentLayouts.SEVEN}>
        <Layout type={ContentLayouts.SEVEN} data={data} />
      </GRP>

      <GRP title={ContentLayouts.EIGHT}>
        <Layout type={ContentLayouts.EIGHT} data={data} />
      </GRP>

      <GRP title={ContentLayouts.NINE}>
        <Layout type={ContentLayouts.NINE} data={data} />
      </GRP>

      <GRP title={ContentLayouts.TEN}>
        <Layout type={ContentLayouts.TEN} data={data} />
      </GRP>

      <GRP title={ContentLayouts.ELEVEN}>
        <Layout type={ContentLayouts.ELEVEN} data={data} />
      </GRP>

      <GRP title={ContentLayouts.TWELVE}>
        <Layout type={ContentLayouts.TWELVE} data={data} />
      </GRP>

      <GRP title={ContentLayouts.THIRTEEN}>
        <Layout type={ContentLayouts.THIRTEEN} data={data} />
      </GRP>

      <GRP title={ContentLayouts.FOURTEEN}>
        <Layout type={ContentLayouts.FOURTEEN} data={data} />
      </GRP>

      <GRP title={ContentLayouts.FIFTEEN}>
        <Layout type={ContentLayouts.FIFTEEN} data={data} />
      </GRP>

      <GRP title={ContentLayouts.SIXTEEN}>
        <Layout type={ContentLayouts.SIXTEEN} data={data} />
      </GRP>

      <GRP title={ContentLayouts.SEVENTEEN}>
        <Layout type={ContentLayouts.SEVENTEEN} data={data} />
      </GRP>

      <GRP title={ContentLayouts.EIGHTEEN}>
        <Layout type={ContentLayouts.EIGHTEEN} data={data} />
      </GRP>

      <GRP title={ContentLayouts.NINETEEN}>
        <Layout type={ContentLayouts.NINETEEN} data={data} />
      </GRP>
    </div>
  );
};
