refactor: 更新管理端页面元数据,统一国际化支持,移除冗余代码

This commit is contained in:
2026-05-21 17:27:52 +08:00
parent 26feed3c4f
commit e8a5507411
77 changed files with 1669 additions and 732 deletions

View File

@@ -1,6 +1,7 @@
"use client";
import { useCallback, useEffect, useState } from "react";
import { useExportLabels } from "@/hooks/use-export-labels";
import { useTranslation } from "react-i18next";
import { toast } from "sonner";
@@ -64,6 +65,7 @@ function toFormState(row: AdminCurrencyRow): CurrencyFormState {
export function CurrencySettingsPanel() {
const { t } = useTranslation(["config", "adminUsers"]);
const exportLabels = useExportLabels("currencies");
const profile = useAdminProfile();
const canManage = adminHasAnyPermission(profile?.permissions, ["prd.currency.manage"]);
const [items, setItems] = useState<AdminCurrencyRow[]>([]);
@@ -210,7 +212,8 @@ export function CurrencySettingsPanel() {
</p>
</div>
<div className="flex items-center gap-2">
<AdminTableExportButton tableId="admin-currencies-table" filename="币种管理" sheetName="币种管理" />
<AdminTableExportButton tableId="admin-currencies-table" filename={exportLabels.filename}
sheetName={exportLabels.sheetName} />
<Button onClick={openCreate}>{t("currencies.actions.create", { ns: "config" })}</Button>
</div>
</CardHeader>