import {
  genreAdjectives,
  getTopics,
  top1KGenres,
} from '@/app/(root)/create/createV2/genres';
import { capitalizeFirstLetter } from '@/utils/utils';

// Load all the necessary data upfront
const adjectives = genreAdjectives;
const lyricsTopics = getTopics();

/**
 * Generates a random prompt placeholder combining an adjective, genre, and topic
 * @returns A formatted prompt placeholder string
 */
export function getPromptPlaceholder(): string {
  if (!top1KGenres.length || !lyricsTopics.length) {
    return 'Upbeat pop song about summer adventures';
  }

  const adjective = adjectives[Math.floor(Math.random() * adjectives.length)];
  const style = top1KGenres[Math.floor(Math.random() * top1KGenres.length)];
  const topic = lyricsTopics[Math.floor(Math.random() * lyricsTopics.length)];

  const prompt = `song about ${topic}`;
  return capitalizeFirstLetter(`${adjective} ${style} ${prompt}`);
}
