refactor(layout, i18n, admin): 优化布局结构与多语言支持
调整 AdminShell 组件的子组件顺序,提升代码可读性。更新 admin-breadcrumb 组件,简化导航标签翻译逻辑,确保多语言支持的一致性。重构 admin-language-switcher 组件,优化语言切换的用户体验,增强界面交互性。更新多语言配置,新增登录界面的副标题,提升用户体验。
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { Eye, Lock, Unlock } from "lucide-react";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { toast } from "sonner";
|
||||
@@ -11,9 +11,9 @@ import {
|
||||
postAdminRiskPoolRecover,
|
||||
} from "@/api/admin-risk";
|
||||
import { AdminListPaginationFooter } from "@/components/admin/admin-list-pagination-footer";
|
||||
import { AdminRowActionsMenu } from "@/components/admin/admin-row-actions-menu";
|
||||
import { AdminTableExportButton } from "@/components/admin/admin-table-export-button";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
@@ -254,7 +254,7 @@ export function RiskPoolsConsole({
|
||||
<TableHead className="text-center">{t("remainingAmount")}</TableHead>
|
||||
<TableHead className="text-center">{t("usageRatio")}</TableHead>
|
||||
<TableHead>{t("poolStatus")}</TableHead>
|
||||
<TableHead className="text-center">{t("actions")}</TableHead>
|
||||
<TableHead className="w-14 text-center">{t("actions")}</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
@@ -302,39 +302,39 @@ export function RiskPoolsConsole({
|
||||
</span>
|
||||
</TableCell>
|
||||
<TableCell className="text-center">
|
||||
<div className="flex justify-center gap-2">
|
||||
{canManageRiskPools ? (
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant={row.is_sold_out ? "outline" : "destructive"}
|
||||
disabled={acting}
|
||||
onClick={() =>
|
||||
<AdminRowActionsMenu
|
||||
busy={acting}
|
||||
actions={[
|
||||
{
|
||||
key: "view",
|
||||
label: t("view"),
|
||||
icon: Eye,
|
||||
href: `/admin/draws/${drawId}/risk/pools/${row.normalized_number}`,
|
||||
},
|
||||
{
|
||||
key: "toggle",
|
||||
label: row.is_sold_out ? t("recover") : t("close"),
|
||||
icon: row.is_sold_out ? Unlock : Lock,
|
||||
destructive: !row.is_sold_out,
|
||||
hidden: !canManageRiskPools,
|
||||
onClick: () =>
|
||||
requestConfirm({
|
||||
title: row.is_sold_out
|
||||
? t("confirm.recoverTitle")
|
||||
: t("confirm.closeTitle"),
|
||||
description: row.is_sold_out
|
||||
? t("confirm.recoverDescription", { number: row.normalized_number })
|
||||
: t("confirm.closeDescription", { number: row.normalized_number }),
|
||||
? t("confirm.recoverDescription", {
|
||||
number: row.normalized_number,
|
||||
})
|
||||
: t("confirm.closeDescription", {
|
||||
number: row.normalized_number,
|
||||
}),
|
||||
confirmVariant: row.is_sold_out ? "default" : "destructive",
|
||||
onConfirm: () => handleManualStatus(row),
|
||||
})
|
||||
}
|
||||
>
|
||||
{row.is_sold_out ? t("recover") : t("close")}
|
||||
</Button>
|
||||
) : null}
|
||||
<Link
|
||||
href={`/admin/draws/${drawId}/risk/pools/${row.normalized_number}`}
|
||||
className={cn(
|
||||
buttonVariants({ variant: "link", size: "sm" }),
|
||||
"h-8 px-0",
|
||||
)}
|
||||
>
|
||||
{t("view")}
|
||||
</Link>
|
||||
</div>
|
||||
}),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user