import { TemplateContent } from "./types";
import { createMusicTemplate } from "./MusicTemplate";
import { createInfluencerTemplate } from "./CreatorInfluencerTemplate";
import { createBusinessTemplate } from "./BusinessTemplate";
import { createEntertainmentTemplate } from "./EntertainmentTemplate";
import { createLifestyleTemplate } from "./LifestyleTemplate";
import { createFashionTemplate } from "./FashionTemplate";
import { createOtherTemplate } from "./OtherTemplate";

type TemplateFunc = () => TemplateContent;

const industryToTemplateFunc: Record<string, TemplateFunc> = {
  music: createMusicTemplate,
  "influencer / creator": createInfluencerTemplate,
  business: createBusinessTemplate,
  entertainment: createEntertainmentTemplate,
  "lifestyle & wellness": createLifestyleTemplate,
  "fashion & beauty": createFashionTemplate,
  other: createOtherTemplate,
};

const defaultTemplateFunc = createOtherTemplate;

export function createTemplateForIndustry(
  industry: string | undefined
): TemplateContent {
  const key = industry?.toLowerCase() || "other";

  const getTemplateContent = industryToTemplateFunc[key] || defaultTemplateFunc;

  return getTemplateContent();
}
