export type MinistryRgcDecisionLanguage = "en" | "kh";

export function normalizeMinistryRgcDecisionLanguage(
  language: string | null | undefined,
): MinistryRgcDecisionLanguage {
  return language === "kh" ? "kh" : "en";
}

export const ministryRgcDecisionText = {
  en: {
    pageTitle: "RGC Decision",
    pageSubtitle: "RGC Decision",
    export: "Export",
    reload: "Reload",
    listTitle: "List of RGC Decisions",

    status: "Status",
    primaryAgency: "Gov’s Primary Agency",
    category: "Category",
    meetingDate: "Meeting Date",
    reset: "Reset",
    selectAll: "Select All",
    oneAgency: "1 Agency",
    agencies: "Agencies",
    oneCategory: "1 Category",
    categories: "Categories",
    loading: "Loading...",
    retry: "Retry",
    noAgencies: "No agencies found.",
    noCategories: "No categories found.",
    clear: "Clear",
    show: "Show",
    previousMonth: "Previous month",
    nextMonth: "Next month",
    nextYear: "Next year",
    previousYear: "Previous year",
    unableToLoadFilters: "Unable to load filter options.",

    totalIssues: "Total Issues",
    solved: "Solved",
    inProgress: "In Progress",
    notAddressed: "Not Addressed",
    totalPrimaryAgencies: "Total Primary Agencies",

    no: "No",
    ministry: "Ministry",
    rgcDecision: "RGC's Decision",
    linkedIssues: "Linked Issues",
    focalPerson: "Focal Person (H.E)",
    sourceOfVerification: "Source of Verification",
    verificationLink: "Link to Verification Source",
    action: "Action",
    loadingDecisions: "Loading RGC Decisions...",
    noDecisions: "No RGC Decisions found.",
    download: "Download",
    viewDetail: "View Detail",
    previous: "Previous",
    next: "Next",

    back: "Back",
    detailTitle: "RGC Decision Detail",
    detailSubtitle: "Detail Information of RGC Decision",
    plenary: "Plenary",
    issuesDescription: "Issues Description",
    recommendations: "Recommendations",
    indicators: "Indicators",
    progressSolution: "Progress Solution",
    implementationChallenges: "Implementation Challenges",
    request: "Request",
    nextStep: "Next Step",
    dateOfIssueSolution: "Date of Issue Solution",
    attachment: "Attachment",
  },

  kh: {
    pageTitle: "សេចក្តីសម្រេចរបស់រាជរដ្ឋាភិបាល",
    pageSubtitle: "បញ្ជីសេចក្តីសម្រេចរបស់រាជរដ្ឋាភិបាល",
    export: "នាំចេញ",
    reload: "ផ្ទុកឡើងវិញ",
    listTitle: "បញ្ជីសេចក្តីសម្រេចរបស់រាជរដ្ឋាភិបាល",

    status: "ស្ថានភាព",
    primaryAgency: "ក្រសួង/ស្ថាប័នទទួលបន្ទុកចម្បង",
    category: "ប្រភេទ",
    meetingDate: "កាលបរិច្ឆេទប្រជុំ",
    reset: "កំណត់ឡើងវិញ",
    selectAll: "ជ្រើសរើសទាំងអស់",
    oneAgency: "១ ក្រសួង/ស្ថាប័ន",
    agencies: "ក្រសួង/ស្ថាប័ន",
    oneCategory: "១ ប្រភេទ",
    categories: "ប្រភេទ",
    loading: "កំពុងផ្ទុក...",
    retry: "ព្យាយាមម្តងទៀត",
    noAgencies: "រកមិនឃើញក្រសួង/ស្ថាប័ន។",
    noCategories: "រកមិនឃើញប្រភេទ។",
    clear: "សម្អាត",
    show: "បង្ហាញ",
    previousMonth: "ខែមុន",
    nextMonth: "ខែបន្ទាប់",
    nextYear: "ឆ្នាំបន្ទាប់",
    previousYear: "ឆ្នាំមុន",
    unableToLoadFilters: "មិនអាចផ្ទុកជម្រើសតម្រងបានទេ។",

    totalIssues: "ចំនួនបញ្ហាសរុប",
    solved: "បានដោះស្រាយ",
    inProgress: "កំពុងដំណើរការ",
    notAddressed: "មិនទាន់ដោះស្រាយ",
    totalPrimaryAgencies: "ក្រសួង/ស្ថាប័នចម្បងសរុប",

    no: "ល.រ",
    ministry: "ក្រសួង/ស្ថាប័ន",
    rgcDecision: "សេចក្តីសម្រេចរបស់រាជរដ្ឋាភិបាល",
    linkedIssues: "បញ្ហាដែលពាក់ព័ន្ធ",
    focalPerson: "មន្ត្រីទទួលបន្ទុក (ឯកឧត្តម)",
    sourceOfVerification: "ប្រភពផ្ទៀងផ្ទាត់",
    verificationLink: "តំណភ្ជាប់ប្រភពផ្ទៀងផ្ទាត់",
    action: "សកម្មភាព",
    loadingDecisions: "កំពុងផ្ទុកសេចក្តីសម្រេច...",
    noDecisions: "មិនមានសេចក្តីសម្រេចទេ។",
    download: "ទាញយក",
    viewDetail: "មើលព័ត៌មានលម្អិត",
    previous: "មុន",
    next: "បន្ទាប់",

    back: "ត្រឡប់ក្រោយ",
    detailTitle: "ព័ត៌មានលម្អិតសេចក្តីសម្រេច",
    detailSubtitle: "ព័ត៌មានលម្អិតនៃសេចក្តីសម្រេចរបស់រាជរដ្ឋាភិបាល",
    plenary: "សម័យប្រជុំពេញអង្គ",
    issuesDescription: "ការពិពណ៌នាបញ្ហា",
    recommendations: "អនុសាសន៍",
    indicators: "សូចនាករ",
    progressSolution: "វឌ្ឍនភាពដំណោះស្រាយ",
    implementationChallenges: "បញ្ហាប្រឈមក្នុងការអនុវត្ត",
    request: "សំណើ",
    nextStep: "ជំហានបន្ទាប់",
    dateOfIssueSolution: "កាលបរិច្ឆេទដោះស្រាយបញ្ហា",
    attachment: "ឯកសារភ្ជាប់",
  },
} as const;

export function translateMinistryRgcDecisionStatus(
  status: string,
  language: MinistryRgcDecisionLanguage,
): string {
  if (language !== "kh") {
    return status;
  }

  if (status === "Solved") {
    return ministryRgcDecisionText.kh.solved;
  }

  if (status === "In Progress") {
    return ministryRgcDecisionText.kh.inProgress;
  }

  if (status === "Not Addressed") {
    return ministryRgcDecisionText.kh.notAddressed;
  }

  return status;
}

export const ministryRgcDecisionMonths = {
  en: [
    "Jan",
    "Feb",
    "Mar",
    "Apr",
    "May",
    "Jun",
    "Jul",
    "Aug",
    "Sep",
    "Oct",
    "Nov",
    "Dec",
  ],
  kh: [
    "មករា",
    "កុម្ភៈ",
    "មីនា",
    "មេសា",
    "ឧសភា",
    "មិថុនា",
    "កក្កដា",
    "សីហា",
    "កញ្ញា",
    "តុលា",
    "វិច្ឆិកា",
    "ធ្នូ",
  ],
} as const;
