"use client";

import { useMemo } from "react";
import { useTranslation } from "react-i18next";

/** 与 `common.export.*` 键一致 */
export type ExportLabelKey =
  | "drawsList"
  | "drawFinance"
  | "adminRoles"
  | "adminUsers"
  | "players"
  | "walletTransferOrders"
  | "walletTransactions"
  | "playerWallets"
  | "tickets"
  | "settlementBatches"
  | "jackpotPayouts"
  | "jackpotContributions"
  | "riskPools"
  | "riskIndex"
  | "riskPoolDetail"
  | "ticketCombinations"
  | "auditLogs"
  | "currencies";

export function useExportLabels(key: ExportLabelKey, params?: Record<string, string>) {
  const { t } = useTranslation("common");

  return useMemo(
    () => ({
      filename: t(`export.${key}.filename`, params),
      sheetName: t(`export.${key}.sheetName`, params),
    }),
    [key, params, t],
  );
}
