feat(agents, i18n): enhance agent management and settlement features with new translations and UI updates
Added new translations for agent management and settlement features in English, Nepali, and Chinese, improving multi-language support. Updated the agents console to reflect changes in funding modes and player details, enhancing user experience. Refactored the admin permission gate to include new logic for handling bound line agents, ensuring better permission management. Additionally, streamlined the UI for agent-related pages and improved navigation to the settlement center, consolidating related functionalities for better accessibility.
This commit is contained in:
83
src/components/admin/admin-no-resource-state.tsx
Normal file
83
src/components/admin/admin-no-resource-state.tsx
Normal file
@@ -0,0 +1,83 @@
|
||||
"use client";
|
||||
|
||||
import Image from "next/image";
|
||||
import type { ReactElement, ReactNode } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const NOTDATA_IMAGE = "/notdata.png";
|
||||
|
||||
export function AdminNoResourceState({
|
||||
className,
|
||||
message,
|
||||
compact = false,
|
||||
imageClassName,
|
||||
children,
|
||||
}: {
|
||||
className?: string;
|
||||
/** 默认「暂无资源」 */
|
||||
message?: string;
|
||||
compact?: boolean;
|
||||
imageClassName?: string;
|
||||
children?: ReactNode;
|
||||
}): ReactElement {
|
||||
const { t } = useTranslation("common");
|
||||
const label = message ?? t("states.noResource", { defaultValue: "暂无资源" });
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"flex w-full flex-col items-center justify-center text-center",
|
||||
compact ? "gap-2 py-4" : "gap-3 py-8",
|
||||
className,
|
||||
)}
|
||||
role="status"
|
||||
>
|
||||
<Image
|
||||
src={NOTDATA_IMAGE}
|
||||
alt=""
|
||||
width={compact ? 120 : 160}
|
||||
height={compact ? 120 : 160}
|
||||
className={cn(
|
||||
"h-auto w-auto object-contain",
|
||||
compact ? "max-h-24 max-w-[120px]" : "max-h-40 max-w-[160px]",
|
||||
imageClassName,
|
||||
)}
|
||||
/>
|
||||
<p
|
||||
className={cn(
|
||||
"text-muted-foreground",
|
||||
compact ? "text-[11px] leading-snug" : "text-sm",
|
||||
)}
|
||||
>
|
||||
{label}
|
||||
</p>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** 表格无数据行(图片 + 暂无资源,竖排居中) */
|
||||
export function AdminTableNoResourceRow({
|
||||
colSpan,
|
||||
className,
|
||||
cellClassName,
|
||||
message,
|
||||
compact,
|
||||
}: {
|
||||
colSpan: number;
|
||||
className?: string;
|
||||
cellClassName?: string;
|
||||
message?: string;
|
||||
compact?: boolean;
|
||||
}): ReactElement {
|
||||
return (
|
||||
<TableRow className={className}>
|
||||
<TableCell colSpan={colSpan} className={cn("text-muted-foreground", cellClassName)}>
|
||||
<AdminNoResourceState message={message} compact={compact} />
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user