"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 (
); } /** 下拉、弹层等紧凑区域 */ 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 (
); } /** 表格内加载行(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 (
); }