import {
  ATOMIC_CITY_MUSIC,
  JASON_DERULO_VIDEO,
  LOCKED_UP_MUSIC,
  MAJID_JORDAN_VIDEO,
  ON_MY_MIND_MUSIC,
  PURSUIT_OF_HAPPINESS_MUSIC,
  STAY_INFORMED_FORM,
  TSHIRT_PRODUCT_1,
  TSHIRT_PRODUCT_2,
  TSHIRT_PRODUCT_3,
  TURN_ON_THE_LIGHTS_AGAIN_MUSIC,
  U2_STAY_VIDEO,
} from "./data/music-template.data";
import { OrderedParams, TemplateContent } from "./types";
import { createModule } from "./createModule";
import { SocialProfileLinkTypes } from "../../redux/User/types";
import { ModuleType } from "@komi-app/shared-types";

export function createMusicTemplate(): TemplateContent {
  return {
    avatar:
      "https://komi-production-assets.s3-accelerate.amazonaws.com/photos/PmG0ghRNCmHKi5vULZN0n.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://open.spotify.com/user/spotify",
        type: SocialProfileLinkTypes.SPOTIFY,
      },
      {
        link: "https://www.youtube.com/user/username",
        type: SocialProfileLinkTypes.YOUTUBE,
      },
      {
        link: "https://www.tiktok.com/@tiktok",
        type: SocialProfileLinkTypes.TIKTOK,
      },
      {
        link: "https://music.apple.com/gb/artist/artistname/userid",
        type: SocialProfileLinkTypes.APPLE_MUSIC,
      },
    ],
    modules: [
      createHeaderMusicModule({ order: 0 }),
      createYoutubeModule({ order: 1 }),
      createMusicModule({ order: 2 }),
      createStayInformedDataCaptureModule({ order: 3 }),
      createProductModule({ order: 4 }),
    ],
  };
}

const createHeaderMusicModule = ({ order }: OrderedParams) =>
  createModule({
    name: "Latest Release",
    type: ModuleType.MUSIC,
    order,
    data: {
      items: [ATOMIC_CITY_MUSIC],
    },
  });

const createYoutubeModule = ({ order }: OrderedParams) =>
  createModule({
    name: "Music Videos",
    type: ModuleType.YOUTUBE_VIDEO,
    order,
    data: {
      items: [JASON_DERULO_VIDEO, MAJID_JORDAN_VIDEO, U2_STAY_VIDEO],
    },
  });

const createMusicModule = ({ order }: OrderedParams) =>
  createModule({
    name: "Playlist",
    type: ModuleType.MUSIC,
    order,
    data: {
      items: [
        PURSUIT_OF_HAPPINESS_MUSIC,
        LOCKED_UP_MUSIC,
        ON_MY_MIND_MUSIC,
        TURN_ON_THE_LIGHTS_AGAIN_MUSIC,
      ],
    },
  });

const createStayInformedDataCaptureModule = ({ order }: OrderedParams) =>
  createModule({
    name: "Stay Informed",
    type: ModuleType.FORM_DATA,
    order,
    data: {
      items: [STAY_INFORMED_FORM],
    },
  });

const createProductModule = ({ order }: OrderedParams) =>
  createModule({
    name: "Merch",
    type: ModuleType.PRODUCT,
    order,
    data: {
      items: [TSHIRT_PRODUCT_1, TSHIRT_PRODUCT_2, TSHIRT_PRODUCT_3],
    },
  });
