38 lines
819 B
TypeScript
38 lines
819 B
TypeScript
"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"
|
|
| "riskLockLogs"
|
|
| "riskPools"
|
|
| "riskIndex"
|
|
| "riskPoolDetail"
|
|
| "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],
|
|
);
|
|
}
|