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 { Check, Eye, HandCoins, X } from "lucide-react";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { useExportLabels } from "@/hooks/use-export-labels";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -13,10 +13,11 @@ import {
|
||||
postAdminRejectSettlementBatch,
|
||||
} from "@/api/admin-settlement";
|
||||
import { AdminListPaginationFooter } from "@/components/admin/admin-list-pagination-footer";
|
||||
import { AdminRowActionsMenu } from "@/components/admin/admin-row-actions-menu";
|
||||
import { AdminStatusBadge } from "@/components/admin/admin-status-badge";
|
||||
import { AdminTableExportButton } from "@/components/admin/admin-table-export-button";
|
||||
import { ModuleScaffold } from "@/components/admin/module-scaffold";
|
||||
import { Button, buttonVariants } from "@/components/ui/button";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import {
|
||||
Dialog,
|
||||
@@ -287,51 +288,45 @@ export function SettlementBatchesConsole() {
|
||||
{settlementStatusText(row.status, t)}
|
||||
</AdminStatusBadge>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<div className="flex flex-wrap justify-center gap-1.5">
|
||||
<Link
|
||||
href={`/admin/settlement-batches/${row.id}/details`}
|
||||
className={cn(buttonVariants({ variant: "outline", size: "sm" }), "!border-border")}
|
||||
>
|
||||
{t("details")}
|
||||
</Link>
|
||||
{canReviewSettlement ? (
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant="outline"
|
||||
disabled={actingId !== null || row.status !== "pending_review"}
|
||||
onClick={() => openActionDialog(row, "approve")}
|
||||
>
|
||||
{t("pass")}
|
||||
</Button>
|
||||
) : null}
|
||||
{canReviewSettlement ? (
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant="outline"
|
||||
disabled={actingId !== null || row.status !== "pending_review"}
|
||||
onClick={() => openActionDialog(row, "reject")}
|
||||
>
|
||||
{t("reject")}
|
||||
</Button>
|
||||
) : null}
|
||||
{canManagePayout ? (
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
disabled={
|
||||
<TableCell className="text-center">
|
||||
<AdminRowActionsMenu
|
||||
busy={actingId === row.id}
|
||||
actions={[
|
||||
{
|
||||
key: "details",
|
||||
label: t("details"),
|
||||
icon: Eye,
|
||||
href: `/admin/settlement-batches/${row.id}/details`,
|
||||
},
|
||||
{
|
||||
key: "approve",
|
||||
label: t("pass"),
|
||||
icon: Check,
|
||||
hidden: !canReviewSettlement,
|
||||
disabled: actingId !== null || row.status !== "pending_review",
|
||||
onClick: () => openActionDialog(row, "approve"),
|
||||
},
|
||||
{
|
||||
key: "reject",
|
||||
label: t("reject"),
|
||||
icon: X,
|
||||
hidden: !canReviewSettlement,
|
||||
disabled: actingId !== null || row.status !== "pending_review",
|
||||
onClick: () => openActionDialog(row, "reject"),
|
||||
},
|
||||
{
|
||||
key: "payout",
|
||||
label: t("payout"),
|
||||
icon: HandCoins,
|
||||
hidden: !canManagePayout,
|
||||
disabled:
|
||||
actingId !== null
|
||||
|| row.status !== "approved"
|
||||
|| row.review_status !== "approved"
|
||||
}
|
||||
onClick={() => openActionDialog(row, "payout")}
|
||||
>
|
||||
{t("payout")}
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
|| row.review_status !== "approved",
|
||||
onClick: () => openActionDialog(row, "payout"),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user