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

import Layout from "../Layout";
import { SocialProofLayouts } from "./types";
import theme from "../theme";

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,
} from "./";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 (
    <>
      <GRP title={SocialProofLayouts.ONE}>
        <Layout type={SocialProofLayouts.ONE} data={data} />
      </GRP>

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

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

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

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

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

      <GRP title={SocialProofLayouts.SEVEN}>
        <Layout type={SocialProofLayouts.SEVEN} data={data} />
      </GRP>
    </>
  );
};
