import * as React from "react";
import { withKnobs, text, boolean, number } from "@storybook/addon-knobs";
import _ from "lodash";

import Layout from "../Layout";
import { BenefitLayouts } from "./types";

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

import { BODY } from "@sc/modules/v2/Editor/types";

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

import {
  addThisAfterThat,
  moveThisByThat,
} from "@sc/modules/v2/Editor/actions";
import { ComponentTypes } from "@sc/plugins/webcomponents/v2/types";

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

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

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

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

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

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

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

export const Benefit07: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={BenefitLayouts.SEVEN}>
          <Layout type={BenefitLayouts.SEVEN} />
        </GRP>
      )}
      {boolean("Show Inspiration", false) && (
        <GRP title="Inspiration">
          <img
            style={{ width: "100%" }}
            src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec12cbe464b43_Features%2026%20(1).jpg"
          />
        </GRP>
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings07.default])}
        />
      )}
    </>
  );
};

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

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

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

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

export const Benefit12: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={BenefitLayouts.TWELVE}>
          <Layout type={BenefitLayouts.TWELVE} />
        </GRP>
      )}
      {boolean("Show Inspiration", false) && (
        <GRP title="Inspiration">
          <img
            style={{ width: "100%" }}
            src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec17f11464990_Features%2021.jpg"
          />
        </GRP>
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings12.default])}
        />
      )}
    </>
  );
};

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

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

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

export const Benefit16: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={BenefitLayouts.SIXTEEN}>
          <Layout type={BenefitLayouts.SIXTEEN} />
        </GRP>
      )}
      {boolean("Show Inspiration", false) && (
        <GRP title="Inspiration">
          <img
            style={{ width: "100%" }}
            src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec128364649a2_Features%2019.jpg"
          />
        </GRP>
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings16.default])}
        />
      )}
    </>
  );
};

export const Benefit17: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={BenefitLayouts.SEVENTEEN}>
          <Layout type={BenefitLayouts.SEVENTEEN} />
        </GRP>
      )}
      {boolean("Show Inspiration", false) && (
        <GRP title="Inspiration">
          <img
            style={{ width: "100%" }}
            src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec1eb9e464994_Features%2017.jpg"
          />
        </GRP>
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings17.default])}
        />
      )}
    </>
  );
};

export const Benefit18: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={BenefitLayouts.EIGHTEEN}>
          <Layout type={BenefitLayouts.EIGHTEEN} />
        </GRP>
      )}
      {boolean("Show Inspiration", false) && (
        <GRP title="Inspiration">
          <img
            style={{ width: "100%" }}
            src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec13edc4649a4_Features%206.jpg"
          />
        </GRP>
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings18.default])}
        />
      )}
    </>
  );
};

export const Benefit19: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={BenefitLayouts.NINETEEN}>
          <Layout type={BenefitLayouts.NINETEEN} />
        </GRP>
      )}
      {boolean("Show Inspiration", false) && (
        <GRP title="Inspiration">
          <img
            style={{ width: "100%" }}
            src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec12e2e464992_Features%2015.jpg"
          />
        </GRP>
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings19.default])}
        />
      )}
    </>
  );
};

export const Benefit20: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={BenefitLayouts.TWENTY}>
          <Layout type={BenefitLayouts.TWENTY} />
        </GRP>
      )}
      {boolean("Show Inspiration", false) && (
        <GRP title="Inspiration">
          <img
            style={{ width: "100%" }}
            src="https://assets.website-files.com/5d4fd160326ec183bf464939/5d4fd160326ec151c846498f_Features%2029.jpg"
          />
        </GRP>
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings20.default])}
        />
      )}
    </>
  );
};

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

export const Benefit22: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={BenefitLayouts.TWENTYTWO}>
          <Layout type={BenefitLayouts.TWENTYTWO} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP title="Inspiration">
          <img
            style={{ width: "100%" }}
            src="http://ambid-backups.s3.amazonaws.com/screenshots/sandcastle/placeholders/Benefits/22.png"
          />
        </GRP>
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings22.default])}
        />
      )}
    </>
  );
};

export const Benefit23: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={BenefitLayouts.TWENTYTHREE}>
          <Layout type={BenefitLayouts.TWENTYTHREE} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP title="Inspiration">
          <img
            style={{ width: "100%" }}
            src="http://ambid-backups.s3.amazonaws.com/screenshots/sandcastle/placeholders/Benefits/23.png"
          />
        </GRP>
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings23.default])}
        />
      )}
    </>
  );
};

export const Benefit24: React.FC = () => {
  return (
    <>
      {boolean("Show Section", false) && (
        <GRP title={BenefitLayouts.TWENTYFOUR}>
          <Layout type={BenefitLayouts.TWENTYFOUR} />
        </GRP>
      )}
      {boolean("Show inspiration", false) && (
        <GRP title="Inspiration">
          <img
            style={{ width: "100%" }}
            src="http://ambid-backups.s3.amazonaws.com/screenshots/sandcastle/placeholders/Benefits/22.png"
          />
        </GRP>
      )}
      {boolean("In the Editor", true) && (
        <EditorWithCustomData
          defaultMobileState={mobileStateData.desktop}
          content={buildContentData([settings24.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,
        settings23.default,
        settings24.default,
      ])}
    />
  );
};

export const AllBenefits: 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={BenefitLayouts.ONE}>
        <Layout type={BenefitLayouts.ONE} data={data} />
      </GRP>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      <GRP title={BenefitLayouts.TWENTY}>
        <Layout type={BenefitLayouts.TWENTY} data={data} />
      </GRP>
    </>
  );
};
