import i18n from "@/i18n";

enum PlanType {
  NUMBER = "number",
  PERCENTAGE = "percent",
  BOOLEAN = "boolean",
}

export const getPlanTypeOptions = () => [ 
  { label: i18n.t("plans.Number"), value: "number" },
  { label: i18n.t("plans.Percent"), value: "percent" },
]

// Quarter list with translation keys
export const QUARTER_KEYS = [
  { key: "plans.quarters.q1", value: "1" },
  { key: "plans.quarters.q2", value: "2" },
  { key: "plans.quarters.q3", value: "3" },
  { key: "plans.quarters.q4", value: "4" },
];

// Month list with translation keys
export const MONTH_KEYS = [
  { key: "plans.months.july", value: "1" },
  { key: "plans.months.august", value: "2" },
  { key: "plans.months.september", value: "3" },
  { key: "plans.months.october", value: "4" },
  { key: "plans.months.november", value: "5" },
  { key: "plans.months.december", value: "6" },
  { key: "plans.months.january", value: "7" },
  { key: "plans.months.february", value: "8" },
  { key: "plans.months.march", value: "9" },
  { key: "plans.months.april", value: "10" },
  { key: "plans.months.may", value: "11" },
  { key: "plans.months.june", value: "12" },
];

// Week list with translation keys
export const WEEK_KEYS = [
  { key: "plans.weeks.week1", value: "1" },
  { key: "plans.weeks.week2", value: "2" },
  { key: "plans.weeks.week3", value: "3" },
  { key: "plans.weeks.week4", value: "4" },
];

// Day list with translation keys
export const DAY_KEYS = [
  { key: "plans.days.monday", value: "1" },
  { key: "plans.days.tuesday", value: "2" },
  { key: "plans.days.wednesday", value: "3" },
  { key: "plans.days.thursday", value: "4" },
  { key: "plans.days.friday", value: "5" },
  { key: "plans.days.saturday", value: "6" },
  { key: "plans.days.sunday", value: "7" },
];

export const getQuarterList = (t?: (key: string) => string) => {
  const translator = t || ((key: string) => i18n.t(key));
  return QUARTER_KEYS.map(item => ({ label: translator(item.key), value: item.value }));
};

export const getMonthList = (t?: (key: string) => string) => {
  const translator = t || ((key: string) => i18n.t(key));
  return MONTH_KEYS.map(item => ({ label: translator(item.key), value: item.value }));
};

export const getWeekList = (t?: (key: string) => string) => {
  const translator = t || ((key: string) => i18n.t(key));
  return WEEK_KEYS.map(item => ({ label: translator(item.key), value: item.value }));
};

export const getDayList = (t?: (key: string) => string) => {
  const translator = t || ((key: string) => i18n.t(key));
  return DAY_KEYS.map(item => ({ label: translator(item.key), value: item.value }));
};

// Deprecated: Use getQuarterList(), getMonthList(), getWeekList(), getDayList() instead
export const QuarterList = getQuarterList();
export const MonthList = getMonthList();
export const WeekList = getWeekList();
export const DayList = getDayList();

export default PlanType;
