import { buildStaticAssetPath } from "@/helpers/file";
import { djb2HashUint32 } from "@/helpers/hash";
import { toKebabCase } from "@/helpers/string";
import type {
  FlowerPetal,
  Investor,
  NavigationItem,
  TeamMember,
} from "@/types";

import { INSTAGRAM_USERNAME, TWITTER_USERNAME } from "./constants";

export const HEADER: NavigationItem[] = [
  {
    label: "Suno",
    href: "/",
  },
  {
    label: "About",
    href: "#about",
  },
  {
    label: "Team",
    href: "#team",
  },
  {
    label: "Blog",
    href: "/blog",
  },
]
  .map((item, index) => ({
    ...item,
    id: `nav-header_${djb2HashUint32(item.label + item.href + index)}`,
    order: index,
  }))
  .sort((a, b) => a.order - b.order);

export const FOOTER: NavigationItem[] = [
  {
    label: "Terms of Service",
    href: "/terms",
  },
  {
    label: "Privacy Policy",
    href: "/privacy",
  },
  {
    label: "Community Guidelines",
    href: "/community-guidelines",
  },
  {
    label: "FAQs",
    href: "https://suno.com/docs/faqs",
  },
]
  .map((item, index) => ({
    ...item,
    id: `nav-footer_${djb2HashUint32(item.label + item.href + index)}`,
    order: index,
  }))
  .sort((a, b) => a.order - b.order);

export const SOCIALS: NavigationItem[] = [
  {
    label: "Discord",
    href: "https://discord.gg/suno",
    icon: "discord",
  },
  {
    label: "Twitter",
    href: `https://twitter.com/${TWITTER_USERNAME}`,
    icon: "twitterX",
  },
  {
    label: "Instagram",
    href: `https://www.instagram.com/${INSTAGRAM_USERNAME}`,
    icon: "instagram",
  },
]
  .map((item, index) => ({
    ...item,
    id: `nav-socials_${djb2HashUint32(item.label + item.href + index)}`,
    order: index,
  }))
  .sort((a, b) => a.order - b.order);

export const SONG_PROMPTS = [
  "song for my friend Earl",
  "song about the moon",
  "song about mom's cooking",
  "song for lunch",
  "song for your goldfish",
  "song about the dentist",
  "song about the Sunday Scaries",
  "song for your workout",
  "song for the holidays",
  "song about mitochondria",
  "happy song",
  "song that feels how you feel",
];

export const FLOWER_PETALS_BASE: FlowerPetal[] = [
  ...SONG_PROMPTS,
  ...SONG_PROMPTS,
]
  .slice(-24)
  .map((prompt, index) => {
    const label = `Make a ${prompt}.`;
    const fileName = toKebabCase(prompt);
    const id = djb2HashUint32(prompt + index);

    return {
      id: `song-prompt_${id}`,
      order: index,
      label,
      song: {
        id: `song_${id}`,
        title: label,
        src: `https://cdn1.suno.ai/public-audio/${fileName}.mp3`,
      },
    };
  });

export const FLOWER_PETALS: FlowerPetal[] = [
  ...FLOWER_PETALS_BASE,
  {
    id: "song-prompt_app-callout",
    order: FLOWER_PETALS_BASE.length,
    label: "Make a song with Suno.",
  },
].sort((a, b) => a.order - b.order);

export const TEAM_MEMBERS: TeamMember[] = [
  {
    name: "Keenan Freyberg",
    role: "Co-Founder",
  },
  {
    name: "Martin Camacho",
    role: "Co-Founder",
  },
  {
    name: "Fan Xu",
    role: "Software Engineering",
  },
  {
    name: "Georg Kucsko",
    role: "Co-Founder",
  },
  {
    name: "Michelle Lesifko",
    role: "Co-Founder",
  },
  {
    name: "Mikey Shulman",
    role: "Co-Founder",
  },
  {
    name: "Patrick O'Neill",
    role: "Machine Learning",
  },
  {
    name: "Tony Tong",
    role: "Machine Learning",
  },
  {
    name: "Victor Tao",
    role: "Machine Learning",
  },
  {
    name: "Michelle Wang",
    role: "Software Engineering",
  },
].map((member, index) => {
  const id = djb2HashUint32(member.name + index);
  return {
    ...member,
    id: `member_${id}`,
    img: buildStaticAssetPath(member.name, "img"),
    // TODO: Replace with actual songs
    song: {
      id: `song_${id}`,
      src: "https://cdn1.suno.ai/public-audio/happy-song.mp3",
    },
  };
});

export const INVESTORS: Investor[] = [
  { name: "Investor A" },
  { name: "Investor B" },
  { name: "Investor X" },
  { name: "Investor Y" },
].map((investor, index) => {
  return {
    ...investor,
    id: `investor_${djb2HashUint32(investor.name + index)}`,
  };
});
