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

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

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

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

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

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

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

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

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

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

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

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

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

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

export const CTA12: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={CTALayouts.TWELVE}>
          <Layout type={CTALayouts.TWELVE} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec1e9a64649fe_Call%20to%20Action%202.jpg"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings12.default])}
        />
      )}
    </>
  );
};

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

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

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

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

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

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

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

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

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

export const CTA22: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={CTALayouts.TWENTYTWO}>
          <Layout type={CTALayouts.TWENTYTWO} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP
          title="Inspiration"
          src="http://ambid-backups.s3.amazonaws.com/screenshots/sandcastle/placeholders/CTA/22.png"
        />
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings22.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,
        settings20.default,
        settings21.default,
        settings22.default,
      ])}
    />
  );
};

export const AllCallsToAction: 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 (
    <>
      <GRP title={CTALayouts.ONE}>
        <Layout type={CTALayouts.ONE} data={data} />
      </GRP>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      <GRP title={CTALayouts.NINETEEN}>
        <Layout type={CTALayouts.NINETEEN} data={data} />
      </GRP>

      <GRP title={CTALayouts.TWENTY}>
        <Layout type={CTALayouts.TWENTY} data={data} />
      </GRP>

      <GRP title={CTALayouts.TWENTYONE}>
        <Layout type={CTALayouts.TWENTYONE} data={data} />
      </GRP>

      <GRP title={CTALayouts.TWENTYTWO}>
        <Layout type={CTALayouts.TWENTYTWO} data={data} />
      </GRP>
    </>
  );
};
