import { OrderedParams, TemplateContent } from "./types";
import { createModule } from "./createModule";
import { SocialProfileLinkTypes } from "../../redux/User/types";
import { ModuleType } from "@komi-app/shared-types";

export function createFashionTemplate(): TemplateContent {
  return {
    avatar:
      "https://komi-production-assets.s3-accelerate.amazonaws.com/photos/hV66CcZr06BiP--0kaXe0.png?tr=w-564%2Ch-709%2Ccm-extract%2Cx-0%2Cy-0&crp=%7B%22x%22%3A0%2C%22y%22%3A0%2C%22zoomVal%22%3A1%7D",
    socialProfileLinks: [
      {
        link: "https://www.instagram.com/instagram",
        type: SocialProfileLinkTypes.INSTAGRAM,
      },
      {
        link: "https://www.tiktok.com/@tiktok",
        type: SocialProfileLinkTypes.TIKTOK,
      },
      {
        link: "example@example.com",
        type: SocialProfileLinkTypes.EMAIL,
      },
      {
        link: "https://www.example.com",
        type: SocialProfileLinkTypes.WEBSITE,
      },
      {
        link: "https://www.youtube.com/user/youtube",
        type: SocialProfileLinkTypes.YOUTUBE,
      },
    ],
    modules: [
      createYoutubeModule({ order: 0 }),
      createShopMyLookModule({ order: 1 }),
      createBrandPartnersModule({ order: 2 }),
      createFavoriteProductsModule({ order: 3 }),
      createWorkTogetherDataCaptureModule({ order: 4 }),
    ],
  };
}

const createYoutubeModule = ({ order }: OrderedParams) => {
  return createModule({
    type: ModuleType.YOUTUBE_VIDEO,
    name: "Latest Video",
    order,
    data: {
      items: [
        {
          url: "https://www.youtube.com/watch?v=nFdNvI76-Sg&pp=ygUcIE1hcmphbiBUYWJpYnphZGFpbnRlcnZpZXdzIA%3D%3D",
          visible: true,
          metadata: {
            html: '<iframe width="200" height="113" src="https://www.youtube.com/embed/nFdNvI76-Sg?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen title="Influencers ‘very resilient’ in considering migration from TikTok amid possible ban: Content creator"></iframe>',
            type: "video",
            title:
              "Influencers ‘very resilient’ in considering migration from TikTok amid possible ban: Content creator",
            width: 200,
            height: 113,
            version: "1.0",
            author_url: "https://www.youtube.com/@YahooFinance",
            author_name: "Yahoo Finance",
            provider_url: "https://www.youtube.com/",
            provider_name: "YouTube",
            thumbnail_url: "https://i.ytimg.com/vi/nFdNvI76-Sg/hqdefault.jpg",
            thumbnail_width: 480,
            thumbnail_height: 360,
          },
        },
      ],
    },
  });
};

const createShopMyLookModule = ({ order }: OrderedParams) => {
  return createModule({
    type: ModuleType.LINK,
    name: "Shop My Looks",
    order,
    data: {
      items: [
        {
          url: "https://www.amazon.com/shop/lianev?ref_=cm_sw_r_apin_aipsfshop_aipsflianev_7R91RBB7YE1FBXK5NG0Z",
          order: 0,
          title: "Amazon Storefront",
          visible: true,
          thumbnail:
            "https://komi-production-assets.s3-accelerate.amazonaws.com/photos/Ya-qVK3tjepNSFsyPORcb.jpg",
        },
        {
          url: "https://shopmy.us/annasitar",
          order: 1,
          title: "ShopMy Shelf",
          visible: true,
          thumbnail:
            "https://komi-production-assets.s3-accelerate.amazonaws.com/photos/f0NJb8RxPZkpj4hJwGO-d.jpg",
        },
      ],
    },
  });
};

const createBrandPartnersModule = ({ order }: OrderedParams) => {
  return createModule({
    type: ModuleType.LINK,
    name: "Brand Partners",
    order,
    data: {
      items: [
        {
          title: "Vegamour",
          url: "https://vegamour.com/",
          order: 0,
          visible: true,
          thumbnail:
            "https://komi-production-assets.s3-accelerate.amazonaws.com/photos/uzrsfKjHs3sEzgIVrWu_a.jpg",
        },
        {
          title: "Keurig",
          url: "https://www.keurig.com/",
          order: 1,
          visible: true,
          thumbnail:
            "https://komi-production-assets.s3-accelerate.amazonaws.com/photos/f6QH8foSR0gQgydDJm053.png",
        },
        {
          title: "Grey Goose",
          url: "https://www.greygoose.com/",
          order: 2,
          visible: true,
          thumbnail:
            "https://komi-production-assets.s3-accelerate.amazonaws.com/photos/i6yWNOMHDGnOCQyb_WZoM.jpg",
        },
      ],
    },
  });
};

const createFavoriteProductsModule = ({ order }: OrderedParams) =>
  createModule({
    name: "Favorite Products",
    type: ModuleType.LINK,
    order,
    data: {
      items: [
        {
          title: "Amazon",
          url: "https://www.amazon.com/shop/youngcouture",
          order: 0,
          visible: true,
          thumbnail:
            "https://komi-production-assets.s3-accelerate.amazonaws.com/photos/nTmAXq2Yd_uv5khMsZanS.jpg",
        },
        {
          title: "LTK",
          url: "https://www.shopltk.com/explore/Youngcouture",
          order: 1,
          visible: true,
          thumbnail:
            "https://komi-production-assets.s3-accelerate.amazonaws.com/photos/ZnbCII4MgdRoxd3JGOKE8.png",
        },
      ],
    },
  });

const createWorkTogetherDataCaptureModule = ({ order }: OrderedParams) =>
  createModule({
    name: "Work Together!",
    type: ModuleType.FORM_DATA,
    order,
    data: {
      items: [
        {
          form: {
            name: "Updates",
            fields: [
              {
                name: "EMAIL_ADDRESS",
                type: "EMAIL_ADDRESS",
                label: "Enter email",
                order: 1,
                required: true,
              },
              {
                name: "INPUT",
                type: "INPUT",
                label: "Name",
                order: 0,
                required: true,
              },
            ],
          },
          order: 0,
          title: "Business enquiries",
          layout: "left",
          visible: true,
          subTitle: "Let's explore working together",
          enableImage: false,
        },
      ],
    },
  });
