feat(api, i18n): add agent_node_id to various admin queries and enhance multi-language support
Introduced the agent_node_id field in AdminDrawListQuery, AdminPlayerListQuery, AdminSettlementBatchListQuery, TicketItemsListQuery, and TransferOrderListQuery to improve filtering capabilities. Updated the admin-breadcrumb and admin-sidebar components to include new translations for agent-related terms in English, Nepali, and Chinese, enhancing the overall user experience and multi-language support across the admin interface.
This commit is contained in:
94
src/components/admin/admin-loading-state.tsx
Normal file
94
src/components/admin/admin-loading-state.tsx
Normal file
@@ -0,0 +1,94 @@
|
||||
"use client";
|
||||
|
||||
import type { ReactElement } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import {
|
||||
LoadingDots,
|
||||
type LoadingDotsSize,
|
||||
} from "@/components/ui/loading-dots";
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
/** 区块居中加载(列表、表单、详情页等) */
|
||||
export function AdminLoadingState({
|
||||
className,
|
||||
label,
|
||||
size = "md",
|
||||
showLabel = false,
|
||||
minHeight = "4rem",
|
||||
}: {
|
||||
className?: string;
|
||||
label?: string;
|
||||
size?: LoadingDotsSize;
|
||||
showLabel?: boolean;
|
||||
minHeight?: string | number;
|
||||
}): ReactElement {
|
||||
const { t } = useTranslation("common");
|
||||
const resolvedLabel = label ?? t("states.loading");
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"flex w-full items-center justify-center py-8 text-muted-foreground",
|
||||
className,
|
||||
)}
|
||||
style={{ minHeight: typeof minHeight === "number" ? `${minHeight}px` : minHeight }}
|
||||
>
|
||||
<LoadingDots size={size} label={resolvedLabel} showLabel={showLabel} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** 下拉、弹层等紧凑区域 */
|
||||
export function AdminLoadingInline({
|
||||
className,
|
||||
label,
|
||||
size = "sm",
|
||||
}: {
|
||||
className?: string;
|
||||
label?: string;
|
||||
size?: LoadingDotsSize;
|
||||
}): ReactElement {
|
||||
const { t } = useTranslation("common");
|
||||
const resolvedLabel = label ?? t("states.loading");
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn("flex justify-center py-3 text-muted-foreground", className)}
|
||||
role="status"
|
||||
aria-live="polite"
|
||||
aria-busy="true"
|
||||
>
|
||||
<LoadingDots size={size} label={resolvedLabel} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** 表格内加载行(colSpan 对齐列数) */
|
||||
export function AdminTableLoadingRow({
|
||||
colSpan,
|
||||
label,
|
||||
size = "md",
|
||||
className,
|
||||
cellClassName,
|
||||
}: {
|
||||
colSpan: number;
|
||||
label?: string;
|
||||
size?: LoadingDotsSize;
|
||||
className?: string;
|
||||
cellClassName?: string;
|
||||
}): ReactElement {
|
||||
const { t } = useTranslation("common");
|
||||
const resolvedLabel = label ?? t("states.loading");
|
||||
|
||||
return (
|
||||
<TableRow className={className}>
|
||||
<TableCell colSpan={colSpan} className={cn("py-10", cellClassName)}>
|
||||
<div className="flex justify-center">
|
||||
<LoadingDots size={size} label={resolvedLabel} />
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user