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

export function createEntertainmentTemplate(): TemplateContent {
  return {
    avatar:
      "https://komi-production-assets.s3-accelerate.amazonaws.com/photos/3R9Ut5hndLxoxogx7bqSF.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.youtube.com/user/youtube",
        type: SocialProfileLinkTypes.YOUTUBE,
      },
      {
        link: "https://www.facebook.com/facebook",
        type: SocialProfileLinkTypes.FACEBOOK,
      },
      {
        link: "https://www.tiktok.com/@tiktok",
        type: SocialProfileLinkTypes.TIKTOK,
      },
      {
        link: "https://www.example.com",
        type: SocialProfileLinkTypes.WEBSITE,
      },
    ],
    modules: [
      createYoutubeModule({ order: 0 }),
      createLinkModule({ order: 1 }),
      createProductModule({ order: 2 }),
    ],
  };
}

const createYoutubeModule = ({ order }: OrderedParams) => {
  return createModule({
    type: ModuleType.YOUTUBE_VIDEO,
    name: "Featured Video",
    order,
    data: {
      items: [
        {
          url: "https://www.youtube.com/watch?v=EGK5qtXuc1Q",
          visible: true,
          metadata: {
            html: '<iframe width="200" height="113" src="https://www.youtube.com/embed/EGK5qtXuc1Q?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen title="Luther: The Fallen Sun | Official Trailer | Netflix"></iframe>',
            type: "video",
            title: "Luther: The Fallen Sun | Official Trailer | Netflix",
            width: 200,
            height: 113,
            version: "1.0",
            author_url: "https://www.youtube.com/@Netflix",
            author_name: "Netflix",
            provider_url: "https://www.youtube.com/",
            provider_name: "YouTube",
            thumbnail_url: "https://i.ytimg.com/vi/EGK5qtXuc1Q/hqdefault.jpg",
            thumbnail_width: 480,
            thumbnail_height: 360,
          },
        },
      ],
    },
  });
};

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

const createProductModule = ({ order }: OrderedParams) => {
  return createModule({
    type: ModuleType.PRODUCT,
    name: "Store",
    order,
    data: {
      items: [
        {
          url: "https://shop.2hrset.com/products/aura-red-hoodie",
          order: 0,
          price: 70,
          title: "AURA RED HOODIE",
          visible: true,
          currency: "GBP",
          isUpdate: true,
          thumbnail:
            "https://komi-production-assets.s3-accelerate.amazonaws.com/photos/fAzK-330B9Smx0fnBtKPW.png",
        },
        {
          url: "https://shop.2hrset.com/products/aura-black-hoodie",
          order: 1,
          price: 70,
          title: "AURA BLACK HOODIE",
          visible: true,
          currency: "GBP",
          isUpdate: true,
          thumbnail:
            "https://komi-production-assets.s3-accelerate.amazonaws.com/photos/2WJjgYlE-_9M2Zpn92shM.png",
        },
        {
          url: "https://shop.2hrset.com/products/cus-i-can-black-t-shirt",
          order: 2,
          price: 25,
          title: "CUS I CAN BLACK T SHIRT",
          visible: true,
          currency: "GBP",
          isUpdate: true,
          thumbnail:
            "https://komi-production-assets.s3-accelerate.amazonaws.com/photos/YOU_jh01XWwl1-KOfavyl.png",
        },
      ],
    },
  });
};
